psi46 / pxar

Life is too short for perfection
16 stars 46 forks source link

Retrieve pixel pulse height ... #446

Closed dinardo closed 6 years ago

dinardo commented 7 years ago

Dear Experts, I'm using the following [1] function to plot the pixel hits (taken from pxar/python/cmdline.py) unfortunately the px.value looks strange. I was expecting the charge in ADC counts, but I always get numbers like 125, sometime 124 or 126. This happens both when I inject with no matter which Vcal value, and also with random triggers on noisy pixels !

Perhaps you guys can give me some hints on what I'm doing wrong ? DTB:

The whole machinery is working, is just the pulse height that is bizarre.

Many thanks,

[1]

def PlotMap(window, data, name, isUpdate = False, count = False):
    # Find number of ROCs present
    module = False
    for px in data.pixels:
        if px.roc > 0:
            module = True
            break

    # Prepare new numpy matrix
    d = zeros((416 if module else 52,160 if module else 80))

    for px in data.pixels:
        xoffset = 52*(px.roc%8) if module else 0
        yoffset = 80*int(px.roc/8) if module else 0
        # Flip the ROCs upside down
        y = (px.row + yoffset) if (px.roc < 8) else (2*yoffset - px.row - 1)
        # Reverse order of the upper ROC row
        x = (px.column + xoffset) if (px.roc < 8) else (415 - xoffset - px.column)
        d[x][y] += 1 if count else px.value

        if isUpdate is False:
            plot = Plotter.create_th2(d, 0, 415 if module else 51, 0, 159 if module else 79, name, 'Pixels x', 'Pixels y', name)
            window.histos.append(plot)
        else:
            for row in xrange(d.shape[0]):
                for col in xrange(d.shape[1]):
                    window.histos[-1].Fill(row+1,col+1,d[row][col])
        window.update()
simonspa commented 7 years ago

Hi @dinardo maybe also attach the code with which you are recording the data, along with the used configuration. When chaning VCal - are you in the CtrlReg = 4 (high region)? Is your chip properly calibrated/trimmed?

/Simon

dinardo commented 7 years ago

Hi Simon, on my CERN public area:

/afs/cern.ch/user/d/dinardo/public/

you can find the tar.gz file ROCtest.tar.gz with the python code, runDTBextCLKtrg.py, and the ROC parameter files.

Yes, I tried also with CtrlReg = 4 and CtrlReg = 0 and the px.value is always 125.0

Many thanks,

schuetzepaul commented 7 years ago

Hi Mauro,

i've been testing your code with inject=True, trigsource=int, but removed the externalClock (btw: Are you running FW 4.6 on external Clock? This should not work) and the clockstretch.

Doing this, I get different pulse heights for different vcal values, meaning I cannot reproduce your issue. Did you try it with these settings?

dinardo commented 7 years ago

Hi Paul, I do have FW = 4.6

I don't remember I've used your settings. I think yes, because I've tried different things, but any way I'll try them again.

Unfortunately right now I'm at Fermilab for a test beam. I'll be back in my lab after the 15th of December.

Quick question, how to you print the pulse height ?

Many thanks for looking into this.

schuetzepaul commented 7 years ago

Hi Mauro,

since I've used your script, the output comes from the decodeData function, hence it's the px.value.