jungfrau classes not work

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorCalibration@36 113b152e-814d-439b-b186-022a431db7b5
This commit is contained in:
bergamaschi 2014-02-06 09:54:10 +00:00
parent a70b13d849
commit 8c2ed9dcf4
3 changed files with 29 additions and 25 deletions

View File

@ -80,6 +80,6 @@ LATEX_HIDE_INDICES = YES
PREDEFINED = __cplusplus
INPUT = MovingStat.h slsDetectorData.h slsReceiverData.h moench02ModuleData.h pedestalSubtraction.h commonModeSubtraction.h moenchCommonMode.h singlePhotonDetector.h energyCalibration.h moenchReadData.C single_photon_hit.h
INPUT = MovingStat.h slsDetectorData.h slsReceiverData.h moench02ModuleData.h pedestalSubtraction.h commonModeSubtraction.h moenchCommonMode.h singlePhotonDetector.h energyCalibration.h moenchReadData.C single_photon_hit.h chiptestBoardData.h jungfrau02Data.h jungfrauReadData.C
OUTPUT_DIRECTORY = docs

View File

@ -74,7 +74,9 @@ class jungfrau02Data : public chiptestBoardData {
if (ix>=0 && ix<nx && iy>=0 && iy<ny && dataMap[iy][ix]>=0 && dataMap[iy][ix]<dataSize) {
m=dataMask[iy][ix];
d=*(((uint16_t*)(data))+dataMap[iy][ix]);
// cout << ix << " " << iy << " " << (uint16_t*)data << " " << ((uint16_t*)(data))+dataMap[iy][ix] << " " << d << endl;
if (nAdc==3) {
cout << "Gain bit!" << endl;
if (*((uint16_t*)(data)+dataMap[iy][ix]+1)>8000)
d|=(1<<14); // set gain bit 0
if (*((uint16_t*)(data)+dataMap[iy][ix]+2)>8000)
@ -96,10 +98,12 @@ class jungfrau02Data : public chiptestBoardData {
*/
double getValue(char *data, int ix, int iy=0) {
// cout << "##" << (void*)data << " " << ix << " " <<iy << endl;
uint16_t d=getChannel(data, ix, iy);
// cout << d << " " << (d&0x3fff) << endl;
if (xtalk==0 || ix==0)
return (double)(getChannel(data, ix, iy)&0x3ff);
return (double)(getChannel(data, ix, iy)&0x3fff);
else
return (double)(getChannel(data, ix, iy)&0x3ff)-xtalk* (double)(getChannel(data, ix, iy)&0x3ff);
return (double)(getChannel(data, ix, iy)&0x3fff)-xtalk* (double)(getChannel(data, ix, iy)&0x3fff);
};

View File

@ -49,6 +49,7 @@ Loops over data file to find single photons, fills the tree (and writes it to fi
\param ymin minimum y coordinate
\param ymax maximum y coordinate
\param cmsub enable commonmode subtraction
\param hitfinder if 0, performs pedestal subtraction, not hit finding
\returns pointer to histo stack with cluster spectra
*/
@ -57,8 +58,8 @@ THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int
jungfrau02Data *decoder=new jungfrau02Data(1,0,0);
moenchCommonMode *cmSub=NULL;
if (cmsub)
cmSub=new moenchCommonMode();
// if (cmsub)
// cmSub=new moenchCommonMode();
int nph=0;
int iev=0;
@ -170,31 +171,30 @@ THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int
// thisEvent=filter->getEventType(buff, ix, iy, cmsub);
thisEvent=filter->getEventType(buff, ix, iy, cmsub);
#ifdef MY_DEBUG
if (hitfinder) {
if (iev%1000==0)
he->SetBinContent(ix+1-xmin, iy+1-ymin, decoder->getValue(buff,ix,iy));
//he->SetBinContent(ix+1-xmin, iy+1-ymin, (int)thisEvent);
he->SetBinContent(ix+1-xmin, iy+1-ymin, (int)thisEvent);
}
#endif
if (nf>1000) {
h1->Fill(decoder->getValue(buff,ix,iy), iy+NR*ix);
// h1->Fill(filter->getClusterTotal(1), iy+NR*ix);
// h1->Fill(decoder->getValue(buff,ix,iy), iy+NR*ix);
h1->Fill(filter->getClusterTotal(1), iy+NR*ix);
if (hitfinder) {
if (thisEvent==PHOTON_MAX ) {
nph++;
// h2->Fill(filter->getClusterTotal(2), iy+NR*ix);
// h3->Fill(filter->getClusterTotal(3), iy+NR*ix);
// iFrame=decoder->getFrameNumber(buff);
h2->Fill(filter->getClusterTotal(2), iy+NR*ix);
h3->Fill(filter->getClusterTotal(3), iy+NR*ix);
iFrame=decoder->getFrameNumber(buff);
// tall->Fill();
tall->Fill();
}
@ -231,8 +231,8 @@ THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int
else
cout << "could not open file " << fname << endl;
}
// if (hitfinder)
// tall->Write(tall->GetName(),TObject::kOverwrite);
if (hitfinder)
tall->Write(tall->GetName(),TObject::kOverwrite);