18 |
// YODA headers |
// YODA headers |
19 |
// |
// |
20 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
|
#include <RegistryEvent.h> |
|
21 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
22 |
#include <CalibCalPedEvent.h> |
#include <CalibCalPedEvent.h> |
23 |
// |
// |
45 |
// |
// |
46 |
|
|
47 |
CaloProcessing::~CaloProcessing(){ |
CaloProcessing::~CaloProcessing(){ |
48 |
|
delete de; |
49 |
delete this; |
delete this; |
50 |
} |
} |
51 |
|
|
52 |
CaloProcessing::CaloProcessing(){ |
CaloProcessing::CaloProcessing(){ |
|
e_clevel1 = new struct FlCaLevel1; |
|
|
e_clevel2 = new struct FlCaLevel2; |
|
|
e_clevel2->ncore = 0; |
|
|
e_clevel2->qcore = 0.; |
|
|
e_clevel2->noint = 0.; |
|
|
e_clevel2->ncyl = 0.; |
|
|
e_clevel2->qcyl = 0.; |
|
|
e_clevel2->qtrack = 0.; |
|
|
e_clevel2->qtrackx = 0.; |
|
|
e_clevel2->qtracky = 0.; |
|
|
e_clevel2->dxtrack = 0.; |
|
|
e_clevel2->dytrack = 0.; |
|
|
e_clevel2->qlast = 0.; |
|
|
e_clevel2->nlast = 0.; |
|
|
e_clevel2->qpre = 0.; |
|
|
e_clevel2->npre = 0.; |
|
|
e_clevel2->qpresh = 0.; |
|
|
e_clevel2->npresh = 0.; |
|
|
e_clevel2->qlow = 0.; |
|
|
e_clevel2->nlow = 0.; |
|
|
e_clevel2->qtr = 0.; |
|
|
e_clevel2->ntr = 0.; |
|
|
e_clevel2->elen = 0.; |
|
|
e_clevel2->selen = 0.; |
|
|
e_clevel1->good2 = 0; |
|
|
e_clevel1->trkchi2 = 0; |
|
|
for (Int_t il = 0; il<2 ; il++){ |
|
|
for ( Int_t jl = 0; jl<22; jl++){ |
|
|
if ( jl < 5 ) e_clevel1->al_p[jl][il] = 0.; |
|
|
for ( Int_t ml = 0; ml<96; ml++){ |
|
|
e_clevel1->estrip[ml][jl][il] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
e_clevel2->trigty = 0.; |
|
|
e_clevel2->good = 0; |
|
|
e_clevel2->nstrip = 0.; |
|
|
e_clevel2->qtot = 0.; |
|
|
e_clevel2->impx = 0.; |
|
|
e_clevel2->impy = 0.; |
|
|
e_clevel2->tanx = 0.; |
|
|
e_clevel2->tany = 0.; |
|
|
e_clevel2->qmax = 0.; |
|
|
e_clevel2->nx22 = 0.; |
|
|
e_clevel2->qx22 = 0.; |
|
|
e_clevel2->planetot = 0.; |
|
|
e_clevel2->qmean = 0.; |
|
|
e_clevel2->dX0l = 0.; |
|
|
for (Int_t il = 0; il<4 ; il++){ |
|
|
e_clevel2->perr[il] = 0; |
|
|
e_clevel2->swerr[il] = 0; |
|
|
e_clevel2->crc[il] = 0; |
|
|
e_clevel2->qq[il] = 0.; |
|
|
if ( il < 2 ){ |
|
|
e_clevel2->varcfit[il] = 0.; |
|
|
e_clevel2->planemax[il] = 0; |
|
|
e_clevel2->npcfit[il] = 0; |
|
|
for ( Int_t jl = 0; jl<22; jl++){ |
|
|
e_clevel2->cibar[jl][il] = 0; |
|
|
e_clevel2->tibar[jl][il] = 0; |
|
|
e_clevel2->cbar[jl][il] = 0.; |
|
|
e_clevel2->tbar[jl][il] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
53 |
// |
// |
54 |
extern struct FlCaLevel1 clevel1_; |
extern struct FlCaLevel1 clevel1_; |
55 |
extern struct FlCaLevel2 clevel2_; |
extern struct FlCaLevel2 clevel2_; |
58 |
// |
// |
59 |
trkseqno = 0; |
trkseqno = 0; |
60 |
ClearStructs(); |
ClearStructs(); |
61 |
for ( Int_t l = 0; l < 2; l++ ){ |
// |
62 |
for ( Int_t m = 0; m < 22; m++ ){ |
memset(dexy, 0, 2*22*96*sizeof(Float_t)); |
63 |
for ( Int_t n = 0; n < 96; n++ ){ |
memset(dexyc, 0, 2*22*96*sizeof(Float_t)); |
64 |
dexy[l][m][n] = 0.; |
memset(mip, 0, 2*22*96*sizeof(Float_t)); |
65 |
dexyc[l][m][n] = 0.; |
memset(base, 0, 2*22*6*sizeof(Float_t)); |
66 |
mip[l][m][n] = 0.; |
memset(sbase, 0, 2*22*6*sizeof(Float_t)); |
|
if ( n < 6 ){ |
|
|
base[l][m][n] = 0.; |
|
|
sbase[l][m][n] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
67 |
calopar1 = true; |
calopar1 = true; |
68 |
calopar2 = true; |
calopar2 = true; |
69 |
ftcalopar1 = 0ULL; |
ftcalopar1 = 0; |
70 |
ttcalopar1 = 0ULL; |
ttcalopar1 = 0; |
71 |
ftcalopar2 = 0ULL; |
ftcalopar2 = 0; |
72 |
ttcalopar2 = 0ULL; |
ttcalopar2 = 0; |
73 |
} |
} |
74 |
|
|
75 |
/** |
/** |
76 |
* Initialize CaloProcessing object |
* Initialize CaloProcessing object |
77 |
**/ |
**/ |
78 |
void CaloProcessing::ProcessingInit(TSQLServer *dbc, ULong64_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){ |
void CaloProcessing::ProcessingInit(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t isdeb, Bool_t isverb){ |
79 |
// |
// |
80 |
debug = isdeb; |
debug = isdeb; |
81 |
verbose = isverb; |
verbose = isverb; |
91 |
GL_CALO_CALIB *glcalo = new GL_CALO_CALIB(); |
GL_CALO_CALIB *glcalo = new GL_CALO_CALIB(); |
92 |
// |
// |
93 |
sgnl = 0; |
sgnl = 0; |
94 |
|
UInt_t uptime = 0; |
95 |
// |
// |
96 |
for (Int_t s = 0; s < 4; s++){ |
for (Int_t s = 0; s < 4; s++){ |
97 |
idcalib[s] = 0ULL; |
idcalib[s] = 0; |
98 |
fromtime[s] = 0ULL; |
fromtime[s] = 0; |
99 |
totime[s] = 0ULL; |
totime[s] = 0; |
100 |
calibno[s] = 0; |
calibno[s] = 0; |
101 |
ClearCalibVals(s); |
ClearCalibVals(s); |
102 |
// |
// |
103 |
sgnl = glcalo->Query_GL_CALO_CALIB(hs,s,dbc); |
sgnl = glcalo->Query_GL_CALO_CALIB(hs,uptime,s,dbc); |
104 |
if ( sgnl < 0 ){ |
if ( sgnl < 0 ){ |
105 |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
106 |
return; |
return; |
107 |
}; |
}; |
108 |
// |
// |
109 |
idcalib[s] = glcalo->ID_REG_CALIBCALPED; |
idcalib[s] = glcalo->ID_ROOT_L0; |
110 |
fromtime[s] = glcalo->FROM_TIME; |
fromtime[s] = glcalo->FROM_TIME; |
111 |
totime[s] = glcalo->TO_TIME; |
if ( glcalo->TO_TIME < hs ){ // calibration is corrupted and we are using the one that preceed the good one |
112 |
calibno[s] = glcalo->EV_REG_CALIBCALPED; |
totime[s] = uptime; |
113 |
// |
} else { |
114 |
if ( totime[s] == 0ULL){ |
totime[s] = glcalo->TO_TIME; |
115 |
|
}; |
116 |
|
calibno[s] = glcalo->EV_ROOT; |
117 |
|
// |
118 |
|
if ( totime[s] == 0 ){ |
119 |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
120 |
ClearCalibVals(s); |
ClearCalibVals(s); |
121 |
sgnl = 100; |
sgnl = 100; |
128 |
if ( verbose ) printf("\n"); |
if ( verbose ) printf("\n"); |
129 |
for (Int_t s = 0; s < 4; s++){ |
for (Int_t s = 0; s < 4; s++){ |
130 |
if ( verbose ) printf(" ** SECTION %i **\n",s); |
if ( verbose ) printf(" ** SECTION %i **\n",s); |
131 |
if ( totime[s] > 0ULL ){ |
if ( totime[s] > 0 ){ |
132 |
// |
// |
133 |
sgnl = glroot->Query_GL_ROOT(idcalib[s],dbc); |
sgnl = glroot->Query_GL_ROOT(idcalib[s],dbc); |
134 |
if ( sgnl < 0 ){ |
if ( sgnl < 0 ){ |
135 |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
136 |
return; |
return; |
137 |
}; |
}; |
138 |
// |
// |
139 |
stringstream name; |
stringstream name; |
140 |
name.str(""); |
name.str(""); |
141 |
name << glroot->PATH.Data() << "/"; |
name << glroot->PATH.Data() << "/"; |
142 |
name << glroot->NAME.Data(); |
name << glroot->NAME.Data(); |
143 |
// |
// |
144 |
fcalname[s] = (TString)name.str().c_str(); |
fcalname[s] = (TString)name.str().c_str(); |
145 |
if ( verbose ) printf(" - runheader at time %llu. From time %llu to time %llu \n use file %s \n calibration at entry %i \n\n",hs,fromtime[s],totime[s],fcalname[s].Data(),calibno[s]); |
if ( verbose ) printf(" - runheader at time %u. From time %u to time %u \n use file %s \n calibration at entry %i \n\n",hs,fromtime[s],totime[s],fcalname[s].Data(),calibno[s]); |
146 |
} else { |
} else { |
147 |
if ( verbose ) printf(" - runheader at time %llu. NO CALIBRATION INCLUDE THE RUNHEADER! ",hs); |
if ( verbose ) printf(" - runheader at time %u. NO CALIBRATION INCLUDE THE RUNHEADER! ",hs); |
148 |
}; |
}; |
149 |
sgnl = LoadCalib(s); |
sgnl = LoadCalib(s); |
150 |
if ( sgnl ) break; |
if ( sgnl ) break; |
157 |
// |
// |
158 |
} |
} |
159 |
|
|
160 |
Int_t CaloProcessing::ChkCalib(TSQLServer *dbc, ULong64_t atime){ |
Int_t CaloProcessing::ChkCalib(TSQLServer *dbc, UInt_t atime){ |
161 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
162 |
for ( Int_t s = 0; s < 4; s++){ |
for ( Int_t s = 0; s < 4; s++){ |
163 |
if ( atime > totime[s] ){ |
if ( atime > totime[s] ){ |
168 |
return(sgnl); |
return(sgnl); |
169 |
} |
} |
170 |
|
|
171 |
Int_t CaloProcessing::ChkParam(TSQLServer *dbc, ULong64_t runheader){ |
Int_t CaloProcessing::ChkParam(TSQLServer *dbc, UInt_t runheader){ |
172 |
stringstream calfile; |
stringstream calfile; |
173 |
stringstream aligfile; |
stringstream aligfile; |
174 |
Int_t error = 0; |
Int_t error = 0; |
183 |
if ( verbose ) printf(" Querying DB for calorimeter parameters files...\n"); |
if ( verbose ) printf(" Querying DB for calorimeter parameters files...\n"); |
184 |
// |
// |
185 |
error = 0; |
error = 0; |
186 |
error = glparam->Query_GL_PARAM(runheader,"Calorimeter ADC to MIP",dbc); |
error = glparam->Query_GL_PARAM(runheader,101,dbc); |
187 |
if ( error < 0 ) return(error); |
if ( error < 0 ) return(error); |
188 |
// |
// |
189 |
calfile.str(""); |
calfile.str(""); |
216 |
// |
// |
217 |
// |
// |
218 |
error = 0; |
error = 0; |
219 |
error = glparam->Query_GL_PARAM(runheader,"Calorimeter alignement",dbc); |
error = glparam->Query_GL_PARAM(runheader,102,dbc); |
220 |
if ( error < 0 ) return(error); |
if ( error < 0 ) return(error); |
221 |
// |
// |
222 |
aligfile.str(""); |
aligfile.str(""); |
245 |
}; |
}; |
246 |
// |
// |
247 |
delete glparam; |
delete glparam; |
|
// delete f; |
|
248 |
// |
// |
249 |
return(0); |
return(0); |
250 |
} |
} |
425 |
doneb = 0; |
doneb = 0; |
426 |
donec = 0; |
donec = 0; |
427 |
pre++; |
pre++; |
428 |
qpre[pre] = 0; |
qpre[pre] = 0.; |
429 |
}; |
}; |
430 |
// |
// |
431 |
// baseline check and calculation |
// baseline check and calculation |
498 |
ipre = ip[i] - 1; |
ipre = ip[i] - 1; |
499 |
}; |
}; |
500 |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
501 |
clevel1->estrip[j][m][l] = clevel1->estrip[j][m][l] + (qpre[ipre] - qpre[ip[i]]) * 0.00478; |
clevel1->estrip[j][m][l] += (qpre[ipre] - qpre[ip[i]]) * 0.00478; |
502 |
}; |
}; |
503 |
}; |
}; |
504 |
if (ck == 2){ |
if (ck == 2){ |
505 |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
506 |
ipre = j/16 + 1; |
ipre = j/16 + 1; |
507 |
clevel1->estrip[j][m][l] = clevel1->estrip[j][m][l] + qpre[ipre] * 0.00478; |
clevel1->estrip[j][m][l] += qpre[ipre] * 0.00478; |
508 |
}; |
}; |
509 |
}; |
}; |
510 |
}; |
}; |
518 |
j4++; |
j4++; |
519 |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
520 |
if ( jj >= 0 && jj < 96 ){ |
if ( jj >= 0 && jj < 96 ){ |
521 |
if ( jj != 0 && jj != 32 && jj != 64 ) ene[jj-1] = ene[jj-1] - clevel1->estrip[jj][m][l] * 0.01581; |
if ( jj != 0 && jj != 32 && jj != 64 ) ene[jj-1] += -clevel1->estrip[jj][m][l] * 0.01581; |
522 |
if ( jj != 31 && jj != 63 && jj != 95 ) ene[jj+1] = ene[jj+1] - clevel1->estrip[jj][m][l] * 0.01581; |
if ( jj != 31 && jj != 63 && jj != 95 ) ene[jj+1] += -clevel1->estrip[jj][m][l] * 0.01581; |
523 |
}; |
}; |
524 |
if ( jjj >= 0 && jjj < 96 ){ |
if ( jjj >= 0 && jjj < 96 ){ |
525 |
if ( jjj != 0 && jjj != 32 && jjj != 64 ) clevel1->estrip[jjj-1][m][l] = clevel1->estrip[jjj-1][m][l] - ene[jjj] * 0.01581; |
if ( jjj != 0 && jjj != 32 && jjj != 64 ) clevel1->estrip[jjj-1][m][l] += -ene[jjj] * 0.01581; |
526 |
if ( jjj != 31 && jjj != 63 && jjj != 95 ) clevel1->estrip[jjj+1][m][l] = clevel1->estrip[jjj+1][m][l] - ene[jjj] * 0.01581; |
if ( jjj != 31 && jjj != 63 && jjj != 95 ) clevel1->estrip[jjj+1][m][l] += -ene[jjj] * 0.01581; |
527 |
}; |
}; |
528 |
if ( j4 >= 0 && j4 < 96 ){ |
if ( j4 >= 0 && j4 < 96 ){ |
529 |
// |
// |
664 |
void CaloProcessing::RunClose(){ |
void CaloProcessing::RunClose(){ |
665 |
l0tr->Delete(); |
l0tr->Delete(); |
666 |
ClearStructs(); |
ClearStructs(); |
667 |
for ( Int_t l = 0; l < 2; l++ ){ |
// |
668 |
for ( Int_t m = 0; m < 22; m++ ){ |
memset(dexy, 0, 2*22*96*sizeof(Float_t)); |
669 |
for ( Int_t n = 0; n < 96; n++ ){ |
memset(dexyc, 0, 2*22*96*sizeof(Float_t)); |
670 |
dexy[l][m][n] = 0.; |
memset(base, 0, 2*22*6*sizeof(Float_t)); |
671 |
dexyc[l][m][n] = 0.; |
memset(sbase, 0, 2*22*6*sizeof(Float_t)); |
672 |
if ( n < 6 ){ |
// |
|
base[l][m][n] = 0.; |
|
|
sbase[l][m][n] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
673 |
} |
} |
674 |
|
|
675 |
// |
// |
702 |
clevel2->dX0l = 0.; |
clevel2->dX0l = 0.; |
703 |
clevel2->elen = 0.; |
clevel2->elen = 0.; |
704 |
clevel2->selen = 0.; |
clevel2->selen = 0.; |
705 |
memcpy(clevel1->al_p,e_clevel1->al_p,sizeof(clevel1->al_p)); |
memset(clevel1->al_p, 0, 5*2*sizeof(Double_t)); |
706 |
memcpy(clevel2->tibar,e_clevel2->tibar,sizeof(clevel2->tibar)); |
memset(clevel2->tibar, 0, 2*22*sizeof(Int_t)); |
707 |
memcpy(clevel2->tbar,e_clevel2->tbar,sizeof(clevel2->tbar)); |
memset(clevel2->tbar, 0, 2*22*sizeof(Float_t)); |
708 |
} |
} |
709 |
|
|
710 |
void CaloProcessing::ClearCommonVar(){ |
void CaloProcessing::ClearCommonVar(){ |
720 |
clevel2->qmax = 0.; |
clevel2->qmax = 0.; |
721 |
clevel2->nx22 = 0.; |
clevel2->nx22 = 0.; |
722 |
clevel2->qx22 = 0.; |
clevel2->qx22 = 0.; |
723 |
memcpy(clevel2->perr,e_clevel2->perr,sizeof(clevel2->perr)); |
memset(clevel2->perr, 0, 4*sizeof(Int_t)); |
724 |
memcpy(clevel2->swerr,e_clevel2->swerr,sizeof(clevel2->swerr)); |
memset(clevel2->swerr, 0, 4*sizeof(Int_t)); |
725 |
memcpy(clevel2->crc,e_clevel2->crc,sizeof(clevel2->crc)); |
memset(clevel2->crc, 0, 4*sizeof(Int_t)); |
726 |
memcpy(clevel2->qq,e_clevel2->qq,sizeof(clevel2->qq)); |
memset(clevel2->qq, 0, 4*sizeof(Int_t)); |
727 |
memcpy(clevel2->planemax,e_clevel2->planemax,sizeof(clevel2->planemax)); |
memset(clevel2->varcfit, 0, 2*sizeof(Float_t)); |
728 |
memcpy(clevel2->varcfit,e_clevel2->varcfit,sizeof(clevel2->varcfit)); |
memset(clevel2->npcfit, 0, 2*sizeof(Int_t)); |
729 |
memcpy(clevel2->npcfit,e_clevel2->npcfit,sizeof(clevel2->npcfit)); |
memset(clevel2->planemax, 0, 2*sizeof(Int_t)); |
730 |
memcpy(clevel2->cibar,e_clevel2->cibar,sizeof(clevel2->cibar)); |
memset(clevel2->cibar, 0, 2*22*sizeof(Int_t)); |
731 |
memcpy(clevel2->cbar,e_clevel2->cbar,sizeof(clevel2->cbar)); |
memset(clevel2->cbar, 0, 2*22*sizeof(Float_t)); |
732 |
} |
} |
733 |
|
|
734 |
void CaloProcessing::ClearCalibVals(Int_t s){ |
void CaloProcessing::ClearCalibVals(Int_t s){ |
782 |
return; |
return; |
783 |
} |
} |
784 |
|
|
785 |
Int_t CaloProcessing::Update(TSQLServer *dbc, ULong64_t atime, Int_t s){ |
Int_t CaloProcessing::Update(TSQLServer *dbc, UInt_t atime, Int_t s){ |
786 |
// |
// |
787 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
788 |
// |
// |
790 |
// |
// |
791 |
sgnl = 0; |
sgnl = 0; |
792 |
// |
// |
793 |
idcalib[s] = 0ULL; |
idcalib[s] = 0; |
794 |
fromtime[s] = 0ULL; |
fromtime[s] = 0; |
795 |
totime[s] = 0ULL; |
totime[s] = 0; |
796 |
calibno[s] = 0; |
calibno[s] = 0; |
797 |
ClearCalibVals(s); |
ClearCalibVals(s); |
798 |
// |
// |
799 |
sgnl = glcalo->Query_GL_CALO_CALIB(atime,s,dbc); |
UInt_t uptime = 0; |
800 |
|
// |
801 |
|
sgnl = glcalo->Query_GL_CALO_CALIB(atime,uptime,s,dbc); |
802 |
if ( sgnl < 0 ){ |
if ( sgnl < 0 ){ |
803 |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
804 |
return(sgnl); |
return(sgnl); |
805 |
}; |
}; |
806 |
// |
// |
807 |
idcalib[s] = glcalo->ID_REG_CALIBCALPED; |
idcalib[s] = glcalo->ID_ROOT_L0; |
808 |
fromtime[s] = glcalo->FROM_TIME; |
fromtime[s] = glcalo->FROM_TIME; |
809 |
totime[s] = glcalo->TO_TIME; |
if ( glcalo->TO_TIME < atime ){ // calibration is corrupted and we are using the one that preceed the good one |
810 |
calibno[s] = glcalo->EV_REG_CALIBCALPED; |
totime[s] = uptime; |
811 |
|
} else { |
812 |
|
totime[s] = glcalo->TO_TIME; |
813 |
|
}; |
814 |
|
// totime[s] = glcalo->TO_TIME; |
815 |
|
calibno[s] = glcalo->EV_ROOT; |
816 |
// |
// |
817 |
if ( totime[s] == 0ULL){ |
if ( totime[s] == 0 ){ |
818 |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
819 |
ClearCalibVals(s); |
ClearCalibVals(s); |
820 |
sgnl = 100; |
sgnl = 100; |
838 |
name << glroot->NAME.Data(); |
name << glroot->NAME.Data(); |
839 |
// |
// |
840 |
fcalname[s] = (TString)name.str().c_str(); |
fcalname[s] = (TString)name.str().c_str(); |
841 |
if ( verbose ) printf(" - event at time %llu. From time %llu to time %llu \n use file %s \n calibration at entry %i \n\n",atime,fromtime[s],totime[s],fcalname[s].Data(),calibno[s]); |
if ( verbose ) printf(" - event at time %u. From time %u to time %u \n use file %s \n calibration at entry %i \n\n",atime,fromtime[s],totime[s],fcalname[s].Data(),calibno[s]); |
842 |
// |
// |
843 |
sgnl = LoadCalib(s); |
sgnl = LoadCalib(s); |
844 |
// |
// |
864 |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
865 |
if ( !tr ) return(-109); |
if ( !tr ) return(-109); |
866 |
// |
// |
|
TBranch *registry = tr->GetBranch("Registry"); |
|
867 |
TBranch *calo = tr->GetBranch("CalibCalPed"); |
TBranch *calo = tr->GetBranch("CalibCalPed"); |
868 |
// |
// |
|
pamela::RegistryEvent *reg = 0; |
|
869 |
pamela::CalibCalPedEvent *ce = 0; |
pamela::CalibCalPedEvent *ce = 0; |
870 |
tr->SetBranchAddress("CalibCalPed", &ce); |
tr->SetBranchAddress("CalibCalPed", &ce); |
|
tr->SetBranchAddress("Registry", ®); |
|
871 |
// |
// |
872 |
Long64_t ncalibs = registry->GetEntries(); |
Long64_t ncalibs = calo->GetEntries(); |
873 |
// |
// |
874 |
if ( !ncalibs ) return(-110); |
if ( !ncalibs ) return(-110); |
875 |
// |
// |
876 |
registry->GetEntry(calibno[s]); |
calo->GetEntry(calibno[s]); |
|
// |
|
|
calo->GetEntry(reg->event); |
|
877 |
// |
// |
878 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
879 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |