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 |
|
}; |
49 |
|
if ( cp ) delete cp; |
50 |
|
cp = NULL; |
51 |
|
} |
52 |
|
|
53 |
void CaloEnergy::UseCaloPreSampler(){ |
void CaloEnergy::UseCaloPreSampler(){ |
54 |
// |
// |
55 |
// 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 |
61 |
// cp->ForceCaloFit(); |
// cp->ForceCaloFit(); |
62 |
// cp->SetDebug(true); |
// cp->SetDebug(true); |
63 |
// cp->Process(); |
// cp->Process(); |
64 |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
65 |
} |
} |
66 |
|
|
67 |
|
|
70 |
fLong = true; |
fLong = true; |
71 |
if ( !clong ){ |
if ( !clong ){ |
72 |
clong = new CaloLong(L2); |
clong = new CaloLong(L2); |
73 |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); |
74 |
clong->SplitInto(0,22); |
clong->SplitInto(0,22); |
75 |
}; |
}; |
76 |
// |
// |
94 |
// |
// |
95 |
indep = false; |
indep = false; |
96 |
// |
// |
97 |
|
fAllpl = true; |
98 |
fLong = false; |
fLong = false; |
99 |
fPl = 1; |
fPl = 1; |
100 |
fRad = -1; |
fRad = -1; |
102 |
clong = NULL; |
clong = NULL; |
103 |
x0max = -1.; |
x0max = -1.; |
104 |
// |
// |
105 |
|
multicol = false; |
106 |
|
// |
107 |
this->DefineGeometry(); |
this->DefineGeometry(); |
108 |
fXosel =true; |
fXosel =true; |
109 |
fXesel = true; |
fXesel = true; |
117 |
fXemin = 1000; |
fXemin = 1000; |
118 |
fYomin = 1000; |
fYomin = 1000; |
119 |
fYemin = 1000; |
fYemin = 1000; |
120 |
|
// |
121 |
|
this->UseCaloPreSampler(); // use it by default, to go back to "standard" mode use CaloEnergy::UseLevel2(). |
122 |
|
// |
123 |
} |
} |
|
|
|
|
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)); |
|
|
} |
|
|
|
|
124 |
void CaloEnergy::DefineGeometry(){ |
void CaloEnergy::DefineGeometry(){ |
125 |
// |
// |
126 |
// 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 |
127 |
// |
// |
128 |
// |
// fM = 2. + 0.096; // real position from cbar BUG the 0.096 is already taken into account in the border calculation made by Giovanna |
129 |
fM = 2. + 0.096; // real position from cbar |
fM = 2. ; // real position from cbar |
130 |
// 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 |
131 |
fM1 = 2. - 0.122 + 0.096; // due to calculation of xe1 etc. |
fM1 = 2. - 0.122 - 0.096 + 0.096; // due to calculation of xe1 etc. |
132 |
if ( fM1 < 0. ) fM1 = 0.; |
if ( fM1 < 0. ) fM1 = 0.; |
133 |
// |
// |
134 |
CaloStrip *cs = new CaloStrip(fSimu); |
CaloStrip *cs = new CaloStrip(fSimu); |
136 |
// view y plane 0 strip 0 |
// view y plane 0 strip 0 |
137 |
cs->Set(1,0,0); |
cs->Set(1,0,0); |
138 |
xe1= cs->GetY(); |
xe1= cs->GetY(); |
|
// z1= cs->GetZ(); |
|
139 |
// view y plane 0 strip 31 |
// view y plane 0 strip 31 |
140 |
cs->Set(1,0,31); |
cs->Set(1,0,31); |
141 |
xe2= cs->GetY(); |
xe2= cs->GetY(); |
151 |
// view y plane 0 strip 95 |
// view y plane 0 strip 95 |
152 |
cs->Set(1,0,95); |
cs->Set(1,0,95); |
153 |
xe6= cs->GetY(); |
xe6= cs->GetY(); |
|
|
|
154 |
// view x plane 0 strip 0 |
// view x plane 0 strip 0 |
155 |
cs->Set(0,0,0); |
cs->Set(0,0,0); |
156 |
yo1= cs->GetX(); |
yo1= cs->GetX(); |
|
// z2= cs->GetZ(); |
|
157 |
// view x plane 0 strip 31 |
// view x plane 0 strip 31 |
158 |
cs->Set(0,0,31); |
cs->Set(0,0,31); |
159 |
yo2= cs->GetX(); |
yo2= cs->GetX(); |
169 |
// view x plane 0 strip 95 |
// view x plane 0 strip 95 |
170 |
cs->Set(0,0,95); |
cs->Set(0,0,95); |
171 |
yo6= cs->GetX(); |
yo6= cs->GetX(); |
|
|
|
|
|
|
172 |
// view y plane 1 strip 0 |
// view y plane 1 strip 0 |
173 |
cs->Set(1,1,0); |
cs->Set(1,1,0); |
174 |
xo1= cs->GetY(); |
xo1= cs->GetY(); |
|
// z3= cs->GetZ(); |
|
175 |
// view y plane 1 strip 31 |
// view y plane 1 strip 31 |
176 |
cs->Set(1,1,31); |
cs->Set(1,1,31); |
177 |
xo2= cs->GetY(); |
xo2= cs->GetY(); |
186 |
xo5= cs->GetY(); |
xo5= cs->GetY(); |
187 |
// view y plane 1 strip 95 |
// view y plane 1 strip 95 |
188 |
cs->Set(1,1,95); |
cs->Set(1,1,95); |
189 |
xo6= cs->GetY(); |
xo6= cs->GetY(); |
|
|
|
190 |
// view x plane 1 strip 0 |
// view x plane 1 strip 0 |
191 |
cs->Set(0,1,0); |
cs->Set(0,1,0); |
192 |
ye1= cs->GetX(); |
ye1= cs->GetX(); |
|
// z4= cs->GetZ(); |
|
193 |
// view x plane 1 strip 31 |
// view x plane 1 strip 31 |
194 |
cs->Set(0,1,31); |
cs->Set(0,1,31); |
195 |
ye2= cs->GetX(); |
ye2= cs->GetX(); |
205 |
// view x plane 1 strip 95 |
// view x plane 1 strip 95 |
206 |
cs->Set(0,1,95); |
cs->Set(0,1,95); |
207 |
ye6= cs->GetX(); |
ye6= cs->GetX(); |
|
|
|
208 |
// |
// |
209 |
for (Int_t p = 0; p<22; p ++){ |
for (Int_t p = 0; p<22; p ++){ |
210 |
for (Int_t v = 0; v<2; v++ ){ |
for (Int_t v = 0; v<2; v++ ){ |
243 |
yomax_en= 0.; |
yomax_en= 0.; |
244 |
yemax_en= 0.; |
yemax_en= 0.; |
245 |
// |
// |
246 |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
247 |
en = 0.; |
en = 0.; |
248 |
view = 0; |
view = 0; |
249 |
plane = 0; |
plane = 0; |
265 |
memset(en_xop,0,11*sizeof(Float_t)); |
memset(en_xop,0,11*sizeof(Float_t)); |
266 |
memset(en_yop,0,11*sizeof(Float_t)); |
memset(en_yop,0,11*sizeof(Float_t)); |
267 |
// |
// |
268 |
|
fColumn = -1; |
269 |
|
fColXE = -1; |
270 |
|
fColXO = -1; |
271 |
|
fColYE = -1; |
272 |
|
fColYO = -1; |
273 |
|
memset(encol,0,2*3*sizeof(Float_t)); |
274 |
|
entot[0] = 0.; |
275 |
|
entot[1] = 0.; |
276 |
|
// |
277 |
|
X0pl = 0.76; |
278 |
|
// |
279 |
} |
} |
280 |
|
|
281 |
void CaloEnergy::Print(){ |
void CaloEnergy::Print(){ |
308 |
printf(" fM1 :.............. %f \n",fM1); |
printf(" fM1 :.............. %f \n",fM1); |
309 |
printf(" fRad :.............. %i \n",fRad); |
printf(" fRad :.............. %i \n",fRad); |
310 |
printf(" fPl :.............. %i \n",fPl); |
printf(" fPl :.............. %i \n",fPl); |
311 |
|
printf(" fColumn :.............. %i \n",fColumn); |
312 |
|
printf(" multicol:.............. %i \n",multicol); |
313 |
|
printf(" encol x :.............. %f \n",this->GetEncol(0)); |
314 |
|
printf(" encol y :.............. %f \n",this->GetEncol(1)); |
315 |
|
printf(" entot x :.............. %f \n",this->GetEntot(0)); |
316 |
|
printf(" entot y :.............. %f \n",this->GetEntot(1)); |
317 |
|
printf(" fColXE :.............. %i \n",fColXE); |
318 |
|
printf(" fColXO :.............. %i \n",fColXO); |
319 |
|
printf(" fColYE :.............. %i \n",fColYE); |
320 |
|
printf(" fColYO :.............. %i \n",fColYO); |
321 |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
322 |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
323 |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
332 |
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
333 |
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
334 |
printf(" x0max :.............. %f \n",x0max); |
printf(" x0max :.............. %f \n",x0max); |
335 |
|
printf(" X0pl :.............. %f \n",X0pl); |
336 |
printf(" debug :.............. %i \n",debug); |
printf(" debug :.............. %i \n",debug); |
337 |
|
|
338 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
339 |
// |
// |
340 |
} |
} |
341 |
|
|
342 |
void CaloEnergy::Delete(){ |
void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ |
343 |
Clear(); |
section.ToUpper(); |
344 |
delete this; |
if ( section.Contains("XO") ) fXomin = plane; |
345 |
|
if ( section.Contains("XE") ) fXemin = plane; |
346 |
|
if ( section.Contains("YO") ) fYomin = plane; |
347 |
|
if ( section.Contains("YE") ) fYemin = plane; |
348 |
|
} |
349 |
|
|
350 |
|
void CaloEnergy::SetMinimumContainment(Int_t plane){ |
351 |
|
this->SetMinimumContainment("XEXOYEYO",plane); |
352 |
|
} |
353 |
|
|
354 |
|
void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ |
355 |
|
section.ToUpper(); |
356 |
|
if ( section.Contains("XO") ) fConv_rxo = conv; |
357 |
|
if ( section.Contains("XE") ) fConv_rxe = conv; |
358 |
|
if ( section.Contains("YO") ) fConv_ryo = conv; |
359 |
|
if ( section.Contains("YE") ) fConv_rye = conv; |
360 |
|
} |
361 |
|
|
362 |
|
void CaloEnergy::SetConversionFactor(Float_t conv){ |
363 |
|
this->SetConversionFactor("XEXOYEYO",conv); |
364 |
|
} |
365 |
|
|
366 |
|
Int_t CaloEnergy::GetMinimumContainment(TString section){ |
367 |
|
section.ToUpper(); |
368 |
|
if ( section.Contains("XO") ) return(fXomin); |
369 |
|
if ( section.Contains("XE") ) return(fXemin); |
370 |
|
if ( section.Contains("YE") ) return(fYemin); |
371 |
|
if ( section.Contains("YO") ) return(fYomin); |
372 |
|
printf(" ERROR: section not recognized \n"); |
373 |
|
return(-1000); |
374 |
|
} |
375 |
|
|
376 |
|
Float_t CaloEnergy::GetConversionFactor(TString section){ |
377 |
|
section.ToUpper(); |
378 |
|
if ( section.Contains("XO") ) return(fConv_rxo); |
379 |
|
if ( section.Contains("XE") ) return(fConv_rxe); |
380 |
|
if ( section.Contains("YO") ) return(fConv_ryo); |
381 |
|
if ( section.Contains("YE") ) return(fConv_rye); |
382 |
|
printf(" ERROR: section not recognized \n"); |
383 |
|
return(-1000.); |
384 |
|
} |
385 |
|
|
386 |
|
Int_t CaloEnergy::GetMaxplane(TString section){ |
387 |
|
section.ToUpper(); |
388 |
|
if ( section.Contains("XO") ) return fMax_planexo; |
389 |
|
if ( section.Contains("XE") ) return fMax_planexe; |
390 |
|
if ( section.Contains("YO") ) return fMax_planeyo; |
391 |
|
if ( section.Contains("YE") ) return fMax_planeye; |
392 |
|
return(-1); |
393 |
|
} |
394 |
|
|
395 |
|
Int_t CaloEnergy::GetColumn(TString section){ |
396 |
|
section.ToUpper(); |
397 |
|
if ( section.Contains("XO") ) return fColXO; |
398 |
|
if ( section.Contains("XE") ) return fColXE; |
399 |
|
if ( section.Contains("YO") ) return fColYO; |
400 |
|
if ( section.Contains("YE") ) return fColYE; |
401 |
|
return(-1); |
402 |
|
} |
403 |
|
|
404 |
|
Float_t CaloEnergy::GetMipEnergyAtMaxplane(TString section){ |
405 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergyAtMaxplane(TString) instead! \n"); |
406 |
|
return (this->GetEnergyAtMaxplane(section)); |
407 |
|
} |
408 |
|
|
409 |
|
Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ |
410 |
|
section.ToUpper(); |
411 |
|
if ( section.Contains("XO") ) return xomax_en; |
412 |
|
if ( section.Contains("XE") ) return xemax_en; |
413 |
|
if ( section.Contains("YO") ) return yomax_en; |
414 |
|
if ( section.Contains("YE") ) return yemax_en; |
415 |
|
return(-1); |
416 |
|
} |
417 |
|
|
418 |
|
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
419 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy(TString) instead! \n"); |
420 |
|
return (this->GetMipEnergy(section)); |
421 |
|
} |
422 |
|
|
423 |
|
Float_t CaloEnergy::GetMipEnergy(TString section){ |
424 |
|
section.ToUpper(); |
425 |
|
if ( fLong ){ |
426 |
|
this->Process(section); |
427 |
|
return fXOen_maxplane; |
428 |
|
} else { |
429 |
|
if ( section.Contains("XO") ) return fXOen_maxplane; |
430 |
|
if ( section.Contains("XE") ) return fXEen_maxplane; |
431 |
|
if ( section.Contains("YO") ) return fYOen_maxplane; |
432 |
|
if ( section.Contains("YE") ) return fYEen_maxplane; |
433 |
|
}; |
434 |
|
return(-1); |
435 |
|
} |
436 |
|
|
437 |
|
Float_t CaloEnergy::GetEncol(Int_t i){ |
438 |
|
if ( fColumn > -1 && (((fXesel || fXosel)&&i==1) || ((fYesel || fYosel)&&i==0)) ){ |
439 |
|
Int_t t = -1; |
440 |
|
if ( i == 0 ){ |
441 |
|
if ( fColumn == 0 || fColumn == 3 || fColumn == 6 ) t = 0; |
442 |
|
if ( fColumn == 1 || fColumn == 4 || fColumn == 7 ) t = 1; |
443 |
|
if ( fColumn == 2 || fColumn == 5 || fColumn == 8 ) t = 2; |
444 |
|
} else { |
445 |
|
if ( fColumn == 0 || fColumn == 1 || fColumn == 2 ) t = 0; |
446 |
|
if ( fColumn == 3 || fColumn == 4 || fColumn == 5 ) t = 1; |
447 |
|
if ( fColumn == 6 || fColumn == 7 || fColumn == 8 ) t = 2; |
448 |
|
}; |
449 |
|
if ( debug ) printf(" encol: i %i t %i encol %f \n",i,t,encol[i][t]); |
450 |
|
return encol[i][t]; |
451 |
|
}; |
452 |
|
return(-1.); |
453 |
|
} |
454 |
|
|
455 |
|
Float_t CaloEnergy::GetMaxEnergy(){ |
456 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy() instead! \n"); |
457 |
|
return (this->GetMipEnergy()); |
458 |
|
} |
459 |
|
|
460 |
|
Float_t CaloEnergy::GetMipEnergy(){ |
461 |
|
if ( fLong ){ |
462 |
|
if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); |
463 |
|
this->Process(asntr); |
464 |
|
}; |
465 |
|
return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); |
466 |
} |
} |
467 |
|
|
468 |
|
|
529 |
enstrip[view][plane][strip]=en; |
enstrip[view][plane][strip]=en; |
530 |
}; |
}; |
531 |
// |
// |
532 |
|
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)); |
533 |
|
// |
534 |
|
// inclination factor (stolen from Daniele's code) |
535 |
|
// |
536 |
|
Float_t ytgx = 0; |
537 |
|
Float_t ytgy = 0; |
538 |
|
ytgx = 0.76 * cl2->tanx[0]; |
539 |
|
ytgy = 0.76 * cl2->tany[0]; |
540 |
|
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
541 |
|
// |
542 |
// sum energy plane by plane for each sections |
// sum energy plane by plane for each sections |
543 |
// |
// |
544 |
|
Float_t fen_xep[11]; |
545 |
|
Float_t fen_xop[11]; |
546 |
|
Float_t fen_yep[11]; |
547 |
|
Float_t fen_yop[11]; |
548 |
|
memset(fen_xep,0,11*sizeof(Float_t)); |
549 |
|
memset(fen_xop,0,11*sizeof(Float_t)); |
550 |
|
memset(fen_yep,0,11*sizeof(Float_t)); |
551 |
|
memset(fen_yop,0,11*sizeof(Float_t)); |
552 |
|
// |
553 |
for (Int_t i=0;i<11;i++){ |
for (Int_t i=0;i<11;i++){ |
554 |
for(strip=0; strip<96; strip++) { |
for(strip=0; strip<96; strip++) { |
555 |
|
fen_xep[i] += enstrip[1][2*i][strip]; |
556 |
|
fen_yop[i] += enstrip[0][2*i][strip]; |
557 |
|
fen_xop[i] += enstrip[1][(2*i)+1][strip]; |
558 |
|
fen_yep[i] += enstrip[0][(2*i)+1][strip]; |
559 |
if ( fRad < 0 ){ |
if ( fRad < 0 ){ |
560 |
// |
// |
561 |
// run over all the strips of the plane |
// run over all the strips of the plane |
562 |
// |
// |
563 |
en_xep[i] += enstrip[1][2*i][strip]; |
en_xep[i] += enstrip[1][2*i][strip]; |
564 |
en_yop[i] += enstrip[0][2*i][strip]; |
en_yop[i] += enstrip[0][2*i][strip]; |
568 |
// |
// |
569 |
// use only the strips inside a cylinder of given radius fRad |
// use only the strips inside a cylinder of given radius fRad |
570 |
// |
// |
571 |
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 && |
572 |
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]; |
573 |
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]; |
|
574 |
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 && |
575 |
|
(strip >= (cl2->cibar[2*i][0]-1-fRad)) && (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip]; |
576 |
|
|
577 |
|
if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 && |
578 |
|
(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]; |
579 |
|
|
580 |
|
if ( cl2->cibar[(2*i)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 && |
581 |
|
(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]; |
582 |
}; |
}; |
583 |
}; |
}; |
584 |
|
if ( debug ) printf(" ex_xep[%i] %f cibar %i \n",i,en_xep[i],cl2->cibar[2*i][1]); |
585 |
|
if ( debug ) printf(" ex_xop[%i] %f cibar %i \n",i,en_xop[i],cl2->cibar[(2*i)+1][1]); |
586 |
|
if ( debug ) printf(" ex_yep[%i] %f cibar %i \n",i,en_yep[i],cl2->cibar[(2*i)+1][0]); |
587 |
|
if ( debug ) printf(" ex_yop[%i] %f cibar %i \n",i,en_yop[i],cl2->cibar[2*i][0]); |
588 |
energyxe += en_xep[i]; |
energyxe += en_xep[i]; |
589 |
energyyo += en_yop[i]; |
energyyo += en_yop[i]; |
590 |
energyxo += en_xop[i]; |
energyxo += en_xop[i]; |
598 |
Int_t yon = 0; |
Int_t yon = 0; |
599 |
Int_t xon = 0; |
Int_t xon = 0; |
600 |
Int_t yen = 0; |
Int_t yen = 0; |
601 |
|
Float_t en = 0.; |
602 |
// |
// |
603 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
604 |
yon++; |
yon++; |
605 |
xon++; |
xon++; |
606 |
yen++; |
yen++; |
607 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
608 |
if(en_xep[ipl] > xemax_en) { |
en = fen_xep[ipl]; |
609 |
xemax_en = en_xep[ipl]; |
if ( !fAllpl ) en = en_xep[ipl]; |
610 |
|
if(en > xemax_en) { |
611 |
|
xemax_en = en; |
612 |
fMax_planexe = ipl; |
fMax_planexe = ipl; |
613 |
}; |
}; |
614 |
}; |
}; |
618 |
xon++; |
xon++; |
619 |
yen++; |
yen++; |
620 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
621 |
if(en_yop[ipl] > yomax_en) { |
en = fen_yop[ipl]; |
622 |
yomax_en = en_yop[ipl]; |
if ( !fAllpl ) en = en_yop[ipl]; |
623 |
|
if(en > yomax_en) { |
624 |
|
yomax_en = en; |
625 |
fMax_planeyo = ipl; |
fMax_planeyo = ipl; |
626 |
}; |
}; |
627 |
}; |
}; |
630 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
631 |
yen++; |
yen++; |
632 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
633 |
if(en_xop[ipl] > xomax_en) { |
en = fen_xop[ipl]; |
634 |
xomax_en = en_xop[ipl]; |
if ( !fAllpl ) en = en_xop[ipl]; |
635 |
|
if(en > xomax_en) { |
636 |
|
xomax_en = en; |
637 |
fMax_planexo = ipl; |
fMax_planexo = ipl; |
638 |
}; |
}; |
639 |
}; |
}; |
641 |
// |
// |
642 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
643 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
644 |
if(en_yep[ipl] > yemax_en) { |
en = fen_yep[ipl]; |
645 |
yemax_en = en_yep[ipl]; |
if ( !fAllpl ) en = en_yep[ipl]; |
646 |
|
if(en > yemax_en) { |
647 |
|
yemax_en = en; |
648 |
fMax_planeye = ipl; |
fMax_planeye = ipl; |
649 |
}; |
}; |
650 |
}; |
}; |
654 |
// |
// |
655 |
if ( x0max > 0. ){ |
if ( x0max > 0. ){ |
656 |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
657 |
Int_t wpl = (Int_t)roundf(x0max/0.76); |
// Int_t wpl = (Int_t)roundf(x0max/0.76); |
658 |
|
Int_t wpl = (Int_t)roundf(x0max/X0pl); |
659 |
Bool_t isY = false; |
Bool_t isY = false; |
660 |
if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
// if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
661 |
|
if ( ((x0max/X0pl)-(Float_t)wpl) > 0. ) isY = true; |
662 |
xomax_en = 0.; |
xomax_en = 0.; |
663 |
yemax_en = 0.; |
yemax_en = 0.; |
664 |
xemax_en = 0.; |
xemax_en = 0.; |
699 |
if ( section.Contains("YO") ) yomax_en = 10.; |
if ( section.Contains("YO") ) yomax_en = 10.; |
700 |
}; |
}; |
701 |
}; |
}; |
702 |
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); |
703 |
|
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); |
704 |
}; |
}; |
705 |
// |
// |
706 |
Int_t nPl = fPl; |
Int_t nPl = fPl; |
772 |
// |
// |
773 |
// 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 |
774 |
// |
// |
|
Float_t track_coordx[22][2]; |
|
|
Float_t track_coordy[22][2]; |
|
775 |
// |
// |
776 |
Float_t tgx_cl2; |
Float_t tgx_cl2; |
777 |
Float_t tgy_cl2; |
Float_t tgy_cl2; |
781 |
for (Int_t p=0; p<22; p++){ |
for (Int_t p=0; p<22; p++){ |
782 |
track_coordy[p][1] = cl2->cbar[p][1]; |
track_coordy[p][1] = cl2->cbar[p][1]; |
783 |
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; |
784 |
|
// track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
785 |
track_coordx[p][0] = cl2->cbar[p][0]; |
track_coordx[p][0] = cl2->cbar[p][0]; |
786 |
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; |
787 |
|
// track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
788 |
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]); |
789 |
}; |
}; |
790 |
// |
// |
792 |
// |
// |
793 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
794 |
// |
// |
795 |
// check event is inside XO acceptance |
// find the column hit in the first plane |
796 |
|
// |
797 |
|
Int_t ix = -1; |
798 |
|
Int_t iy = -1; |
799 |
|
if ( track_coordx[(2*0)+1][1] >= (-12.054+fM) && track_coordx[(2*0)+1][1] <= (-4.246-fM) ) ix = 0; |
800 |
|
if ( track_coordx[(2*0)+1][1] >= ( -4.004+fM) && track_coordx[(2*0)+1][1] <= ( 3.804-fM) ) ix = 1; |
801 |
|
if ( track_coordx[(2*0)+1][1] >= ( 4.046+fM) && track_coordx[(2*0)+1][1] <= (11.854-fM) ) ix = 2; |
802 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo2 - fM1) ) iy = 0; |
803 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo4 - fM1) ) iy = 1; |
804 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo6 - fM1) ) iy = 2; |
805 |
|
if ( ix > -1 && iy > -1 ) fColXO = ix + iy*3; |
806 |
|
// |
807 |
|
// check event is inside XO acceptance, if multicol is false (SingleColumn mode) then the track must be contained in a column. |
808 |
// |
// |
809 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
810 |
if |
if (( |
811 |
( |
( track_coordx[(2*i)+1][1] >= (-12.054+fM) && track_coordx[(2*i)+1][1] <= (-4.246-fM) && (ix == 0 || multicol) ) || |
812 |
(((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) ) || |
813 |
(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) ) |
814 |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
) && ( |
815 |
(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) ) || |
816 |
((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) ) || |
817 |
(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) ) |
818 |
((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 )))) |
|
|
){ |
|
819 |
fXosel = true; |
fXosel = true; |
820 |
fXoout = i; |
fXoout = i; |
821 |
} else { |
} else { |
835 |
// 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 |
836 |
// |
// |
837 |
if ( fXosel ){ |
if ( fXosel ){ |
838 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++){ |
for (Int_t iplm=0; iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)); iplm++){ |
839 |
fXOen_maxplane += en_xop[iplm]; |
fXOen_maxplane += en_xop[iplm]; |
840 |
if ( debug ) printf(" XO iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]); |
if ( debug ) printf(" XO iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]); |
841 |
}; |
}; |
842 |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
843 |
|
// |
844 |
|
for (Int_t i=0;i<11;i++){ |
845 |
|
for(strip=0; strip<96; strip++) { |
846 |
|
// |
847 |
|
// run over all the strips of the plane |
848 |
|
// |
849 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)+1][strip]; |
850 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)+1][strip]; |
851 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)+1][strip]; |
852 |
|
entot[1] += enstrip[1][(2*i)+1][strip]; |
853 |
|
// |
854 |
|
}; |
855 |
|
}; |
856 |
}; |
}; |
857 |
}; |
}; |
858 |
// |
// |
859 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
860 |
|
// |
861 |
|
// find the column hit in the first plane |
862 |
|
// |
863 |
|
Int_t ix = -1; |
864 |
|
Int_t iy = -1; |
865 |
|
if ( track_coordx[(2*0)][1] >= (-11.854+fM) && track_coordx[(2*0)][1] <= (-4.046-fM) ) ix = 0; |
866 |
|
if ( track_coordx[(2*0)][1] >= ( -3.804+fM) && track_coordx[(2*0)][1] <= ( 4.004-fM) ) ix = 1; |
867 |
|
if ( track_coordx[(2*0)][1] >= ( 4.246+fM) && track_coordx[(2*0)][1] <= (12.054-fM) ) ix = 2; |
868 |
|
if ( cl2->cbar[(2*0)][1] >= (xe1 + fM1) && cl2->cbar[(2*0)][1] <= (xe2 - fM1) ) iy = 0; |
869 |
|
if ( cl2->cbar[(2*0)][1] >= (xe3 + fM1) && cl2->cbar[(2*0)][1] <= (xe4 - fM1) ) iy = 1; |
870 |
|
if ( cl2->cbar[(2*0)][1] >= (xe5 + fM1) && cl2->cbar[(2*0)][1] <= (xe6 - fM1) ) iy = 2; |
871 |
|
if ( ix > -1 && iy > -1 ) fColXE = ix + iy*3; |
872 |
|
// |
873 |
|
// check event is inside XO acceptance |
874 |
|
// |
875 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
876 |
if |
if (( |
877 |
( |
( track_coordx[(2*i)][1] >= (-11.854+fM) && track_coordx[(2*i)][1] <= (-4.046-fM) && (ix == 0 || multicol) ) || |
878 |
(((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) ) || |
879 |
(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) ) |
880 |
(((cl2->cbar[2*i][1]>=xe1 + fM1)&& |
) && ( |
881 |
(cl2->cbar[2*i][1]<=xe2 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe1 + fM1) && cl2->cbar[(2*i)][1] <= (xe2 - fM1) && (iy == 0 || multicol) ) || |
882 |
((cl2->cbar[2*i][1]>=xe3 + fM1)&& |
( cl2->cbar[(2*i)][1] >= (xe3 + fM1) && cl2->cbar[(2*i)][1] <= (xe4 - fM1) && (iy == 1 || multicol) ) || |
883 |
(cl2->cbar[2*i][1]<=xe4 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe5 + fM1) && cl2->cbar[(2*i)][1] <= (xe6 - fM1) && (iy == 2 || multicol) ) |
884 |
((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 )))) |
|
|
){ |
|
885 |
fXesel = true; |
fXesel = true; |
886 |
fXeout = i; |
fXeout = i; |
887 |
} else { |
} else { |
889 |
break; |
break; |
890 |
}; |
}; |
891 |
}; |
}; |
892 |
|
// |
893 |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
894 |
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)); |
895 |
fPartsel = true; |
fPartsel = true; |
901 |
if ( debug ) printf(" XE iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]); |
if ( debug ) printf(" XE iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]); |
902 |
}; |
}; |
903 |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
904 |
|
// |
905 |
|
for (Int_t i=0;i<11;i++){ |
906 |
|
for(strip=0; strip<96; strip++) { |
907 |
|
// |
908 |
|
// run over all the strips of the plane |
909 |
|
// |
910 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)][strip]; |
911 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)][strip]; |
912 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)][strip]; |
913 |
|
entot[1] += enstrip[1][(2*i)][strip]; |
914 |
|
// |
915 |
|
}; |
916 |
|
}; |
917 |
}; |
}; |
918 |
}; |
}; |
919 |
// |
// |
920 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
921 |
|
// |
922 |
|
// find the column hit in the first plane |
923 |
|
// |
924 |
|
Int_t ix = -1; |
925 |
|
Int_t iy = -1; |
926 |
|
if ( track_coordy[(2*0)+1][0] >= (-12.154+fM) && track_coordy[(2*0)+1][0] <= (-4.346-fM) ) iy = 0; |
927 |
|
if ( track_coordy[(2*0)+1][0] >= ( -4.104+fM) && track_coordy[(2*0)+1][0] <= ( 3.704-fM) ) iy = 1; |
928 |
|
if ( track_coordy[(2*0)+1][0] >= ( 3.946+fM) && track_coordy[(2*0)+1][0] <= (11.754-fM) ) iy = 2; |
929 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye2 - fM1) ) ix = 0; |
930 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye4 - fM1) ) ix = 1; |
931 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye6 - fM1) ) ix = 2; |
932 |
|
if ( ix > -1 && iy > -1 ) fColYE = ix + iy*3; |
933 |
|
// |
934 |
|
// check event is inside XO acceptance |
935 |
|
// |
936 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
937 |
if |
if (( |
938 |
( |
( track_coordy[(2*i)+1][0] >= (-12.154+fM) && track_coordy[(2*i)+1][0] <= (-4.346-fM) && (iy == 0 || multicol) ) || |
939 |
(((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) ) || |
940 |
(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) ) |
941 |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
) && ( |
942 |
(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) ) || |
943 |
((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) ) || |
944 |
(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) ) |
945 |
((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 )))) |
|
|
){ |
|
946 |
fYesel = true; |
fYesel = true; |
947 |
fYeout = i; |
fYeout = i; |
948 |
} else { |
} else { |
950 |
break; |
break; |
951 |
}; |
}; |
952 |
}; |
}; |
953 |
|
// |
954 |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
955 |
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)); |
956 |
fPartsel = true; |
fPartsel = true; |
959 |
if ( fYesel ){ |
if ( fYesel ){ |
960 |
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]; |
961 |
fEnergyye = fYEen_maxplane/fConv_rye; |
fEnergyye = fYEen_maxplane/fConv_rye; |
962 |
|
// |
963 |
|
for (Int_t i=0;i<11;i++){ |
964 |
|
for(strip=0; strip<96; strip++) { |
965 |
|
// |
966 |
|
// run over all the strips of the plane |
967 |
|
// |
968 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)+1][strip]; |
969 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)+1][strip]; |
970 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)+1][strip]; |
971 |
|
entot[0] += enstrip[0][(2*i)+1][strip]; |
972 |
|
// |
973 |
|
}; |
974 |
|
}; |
975 |
|
// |
976 |
}; |
}; |
977 |
}; |
}; |
978 |
// |
// |
979 |
if ( section.Contains("YO") ){ |
if ( section.Contains("YO") ){ |
980 |
|
// |
981 |
|
// find the column hit in the first plane |
982 |
|
// |
983 |
|
Int_t ix = -1; |
984 |
|
Int_t iy = -1; |
985 |
|
if ( track_coordy[(2*0)][0] >= (-11.954+fM) && track_coordy[(2*0)][0] <= (-4.146-fM) ) iy = 0; |
986 |
|
if ( track_coordy[(2*0)][0] >= ( -3.904+fM) && track_coordy[(2*0)][0] <= ( 3.904-fM) ) iy = 1; |
987 |
|
if ( track_coordy[(2*0)][0] >= ( 4.146+fM) && track_coordy[(2*0)][0] <= (11.954-fM) ) iy = 2; |
988 |
|
if ( cl2->cbar[(2*0)][0] >= (yo1 + fM1) && cl2->cbar[(2*0)][0] <= (yo2 - fM1) ) ix = 0; |
989 |
|
if ( cl2->cbar[(2*0)][0] >= (yo3 + fM1) && cl2->cbar[(2*0)][0] <= (yo4 - fM1) ) ix = 1; |
990 |
|
if ( cl2->cbar[(2*0)][0] >= (yo5 + fM1) && cl2->cbar[(2*0)][0] <= (yo6 - fM1) ) ix = 2; |
991 |
|
if ( ix > -1 && iy > -1 ) fColYO = ix + iy*3; |
992 |
|
// |
993 |
|
// check event is inside XO acceptance |
994 |
|
// |
995 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
996 |
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 (( |
997 |
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) ) || |
998 |
if |
( track_coordy[(2*i)][0] >= ( -3.904+fM) && track_coordy[(2*i)][0] <= ( 3.904-fM) && (iy == 1 || multicol) ) || |
999 |
( |
( track_coordy[(2*i)][0] >= ( 4.146+fM) && track_coordy[(2*i)][0] <= (11.954-fM) && (iy == 2 || multicol) ) |
1000 |
(((track_coordy[2*i][0]>=(-11.954+fM))&& |
) && ( |
1001 |
(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) ) || |
1002 |
(((cl2->cbar[2*i][0]>=yo1 + fM1)&& |
( cl2->cbar[(2*i)][0] >= (yo3 + fM1) && cl2->cbar[(2*i)][0] <= (yo4 - fM1) && (ix == 1 || multicol) ) || |
1003 |
(cl2->cbar[2*i][0]<=yo2 - fM1 ))|| |
( cl2->cbar[(2*i)][0] >= (yo5 + fM1) && cl2->cbar[(2*i)][0] <= (yo6 - fM1) && (ix == 2 || multicol) ) |
1004 |
((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 )))) |
|
|
){ |
|
1005 |
fYosel = true; |
fYosel = true; |
1006 |
fYoout = i; |
fYoout = i; |
1007 |
} else { |
} else { |
1009 |
break; |
break; |
1010 |
}; |
}; |
1011 |
}; |
}; |
1012 |
|
// |
1013 |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
1014 |
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)); |
1015 |
fPartsel = true; |
fPartsel = true; |
1018 |
if ( fYosel ){ |
if ( fYosel ){ |
1019 |
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]; |
1020 |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
1021 |
|
// |
1022 |
|
for (Int_t i=0;i<11;i++){ |
1023 |
|
for(strip=0; strip<96; strip++) { |
1024 |
|
// |
1025 |
|
// run over all the strips of the plane |
1026 |
|
// |
1027 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)][strip]; |
1028 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)][strip]; |
1029 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)][strip]; |
1030 |
|
entot[0] += enstrip[0][(2*i)][strip]; |
1031 |
|
// |
1032 |
|
}; |
1033 |
|
}; |
1034 |
}; |
}; |
1035 |
}; |
}; |
1036 |
// |
// |
1056 |
fSel = true; |
fSel = true; |
1057 |
}; |
}; |
1058 |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
1059 |
|
if ( fSel ){ |
1060 |
|
if ( fXesel ) fColumn = fColXE; |
1061 |
|
if ( fXosel ){ |
1062 |
|
if ( fColXO != fColumn && fColumn > -1 ){ |
1063 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColXO %i \n",fColumn,fColXO); |
1064 |
|
} else { |
1065 |
|
fColumn = fColXO; |
1066 |
|
}; |
1067 |
|
}; |
1068 |
|
if ( fYesel ){ |
1069 |
|
if ( fColYE != fColumn && fColumn > -1 ){ |
1070 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYE %i \n",fColumn,fColYE); |
1071 |
|
} else { |
1072 |
|
fColumn = fColYE; |
1073 |
|
}; |
1074 |
|
}; |
1075 |
|
if ( fYosel ){ |
1076 |
|
if ( fColYO != fColumn && fColumn > -1 ){ |
1077 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYO %i \n",fColumn,fColYO); |
1078 |
|
} else { |
1079 |
|
fColumn = fColYO; |
1080 |
|
}; |
1081 |
|
}; |
1082 |
|
}; |
1083 |
}; |
}; |
1084 |
// |
// |
1085 |
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); |