190 |
// 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 |
191 |
// |
// |
192 |
// |
// |
193 |
fM = 2. + 0.096; // real position from cbar |
// fM = 2. + 0.096; // real position from cbar BUG the 0.096 is already taken into account in the border calculation made by Giovanna |
194 |
fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. |
fM = 2. ; // real position from cbar |
195 |
|
// 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 |
196 |
|
fM1 = 2. - 0.122 - 0.096 + 0.096; // due to calculation of xe1 etc. |
197 |
if ( fM1 < 0. ) fM1 = 0.; |
if ( fM1 < 0. ) fM1 = 0.; |
198 |
// |
// |
199 |
CaloStrip *cs = new CaloStrip(fSimu); |
CaloStrip *cs = new CaloStrip(fSimu); |
218 |
cs->Set(1,0,95); |
cs->Set(1,0,95); |
219 |
xe6= cs->GetY(); |
xe6= cs->GetY(); |
220 |
|
|
221 |
|
// printf(" xe1 %f xe2 %f xe3 %f xe4 %f xe5 %f xe6 %f \n",xe1,xe2,xe3,xe4,xe5,xe6); |
222 |
|
|
223 |
// view x plane 0 strip 0 |
// view x plane 0 strip 0 |
224 |
cs->Set(0,0,0); |
cs->Set(0,0,0); |
225 |
yo1= cs->GetX(); |
yo1= cs->GetX(); |
240 |
cs->Set(0,0,95); |
cs->Set(0,0,95); |
241 |
yo6= cs->GetX(); |
yo6= cs->GetX(); |
242 |
|
|
|
|
|
243 |
// view y plane 1 strip 0 |
// view y plane 1 strip 0 |
244 |
cs->Set(1,1,0); |
cs->Set(1,1,0); |
245 |
xo1= cs->GetY(); |
xo1= cs->GetY(); |
280 |
cs->Set(0,1,95); |
cs->Set(0,1,95); |
281 |
ye6= cs->GetX(); |
ye6= cs->GetX(); |
282 |
|
|
283 |
|
//printf(" ye1 %f ye2 %f ye3 %f ye4 %f ye5 %f ye6 %f \n",ye1,ye2,ye3,ye4,ye5,ye6); |
284 |
|
|
285 |
// |
// |
286 |
for (Int_t p = 0; p<22; p ++){ |
for (Int_t p = 0; p<22; p ++){ |
287 |
for (Int_t v = 0; v<2; v++ ){ |
for (Int_t v = 0; v<2; v++ ){ |
320 |
yomax_en= 0.; |
yomax_en= 0.; |
321 |
yemax_en= 0.; |
yemax_en= 0.; |
322 |
// |
// |
323 |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
324 |
en = 0.; |
en = 0.; |
325 |
view = 0; |
view = 0; |
326 |
plane = 0; |
plane = 0; |
463 |
enstrip[view][plane][strip]=en; |
enstrip[view][plane][strip]=en; |
464 |
}; |
}; |
465 |
// |
// |
466 |
|
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)); |
467 |
|
// |
468 |
// sum energy plane by plane for each sections |
// sum energy plane by plane for each sections |
469 |
// |
// |
470 |
for (Int_t i=0;i<11;i++){ |
for (Int_t i=0;i<11;i++){ |
471 |
for(strip=0; strip<96; strip++) { |
for(strip=0; strip<96; strip++) { |
472 |
if ( fRad < 0 ){ |
if ( fRad < 0 ){ |
473 |
// |
// |
474 |
// run over all the strips of the plane |
// run over all the strips of the plane |
475 |
// |
// |
476 |
en_xep[i] += enstrip[1][2*i][strip]; |
en_xep[i] += enstrip[1][2*i][strip]; |
477 |
en_yop[i] += enstrip[0][2*i][strip]; |
en_yop[i] += enstrip[0][2*i][strip]; |
481 |
// |
// |
482 |
// use only the strips inside a cylinder of given radius fRad |
// use only the strips inside a cylinder of given radius fRad |
483 |
// |
// |
484 |
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 && (strip >= (cl2->cibar[2*i][1]-1-fRad)) && (strip <= (cl2->cibar[2*i][1]-1+fRad)) ) en_xep[i] += enstrip[1][2*i][strip]; |
485 |
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]; |
if ( cl2->cibar[2*i][0] >= 1 && cl2->cibar[2*i][0] <= 96 && (strip >= (cl2->cibar[2*i][0]-1-fRad)) && (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip]; |
486 |
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]; |
if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 && (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]; |
487 |
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)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 && (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]; |
488 |
}; |
}; |
489 |
}; |
}; |
490 |
energyxe += en_xep[i]; |
energyxe += en_xep[i]; |
662 |
// |
// |
663 |
// 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 |
664 |
// |
// |
|
Float_t track_coordx[22][2]; |
|
|
Float_t track_coordy[22][2]; |
|
665 |
// |
// |
666 |
Float_t tgx_cl2; |
Float_t tgx_cl2; |
667 |
Float_t tgy_cl2; |
Float_t tgy_cl2; |
671 |
for (Int_t p=0; p<22; p++){ |
for (Int_t p=0; p<22; p++){ |
672 |
track_coordy[p][1] = cl2->cbar[p][1]; |
track_coordy[p][1] = cl2->cbar[p][1]; |
673 |
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; |
674 |
|
// track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; |
675 |
track_coordx[p][0] = cl2->cbar[p][0]; |
track_coordx[p][0] = cl2->cbar[p][0]; |
676 |
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; |
677 |
|
// track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; |
678 |
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]); |
679 |
}; |
}; |
680 |
// |
// |
1003 |
} else { |
} else { |
1004 |
fXOen_maxplane = clong->Get_E0(); |
fXOen_maxplane = clong->Get_E0(); |
1005 |
}; |
}; |
1006 |
|
fMax_plane = clong->Get_tmax(); |
1007 |
fYOen_maxplane = 0.; |
fYOen_maxplane = 0.; |
1008 |
fYEen_maxplane = 0.; |
fYEen_maxplane = 0.; |
1009 |
fXEen_maxplane = 0.; |
fXEen_maxplane = 0.; |