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; |
93 |
sgnl = 0; |
sgnl = 0; |
94 |
// |
// |
95 |
for (Int_t s = 0; s < 4; s++){ |
for (Int_t s = 0; s < 4; s++){ |
96 |
idcalib[s] = 0ULL; |
idcalib[s] = 0; |
97 |
fromtime[s] = 0ULL; |
fromtime[s] = 0; |
98 |
totime[s] = 0ULL; |
totime[s] = 0; |
99 |
calibno[s] = 0; |
calibno[s] = 0; |
100 |
ClearCalibVals(s); |
ClearCalibVals(s); |
101 |
// |
// |
102 |
sgnl = glcalo->Query_GL_CALO_CALIB(hs,s,dbc); |
sgnl = glcalo->Query_GL_CALO_CALIB(hs,s,dbc); |
103 |
if ( sgnl < 0 ){ |
if ( sgnl < 0 ){ |
104 |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
105 |
return; |
return; |
106 |
}; |
}; |
107 |
// |
// |
108 |
idcalib[s] = glcalo->ID_REG_CALIBCALPED; |
idcalib[s] = glcalo->ID_ROOT_L0; |
109 |
fromtime[s] = glcalo->FROM_TIME; |
fromtime[s] = glcalo->FROM_TIME; |
110 |
totime[s] = glcalo->TO_TIME; |
totime[s] = glcalo->TO_TIME; |
111 |
calibno[s] = glcalo->EV_REG_CALIBCALPED; |
calibno[s] = glcalo->EV_ROOT; |
112 |
// |
// |
113 |
if ( totime[s] == 0ULL){ |
if ( totime[s] == 0 ){ |
114 |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
115 |
ClearCalibVals(s); |
ClearCalibVals(s); |
116 |
sgnl = 100; |
sgnl = 100; |
123 |
if ( verbose ) printf("\n"); |
if ( verbose ) printf("\n"); |
124 |
for (Int_t s = 0; s < 4; s++){ |
for (Int_t s = 0; s < 4; s++){ |
125 |
if ( verbose ) printf(" ** SECTION %i **\n",s); |
if ( verbose ) printf(" ** SECTION %i **\n",s); |
126 |
if ( totime[s] > 0ULL ){ |
if ( totime[s] > 0 ){ |
127 |
// |
// |
128 |
sgnl = glroot->Query_GL_ROOT(idcalib[s],dbc); |
sgnl = glroot->Query_GL_ROOT(idcalib[s],dbc); |
129 |
if ( sgnl < 0 ){ |
if ( sgnl < 0 ){ |
130 |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
if ( verbose ) printf(" CALORIMETER - ERROR: error from GLTables\n"); |
131 |
return; |
return; |
132 |
}; |
}; |
133 |
// |
// |
134 |
stringstream name; |
stringstream name; |
135 |
name.str(""); |
name.str(""); |
136 |
name << glroot->PATH.Data() << "/"; |
name << glroot->PATH.Data() << "/"; |
137 |
name << glroot->NAME.Data(); |
name << glroot->NAME.Data(); |
138 |
// |
// |
139 |
fcalname[s] = (TString)name.str().c_str(); |
fcalname[s] = (TString)name.str().c_str(); |
140 |
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]); |
141 |
} else { |
} else { |
142 |
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); |
143 |
}; |
}; |
144 |
sgnl = LoadCalib(s); |
sgnl = LoadCalib(s); |
145 |
if ( sgnl ) break; |
if ( sgnl ) break; |
146 |
}; |
}; |
147 |
// |
// |
148 |
|
delete glcalo; |
149 |
|
delete glroot; |
150 |
|
// |
151 |
return; |
return; |
152 |
// |
// |
153 |
} |
} |
154 |
|
|
155 |
Int_t CaloProcessing::ChkCalib(TSQLServer *dbc, ULong64_t atime){ |
Int_t CaloProcessing::ChkCalib(TSQLServer *dbc, UInt_t atime){ |
156 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
157 |
for ( Int_t s = 0; s < 4; s++){ |
for ( Int_t s = 0; s < 4; s++){ |
158 |
if ( atime > totime[s] ){ |
if ( atime > totime[s] ){ |
163 |
return(sgnl); |
return(sgnl); |
164 |
} |
} |
165 |
|
|
166 |
Int_t CaloProcessing::ChkParam(TSQLServer *dbc, ULong64_t runheader){ |
Int_t CaloProcessing::ChkParam(TSQLServer *dbc, UInt_t runheader){ |
167 |
stringstream calfile; |
stringstream calfile; |
168 |
stringstream aligfile; |
stringstream aligfile; |
169 |
Int_t error = 0; |
Int_t error = 0; |
178 |
if ( verbose ) printf(" Querying DB for calorimeter parameters files...\n"); |
if ( verbose ) printf(" Querying DB for calorimeter parameters files...\n"); |
179 |
// |
// |
180 |
error = 0; |
error = 0; |
181 |
error = glparam->Query_GL_PARAM(runheader,"Calorimeter ADC to MIP",dbc); |
error = glparam->Query_GL_PARAM(runheader,101,dbc); |
182 |
if ( error < 0 ) return(error); |
if ( error < 0 ) return(error); |
183 |
// |
// |
184 |
calfile.str(""); |
calfile.str(""); |
211 |
// |
// |
212 |
// |
// |
213 |
error = 0; |
error = 0; |
214 |
error = glparam->Query_GL_PARAM(runheader,"Calorimeter alignement",dbc); |
error = glparam->Query_GL_PARAM(runheader,102,dbc); |
215 |
if ( error < 0 ) return(error); |
if ( error < 0 ) return(error); |
216 |
// |
// |
217 |
aligfile.str(""); |
aligfile.str(""); |
239 |
fclose(f); |
fclose(f); |
240 |
}; |
}; |
241 |
// |
// |
242 |
|
delete glparam; |
243 |
|
// |
244 |
return(0); |
return(0); |
245 |
} |
} |
246 |
|
|
420 |
doneb = 0; |
doneb = 0; |
421 |
donec = 0; |
donec = 0; |
422 |
pre++; |
pre++; |
423 |
qpre[pre] = 0; |
qpre[pre] = 0.; |
424 |
}; |
}; |
425 |
// |
// |
426 |
// baseline check and calculation |
// baseline check and calculation |
493 |
ipre = ip[i] - 1; |
ipre = ip[i] - 1; |
494 |
}; |
}; |
495 |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
496 |
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; |
497 |
}; |
}; |
498 |
}; |
}; |
499 |
if (ck == 2){ |
if (ck == 2){ |
500 |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
for (Int_t j = i*32 ; j < (i+1)*32 ; j++){ |
501 |
ipre = j/16 + 1; |
ipre = j/16 + 1; |
502 |
clevel1->estrip[j][m][l] = clevel1->estrip[j][m][l] + qpre[ipre] * 0.00478; |
clevel1->estrip[j][m][l] += qpre[ipre] * 0.00478; |
503 |
}; |
}; |
504 |
}; |
}; |
505 |
}; |
}; |
513 |
j4++; |
j4++; |
514 |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
515 |
if ( jj >= 0 && jj < 96 ){ |
if ( jj >= 0 && jj < 96 ){ |
516 |
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; |
517 |
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; |
518 |
}; |
}; |
519 |
if ( jjj >= 0 && jjj < 96 ){ |
if ( jjj >= 0 && jjj < 96 ){ |
520 |
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; |
521 |
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; |
522 |
}; |
}; |
523 |
if ( j4 >= 0 && j4 < 96 ){ |
if ( j4 >= 0 && j4 < 96 ){ |
524 |
// |
// |
609 |
TClonesArray &t = *ca->CaloTrk; |
TClonesArray &t = *ca->CaloTrk; |
610 |
new(t[nutrk]) CaloTrkVar(*t_ca); |
new(t[nutrk]) CaloTrkVar(*t_ca); |
611 |
// |
// |
612 |
|
delete t_ca; |
613 |
|
// |
614 |
ClearTrkVar(); |
ClearTrkVar(); |
615 |
} |
} |
616 |
|
|
659 |
void CaloProcessing::RunClose(){ |
void CaloProcessing::RunClose(){ |
660 |
l0tr->Delete(); |
l0tr->Delete(); |
661 |
ClearStructs(); |
ClearStructs(); |
662 |
for ( Int_t l = 0; l < 2; l++ ){ |
// |
663 |
for ( Int_t m = 0; m < 22; m++ ){ |
memset(dexy, 0, 2*22*96*sizeof(Float_t)); |
664 |
for ( Int_t n = 0; n < 96; n++ ){ |
memset(dexyc, 0, 2*22*96*sizeof(Float_t)); |
665 |
dexy[l][m][n] = 0.; |
memset(base, 0, 2*22*6*sizeof(Float_t)); |
666 |
dexyc[l][m][n] = 0.; |
memset(sbase, 0, 2*22*6*sizeof(Float_t)); |
667 |
if ( n < 6 ){ |
// |
|
base[l][m][n] = 0.; |
|
|
sbase[l][m][n] = 0.; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
668 |
} |
} |
669 |
|
|
670 |
// |
// |
697 |
clevel2->dX0l = 0.; |
clevel2->dX0l = 0.; |
698 |
clevel2->elen = 0.; |
clevel2->elen = 0.; |
699 |
clevel2->selen = 0.; |
clevel2->selen = 0.; |
700 |
memcpy(clevel1->al_p,e_clevel1->al_p,sizeof(clevel1->al_p)); |
memset(clevel1->al_p, 0, 5*2*sizeof(Double_t)); |
701 |
memcpy(clevel2->tibar,e_clevel2->tibar,sizeof(clevel2->tibar)); |
memset(clevel2->tibar, 0, 2*22*sizeof(Int_t)); |
702 |
memcpy(clevel2->tbar,e_clevel2->tbar,sizeof(clevel2->tbar)); |
memset(clevel2->tbar, 0, 2*22*sizeof(Float_t)); |
703 |
} |
} |
704 |
|
|
705 |
void CaloProcessing::ClearCommonVar(){ |
void CaloProcessing::ClearCommonVar(){ |
715 |
clevel2->qmax = 0.; |
clevel2->qmax = 0.; |
716 |
clevel2->nx22 = 0.; |
clevel2->nx22 = 0.; |
717 |
clevel2->qx22 = 0.; |
clevel2->qx22 = 0.; |
718 |
memcpy(clevel2->perr,e_clevel2->perr,sizeof(clevel2->perr)); |
memset(clevel2->perr, 0, 4*sizeof(Int_t)); |
719 |
memcpy(clevel2->swerr,e_clevel2->swerr,sizeof(clevel2->swerr)); |
memset(clevel2->swerr, 0, 4*sizeof(Int_t)); |
720 |
memcpy(clevel2->crc,e_clevel2->crc,sizeof(clevel2->crc)); |
memset(clevel2->crc, 0, 4*sizeof(Int_t)); |
721 |
memcpy(clevel2->qq,e_clevel2->qq,sizeof(clevel2->qq)); |
memset(clevel2->qq, 0, 4*sizeof(Int_t)); |
722 |
memcpy(clevel2->planemax,e_clevel2->planemax,sizeof(clevel2->planemax)); |
memset(clevel2->varcfit, 0, 2*sizeof(Float_t)); |
723 |
memcpy(clevel2->varcfit,e_clevel2->varcfit,sizeof(clevel2->varcfit)); |
memset(clevel2->npcfit, 0, 2*sizeof(Int_t)); |
724 |
memcpy(clevel2->npcfit,e_clevel2->npcfit,sizeof(clevel2->npcfit)); |
memset(clevel2->planemax, 0, 2*sizeof(Int_t)); |
725 |
memcpy(clevel2->cibar,e_clevel2->cibar,sizeof(clevel2->cibar)); |
memset(clevel2->cibar, 0, 2*22*sizeof(Int_t)); |
726 |
memcpy(clevel2->cbar,e_clevel2->cbar,sizeof(clevel2->cbar)); |
memset(clevel2->cbar, 0, 2*22*sizeof(Float_t)); |
727 |
} |
} |
728 |
|
|
729 |
void CaloProcessing::ClearCalibVals(Int_t s){ |
void CaloProcessing::ClearCalibVals(Int_t s){ |
777 |
return; |
return; |
778 |
} |
} |
779 |
|
|
780 |
Int_t CaloProcessing::Update(TSQLServer *dbc, ULong64_t atime, Int_t s){ |
Int_t CaloProcessing::Update(TSQLServer *dbc, UInt_t atime, Int_t s){ |
781 |
// |
// |
782 |
Int_t sgnl = 0; |
Int_t sgnl = 0; |
783 |
// |
// |
785 |
// |
// |
786 |
sgnl = 0; |
sgnl = 0; |
787 |
// |
// |
788 |
idcalib[s] = 0ULL; |
idcalib[s] = 0; |
789 |
fromtime[s] = 0ULL; |
fromtime[s] = 0; |
790 |
totime[s] = 0ULL; |
totime[s] = 0; |
791 |
calibno[s] = 0; |
calibno[s] = 0; |
792 |
ClearCalibVals(s); |
ClearCalibVals(s); |
793 |
// |
// |
797 |
return(sgnl); |
return(sgnl); |
798 |
}; |
}; |
799 |
// |
// |
800 |
idcalib[s] = glcalo->ID_REG_CALIBCALPED; |
idcalib[s] = glcalo->ID_ROOT_L0; |
801 |
fromtime[s] = glcalo->FROM_TIME; |
fromtime[s] = glcalo->FROM_TIME; |
802 |
totime[s] = glcalo->TO_TIME; |
totime[s] = glcalo->TO_TIME; |
803 |
calibno[s] = glcalo->EV_REG_CALIBCALPED; |
calibno[s] = glcalo->EV_ROOT; |
804 |
// |
// |
805 |
if ( totime[s] == 0ULL){ |
if ( totime[s] == 0 ){ |
806 |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
if ( verbose ) printf(" CALORIMETER - WARNING: data with no associated calibration\n"); |
807 |
ClearCalibVals(s); |
ClearCalibVals(s); |
808 |
sgnl = 100; |
sgnl = 100; |
826 |
name << glroot->NAME.Data(); |
name << glroot->NAME.Data(); |
827 |
// |
// |
828 |
fcalname[s] = (TString)name.str().c_str(); |
fcalname[s] = (TString)name.str().c_str(); |
829 |
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]); |
830 |
// |
// |
831 |
sgnl = LoadCalib(s); |
sgnl = LoadCalib(s); |
832 |
// |
// |
833 |
if ( sgnl != 0 ) return(sgnl); |
if ( sgnl != 0 ) return(sgnl); |
834 |
|
delete glcalo; |
835 |
|
delete glroot; |
836 |
// |
// |
837 |
return(0); |
return(0); |
838 |
// |
// |
852 |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
853 |
if ( !tr ) return(-109); |
if ( !tr ) return(-109); |
854 |
// |
// |
|
TBranch *registry = tr->GetBranch("Registry"); |
|
855 |
TBranch *calo = tr->GetBranch("CalibCalPed"); |
TBranch *calo = tr->GetBranch("CalibCalPed"); |
856 |
// |
// |
|
pamela::RegistryEvent *reg = 0; |
|
857 |
pamela::CalibCalPedEvent *ce = 0; |
pamela::CalibCalPedEvent *ce = 0; |
858 |
tr->SetBranchAddress("CalibCalPed", &ce); |
tr->SetBranchAddress("CalibCalPed", &ce); |
|
tr->SetBranchAddress("Registry", ®); |
|
859 |
// |
// |
860 |
Long64_t ncalibs = registry->GetEntries(); |
Long64_t ncalibs = calo->GetEntries(); |
861 |
// |
// |
862 |
if ( !ncalibs ) return(-110); |
if ( !ncalibs ) return(-110); |
863 |
// |
// |
864 |
registry->GetEntry(calibno[s]); |
calo->GetEntry(calibno[s]); |
|
// |
|
|
calo->GetEntry(reg->event); |
|
865 |
// |
// |
866 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
867 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |