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 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 OUTPUT_DIRECTORY = docs

View File

@ -38,13 +38,13 @@ class jungfrau02Data : public chiptestBoardData {
} }
for (int iy=0; iy<48; iy++) { for (int iy=0; iy<48; iy++) {
for (int ix=0; ix<48; ix++) { for (int ix=0; ix<48; ix++) {
dMap[iy][ix]=offset+(iy*48+ix)*nAdc; dMap[iy][ix]=offset+(iy*48+ix)*nAdc;
// cout << ix << " " << iy << " " << dMap[ix][iy] << endl; // cout << ix << " " << iy << " " << dMap[ix][iy] << endl;
} }
} }
for (int ix=0; ix<48; ix++) { for (int ix=0; ix<48; ix++) {
for (int iy=0; iy<48; iy++) for (int iy=0; iy<48; iy++)
@ -74,12 +74,14 @@ class jungfrau02Data : public chiptestBoardData {
if (ix>=0 && ix<nx && iy>=0 && iy<ny && dataMap[iy][ix]>=0 && dataMap[iy][ix]<dataSize) { if (ix>=0 && ix<nx && iy>=0 && iy<ny && dataMap[iy][ix]>=0 && dataMap[iy][ix]<dataSize) {
m=dataMask[iy][ix]; m=dataMask[iy][ix];
d=*(((uint16_t*)(data))+dataMap[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) { if (nAdc==3) {
cout << "Gain bit!" << endl;
if (*((uint16_t*)(data)+dataMap[iy][ix]+1)>8000) if (*((uint16_t*)(data)+dataMap[iy][ix]+1)>8000)
d|=(1<<14); // set gain bit 0 d|=(1<<14); // set gain bit 0
if (*((uint16_t*)(data)+dataMap[iy][ix]+2)>8000) if (*((uint16_t*)(data)+dataMap[iy][ix]+2)>8000)
d|=(1<<15); // set gain bit 1 d|=(1<<15); // set gain bit 1
} }
} }
@ -96,10 +98,12 @@ class jungfrau02Data : public chiptestBoardData {
*/ */
double getValue(char *data, int ix, int iy=0) { double getValue(char *data, int ix, int iy=0) {
// cout << "##" << (void*)data << " " << ix << " " <<iy << endl; // cout << "##" << (void*)data << " " << ix << " " <<iy << endl;
uint16_t d=getChannel(data, ix, iy);
// cout << d << " " << (d&0x3fff) << endl;
if (xtalk==0 || ix==0) if (xtalk==0 || ix==0)
return (double)(getChannel(data, ix, iy)&0x3ff); return (double)(getChannel(data, ix, iy)&0x3fff);
else 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 ymin minimum y coordinate
\param ymax maximum y coordinate \param ymax maximum y coordinate
\param cmsub enable commonmode subtraction \param cmsub enable commonmode subtraction
\param hitfinder if 0, performs pedestal subtraction, not hit finding
\returns pointer to histo stack with cluster spectra \returns pointer to histo stack with cluster spectra
*/ */
@ -56,9 +57,9 @@ Loops over data file to find single photons, fills the tree (and writes it to fi
THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int nbins=1500, int hmin=-500, int hmax=1000, int sign=1, double hc=0, int xmin=1, int xmax=NC-1, int ymin=1, int ymax=NR-1, int cmsub=0, int hitfinder=1) { THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int nbins=1500, int hmin=-500, int hmax=1000, int sign=1, double hc=0, int xmin=1, int xmax=NC-1, int ymin=1, int ymax=NR-1, int cmsub=0, int hitfinder=1) {
jungfrau02Data *decoder=new jungfrau02Data(1,0,0); jungfrau02Data *decoder=new jungfrau02Data(1,0,0);
moenchCommonMode *cmSub=NULL; moenchCommonMode *cmSub=NULL;
if (cmsub) // if (cmsub)
cmSub=new moenchCommonMode(); // cmSub=new moenchCommonMode();
int nph=0; int nph=0;
int iev=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 #ifdef MY_DEBUG
if (hitfinder) { if (hitfinder) {
if (iev%1000==0) 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 #endif
if (nf>1000) { if (nf>1000) {
h1->Fill(decoder->getValue(buff,ix,iy), iy+NR*ix); // h1->Fill(decoder->getValue(buff,ix,iy), iy+NR*ix);
// h1->Fill(filter->getClusterTotal(1), iy+NR*ix); h1->Fill(filter->getClusterTotal(1), iy+NR*ix);
if (hitfinder) { if (hitfinder) {
if (thisEvent==PHOTON_MAX ) { if (thisEvent==PHOTON_MAX ) {
nph++; nph++;
// h2->Fill(filter->getClusterTotal(2), iy+NR*ix); h2->Fill(filter->getClusterTotal(2), iy+NR*ix);
// h3->Fill(filter->getClusterTotal(3), iy+NR*ix); h3->Fill(filter->getClusterTotal(3), iy+NR*ix);
// iFrame=decoder->getFrameNumber(buff); iFrame=decoder->getFrameNumber(buff);
// tall->Fill(); tall->Fill();
} }
@ -231,8 +231,8 @@ THStack *jungfrauReadData(char *fformat, char *tit, int runmin, int runmax, int
else else
cout << "could not open file " << fname << endl; cout << "could not open file " << fname << endl;
} }
// if (hitfinder) if (hitfinder)
// tall->Write(tall->GetName(),TObject::kOverwrite); tall->Write(tall->GetName(),TObject::kOverwrite);