35 |
// |
// |
36 |
} |
} |
37 |
|
|
38 |
|
void CaloEnergy::Delete(){ |
39 |
|
Clear(); |
40 |
|
delete this; |
41 |
|
} |
42 |
|
|
43 |
|
void CaloEnergy::UseLevel2(){ |
44 |
|
if ( clong ){ |
45 |
|
delete clong; |
46 |
|
clong = new CaloLong(L2); |
47 |
|
clong->SplitInto(0,22); |
48 |
|
// clong->HeavyTail(true); |
49 |
|
clong->HeavyTail(false); |
50 |
|
}; |
51 |
|
if ( cp ) delete cp; |
52 |
|
cp = NULL; |
53 |
|
} |
54 |
|
|
55 |
void CaloEnergy::UseCaloPreSampler(){ |
void CaloEnergy::UseCaloPreSampler(){ |
56 |
// |
// |
57 |
// use the presampler setting forcefitmode to 1000 means to force the DV routine to find the track inside the calorimeter using the "shower" approach developed for electrons |
// use the presampler setting forcefitmode to 1000 means to force the DV routine to find the track inside the calorimeter using the "shower" approach developed for electrons |
63 |
// cp->ForceCaloFit(); |
// cp->ForceCaloFit(); |
64 |
// cp->SetDebug(true); |
// cp->SetDebug(true); |
65 |
// cp->Process(); |
// cp->Process(); |
66 |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
67 |
} |
} |
68 |
|
|
69 |
|
|
72 |
fLong = true; |
fLong = true; |
73 |
if ( !clong ){ |
if ( !clong ){ |
74 |
clong = new CaloLong(L2); |
clong = new CaloLong(L2); |
75 |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
76 |
clong->SplitInto(0,22); |
clong->SplitInto(0,22); |
77 |
|
// clong->HeavyTail(true); |
78 |
|
clong->HeavyTail(false); |
79 |
}; |
}; |
80 |
// |
// |
81 |
} |
} |
95 |
asntr = "start"; |
asntr = "start"; |
96 |
// |
// |
97 |
debug = false; |
debug = false; |
98 |
|
usepl18x = false; |
99 |
// |
// |
100 |
indep = false; |
indep = false; |
101 |
// |
// |
102 |
|
fAllpl = true; |
103 |
fLong = false; |
fLong = false; |
104 |
fPl = 1; |
fPl = 1; |
105 |
fRad = -1; |
fRad = -1; |
107 |
clong = NULL; |
clong = NULL; |
108 |
x0max = -1.; |
x0max = -1.; |
109 |
// |
// |
110 |
|
multicol = false; |
111 |
|
// |
112 |
this->DefineGeometry(); |
this->DefineGeometry(); |
113 |
fXosel =true; |
fXosel =true; |
114 |
fXesel = true; |
fXesel = true; |
122 |
fXemin = 1000; |
fXemin = 1000; |
123 |
fYomin = 1000; |
fYomin = 1000; |
124 |
fYemin = 1000; |
fYemin = 1000; |
125 |
|
// |
126 |
|
this->UseCaloPreSampler(); // use it by default, to go back to "standard" mode use CaloEnergy::UseLevel2(). |
127 |
|
// |
128 |
} |
} |
|
|
|
|
void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) fXomin = plane; |
|
|
if ( section.Contains("XE") ) fXemin = plane; |
|
|
if ( section.Contains("YO") ) fYomin = plane; |
|
|
if ( section.Contains("YE") ) fYemin = plane; |
|
|
} |
|
|
|
|
|
void CaloEnergy::SetMinimumContainment(Int_t plane){ |
|
|
this->SetMinimumContainment("XEXOYEYO",plane); |
|
|
} |
|
|
|
|
|
Int_t CaloEnergy::GetMinimumContainment(TString section){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) return(fXomin); |
|
|
if ( section.Contains("XE") ) return(fXemin); |
|
|
if ( section.Contains("YE") ) return(fYemin); |
|
|
if ( section.Contains("YO") ) return(fYomin); |
|
|
printf(" ERROR: section not recognized \n"); |
|
|
return(-1000); |
|
|
} |
|
|
|
|
|
void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) fConv_rxo = conv; |
|
|
if ( section.Contains("XE") ) fConv_rxe = conv; |
|
|
if ( section.Contains("YO") ) fConv_ryo = conv; |
|
|
if ( section.Contains("YE") ) fConv_rye = conv; |
|
|
} |
|
|
|
|
|
void CaloEnergy::SetConversionFactor(Float_t conv){ |
|
|
this->SetConversionFactor("XEXOYEYO",conv); |
|
|
} |
|
|
|
|
|
Float_t CaloEnergy::GetConversionFactor(TString section){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) return(fConv_rxo); |
|
|
if ( section.Contains("XE") ) return(fConv_rxe); |
|
|
if ( section.Contains("YO") ) return(fConv_ryo); |
|
|
if ( section.Contains("YE") ) return(fConv_rye); |
|
|
printf(" ERROR: section not recognized \n"); |
|
|
return(-1000.); |
|
|
} |
|
|
|
|
|
Int_t CaloEnergy::GetMaxplane(TString section){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) return fMax_planexo; |
|
|
if ( section.Contains("XE") ) return fMax_planexe; |
|
|
if ( section.Contains("YO") ) return fMax_planeyo; |
|
|
if ( section.Contains("YE") ) return fMax_planeye; |
|
|
return(-1); |
|
|
} |
|
|
|
|
|
Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ |
|
|
section.ToUpper(); |
|
|
if ( section.Contains("XO") ) return xomax_en; |
|
|
if ( section.Contains("XE") ) return xemax_en; |
|
|
if ( section.Contains("YO") ) return yomax_en; |
|
|
if ( section.Contains("YE") ) return yemax_en; |
|
|
return(-1); |
|
|
} |
|
|
|
|
|
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
|
|
section.ToUpper(); |
|
|
if ( fLong ){ |
|
|
this->Process(section); |
|
|
return fXOen_maxplane; |
|
|
} else { |
|
|
if ( section.Contains("XO") ) return fXOen_maxplane; |
|
|
if ( section.Contains("XE") ) return fXEen_maxplane; |
|
|
if ( section.Contains("YO") ) return fYOen_maxplane; |
|
|
if ( section.Contains("YE") ) return fYEen_maxplane; |
|
|
}; |
|
|
return(-1); |
|
|
} |
|
|
|
|
|
Float_t CaloEnergy::GetMaxEnergy(){ |
|
|
if ( fLong ){ |
|
|
if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); |
|
|
this->Process(asntr); |
|
|
}; |
|
|
return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); |
|
|
} |
|
|
|
|
129 |
void CaloEnergy::DefineGeometry(){ |
void CaloEnergy::DefineGeometry(){ |
130 |
// |
// |
131 |
// Use CaloStrip to determine once the position of border strips for each section |
// Use CaloStrip to determine once the position of border strips for each section |
132 |
// |
// |
133 |
// |
// fM = 2. + 0.096; // real position from cbar BUG the 0.096 is already taken into account in the border calculation made by Giovanna |
134 |
fM = 2. + 0.096; // real position from cbar |
fM = 2. ; // real position from cbar |
135 |
fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. |
// fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. BUG! this way we count from the silicon border not from the silicon sensitive area |
136 |
|
fM1 = 2. - 0.122 - 0.096 + 0.096; // due to calculation of xe1 etc. |
137 |
if ( fM1 < 0. ) fM1 = 0.; |
if ( fM1 < 0. ) fM1 = 0.; |
138 |
// |
// |
139 |
CaloStrip *cs = new CaloStrip(fSimu); |
CaloStrip *cs = new CaloStrip(fSimu); |
141 |
// view y plane 0 strip 0 |
// view y plane 0 strip 0 |
142 |
cs->Set(1,0,0); |
cs->Set(1,0,0); |
143 |
xe1= cs->GetY(); |
xe1= cs->GetY(); |
|
// z1= cs->GetZ(); |
|
144 |
// view y plane 0 strip 31 |
// view y plane 0 strip 31 |
145 |
cs->Set(1,0,31); |
cs->Set(1,0,31); |
146 |
xe2= cs->GetY(); |
xe2= cs->GetY(); |
156 |
// view y plane 0 strip 95 |
// view y plane 0 strip 95 |
157 |
cs->Set(1,0,95); |
cs->Set(1,0,95); |
158 |
xe6= cs->GetY(); |
xe6= cs->GetY(); |
|
|
|
159 |
// view x plane 0 strip 0 |
// view x plane 0 strip 0 |
160 |
cs->Set(0,0,0); |
cs->Set(0,0,0); |
161 |
yo1= cs->GetX(); |
yo1= cs->GetX(); |
|
// z2= cs->GetZ(); |
|
162 |
// view x plane 0 strip 31 |
// view x plane 0 strip 31 |
163 |
cs->Set(0,0,31); |
cs->Set(0,0,31); |
164 |
yo2= cs->GetX(); |
yo2= cs->GetX(); |
174 |
// view x plane 0 strip 95 |
// view x plane 0 strip 95 |
175 |
cs->Set(0,0,95); |
cs->Set(0,0,95); |
176 |
yo6= cs->GetX(); |
yo6= cs->GetX(); |
|
|
|
|
|
|
177 |
// view y plane 1 strip 0 |
// view y plane 1 strip 0 |
178 |
cs->Set(1,1,0); |
cs->Set(1,1,0); |
179 |
xo1= cs->GetY(); |
xo1= cs->GetY(); |
|
// z3= cs->GetZ(); |
|
180 |
// view y plane 1 strip 31 |
// view y plane 1 strip 31 |
181 |
cs->Set(1,1,31); |
cs->Set(1,1,31); |
182 |
xo2= cs->GetY(); |
xo2= cs->GetY(); |
191 |
xo5= cs->GetY(); |
xo5= cs->GetY(); |
192 |
// view y plane 1 strip 95 |
// view y plane 1 strip 95 |
193 |
cs->Set(1,1,95); |
cs->Set(1,1,95); |
194 |
xo6= cs->GetY(); |
xo6= cs->GetY(); |
|
|
|
195 |
// view x plane 1 strip 0 |
// view x plane 1 strip 0 |
196 |
cs->Set(0,1,0); |
cs->Set(0,1,0); |
197 |
ye1= cs->GetX(); |
ye1= cs->GetX(); |
|
// z4= cs->GetZ(); |
|
198 |
// view x plane 1 strip 31 |
// view x plane 1 strip 31 |
199 |
cs->Set(0,1,31); |
cs->Set(0,1,31); |
200 |
ye2= cs->GetX(); |
ye2= cs->GetX(); |
210 |
// view x plane 1 strip 95 |
// view x plane 1 strip 95 |
211 |
cs->Set(0,1,95); |
cs->Set(0,1,95); |
212 |
ye6= cs->GetX(); |
ye6= cs->GetX(); |
|
|
|
213 |
// |
// |
214 |
for (Int_t p = 0; p<22; p ++){ |
for (Int_t p = 0; p<22; p ++){ |
215 |
for (Int_t v = 0; v<2; v++ ){ |
for (Int_t v = 0; v<2; v++ ){ |
248 |
yomax_en= 0.; |
yomax_en= 0.; |
249 |
yemax_en= 0.; |
yemax_en= 0.; |
250 |
// |
// |
251 |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
252 |
en = 0.; |
en = 0.; |
253 |
view = 0; |
view = 0; |
254 |
plane = 0; |
plane = 0; |
270 |
memset(en_xop,0,11*sizeof(Float_t)); |
memset(en_xop,0,11*sizeof(Float_t)); |
271 |
memset(en_yop,0,11*sizeof(Float_t)); |
memset(en_yop,0,11*sizeof(Float_t)); |
272 |
// |
// |
273 |
|
fColumn = -1; |
274 |
|
fColXE = -1; |
275 |
|
fColXO = -1; |
276 |
|
fColYE = -1; |
277 |
|
fColYO = -1; |
278 |
|
memset(encol,0,2*3*sizeof(Float_t)); |
279 |
|
entot[0] = 0.; |
280 |
|
entot[1] = 0.; |
281 |
|
// |
282 |
|
X0pl = 0.76; |
283 |
|
// |
284 |
} |
} |
285 |
|
|
286 |
void CaloEnergy::Print(){ |
void CaloEnergy::Print(){ |
313 |
printf(" fM1 :.............. %f \n",fM1); |
printf(" fM1 :.............. %f \n",fM1); |
314 |
printf(" fRad :.............. %i \n",fRad); |
printf(" fRad :.............. %i \n",fRad); |
315 |
printf(" fPl :.............. %i \n",fPl); |
printf(" fPl :.............. %i \n",fPl); |
316 |
|
printf(" fColumn :.............. %i \n",fColumn); |
317 |
|
printf(" multicol:.............. %i \n",multicol); |
318 |
|
printf(" encol x :.............. %f \n",this->GetEncol(0)); |
319 |
|
printf(" encol y :.............. %f \n",this->GetEncol(1)); |
320 |
|
printf(" entot x :.............. %f \n",this->GetEntot(0)); |
321 |
|
printf(" entot y :.............. %f \n",this->GetEntot(1)); |
322 |
|
printf(" fColXE :.............. %i \n",fColXE); |
323 |
|
printf(" fColXO :.............. %i \n",fColXO); |
324 |
|
printf(" fColYE :.............. %i \n",fColYE); |
325 |
|
printf(" fColYO :.............. %i \n",fColYO); |
326 |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
327 |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
328 |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
332 |
printf(" energyxo:.............. %f \n",energyxo); |
printf(" energyxo:.............. %f \n",energyxo); |
333 |
printf(" energyye:.............. %f \n",energyye); |
printf(" energyye:.............. %f \n",energyye); |
334 |
printf(" energyyo:.............. %f \n",energyyo); |
printf(" energyyo:.............. %f \n",energyyo); |
335 |
|
printf(" fXEen_maxplane:........ %f \n",fXEen_maxplane); |
336 |
|
printf(" fXOen_maxplane:........ %f \n",fXOen_maxplane); |
337 |
|
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
338 |
|
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
339 |
printf(" x0max :.............. %f \n",x0max); |
printf(" x0max :.............. %f \n",x0max); |
340 |
|
printf(" X0pl :.............. %f \n",X0pl); |
341 |
printf(" debug :.............. %i \n",debug); |
printf(" debug :.............. %i \n",debug); |
342 |
|
|
343 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
344 |
// |
// |
345 |
} |
} |
346 |
|
|
347 |
void CaloEnergy::Delete(){ |
void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ |
348 |
Clear(); |
section.ToUpper(); |
349 |
delete this; |
if ( section.Contains("XO") ) fXomin = plane; |
350 |
|
if ( section.Contains("XE") ) fXemin = plane; |
351 |
|
if ( section.Contains("YO") ) fYomin = plane; |
352 |
|
if ( section.Contains("YE") ) fYemin = plane; |
353 |
|
} |
354 |
|
|
355 |
|
void CaloEnergy::SetMinimumContainment(Int_t plane){ |
356 |
|
this->SetMinimumContainment("XEXOYEYO",plane); |
357 |
|
} |
358 |
|
|
359 |
|
void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ |
360 |
|
section.ToUpper(); |
361 |
|
if ( section.Contains("XO") ) fConv_rxo = conv; |
362 |
|
if ( section.Contains("XE") ) fConv_rxe = conv; |
363 |
|
if ( section.Contains("YO") ) fConv_ryo = conv; |
364 |
|
if ( section.Contains("YE") ) fConv_rye = conv; |
365 |
|
} |
366 |
|
|
367 |
|
void CaloEnergy::SetConversionFactor(Float_t conv){ |
368 |
|
this->SetConversionFactor("XEXOYEYO",conv); |
369 |
|
} |
370 |
|
|
371 |
|
Int_t CaloEnergy::GetMinimumContainment(TString section){ |
372 |
|
section.ToUpper(); |
373 |
|
if ( section.Contains("XO") ) return(fXomin); |
374 |
|
if ( section.Contains("XE") ) return(fXemin); |
375 |
|
if ( section.Contains("YE") ) return(fYemin); |
376 |
|
if ( section.Contains("YO") ) return(fYomin); |
377 |
|
printf(" ERROR: section not recognized \n"); |
378 |
|
return(-1000); |
379 |
|
} |
380 |
|
|
381 |
|
Float_t CaloEnergy::GetConversionFactor(TString section){ |
382 |
|
section.ToUpper(); |
383 |
|
if ( section.Contains("XO") ) return(fConv_rxo); |
384 |
|
if ( section.Contains("XE") ) return(fConv_rxe); |
385 |
|
if ( section.Contains("YO") ) return(fConv_ryo); |
386 |
|
if ( section.Contains("YE") ) return(fConv_rye); |
387 |
|
printf(" ERROR: section not recognized \n"); |
388 |
|
return(-1000.); |
389 |
|
} |
390 |
|
|
391 |
|
Int_t CaloEnergy::GetMaxplane(TString section){ |
392 |
|
section.ToUpper(); |
393 |
|
if ( section.Contains("XO") ) return fMax_planexo; |
394 |
|
if ( section.Contains("XE") ) return fMax_planexe; |
395 |
|
if ( section.Contains("YO") ) return fMax_planeyo; |
396 |
|
if ( section.Contains("YE") ) return fMax_planeye; |
397 |
|
return(-1); |
398 |
|
} |
399 |
|
|
400 |
|
Int_t CaloEnergy::GetColumn(TString section){ |
401 |
|
section.ToUpper(); |
402 |
|
if ( section.Contains("XO") ) return fColXO; |
403 |
|
if ( section.Contains("XE") ) return fColXE; |
404 |
|
if ( section.Contains("YO") ) return fColYO; |
405 |
|
if ( section.Contains("YE") ) return fColYE; |
406 |
|
return(-1); |
407 |
|
} |
408 |
|
|
409 |
|
Float_t CaloEnergy::GetMipEnergyAtMaxplane(TString section){ |
410 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergyAtMaxplane(TString) instead! \n"); |
411 |
|
return (this->GetEnergyAtMaxplane(section)); |
412 |
|
} |
413 |
|
|
414 |
|
Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ |
415 |
|
section.ToUpper(); |
416 |
|
if ( section.Contains("XO") ) return xomax_en; |
417 |
|
if ( section.Contains("XE") ) return xemax_en; |
418 |
|
if ( section.Contains("YO") ) return yomax_en; |
419 |
|
if ( section.Contains("YE") ) return yemax_en; |
420 |
|
return(-1); |
421 |
|
} |
422 |
|
|
423 |
|
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
424 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy(TString) instead! \n"); |
425 |
|
return (this->GetMipEnergy(section)); |
426 |
|
} |
427 |
|
|
428 |
|
Float_t CaloEnergy::GetMipEnergy(TString section){ |
429 |
|
section.ToUpper(); |
430 |
|
if ( fLong ){ |
431 |
|
this->Process(section); |
432 |
|
return fXOen_maxplane; |
433 |
|
} else { |
434 |
|
if ( section.Contains("XO") ) return fXOen_maxplane; |
435 |
|
if ( section.Contains("XE") ) return fXEen_maxplane; |
436 |
|
if ( section.Contains("YO") ) return fYOen_maxplane; |
437 |
|
if ( section.Contains("YE") ) return fYEen_maxplane; |
438 |
|
}; |
439 |
|
return(-1); |
440 |
|
} |
441 |
|
|
442 |
|
Float_t CaloEnergy::GetEncol(Int_t i){ |
443 |
|
if ( fColumn > -1 && (((fXesel || fXosel)&&i==1) || ((fYesel || fYosel)&&i==0)) ){ |
444 |
|
Int_t t = -1; |
445 |
|
if ( i == 0 ){ |
446 |
|
if ( fColumn == 0 || fColumn == 3 || fColumn == 6 ) t = 0; |
447 |
|
if ( fColumn == 1 || fColumn == 4 || fColumn == 7 ) t = 1; |
448 |
|
if ( fColumn == 2 || fColumn == 5 || fColumn == 8 ) t = 2; |
449 |
|
} else { |
450 |
|
if ( fColumn == 0 || fColumn == 1 || fColumn == 2 ) t = 0; |
451 |
|
if ( fColumn == 3 || fColumn == 4 || fColumn == 5 ) t = 1; |
452 |
|
if ( fColumn == 6 || fColumn == 7 || fColumn == 8 ) t = 2; |
453 |
|
}; |
454 |
|
if ( debug ) printf(" encol: i %i t %i encol %f \n",i,t,encol[i][t]); |
455 |
|
return encol[i][t]; |
456 |
|
}; |
457 |
|
return(-1.); |
458 |
|
} |
459 |
|
|
460 |
|
Float_t CaloEnergy::GetMaxEnergy(){ |
461 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy() instead! \n"); |
462 |
|
return (this->GetMipEnergy()); |
463 |
|
} |
464 |
|
|
465 |
|
Float_t CaloEnergy::GetMipEnergy(){ |
466 |
|
if ( fLong ){ |
467 |
|
if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); |
468 |
|
this->Process(asntr); |
469 |
|
}; |
470 |
|
return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); |
471 |
} |
} |
472 |
|
|
473 |
|
|
531 |
// |
// |
532 |
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ |
533 |
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); |
534 |
|
// |
535 |
|
if ( !usepl18x && view==0 && plane==18 ) en = 0.; |
536 |
|
// |
537 |
enstrip[view][plane][strip]=en; |
enstrip[view][plane][strip]=en; |
538 |
}; |
}; |
539 |
// |
// |
540 |
|
if ( debug && ((fM1+0.122-0.244*(Float_t)fRad) < 0.) ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad)); |
541 |
|
// |
542 |
|
// inclination factor (stolen from Daniele's code) |
543 |
|
// |
544 |
|
Float_t ytgx = 0; |
545 |
|
Float_t ytgy = 0; |
546 |
|
ytgx = 0.76 * cl2->tanx[0]; |
547 |
|
ytgy = 0.76 * cl2->tany[0]; |
548 |
|
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
549 |
|
// |
550 |
// sum energy plane by plane for each sections |
// sum energy plane by plane for each sections |
551 |
// |
// |
552 |
|
Float_t fen_xep[11]; |
553 |
|
Float_t fen_xop[11]; |
554 |
|
Float_t fen_yep[11]; |
555 |
|
Float_t fen_yop[11]; |
556 |
|
memset(fen_xep,0,11*sizeof(Float_t)); |
557 |
|
memset(fen_xop,0,11*sizeof(Float_t)); |
558 |
|
memset(fen_yep,0,11*sizeof(Float_t)); |
559 |
|
memset(fen_yop,0,11*sizeof(Float_t)); |
560 |
|
// |
561 |
for (Int_t i=0;i<11;i++){ |
for (Int_t i=0;i<11;i++){ |
562 |
for(strip=0; strip<96; strip++) { |
for(strip=0; strip<96; strip++) { |
563 |
|
fen_xep[i] += enstrip[1][2*i][strip]; |
564 |
|
fen_yop[i] += enstrip[0][2*i][strip]; |
565 |
|
fen_xop[i] += enstrip[1][(2*i)+1][strip]; |
566 |
|
fen_yep[i] += enstrip[0][(2*i)+1][strip]; |
567 |
if ( fRad < 0 ){ |
if ( fRad < 0 ){ |
568 |
// |
// |
569 |
// run over all the strips of the plane |
// run over all the strips of the plane |
570 |
// |
// |
571 |
en_xep[i] += enstrip[1][2*i][strip]; |
en_xep[i] += enstrip[1][2*i][strip]; |
572 |
en_yop[i] += enstrip[0][2*i][strip]; |
en_yop[i] += enstrip[0][2*i][strip]; |
576 |
// |
// |
577 |
// use only the strips inside a cylinder of given radius fRad |
// use only the strips inside a cylinder of given radius fRad |
578 |
// |
// |
579 |
if ( strip >= cl2->cibar[2*i][1]-1-fRad && strip <= cl2->cibar[2*i][1]-1+fRad ) en_xep[i] += enstrip[1][2*i][strip]; |
if ( cl2->cibar[2*i][1] >= 1 && cl2->cibar[2*i][1] <= 96 && |
580 |
if ( strip >= cl2->cibar[2*i][0]-1-fRad && strip <= cl2->cibar[2*i][0]-1+fRad ) en_yop[i] += enstrip[0][2*i][strip]; |
(strip >= (cl2->cibar[2*i][1]-1-fRad)) && (strip <= (cl2->cibar[2*i][1]-1+fRad)) ) en_xep[i] += enstrip[1][2*i][strip]; |
581 |
if ( strip >= cl2->cibar[(2*i)+1][1]-1-fRad && strip <= cl2->cibar[(2*i)+1][1]-1+fRad ) en_xop[i] += enstrip[1][(2*i)+1][strip]; |
|
582 |
if ( strip >= cl2->cibar[(2*i)+1][0]-1-fRad && strip <= cl2->cibar[(2*i)+1][0]-1+fRad ) en_yep[i] += enstrip[0][(2*i)+1][strip]; |
if ( cl2->cibar[2*i][0] >= 1 && cl2->cibar[2*i][0] <= 96 && |
583 |
|
(strip >= (cl2->cibar[2*i][0]-1-fRad)) && (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip]; |
584 |
|
|
585 |
|
if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 && |
586 |
|
(strip >= (cl2->cibar[(2*i)+1][1]-1-fRad)) && (strip <= (cl2->cibar[(2*i)+1][1]-1+fRad)) ) en_xop[i] += enstrip[1][(2*i)+1][strip]; |
587 |
|
|
588 |
|
if ( cl2->cibar[(2*i)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 && |
589 |
|
(strip >= (cl2->cibar[(2*i)+1][0]-1-fRad)) && (strip <= (cl2->cibar[(2*i)+1][0]-1+fRad)) ) en_yep[i] += enstrip[0][(2*i)+1][strip]; |
590 |
}; |
}; |
591 |
}; |
}; |
592 |
|
if ( debug ) printf(" ex_xep[%i] %f cibar %i \n",i,en_xep[i],cl2->cibar[2*i][1]); |
593 |
|
if ( debug ) printf(" ex_xop[%i] %f cibar %i \n",i,en_xop[i],cl2->cibar[(2*i)+1][1]); |
594 |
|
if ( debug ) printf(" ex_yep[%i] %f cibar %i \n",i,en_yep[i],cl2->cibar[(2*i)+1][0]); |
595 |
|
if ( debug ) printf(" ex_yop[%i] %f cibar %i \n",i,en_yop[i],cl2->cibar[2*i][0]); |
596 |
energyxe += en_xep[i]; |
energyxe += en_xep[i]; |
597 |
energyyo += en_yop[i]; |
energyyo += en_yop[i]; |
598 |
energyxo += en_xop[i]; |
energyxo += en_xop[i]; |
606 |
Int_t yon = 0; |
Int_t yon = 0; |
607 |
Int_t xon = 0; |
Int_t xon = 0; |
608 |
Int_t yen = 0; |
Int_t yen = 0; |
609 |
|
Float_t en = 0.; |
610 |
// |
// |
611 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
612 |
yon++; |
yon++; |
613 |
xon++; |
xon++; |
614 |
yen++; |
yen++; |
615 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
616 |
if(en_xep[ipl] > xemax_en) { |
en = fen_xep[ipl]; |
617 |
xemax_en = en_xep[ipl]; |
if ( !fAllpl ) en = en_xep[ipl]; |
618 |
|
if(en > xemax_en) { |
619 |
|
xemax_en = en; |
620 |
fMax_planexe = ipl; |
fMax_planexe = ipl; |
621 |
}; |
}; |
622 |
}; |
}; |
626 |
xon++; |
xon++; |
627 |
yen++; |
yen++; |
628 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
629 |
if(en_yop[ipl] > yomax_en) { |
en = fen_yop[ipl]; |
630 |
yomax_en = en_yop[ipl]; |
if ( !fAllpl ) en = en_yop[ipl]; |
631 |
|
if(en > yomax_en) { |
632 |
|
yomax_en = en; |
633 |
fMax_planeyo = ipl; |
fMax_planeyo = ipl; |
634 |
}; |
}; |
635 |
}; |
}; |
638 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
639 |
yen++; |
yen++; |
640 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
641 |
if(en_xop[ipl] > xomax_en) { |
en = fen_xop[ipl]; |
642 |
xomax_en = en_xop[ipl]; |
if ( !fAllpl ) en = en_xop[ipl]; |
643 |
|
if(en > xomax_en) { |
644 |
|
xomax_en = en; |
645 |
fMax_planexo = ipl; |
fMax_planexo = ipl; |
646 |
}; |
}; |
647 |
}; |
}; |
649 |
// |
// |
650 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
651 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
652 |
if(en_yep[ipl] > yemax_en) { |
en = fen_yep[ipl]; |
653 |
yemax_en = en_yep[ipl]; |
if ( !fAllpl ) en = en_yep[ipl]; |
654 |
|
if(en > yemax_en) { |
655 |
|
yemax_en = en; |
656 |
fMax_planeye = ipl; |
fMax_planeye = ipl; |
657 |
}; |
}; |
658 |
}; |
}; |
662 |
// |
// |
663 |
if ( x0max > 0. ){ |
if ( x0max > 0. ){ |
664 |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
665 |
Int_t wpl = (Int_t)roundf(x0max/0.76); |
// Int_t wpl = (Int_t)roundf(x0max/0.76); |
666 |
|
Int_t wpl = (Int_t)roundf(x0max/X0pl); |
667 |
Bool_t isY = false; |
Bool_t isY = false; |
668 |
if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
// if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
669 |
|
if ( ((x0max/X0pl)-(Float_t)wpl) > 0. ) isY = true; |
670 |
xomax_en = 0.; |
xomax_en = 0.; |
671 |
yemax_en = 0.; |
yemax_en = 0.; |
672 |
xemax_en = 0.; |
xemax_en = 0.; |
707 |
if ( section.Contains("YO") ) yomax_en = 10.; |
if ( section.Contains("YO") ) yomax_en = 10.; |
708 |
}; |
}; |
709 |
}; |
}; |
710 |
if ( debug ) printf(" x0max %f x0max/0.76 %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/0.76),wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
// if ( debug ) printf(" x0max %f x0max/0.76 %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/0.76),wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
711 |
|
if ( debug ) printf(" x0max %f x0max/X0pl %f X0pl %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/X0pl),X0pl,wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); |
712 |
}; |
}; |
713 |
// |
// |
714 |
Int_t nPl = fPl; |
Int_t nPl = fPl; |
780 |
// |
// |
781 |
// for each plane of the calorimeter find the position of the track in the direction along the strip (where we do not have a measurement from the selected plane) by looking at the plane above/below of the other view and extrapolating the trajectory to the given plane |
// for each plane of the calorimeter find the position of the track in the direction along the strip (where we do not have a measurement from the selected plane) by looking at the plane above/below of the other view and extrapolating the trajectory to the given plane |
782 |
// |
// |
|
Float_t track_coordx[22][2]; |
|
|
Float_t track_coordy[22][2]; |
|
783 |
// |
// |
784 |
Float_t tgx_cl2; |
Float_t tgx_cl2; |
785 |
Float_t tgy_cl2; |
Float_t tgy_cl2; |
789 |
for (Int_t p=0; p<22; p++){ |
for (Int_t p=0; p<22; p++){ |
790 |
track_coordy[p][1] = cl2->cbar[p][1]; |
track_coordy[p][1] = cl2->cbar[p][1]; |
791 |
track_coordx[p][1] = cl2->cbar[p][0] - fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
track_coordx[p][1] = cl2->cbar[p][0] - fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
792 |
|
// track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
793 |
track_coordx[p][0] = cl2->cbar[p][0]; |
track_coordx[p][0] = cl2->cbar[p][0]; |
794 |
track_coordy[p][0] = cl2->cbar[p][1] - fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
track_coordy[p][0] = cl2->cbar[p][1] - fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
795 |
|
// track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
796 |
if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]); |
if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]); |
797 |
}; |
}; |
798 |
// |
// |
800 |
// |
// |
801 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
802 |
// |
// |
803 |
// check event is inside XO acceptance |
// find the column hit in the first plane |
804 |
|
// |
805 |
|
Int_t ix = -1; |
806 |
|
Int_t iy = -1; |
807 |
|
if ( track_coordx[(2*0)+1][1] >= (-12.054+fM) && track_coordx[(2*0)+1][1] <= (-4.246-fM) ) ix = 0; |
808 |
|
if ( track_coordx[(2*0)+1][1] >= ( -4.004+fM) && track_coordx[(2*0)+1][1] <= ( 3.804-fM) ) ix = 1; |
809 |
|
if ( track_coordx[(2*0)+1][1] >= ( 4.046+fM) && track_coordx[(2*0)+1][1] <= (11.854-fM) ) ix = 2; |
810 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo2 - fM1) ) iy = 0; |
811 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo4 - fM1) ) iy = 1; |
812 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo6 - fM1) ) iy = 2; |
813 |
|
if ( ix > -1 && iy > -1 ) fColXO = ix + iy*3; |
814 |
|
// |
815 |
|
// check event is inside XO acceptance, if multicol is false (SingleColumn mode) then the track must be contained in a column. |
816 |
// |
// |
817 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
818 |
if |
if (( |
819 |
( |
( track_coordx[(2*i)+1][1] >= (-12.054+fM) && track_coordx[(2*i)+1][1] <= (-4.246-fM) && (ix == 0 || multicol) ) || |
820 |
(((track_coordx[(2*i)+1][1]>=(-12.054+fM))&& |
( track_coordx[(2*i)+1][1] >= ( -4.004+fM) && track_coordx[(2*i)+1][1] <= ( 3.804-fM) && (ix == 1 || multicol) ) || |
821 |
(track_coordx[(2*i)+1][1]<=(-4.246-fM)))&& |
( track_coordx[(2*i)+1][1] >= ( 4.046+fM) && track_coordx[(2*i)+1][1] <= (11.854-fM) && (ix == 2 || multicol) ) |
822 |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
) && ( |
823 |
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| |
( cl2->cbar[(2*i)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo2 - fM1) && (iy == 0 || multicol) ) || |
824 |
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
( cl2->cbar[(2*i)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo4 - fM1) && (iy == 1 || multicol) ) || |
825 |
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| |
( cl2->cbar[(2*i)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo6 - fM1) && (iy == 2 || multicol) ) |
826 |
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
)){ |
|
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordx[(2*i)+1][1]>=(-4.004+fM))&& |
|
|
(track_coordx[(2*i)+1][1]<=(3.804-fM)))&& |
|
|
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| |
|
|
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1))|| |
|
|
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordx[(2*i)+1][1]>=(4.046+fM))&& |
|
|
(track_coordx[(2*i)+1][1]<=(11.854-fM)))&& |
|
|
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1))|| |
|
|
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| |
|
|
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 )))) |
|
|
){ |
|
827 |
fXosel = true; |
fXosel = true; |
828 |
fXoout = i; |
fXoout = i; |
829 |
} else { |
} else { |
843 |
// event is contained (or partially contained) hence we can integrate energy up to the maximum and calculate the energy as measured by this section |
// event is contained (or partially contained) hence we can integrate energy up to the maximum and calculate the energy as measured by this section |
844 |
// |
// |
845 |
if ( fXosel ){ |
if ( fXosel ){ |
846 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++) fXOen_maxplane += en_xop[iplm]; |
for (Int_t iplm=0; iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)); iplm++){ |
847 |
|
fXOen_maxplane += en_xop[iplm]; |
848 |
|
if ( debug ) printf(" XO iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]); |
849 |
|
}; |
850 |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
851 |
|
// |
852 |
|
for (Int_t i=0;i<11;i++){ |
853 |
|
for(strip=0; strip<96; strip++) { |
854 |
|
// |
855 |
|
// run over all the strips of the plane |
856 |
|
// |
857 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)+1][strip]; |
858 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)+1][strip]; |
859 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)+1][strip]; |
860 |
|
entot[1] += enstrip[1][(2*i)+1][strip]; |
861 |
|
// |
862 |
|
}; |
863 |
|
}; |
864 |
}; |
}; |
865 |
}; |
}; |
866 |
// |
// |
867 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
868 |
|
// |
869 |
|
// find the column hit in the first plane |
870 |
|
// |
871 |
|
Int_t ix = -1; |
872 |
|
Int_t iy = -1; |
873 |
|
if ( track_coordx[(2*0)][1] >= (-11.854+fM) && track_coordx[(2*0)][1] <= (-4.046-fM) ) ix = 0; |
874 |
|
if ( track_coordx[(2*0)][1] >= ( -3.804+fM) && track_coordx[(2*0)][1] <= ( 4.004-fM) ) ix = 1; |
875 |
|
if ( track_coordx[(2*0)][1] >= ( 4.246+fM) && track_coordx[(2*0)][1] <= (12.054-fM) ) ix = 2; |
876 |
|
if ( cl2->cbar[(2*0)][1] >= (xe1 + fM1) && cl2->cbar[(2*0)][1] <= (xe2 - fM1) ) iy = 0; |
877 |
|
if ( cl2->cbar[(2*0)][1] >= (xe3 + fM1) && cl2->cbar[(2*0)][1] <= (xe4 - fM1) ) iy = 1; |
878 |
|
if ( cl2->cbar[(2*0)][1] >= (xe5 + fM1) && cl2->cbar[(2*0)][1] <= (xe6 - fM1) ) iy = 2; |
879 |
|
if ( ix > -1 && iy > -1 ) fColXE = ix + iy*3; |
880 |
|
// |
881 |
|
// check event is inside XO acceptance |
882 |
|
// |
883 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
884 |
if |
if (( |
885 |
( |
( track_coordx[(2*i)][1] >= (-11.854+fM) && track_coordx[(2*i)][1] <= (-4.046-fM) && (ix == 0 || multicol) ) || |
886 |
(((track_coordx[2*i][1]>=(-11.854+fM))&& |
( track_coordx[(2*i)][1] >= ( -3.804+fM) && track_coordx[(2*i)][1] <= ( 4.004-fM) && (ix == 1 || multicol) ) || |
887 |
(track_coordx[2*i][1]<=(-4.046-fM)))&& |
( track_coordx[(2*i)][1] >= ( 4.246+fM) && track_coordx[(2*i)][1] <= (12.054-fM) && (ix == 2 || multicol) ) |
888 |
(((cl2->cbar[2*i][1]>=xe1 + fM1)&& |
) && ( |
889 |
(cl2->cbar[2*i][1]<=xe2 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe1 + fM1) && cl2->cbar[(2*i)][1] <= (xe2 - fM1) && (iy == 0 || multicol) ) || |
890 |
((cl2->cbar[2*i][1]>=xe3 + fM1)&& |
( cl2->cbar[(2*i)][1] >= (xe3 + fM1) && cl2->cbar[(2*i)][1] <= (xe4 - fM1) && (iy == 1 || multicol) ) || |
891 |
(cl2->cbar[2*i][1]<=xe4 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe5 + fM1) && cl2->cbar[(2*i)][1] <= (xe6 - fM1) && (iy == 2 || multicol) ) |
892 |
((cl2->cbar[2*i][1]>=xe5 + fM1)&& |
)){ |
|
(cl2->cbar[2*i][1]<=xe6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordx[2*i][1]>=(-3.804+fM))&& |
|
|
(track_coordx[2*i][1]<=(4.004-fM)))&& |
|
|
(((cl2->cbar[2*i][1]>=xe1 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe2 - fM1 ))|| |
|
|
((cl2->cbar[2*i][1]>=xe3 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe4 - fM1))|| |
|
|
((cl2->cbar[2*i][1]>=xe5 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordx[2*i][1]>=(4.246+fM))&& |
|
|
(track_coordx[2*i][1]<=(12.054-fM)))&& |
|
|
(((cl2->cbar[2*i][1]>=xe1 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe2 - fM1))|| |
|
|
((cl2->cbar[2*i][1]>=xe3 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe4 - fM1 ))|| |
|
|
((cl2->cbar[2*i][1]>=xe5 + fM1)&& |
|
|
(cl2->cbar[2*i][1]<=xe6 - fM1 )))) |
|
|
){ |
|
893 |
fXesel = true; |
fXesel = true; |
894 |
fXeout = i; |
fXeout = i; |
895 |
} else { |
} else { |
897 |
break; |
break; |
898 |
}; |
}; |
899 |
}; |
}; |
900 |
|
// |
901 |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
902 |
if ( debug ) printf(" XE: this event is only partially contained: fXeout %i fXemin %i fMax_planexe + nPl %i \n",fXeout,fXemin,(Int_t)(fMax_planexe+nPl)); |
if ( debug ) printf(" XE: this event is only partially contained: fXeout %i fXemin %i fMax_planexe + nPl %i \n",fXeout,fXemin,(Int_t)(fMax_planexe+nPl)); |
903 |
fPartsel = true; |
fPartsel = true; |
904 |
fXesel = true; |
fXesel = true; |
905 |
}; |
}; |
906 |
if ( fXesel ){ |
if ( fXesel ){ |
907 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++) fXEen_maxplane += en_xep[iplm]; |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++){ |
908 |
|
fXEen_maxplane += en_xep[iplm]; |
909 |
|
if ( debug ) printf(" XE iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]); |
910 |
|
}; |
911 |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
912 |
|
// |
913 |
|
for (Int_t i=0;i<11;i++){ |
914 |
|
for(strip=0; strip<96; strip++) { |
915 |
|
// |
916 |
|
// run over all the strips of the plane |
917 |
|
// |
918 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)][strip]; |
919 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)][strip]; |
920 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)][strip]; |
921 |
|
entot[1] += enstrip[1][(2*i)][strip]; |
922 |
|
// |
923 |
|
}; |
924 |
|
}; |
925 |
}; |
}; |
926 |
}; |
}; |
927 |
// |
// |
928 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
929 |
|
// |
930 |
|
// find the column hit in the first plane |
931 |
|
// |
932 |
|
Int_t ix = -1; |
933 |
|
Int_t iy = -1; |
934 |
|
if ( track_coordy[(2*0)+1][0] >= (-12.154+fM) && track_coordy[(2*0)+1][0] <= (-4.346-fM) ) iy = 0; |
935 |
|
if ( track_coordy[(2*0)+1][0] >= ( -4.104+fM) && track_coordy[(2*0)+1][0] <= ( 3.704-fM) ) iy = 1; |
936 |
|
if ( track_coordy[(2*0)+1][0] >= ( 3.946+fM) && track_coordy[(2*0)+1][0] <= (11.754-fM) ) iy = 2; |
937 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye2 - fM1) ) ix = 0; |
938 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye4 - fM1) ) ix = 1; |
939 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye6 - fM1) ) ix = 2; |
940 |
|
if ( ix > -1 && iy > -1 ) fColYE = ix + iy*3; |
941 |
|
// |
942 |
|
// check event is inside XO acceptance |
943 |
|
// |
944 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
945 |
if |
if (( |
946 |
( |
( track_coordy[(2*i)+1][0] >= (-12.154+fM) && track_coordy[(2*i)+1][0] <= (-4.346-fM) && (iy == 0 || multicol) ) || |
947 |
(((track_coordy[(2*i)+1][0]>=(-12.154+fM))&& |
( track_coordy[(2*i)+1][0] >= ( -4.104+fM) && track_coordy[(2*i)+1][0] <= ( 3.704-fM) && (iy == 1 || multicol) ) || |
948 |
(track_coordy[(2*i)+1][0]<=(-4.346-fM)))&& |
( track_coordy[(2*i)+1][0] >= ( 3.946+fM) && track_coordy[(2*i)+1][0] <= (11.754-fM) && (iy == 2 || multicol) ) |
949 |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
) && ( |
950 |
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| |
( cl2->cbar[(2*i)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye2 - fM1) && (ix == 0 || multicol) ) || |
951 |
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
( cl2->cbar[(2*i)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye4 - fM1) && (ix == 1 || multicol) ) || |
952 |
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| |
( cl2->cbar[(2*i)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye6 - fM1) && (ix == 2 || multicol) ) |
953 |
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
)){ |
|
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordy[(2*i)+1][0]>=(-4.104+fM))&& |
|
|
(track_coordy[(2*i)+1][0]<=(3.704-fM)))&& |
|
|
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| |
|
|
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1))|| |
|
|
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordy[(2*i)+1][0]>=(3.946+fM))&& |
|
|
(track_coordy[(2*i)+1][0]<=(11.754-fM)))&& |
|
|
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1))|| |
|
|
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| |
|
|
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
|
|
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 )))) |
|
|
){ |
|
954 |
fYesel = true; |
fYesel = true; |
955 |
fYeout = i; |
fYeout = i; |
956 |
} else { |
} else { |
958 |
break; |
break; |
959 |
}; |
}; |
960 |
}; |
}; |
961 |
|
// |
962 |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
963 |
if ( debug ) printf(" YE: this event is only partially contained: fYeout %i fYemin %i fMax_planeye + nPl %i \n",fYeout,fYemin,(Int_t)(fMax_planeye+nPl)); |
if ( debug ) printf(" YE: this event is only partially contained: fYeout %i fYemin %i fMax_planeye + nPl %i \n",fYeout,fYemin,(Int_t)(fMax_planeye+nPl)); |
964 |
fPartsel = true; |
fPartsel = true; |
967 |
if ( fYesel ){ |
if ( fYesel ){ |
968 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeye+nPl)) ;iplm++) fYEen_maxplane += en_yep[iplm]; |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeye+nPl)) ;iplm++) fYEen_maxplane += en_yep[iplm]; |
969 |
fEnergyye = fYEen_maxplane/fConv_rye; |
fEnergyye = fYEen_maxplane/fConv_rye; |
970 |
|
// |
971 |
|
for (Int_t i=0;i<11;i++){ |
972 |
|
for(strip=0; strip<96; strip++) { |
973 |
|
// |
974 |
|
// run over all the strips of the plane |
975 |
|
// |
976 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)+1][strip]; |
977 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)+1][strip]; |
978 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)+1][strip]; |
979 |
|
entot[0] += enstrip[0][(2*i)+1][strip]; |
980 |
|
// |
981 |
|
}; |
982 |
|
}; |
983 |
|
// |
984 |
}; |
}; |
985 |
}; |
}; |
986 |
// |
// |
987 |
if ( section.Contains("YO") ){ |
if ( section.Contains("YO") ){ |
988 |
|
// |
989 |
|
// find the column hit in the first plane |
990 |
|
// |
991 |
|
Int_t ix = -1; |
992 |
|
Int_t iy = -1; |
993 |
|
if ( track_coordy[(2*0)][0] >= (-11.954+fM) && track_coordy[(2*0)][0] <= (-4.146-fM) ) iy = 0; |
994 |
|
if ( track_coordy[(2*0)][0] >= ( -3.904+fM) && track_coordy[(2*0)][0] <= ( 3.904-fM) ) iy = 1; |
995 |
|
if ( track_coordy[(2*0)][0] >= ( 4.146+fM) && track_coordy[(2*0)][0] <= (11.954-fM) ) iy = 2; |
996 |
|
if ( cl2->cbar[(2*0)][0] >= (yo1 + fM1) && cl2->cbar[(2*0)][0] <= (yo2 - fM1) ) ix = 0; |
997 |
|
if ( cl2->cbar[(2*0)][0] >= (yo3 + fM1) && cl2->cbar[(2*0)][0] <= (yo4 - fM1) ) ix = 1; |
998 |
|
if ( cl2->cbar[(2*0)][0] >= (yo5 + fM1) && cl2->cbar[(2*0)][0] <= (yo6 - fM1) ) ix = 2; |
999 |
|
if ( ix > -1 && iy > -1 ) fColYO = ix + iy*3; |
1000 |
|
// |
1001 |
|
// check event is inside XO acceptance |
1002 |
|
// |
1003 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
1004 |
if ( debug ) printf(" i %i track_coordy[2*i][0] %f cl2->cbar[2*i][0] %f \n",i,track_coordy[2*i][0],cl2->cbar[2*i][0]); |
if (( |
1005 |
if ( debug ) printf(" i %i fm %f fm1 %f yo1 %g yo2 %f yo3 %f yo4 %f yo5 %f yo6 %f \n",i,fM,fM1,yo1,yo2,yo3,yo4,yo5,yo6); |
( track_coordy[(2*i)][0] >= (-11.954+fM) && track_coordy[(2*i)][0] <= (-4.146-fM) && (iy == 0 || multicol) ) || |
1006 |
if |
( track_coordy[(2*i)][0] >= ( -3.904+fM) && track_coordy[(2*i)][0] <= ( 3.904-fM) && (iy == 1 || multicol) ) || |
1007 |
( |
( track_coordy[(2*i)][0] >= ( 4.146+fM) && track_coordy[(2*i)][0] <= (11.954-fM) && (iy == 2 || multicol) ) |
1008 |
(((track_coordy[2*i][0]>=(-11.954+fM))&& |
) && ( |
1009 |
(track_coordy[2*i][0]<=(-4.146-fM)))&& |
( cl2->cbar[(2*i)][0] >= (yo1 + fM1) && cl2->cbar[(2*i)][0] <= (yo2 - fM1) && (ix == 0 || multicol) ) || |
1010 |
(((cl2->cbar[2*i][0]>=yo1 + fM1)&& |
( cl2->cbar[(2*i)][0] >= (yo3 + fM1) && cl2->cbar[(2*i)][0] <= (yo4 - fM1) && (ix == 1 || multicol) ) || |
1011 |
(cl2->cbar[2*i][0]<=yo2 - fM1 ))|| |
( cl2->cbar[(2*i)][0] >= (yo5 + fM1) && cl2->cbar[(2*i)][0] <= (yo6 - fM1) && (ix == 2 || multicol) ) |
1012 |
((cl2->cbar[2*i][0]>=yo3 + fM1)&& |
)){ |
|
(cl2->cbar[2*i][0]<=yo4 - fM1 ))|| |
|
|
((cl2->cbar[2*i][0]>=yo5 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordy[2*i][0]>=(-3.904+fM))&& |
|
|
(track_coordy[2*i][0]<=(+3.904-fM)))&& |
|
|
(((cl2->cbar[2*i][0]>=yo1 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo2 - fM1 ))|| |
|
|
((cl2->cbar[2*i][0]>=yo3 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo4 - fM1))|| |
|
|
((cl2->cbar[2*i][0]>=yo5 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo6 - fM1 ))))|| |
|
|
|
|
|
(((track_coordy[2*i][0]>=(4.146+fM))&& |
|
|
(track_coordy[2*i][0]<=(11.954-fM)))&& |
|
|
(((cl2->cbar[2*i][0]>=yo1 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo2 - fM1))|| |
|
|
((cl2->cbar[2*i][0]>=yo3 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo4 - fM1 ))|| |
|
|
((cl2->cbar[2*i][0]>=yo5 + fM1)&& |
|
|
(cl2->cbar[2*i][0]<=yo6 - fM1 )))) |
|
|
){ |
|
1013 |
fYosel = true; |
fYosel = true; |
1014 |
fYoout = i; |
fYoout = i; |
1015 |
} else { |
} else { |
1017 |
break; |
break; |
1018 |
}; |
}; |
1019 |
}; |
}; |
1020 |
|
// |
1021 |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
1022 |
if ( debug ) printf(" YO: this event is only partially contained: fYoout %i fYomin %i fMax_planeyo + nPl %i \n",fYoout,fYomin,(Int_t)(fMax_planeyo+nPl)); |
if ( debug ) printf(" YO: this event is only partially contained: fYoout %i fYomin %i fMax_planeyo + nPl %i \n",fYoout,fYomin,(Int_t)(fMax_planeyo+nPl)); |
1023 |
fPartsel = true; |
fPartsel = true; |
1026 |
if ( fYosel ){ |
if ( fYosel ){ |
1027 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeyo+nPl)) ;iplm++) fYOen_maxplane += en_yop[iplm]; |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeyo+nPl)) ;iplm++) fYOen_maxplane += en_yop[iplm]; |
1028 |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
1029 |
|
// |
1030 |
|
for (Int_t i=0;i<11;i++){ |
1031 |
|
for(strip=0; strip<96; strip++) { |
1032 |
|
// |
1033 |
|
// run over all the strips of the plane |
1034 |
|
// |
1035 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)][strip]; |
1036 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)][strip]; |
1037 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)][strip]; |
1038 |
|
entot[0] += enstrip[0][(2*i)][strip]; |
1039 |
|
// |
1040 |
|
}; |
1041 |
|
}; |
1042 |
}; |
}; |
1043 |
}; |
}; |
1044 |
// |
// |
1064 |
fSel = true; |
fSel = true; |
1065 |
}; |
}; |
1066 |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
1067 |
|
if ( fSel ){ |
1068 |
|
if ( fXesel ) fColumn = fColXE; |
1069 |
|
if ( fXosel ){ |
1070 |
|
if ( fColXO != fColumn && fColumn > -1 ){ |
1071 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColXO %i \n",fColumn,fColXO); |
1072 |
|
} else { |
1073 |
|
fColumn = fColXO; |
1074 |
|
}; |
1075 |
|
}; |
1076 |
|
if ( fYesel ){ |
1077 |
|
if ( fColYE != fColumn && fColumn > -1 ){ |
1078 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYE %i \n",fColumn,fColYE); |
1079 |
|
} else { |
1080 |
|
fColumn = fColYE; |
1081 |
|
}; |
1082 |
|
}; |
1083 |
|
if ( fYosel ){ |
1084 |
|
if ( fColYO != fColumn && fColumn > -1 ){ |
1085 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYO %i \n",fColumn,fColYO); |
1086 |
|
} else { |
1087 |
|
fColumn = fColYO; |
1088 |
|
}; |
1089 |
|
}; |
1090 |
|
}; |
1091 |
}; |
}; |
1092 |
// |
// |
1093 |
if ( debug ) printf("sel %i indep %i fMax_plane %f conv_r %f en_maxplane %f encalo %f \n",fSel,indep,fMax_plane,fConv_rxo,fXOen_maxplane,fEnergy); |
if ( debug ) printf("sel %i indep %i fMax_plane %f conv_r %f en_maxplane %f encalo %f \n",fSel,indep,fMax_plane,fConv_rxo,fXOen_maxplane,fEnergy); |
1140 |
// |
// |
1141 |
// check if the cylinder of integration can go out of the sensor given the frame which has been set (if we use all the calorimeter fRad is < 0 and the printout is suppressed) |
// check if the cylinder of integration can go out of the sensor given the frame which has been set (if we use all the calorimeter fRad is < 0 and the printout is suppressed) |
1142 |
// |
// |
1143 |
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0. ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad)); |
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0.001 ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad)); |
1144 |
// |
// |
1145 |
if ( fLong ){ |
if ( fLong ){ |
1146 |
if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n"); |
if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n"); |
1171 |
} else { |
} else { |
1172 |
clong->Fit(); |
clong->Fit(); |
1173 |
}; |
}; |
1174 |
fXOen_maxplane = clong->Get_E0(); |
if ( clong->GetLowerLimit() != 0. || clong->GetUpperLimit() != 0. ){ |
1175 |
|
fXOen_maxplane = clong->Get_defE0(); |
1176 |
|
} else { |
1177 |
|
fXOen_maxplane = clong->Get_E0(); |
1178 |
|
}; |
1179 |
|
fMax_plane = clong->Get_tmax(); |
1180 |
fYOen_maxplane = 0.; |
fYOen_maxplane = 0.; |
1181 |
fYEen_maxplane = 0.; |
fYEen_maxplane = 0.; |
1182 |
fXEen_maxplane = 0.; |
fXEen_maxplane = 0.; |