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 |
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 |
} |
} |
278 |
|
|
279 |
void CaloEnergy::Print(){ |
void CaloEnergy::Print(){ |
306 |
printf(" fM1 :.............. %f \n",fM1); |
printf(" fM1 :.............. %f \n",fM1); |
307 |
printf(" fRad :.............. %i \n",fRad); |
printf(" fRad :.............. %i \n",fRad); |
308 |
printf(" fPl :.............. %i \n",fPl); |
printf(" fPl :.............. %i \n",fPl); |
309 |
|
printf(" fColumn :.............. %i \n",fColumn); |
310 |
|
printf(" multicol:.............. %i \n",multicol); |
311 |
|
printf(" encol x :.............. %f \n",this->GetEncol(0)); |
312 |
|
printf(" encol y :.............. %f \n",this->GetEncol(1)); |
313 |
|
printf(" entot x :.............. %f \n",this->GetEntot(0)); |
314 |
|
printf(" entot y :.............. %f \n",this->GetEntot(1)); |
315 |
|
printf(" fColXE :.............. %i \n",fColXE); |
316 |
|
printf(" fColXO :.............. %i \n",fColXO); |
317 |
|
printf(" fColYE :.............. %i \n",fColYE); |
318 |
|
printf(" fColYO :.............. %i \n",fColYO); |
319 |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
printf(" fConv_rxe ............. %f \n",fConv_rxe); |
320 |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
printf(" fConv_rxo ............. %f \n",fConv_rxo); |
321 |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
printf(" fConv_ryo ............. %f \n",fConv_ryo); |
336 |
// |
// |
337 |
} |
} |
338 |
|
|
339 |
void CaloEnergy::Delete(){ |
void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ |
340 |
Clear(); |
section.ToUpper(); |
341 |
delete this; |
if ( section.Contains("XO") ) fXomin = plane; |
342 |
|
if ( section.Contains("XE") ) fXemin = plane; |
343 |
|
if ( section.Contains("YO") ) fYomin = plane; |
344 |
|
if ( section.Contains("YE") ) fYemin = plane; |
345 |
|
} |
346 |
|
|
347 |
|
void CaloEnergy::SetMinimumContainment(Int_t plane){ |
348 |
|
this->SetMinimumContainment("XEXOYEYO",plane); |
349 |
|
} |
350 |
|
|
351 |
|
void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ |
352 |
|
section.ToUpper(); |
353 |
|
if ( section.Contains("XO") ) fConv_rxo = conv; |
354 |
|
if ( section.Contains("XE") ) fConv_rxe = conv; |
355 |
|
if ( section.Contains("YO") ) fConv_ryo = conv; |
356 |
|
if ( section.Contains("YE") ) fConv_rye = conv; |
357 |
|
} |
358 |
|
|
359 |
|
void CaloEnergy::SetConversionFactor(Float_t conv){ |
360 |
|
this->SetConversionFactor("XEXOYEYO",conv); |
361 |
|
} |
362 |
|
|
363 |
|
Int_t CaloEnergy::GetMinimumContainment(TString section){ |
364 |
|
section.ToUpper(); |
365 |
|
if ( section.Contains("XO") ) return(fXomin); |
366 |
|
if ( section.Contains("XE") ) return(fXemin); |
367 |
|
if ( section.Contains("YE") ) return(fYemin); |
368 |
|
if ( section.Contains("YO") ) return(fYomin); |
369 |
|
printf(" ERROR: section not recognized \n"); |
370 |
|
return(-1000); |
371 |
|
} |
372 |
|
|
373 |
|
Float_t CaloEnergy::GetConversionFactor(TString section){ |
374 |
|
section.ToUpper(); |
375 |
|
if ( section.Contains("XO") ) return(fConv_rxo); |
376 |
|
if ( section.Contains("XE") ) return(fConv_rxe); |
377 |
|
if ( section.Contains("YO") ) return(fConv_ryo); |
378 |
|
if ( section.Contains("YE") ) return(fConv_rye); |
379 |
|
printf(" ERROR: section not recognized \n"); |
380 |
|
return(-1000.); |
381 |
|
} |
382 |
|
|
383 |
|
Int_t CaloEnergy::GetMaxplane(TString section){ |
384 |
|
section.ToUpper(); |
385 |
|
if ( section.Contains("XO") ) return fMax_planexo; |
386 |
|
if ( section.Contains("XE") ) return fMax_planexe; |
387 |
|
if ( section.Contains("YO") ) return fMax_planeyo; |
388 |
|
if ( section.Contains("YE") ) return fMax_planeye; |
389 |
|
return(-1); |
390 |
|
} |
391 |
|
|
392 |
|
Int_t CaloEnergy::GetColumn(TString section){ |
393 |
|
section.ToUpper(); |
394 |
|
if ( section.Contains("XO") ) return fColXO; |
395 |
|
if ( section.Contains("XE") ) return fColXE; |
396 |
|
if ( section.Contains("YO") ) return fColYO; |
397 |
|
if ( section.Contains("YE") ) return fColYE; |
398 |
|
return(-1); |
399 |
|
} |
400 |
|
|
401 |
|
Float_t CaloEnergy::GetMipEnergyAtMaxplane(TString section){ |
402 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergyAtMaxplane(TString) instead! \n"); |
403 |
|
return (this->GetEnergyAtMaxplane(section)); |
404 |
|
} |
405 |
|
|
406 |
|
Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ |
407 |
|
section.ToUpper(); |
408 |
|
if ( section.Contains("XO") ) return xomax_en; |
409 |
|
if ( section.Contains("XE") ) return xemax_en; |
410 |
|
if ( section.Contains("YO") ) return yomax_en; |
411 |
|
if ( section.Contains("YE") ) return yemax_en; |
412 |
|
return(-1); |
413 |
|
} |
414 |
|
|
415 |
|
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
416 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy(TString) instead! \n"); |
417 |
|
return (this->GetMipEnergy(section)); |
418 |
|
} |
419 |
|
|
420 |
|
Float_t CaloEnergy::GetMipEnergy(TString section){ |
421 |
|
section.ToUpper(); |
422 |
|
if ( fLong ){ |
423 |
|
this->Process(section); |
424 |
|
return fXOen_maxplane; |
425 |
|
} else { |
426 |
|
if ( section.Contains("XO") ) return fXOen_maxplane; |
427 |
|
if ( section.Contains("XE") ) return fXEen_maxplane; |
428 |
|
if ( section.Contains("YO") ) return fYOen_maxplane; |
429 |
|
if ( section.Contains("YE") ) return fYEen_maxplane; |
430 |
|
}; |
431 |
|
return(-1); |
432 |
|
} |
433 |
|
|
434 |
|
Float_t CaloEnergy::GetEncol(Int_t i){ |
435 |
|
if ( fColumn > -1 && (((fXesel || fXosel)&&i==1) || ((fYesel || fYosel)&&i==0)) ){ |
436 |
|
Int_t t = -1; |
437 |
|
if ( i == 0 ){ |
438 |
|
if ( fColumn == 0 || fColumn == 3 || fColumn == 6 ) t = 0; |
439 |
|
if ( fColumn == 1 || fColumn == 4 || fColumn == 7 ) t = 1; |
440 |
|
if ( fColumn == 2 || fColumn == 5 || fColumn == 8 ) t = 2; |
441 |
|
} else { |
442 |
|
if ( fColumn == 0 || fColumn == 1 || fColumn == 2 ) t = 0; |
443 |
|
if ( fColumn == 3 || fColumn == 4 || fColumn == 5 ) t = 1; |
444 |
|
if ( fColumn == 6 || fColumn == 7 || fColumn == 8 ) t = 2; |
445 |
|
}; |
446 |
|
if ( debug ) printf(" encol: i %i t %i encol %f \n",i,t,encol[i][t]); |
447 |
|
return encol[i][t]; |
448 |
|
}; |
449 |
|
return(-1.); |
450 |
|
} |
451 |
|
|
452 |
|
Float_t CaloEnergy::GetMaxEnergy(){ |
453 |
|
printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy() instead! \n"); |
454 |
|
return (this->GetMipEnergy()); |
455 |
|
} |
456 |
|
|
457 |
|
Float_t CaloEnergy::GetMipEnergy(){ |
458 |
|
if ( fLong ){ |
459 |
|
if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); |
460 |
|
this->Process(asntr); |
461 |
|
}; |
462 |
|
return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); |
463 |
} |
} |
464 |
|
|
465 |
|
|
526 |
enstrip[view][plane][strip]=en; |
enstrip[view][plane][strip]=en; |
527 |
}; |
}; |
528 |
// |
// |
529 |
|
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)); |
530 |
|
// |
531 |
// sum energy plane by plane for each sections |
// sum energy plane by plane for each sections |
532 |
// |
// |
533 |
|
Float_t fen_xep[11]; |
534 |
|
Float_t fen_xop[11]; |
535 |
|
Float_t fen_yep[11]; |
536 |
|
Float_t fen_yop[11]; |
537 |
|
memset(fen_xep,0,11*sizeof(Float_t)); |
538 |
|
memset(fen_xop,0,11*sizeof(Float_t)); |
539 |
|
memset(fen_yep,0,11*sizeof(Float_t)); |
540 |
|
memset(fen_yop,0,11*sizeof(Float_t)); |
541 |
|
// |
542 |
for (Int_t i=0;i<11;i++){ |
for (Int_t i=0;i<11;i++){ |
543 |
for(strip=0; strip<96; strip++) { |
for(strip=0; strip<96; strip++) { |
544 |
|
fen_xep[i] += enstrip[1][2*i][strip]; |
545 |
|
fen_yop[i] += enstrip[0][2*i][strip]; |
546 |
|
fen_xop[i] += enstrip[1][(2*i)+1][strip]; |
547 |
|
fen_yep[i] += enstrip[0][(2*i)+1][strip]; |
548 |
if ( fRad < 0 ){ |
if ( fRad < 0 ){ |
549 |
// |
// |
550 |
// run over all the strips of the plane |
// run over all the strips of the plane |
551 |
// |
// |
552 |
en_xep[i] += enstrip[1][2*i][strip]; |
en_xep[i] += enstrip[1][2*i][strip]; |
553 |
en_yop[i] += enstrip[0][2*i][strip]; |
en_yop[i] += enstrip[0][2*i][strip]; |
557 |
// |
// |
558 |
// use only the strips inside a cylinder of given radius fRad |
// use only the strips inside a cylinder of given radius fRad |
559 |
// |
// |
560 |
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 && |
561 |
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]; |
562 |
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]; |
|
563 |
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 && |
564 |
|
(strip >= (cl2->cibar[2*i][0]-1-fRad)) && (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip]; |
565 |
|
|
566 |
|
if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 && |
567 |
|
(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]; |
568 |
|
|
569 |
|
if ( cl2->cibar[(2*i)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 && |
570 |
|
(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]; |
571 |
}; |
}; |
572 |
}; |
}; |
573 |
|
if ( debug ) printf(" ex_xep[%i] %f cibar %i \n",i,en_xep[i],cl2->cibar[2*i][1]); |
574 |
|
if ( debug ) printf(" ex_xop[%i] %f cibar %i \n",i,en_xop[i],cl2->cibar[(2*i)+1][1]); |
575 |
|
if ( debug ) printf(" ex_yep[%i] %f cibar %i \n",i,en_yep[i],cl2->cibar[(2*i)+1][0]); |
576 |
|
if ( debug ) printf(" ex_yop[%i] %f cibar %i \n",i,en_yop[i],cl2->cibar[2*i][0]); |
577 |
energyxe += en_xep[i]; |
energyxe += en_xep[i]; |
578 |
energyyo += en_yop[i]; |
energyyo += en_yop[i]; |
579 |
energyxo += en_xop[i]; |
energyxo += en_xop[i]; |
587 |
Int_t yon = 0; |
Int_t yon = 0; |
588 |
Int_t xon = 0; |
Int_t xon = 0; |
589 |
Int_t yen = 0; |
Int_t yen = 0; |
590 |
|
Float_t en = 0.; |
591 |
// |
// |
592 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
593 |
yon++; |
yon++; |
594 |
xon++; |
xon++; |
595 |
yen++; |
yen++; |
596 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
597 |
if(en_xep[ipl] > xemax_en) { |
en = fen_xep[ipl]; |
598 |
xemax_en = en_xep[ipl]; |
if ( !fAllpl ) en = en_xep[ipl]; |
599 |
|
if(en > xemax_en) { |
600 |
|
xemax_en = en; |
601 |
fMax_planexe = ipl; |
fMax_planexe = ipl; |
602 |
}; |
}; |
603 |
}; |
}; |
607 |
xon++; |
xon++; |
608 |
yen++; |
yen++; |
609 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
610 |
if(en_yop[ipl] > yomax_en) { |
en = fen_yop[ipl]; |
611 |
yomax_en = en_yop[ipl]; |
if ( !fAllpl ) en = en_yop[ipl]; |
612 |
|
if(en > yomax_en) { |
613 |
|
yomax_en = en; |
614 |
fMax_planeyo = ipl; |
fMax_planeyo = ipl; |
615 |
}; |
}; |
616 |
}; |
}; |
619 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
620 |
yen++; |
yen++; |
621 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
622 |
if(en_xop[ipl] > xomax_en) { |
en = fen_xop[ipl]; |
623 |
xomax_en = en_xop[ipl]; |
if ( !fAllpl ) en = en_xop[ipl]; |
624 |
|
if(en > xomax_en) { |
625 |
|
xomax_en = en; |
626 |
fMax_planexo = ipl; |
fMax_planexo = ipl; |
627 |
}; |
}; |
628 |
}; |
}; |
630 |
// |
// |
631 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
632 |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
for (Int_t ipl =0; ipl < 11; ipl ++) { |
633 |
if(en_yep[ipl] > yemax_en) { |
en = fen_yep[ipl]; |
634 |
yemax_en = en_yep[ipl]; |
if ( !fAllpl ) en = en_yep[ipl]; |
635 |
|
if(en > yemax_en) { |
636 |
|
yemax_en = en; |
637 |
fMax_planeye = ipl; |
fMax_planeye = ipl; |
638 |
}; |
}; |
639 |
}; |
}; |
758 |
// |
// |
759 |
// 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 |
760 |
// |
// |
|
Float_t track_coordx[22][2]; |
|
|
Float_t track_coordy[22][2]; |
|
761 |
// |
// |
762 |
Float_t tgx_cl2; |
Float_t tgx_cl2; |
763 |
Float_t tgy_cl2; |
Float_t tgy_cl2; |
767 |
for (Int_t p=0; p<22; p++){ |
for (Int_t p=0; p<22; p++){ |
768 |
track_coordy[p][1] = cl2->cbar[p][1]; |
track_coordy[p][1] = cl2->cbar[p][1]; |
769 |
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; |
770 |
|
// track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
771 |
track_coordx[p][0] = cl2->cbar[p][0]; |
track_coordx[p][0] = cl2->cbar[p][0]; |
772 |
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; |
773 |
|
// track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
774 |
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]); |
775 |
}; |
}; |
776 |
// |
// |
778 |
// |
// |
779 |
if ( section.Contains("XO") ){ |
if ( section.Contains("XO") ){ |
780 |
// |
// |
781 |
// check event is inside XO acceptance |
// find the column hit in the first plane |
782 |
|
// |
783 |
|
Int_t ix = -1; |
784 |
|
Int_t iy = -1; |
785 |
|
if ( track_coordx[(2*0)+1][1] >= (-12.054+fM) && track_coordx[(2*0)+1][1] <= (-4.246-fM) ) ix = 0; |
786 |
|
if ( track_coordx[(2*0)+1][1] >= ( -4.004+fM) && track_coordx[(2*0)+1][1] <= ( 3.804-fM) ) ix = 1; |
787 |
|
if ( track_coordx[(2*0)+1][1] >= ( 4.046+fM) && track_coordx[(2*0)+1][1] <= (11.854-fM) ) ix = 2; |
788 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo2 - fM1) ) iy = 0; |
789 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo4 - fM1) ) iy = 1; |
790 |
|
if ( cl2->cbar[(2*0)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo6 - fM1) ) iy = 2; |
791 |
|
if ( ix > -1 && iy > -1 ) fColXO = ix + iy*3; |
792 |
|
// |
793 |
|
// check event is inside XO acceptance, if multicol is false (SingleColumn mode) then the track must be contained in a column. |
794 |
// |
// |
795 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
796 |
if |
if (( |
797 |
( |
( track_coordx[(2*i)+1][1] >= (-12.054+fM) && track_coordx[(2*i)+1][1] <= (-4.246-fM) && (ix == 0 || multicol) ) || |
798 |
(((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) ) || |
799 |
(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) ) |
800 |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
) && ( |
801 |
(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) ) || |
802 |
((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) ) || |
803 |
(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) ) |
804 |
((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 )))) |
|
|
){ |
|
805 |
fXosel = true; |
fXosel = true; |
806 |
fXoout = i; |
fXoout = i; |
807 |
} else { |
} else { |
821 |
// 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 |
822 |
// |
// |
823 |
if ( fXosel ){ |
if ( fXosel ){ |
824 |
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++){ |
825 |
fXOen_maxplane += en_xop[iplm]; |
fXOen_maxplane += en_xop[iplm]; |
826 |
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]); |
827 |
}; |
}; |
828 |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
829 |
|
// |
830 |
|
for (Int_t i=0;i<11;i++){ |
831 |
|
for(strip=0; strip<96; strip++) { |
832 |
|
// |
833 |
|
// run over all the strips of the plane |
834 |
|
// |
835 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)+1][strip]; |
836 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)+1][strip]; |
837 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)+1][strip]; |
838 |
|
entot[1] += enstrip[1][(2*i)+1][strip]; |
839 |
|
// |
840 |
|
}; |
841 |
|
}; |
842 |
}; |
}; |
843 |
}; |
}; |
844 |
// |
// |
845 |
if ( section.Contains("XE") ){ |
if ( section.Contains("XE") ){ |
846 |
|
// |
847 |
|
// find the column hit in the first plane |
848 |
|
// |
849 |
|
Int_t ix = -1; |
850 |
|
Int_t iy = -1; |
851 |
|
if ( track_coordx[(2*0)][1] >= (-11.854+fM) && track_coordx[(2*0)][1] <= (-4.046-fM) ) ix = 0; |
852 |
|
if ( track_coordx[(2*0)][1] >= ( -3.804+fM) && track_coordx[(2*0)][1] <= ( 4.004-fM) ) ix = 1; |
853 |
|
if ( track_coordx[(2*0)][1] >= ( 4.246+fM) && track_coordx[(2*0)][1] <= (12.054-fM) ) ix = 2; |
854 |
|
if ( cl2->cbar[(2*0)][1] >= (xe1 + fM1) && cl2->cbar[(2*0)][1] <= (xe2 - fM1) ) iy = 0; |
855 |
|
if ( cl2->cbar[(2*0)][1] >= (xe3 + fM1) && cl2->cbar[(2*0)][1] <= (xe4 - fM1) ) iy = 1; |
856 |
|
if ( cl2->cbar[(2*0)][1] >= (xe5 + fM1) && cl2->cbar[(2*0)][1] <= (xe6 - fM1) ) iy = 2; |
857 |
|
if ( ix > -1 && iy > -1 ) fColXE = ix + iy*3; |
858 |
|
// |
859 |
|
// check event is inside XO acceptance |
860 |
|
// |
861 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
862 |
if |
if (( |
863 |
( |
( track_coordx[(2*i)][1] >= (-11.854+fM) && track_coordx[(2*i)][1] <= (-4.046-fM) && (ix == 0 || multicol) ) || |
864 |
(((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) ) || |
865 |
(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) ) |
866 |
(((cl2->cbar[2*i][1]>=xe1 + fM1)&& |
) && ( |
867 |
(cl2->cbar[2*i][1]<=xe2 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe1 + fM1) && cl2->cbar[(2*i)][1] <= (xe2 - fM1) && (iy == 0 || multicol) ) || |
868 |
((cl2->cbar[2*i][1]>=xe3 + fM1)&& |
( cl2->cbar[(2*i)][1] >= (xe3 + fM1) && cl2->cbar[(2*i)][1] <= (xe4 - fM1) && (iy == 1 || multicol) ) || |
869 |
(cl2->cbar[2*i][1]<=xe4 - fM1 ))|| |
( cl2->cbar[(2*i)][1] >= (xe5 + fM1) && cl2->cbar[(2*i)][1] <= (xe6 - fM1) && (iy == 2 || multicol) ) |
870 |
((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 )))) |
|
|
){ |
|
871 |
fXesel = true; |
fXesel = true; |
872 |
fXeout = i; |
fXeout = i; |
873 |
} else { |
} else { |
875 |
break; |
break; |
876 |
}; |
}; |
877 |
}; |
}; |
878 |
|
// |
879 |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ |
880 |
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)); |
881 |
fPartsel = true; |
fPartsel = true; |
887 |
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]); |
888 |
}; |
}; |
889 |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
890 |
|
// |
891 |
|
for (Int_t i=0;i<11;i++){ |
892 |
|
for(strip=0; strip<96; strip++) { |
893 |
|
// |
894 |
|
// run over all the strips of the plane |
895 |
|
// |
896 |
|
if ( strip >= 0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)][strip]; |
897 |
|
if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)][strip]; |
898 |
|
if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)][strip]; |
899 |
|
entot[1] += enstrip[1][(2*i)][strip]; |
900 |
|
// |
901 |
|
}; |
902 |
|
}; |
903 |
}; |
}; |
904 |
}; |
}; |
905 |
// |
// |
906 |
if ( section.Contains("YE") ){ |
if ( section.Contains("YE") ){ |
907 |
|
// |
908 |
|
// find the column hit in the first plane |
909 |
|
// |
910 |
|
Int_t ix = -1; |
911 |
|
Int_t iy = -1; |
912 |
|
if ( track_coordy[(2*0)+1][0] >= (-12.154+fM) && track_coordy[(2*0)+1][0] <= (-4.346-fM) ) iy = 0; |
913 |
|
if ( track_coordy[(2*0)+1][0] >= ( -4.104+fM) && track_coordy[(2*0)+1][0] <= ( 3.704-fM) ) iy = 1; |
914 |
|
if ( track_coordy[(2*0)+1][0] >= ( 3.946+fM) && track_coordy[(2*0)+1][0] <= (11.754-fM) ) iy = 2; |
915 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye2 - fM1) ) ix = 0; |
916 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye4 - fM1) ) ix = 1; |
917 |
|
if ( cl2->cbar[(2*0)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye6 - fM1) ) ix = 2; |
918 |
|
if ( ix > -1 && iy > -1 ) fColYE = ix + iy*3; |
919 |
|
// |
920 |
|
// check event is inside XO acceptance |
921 |
|
// |
922 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
923 |
if |
if (( |
924 |
( |
( track_coordy[(2*i)+1][0] >= (-12.154+fM) && track_coordy[(2*i)+1][0] <= (-4.346-fM) && (iy == 0 || multicol) ) || |
925 |
(((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) ) || |
926 |
(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) ) |
927 |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
) && ( |
928 |
(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) ) || |
929 |
((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) ) || |
930 |
(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) ) |
931 |
((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 )))) |
|
|
){ |
|
932 |
fYesel = true; |
fYesel = true; |
933 |
fYeout = i; |
fYeout = i; |
934 |
} else { |
} else { |
936 |
break; |
break; |
937 |
}; |
}; |
938 |
}; |
}; |
939 |
|
// |
940 |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ |
941 |
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)); |
942 |
fPartsel = true; |
fPartsel = true; |
945 |
if ( fYesel ){ |
if ( fYesel ){ |
946 |
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]; |
947 |
fEnergyye = fYEen_maxplane/fConv_rye; |
fEnergyye = fYEen_maxplane/fConv_rye; |
948 |
|
// |
949 |
|
for (Int_t i=0;i<11;i++){ |
950 |
|
for(strip=0; strip<96; strip++) { |
951 |
|
// |
952 |
|
// run over all the strips of the plane |
953 |
|
// |
954 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)+1][strip]; |
955 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)+1][strip]; |
956 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)+1][strip]; |
957 |
|
entot[0] += enstrip[0][(2*i)+1][strip]; |
958 |
|
// |
959 |
|
}; |
960 |
|
}; |
961 |
|
// |
962 |
}; |
}; |
963 |
}; |
}; |
964 |
// |
// |
965 |
if ( section.Contains("YO") ){ |
if ( section.Contains("YO") ){ |
966 |
|
// |
967 |
|
// find the column hit in the first plane |
968 |
|
// |
969 |
|
Int_t ix = -1; |
970 |
|
Int_t iy = -1; |
971 |
|
if ( track_coordy[(2*0)][0] >= (-11.954+fM) && track_coordy[(2*0)][0] <= (-4.146-fM) ) iy = 0; |
972 |
|
if ( track_coordy[(2*0)][0] >= ( -3.904+fM) && track_coordy[(2*0)][0] <= ( 3.904-fM) ) iy = 1; |
973 |
|
if ( track_coordy[(2*0)][0] >= ( 4.146+fM) && track_coordy[(2*0)][0] <= (11.954-fM) ) iy = 2; |
974 |
|
if ( cl2->cbar[(2*0)][0] >= (yo1 + fM1) && cl2->cbar[(2*0)][0] <= (yo2 - fM1) ) ix = 0; |
975 |
|
if ( cl2->cbar[(2*0)][0] >= (yo3 + fM1) && cl2->cbar[(2*0)][0] <= (yo4 - fM1) ) ix = 1; |
976 |
|
if ( cl2->cbar[(2*0)][0] >= (yo5 + fM1) && cl2->cbar[(2*0)][0] <= (yo6 - fM1) ) ix = 2; |
977 |
|
if ( ix > -1 && iy > -1 ) fColYO = ix + iy*3; |
978 |
|
// |
979 |
|
// check event is inside XO acceptance |
980 |
|
// |
981 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
982 |
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 (( |
983 |
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) ) || |
984 |
if |
( track_coordy[(2*i)][0] >= ( -3.904+fM) && track_coordy[(2*i)][0] <= ( 3.904-fM) && (iy == 1 || multicol) ) || |
985 |
( |
( track_coordy[(2*i)][0] >= ( 4.146+fM) && track_coordy[(2*i)][0] <= (11.954-fM) && (iy == 2 || multicol) ) |
986 |
(((track_coordy[2*i][0]>=(-11.954+fM))&& |
) && ( |
987 |
(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) ) || |
988 |
(((cl2->cbar[2*i][0]>=yo1 + fM1)&& |
( cl2->cbar[(2*i)][0] >= (yo3 + fM1) && cl2->cbar[(2*i)][0] <= (yo4 - fM1) && (ix == 1 || multicol) ) || |
989 |
(cl2->cbar[2*i][0]<=yo2 - fM1 ))|| |
( cl2->cbar[(2*i)][0] >= (yo5 + fM1) && cl2->cbar[(2*i)][0] <= (yo6 - fM1) && (ix == 2 || multicol) ) |
990 |
((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 )))) |
|
|
){ |
|
991 |
fYosel = true; |
fYosel = true; |
992 |
fYoout = i; |
fYoout = i; |
993 |
} else { |
} else { |
995 |
break; |
break; |
996 |
}; |
}; |
997 |
}; |
}; |
998 |
|
// |
999 |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ |
1000 |
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)); |
1001 |
fPartsel = true; |
fPartsel = true; |
1004 |
if ( fYosel ){ |
if ( fYosel ){ |
1005 |
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]; |
1006 |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
fEnergyyo = fYOen_maxplane/fConv_ryo; |
1007 |
|
// |
1008 |
|
for (Int_t i=0;i<11;i++){ |
1009 |
|
for(strip=0; strip<96; strip++) { |
1010 |
|
// |
1011 |
|
// run over all the strips of the plane |
1012 |
|
// |
1013 |
|
if ( strip >= 0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)][strip]; |
1014 |
|
if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)][strip]; |
1015 |
|
if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)][strip]; |
1016 |
|
entot[0] += enstrip[0][(2*i)][strip]; |
1017 |
|
// |
1018 |
|
}; |
1019 |
|
}; |
1020 |
}; |
}; |
1021 |
}; |
}; |
1022 |
// |
// |
1042 |
fSel = true; |
fSel = true; |
1043 |
}; |
}; |
1044 |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; |
1045 |
|
if ( fSel ){ |
1046 |
|
if ( fXesel ) fColumn = fColXE; |
1047 |
|
if ( fXosel ){ |
1048 |
|
if ( fColXO != fColumn && fColumn > -1 ){ |
1049 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColXO %i \n",fColumn,fColXO); |
1050 |
|
} else { |
1051 |
|
fColumn = fColXO; |
1052 |
|
}; |
1053 |
|
}; |
1054 |
|
if ( fYesel ){ |
1055 |
|
if ( fColYE != fColumn && fColumn > -1 ){ |
1056 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYE %i \n",fColumn,fColYE); |
1057 |
|
} else { |
1058 |
|
fColumn = fColYE; |
1059 |
|
}; |
1060 |
|
}; |
1061 |
|
if ( fYosel ){ |
1062 |
|
if ( fColYO != fColumn && fColumn > -1 ){ |
1063 |
|
printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYO %i \n",fColumn,fColYO); |
1064 |
|
} else { |
1065 |
|
fColumn = fColYO; |
1066 |
|
}; |
1067 |
|
}; |
1068 |
|
}; |
1069 |
}; |
}; |
1070 |
// |
// |
1071 |
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); |