39 |
// |
// |
40 |
// 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 |
41 |
// |
// |
42 |
cp = new CaloPreSampler(L2); |
if ( !cp ) cp = new CaloPreSampler(L2); |
43 |
cp->SplitInto(0,22); |
cp->SplitInto(0,22); |
44 |
cp->SetForceFitMode(1000); |
cp->SetForceFitMode(1000); |
45 |
// cp->UseTracker(false); |
// cp->UseTracker(false); |
46 |
// cp->ForceCaloFit(); |
// cp->ForceCaloFit(); |
47 |
// cp->SetDebug(true); |
// cp->SetDebug(true); |
48 |
// cp->Process(); |
// cp->Process(); |
49 |
|
if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
void CaloEnergy::UseLongFit(){ |
54 |
|
fPl = 0; |
55 |
|
fLong = true; |
56 |
|
if ( !clong ){ |
57 |
|
clong = new CaloLong(L2); |
58 |
|
if ( cp ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); |
59 |
|
clong->SplitInto(0,22); |
60 |
|
}; |
61 |
|
// |
62 |
} |
} |
63 |
|
|
64 |
void CaloEnergy::Set(){ |
void CaloEnergy::Set(){ |
83 |
fPl = 1; |
fPl = 1; |
84 |
fRad = -1; |
fRad = -1; |
85 |
cp = NULL; |
cp = NULL; |
86 |
|
clong = NULL; |
87 |
|
x0max = -1.; |
88 |
// |
// |
89 |
this->DefineGeometry(); |
this->DefineGeometry(); |
90 |
fXosel =true; |
fXosel =true; |
154 |
return(-1); |
return(-1); |
155 |
} |
} |
156 |
|
|
157 |
|
Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ |
158 |
|
section.ToUpper(); |
159 |
|
if ( section.Contains("XO") ) return xomax_en; |
160 |
|
if ( section.Contains("XE") ) return xemax_en; |
161 |
|
if ( section.Contains("YO") ) return yomax_en; |
162 |
|
if ( section.Contains("YE") ) return yemax_en; |
163 |
|
return(-1); |
164 |
|
} |
165 |
|
|
166 |
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
Float_t CaloEnergy::GetMaxEnergy(TString section){ |
167 |
section.ToUpper(); |
section.ToUpper(); |
168 |
if ( section.Contains("XO") ) return fXOen_maxplane; |
if ( fLong ){ |
169 |
if ( section.Contains("XE") ) return fXEen_maxplane; |
this->Process(section); |
170 |
if ( section.Contains("YO") ) return fYOen_maxplane; |
return fXOen_maxplane; |
171 |
if ( section.Contains("YE") ) return fYEen_maxplane; |
} else { |
172 |
|
if ( section.Contains("XO") ) return fXOen_maxplane; |
173 |
|
if ( section.Contains("XE") ) return fXEen_maxplane; |
174 |
|
if ( section.Contains("YO") ) return fYOen_maxplane; |
175 |
|
if ( section.Contains("YE") ) return fYEen_maxplane; |
176 |
|
}; |
177 |
return(-1); |
return(-1); |
178 |
} |
} |
179 |
|
|
180 |
|
Float_t CaloEnergy::GetMaxEnergy(){ |
181 |
|
if ( fLong ){ |
182 |
|
if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); |
183 |
|
this->Process(asntr); |
184 |
|
}; |
185 |
|
return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); |
186 |
|
} |
187 |
|
|
188 |
void CaloEnergy::DefineGeometry(){ |
void CaloEnergy::DefineGeometry(){ |
189 |
// |
// |
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 |
309 |
fMax_planexo = 0; |
fMax_planexo = 0; |
310 |
fMax_planexe = 0; |
fMax_planexe = 0; |
311 |
fMax_planeyo = 0; |
fMax_planeyo = 0; |
312 |
fMax_planeye = 0; |
fMax_planeye = 0; |
313 |
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
xomax_en= 0.; |
314 |
|
xemax_en= 0.; |
315 |
|
yomax_en= 0.; |
316 |
|
yemax_en= 0.; |
317 |
|
// |
318 |
|
memset(enstrip,0,2*22*96*(sizeof(Float_t))); |
319 |
en = 0.; |
en = 0.; |
320 |
view = 0; |
view = 0; |
321 |
plane = 0; |
plane = 0; |
378 |
printf(" energyxo:.............. %f \n",energyxo); |
printf(" energyxo:.............. %f \n",energyxo); |
379 |
printf(" energyye:.............. %f \n",energyye); |
printf(" energyye:.............. %f \n",energyye); |
380 |
printf(" energyyo:.............. %f \n",energyyo); |
printf(" energyyo:.............. %f \n",energyyo); |
381 |
|
printf(" fXEen_maxplane:........ %f \n",fXEen_maxplane); |
382 |
|
printf(" fXOen_maxplane:........ %f \n",fXOen_maxplane); |
383 |
|
printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); |
384 |
|
printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); |
385 |
|
printf(" x0max :.............. %f \n",x0max); |
386 |
printf(" debug :.............. %i \n",debug); |
printf(" debug :.............. %i \n",debug); |
387 |
|
|
388 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
468 |
// |
// |
469 |
en_xep[i] += enstrip[1][2*i][strip]; |
en_xep[i] += enstrip[1][2*i][strip]; |
470 |
en_yop[i] += enstrip[0][2*i][strip]; |
en_yop[i] += enstrip[0][2*i][strip]; |
471 |
en_xop[i] += enstrip[1][2*i+1][strip]; |
en_xop[i] += enstrip[1][(2*i)+1][strip]; |
472 |
en_yep[i] += enstrip[0][2*i+1][strip]; |
en_yep[i] += enstrip[0][(2*i)+1][strip]; |
473 |
} else { |
} else { |
474 |
// |
// |
475 |
// use only the strips inside a cylinder of given radius fRad |
// use only the strips inside a cylinder of given radius fRad |
476 |
// |
// |
477 |
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 ( strip >= cl2->cibar[2*i][1]-1-fRad && strip <= cl2->cibar[2*i][1]-1+fRad ) en_xep[i] += enstrip[1][2*i][strip]; |
478 |
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 ( strip >= cl2->cibar[2*i][0]-1-fRad && strip <= cl2->cibar[2*i][0]-1+fRad ) en_yop[i] += enstrip[0][2*i][strip]; |
479 |
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 ( 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]; |
480 |
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 ( 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]; |
481 |
}; |
}; |
482 |
}; |
}; |
483 |
energyxe += en_xep[i]; |
energyxe += en_xep[i]; |
488 |
// |
// |
489 |
// Find the plane of maximum for each section |
// Find the plane of maximum for each section |
490 |
// |
// |
|
Float_t xomax_en= 0.; |
|
|
Float_t xemax_en= 0.; |
|
|
Float_t yomax_en= 0.; |
|
|
Float_t yemax_en= 0.; |
|
|
// |
|
491 |
// |
// |
492 |
Int_t xen = 0; |
Int_t xen = 0; |
493 |
Int_t yon = 0; |
Int_t yon = 0; |
536 |
}; |
}; |
537 |
}; |
}; |
538 |
// |
// |
539 |
|
// the maximum is given externally as X0, convert it to plane and section |
540 |
|
// |
541 |
|
if ( x0max > 0. ){ |
542 |
|
if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); |
543 |
|
Int_t wpl = (Int_t)roundf(x0max/0.76); |
544 |
|
Bool_t isY = false; |
545 |
|
if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; |
546 |
|
xomax_en = 0.; |
547 |
|
yemax_en = 0.; |
548 |
|
xemax_en = 0.; |
549 |
|
yomax_en = 0.; |
550 |
|
// |
551 |
|
if ( !(wpl%2) ){ |
552 |
|
// 0, 2, 4, ... |
553 |
|
if ( isY ){ |
554 |
|
if ( section.Contains("YO") ) yomax_en = 1000.; |
555 |
|
if ( section.Contains("XE") ) xemax_en = 500.; |
556 |
|
fMax_planeyo=wpl/2; |
557 |
|
fMax_planexe=wpl/2; |
558 |
|
if ( section.Contains("XO") ) xomax_en = 10.; |
559 |
|
if ( section.Contains("YE") ) yemax_en = 5.; |
560 |
|
} else { |
561 |
|
if ( section.Contains("YO") ) yomax_en = 500.; |
562 |
|
if ( section.Contains("XE") ) xemax_en = 1000.; |
563 |
|
fMax_planeyo=wpl/2; |
564 |
|
fMax_planexe=wpl/2; |
565 |
|
if ( section.Contains("XO") ) xomax_en = 5.; |
566 |
|
if ( section.Contains("YE") ) yemax_en = 10.; |
567 |
|
}; |
568 |
|
} else { |
569 |
|
// 1, 3, 5, ... |
570 |
|
if ( isY ){ |
571 |
|
if ( section.Contains("YE") ) yemax_en = 1000.; |
572 |
|
if ( section.Contains("XO") ) xomax_en = 500.; |
573 |
|
fMax_planeye=(wpl-1)/2; |
574 |
|
fMax_planexo=(wpl-1)/2; |
575 |
|
if ( section.Contains("XE") ) xemax_en = 10.; |
576 |
|
if ( section.Contains("YO") ) yomax_en = 5.; |
577 |
|
} else { |
578 |
|
if ( section.Contains("YE") ) yemax_en = 500.; |
579 |
|
if ( section.Contains("XO") ) xomax_en = 1000.; |
580 |
|
fMax_planeye=(wpl-1)/2; |
581 |
|
fMax_planexo=(wpl-1)/2; |
582 |
|
if ( section.Contains("XE") ) xemax_en = 5.; |
583 |
|
if ( section.Contains("YO") ) yomax_en = 10.; |
584 |
|
}; |
585 |
|
}; |
586 |
|
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); |
587 |
|
}; |
588 |
|
// |
589 |
Int_t nPl = fPl; |
Int_t nPl = fPl; |
590 |
// |
// |
591 |
// Set the maximum in case of coherent mode was selected |
// Set the maximum in case of coherent mode was selected |
680 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
681 |
if |
if |
682 |
( |
( |
683 |
(((track_coordx[2*i+1][1]>=(-12.054+fM))&& |
(((track_coordx[(2*i)+1][1]>=(-12.054+fM))&& |
684 |
(track_coordx[2*i+1][1]<=(-4.246-fM)))&& |
(track_coordx[(2*i)+1][1]<=(-4.246-fM)))&& |
685 |
(((cl2->cbar[2*i+1][1]>=xo1 + fM1)&& |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
686 |
(cl2->cbar[2*i+1][1]<=xo2 - fM1 ))|| |
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| |
687 |
((cl2->cbar[2*i+1][1]>=xo3 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
688 |
(cl2->cbar[2*i+1][1]<=xo4 - fM1 ))|| |
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| |
689 |
((cl2->cbar[2*i+1][1]>=xo5 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
690 |
(cl2->cbar[2*i+1][1]<=xo6 - fM1 ))))|| |
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| |
691 |
|
|
692 |
(((track_coordx[2*i+1][1]>=(-4.004+fM))&& |
(((track_coordx[(2*i)+1][1]>=(-4.004+fM))&& |
693 |
(track_coordx[2*i+1][1]<=(3.804-fM)))&& |
(track_coordx[(2*i)+1][1]<=(3.804-fM)))&& |
694 |
(((cl2->cbar[2*i+1][1]>=xo1 + fM1)&& |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
695 |
(cl2->cbar[2*i+1][1]<=xo2 - fM1 ))|| |
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| |
696 |
((cl2->cbar[2*i+1][1]>=xo3 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
697 |
(cl2->cbar[2*i+1][1]<=xo4 - fM1))|| |
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1))|| |
698 |
((cl2->cbar[2*i+1][1]>=xo5 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
699 |
(cl2->cbar[2*i+1][1]<=xo6 - fM1 ))))|| |
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| |
700 |
|
|
701 |
(((track_coordx[2*i+1][1]>=(4.046+fM))&& |
(((track_coordx[(2*i)+1][1]>=(4.046+fM))&& |
702 |
(track_coordx[2*i+1][1]<=(11.854-fM)))&& |
(track_coordx[(2*i)+1][1]<=(11.854-fM)))&& |
703 |
(((cl2->cbar[2*i+1][1]>=xo1 + fM1)&& |
(((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& |
704 |
(cl2->cbar[2*i+1][1]<=xo2 - fM1))|| |
(cl2->cbar[(2*i)+1][1]<=xo2 - fM1))|| |
705 |
((cl2->cbar[2*i+1][1]>=xo3 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& |
706 |
(cl2->cbar[2*i+1][1]<=xo4 - fM1 ))|| |
(cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| |
707 |
((cl2->cbar[2*i+1][1]>=xo5 + fM1)&& |
((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& |
708 |
(cl2->cbar[2*i+1][1]<=xo6 - fM1 )))) |
(cl2->cbar[(2*i)+1][1]<=xo6 - fM1 )))) |
709 |
){ |
){ |
710 |
fXosel = true; |
fXosel = true; |
711 |
fXoout = i; |
fXoout = i; |
726 |
// 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 |
727 |
// |
// |
728 |
if ( fXosel ){ |
if ( fXosel ){ |
729 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++) fXOen_maxplane += en_xop[iplm]; |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++){ |
730 |
|
fXOen_maxplane += en_xop[iplm]; |
731 |
|
if ( debug ) printf(" XO iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]); |
732 |
|
}; |
733 |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
fEnergyxo = fXOen_maxplane/fConv_rxo; |
734 |
}; |
}; |
735 |
}; |
}; |
778 |
fXesel = true; |
fXesel = true; |
779 |
}; |
}; |
780 |
if ( fXesel ){ |
if ( fXesel ){ |
781 |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++) fXEen_maxplane += en_xep[iplm]; |
for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++){ |
782 |
|
fXEen_maxplane += en_xep[iplm]; |
783 |
|
if ( debug ) printf(" XE iplm %i fXOen_maxplane %f en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]); |
784 |
|
}; |
785 |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
fEnergyxe = fXEen_maxplane/fConv_rxe; |
786 |
}; |
}; |
787 |
}; |
}; |
790 |
for (Int_t i=0; i<11; i++) { |
for (Int_t i=0; i<11; i++) { |
791 |
if |
if |
792 |
( |
( |
793 |
(((track_coordy[2*i+1][0]>=(-12.154+fM))&& |
(((track_coordy[(2*i)+1][0]>=(-12.154+fM))&& |
794 |
(track_coordy[2*i+1][0]<=(-4.346-fM)))&& |
(track_coordy[(2*i)+1][0]<=(-4.346-fM)))&& |
795 |
(((cl2->cbar[2*i+1][0]>=ye1 + fM1)&& |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
796 |
(cl2->cbar[2*i+1][0]<=ye2 - fM1 ))|| |
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| |
797 |
((cl2->cbar[2*i+1][0]>=ye3 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
798 |
(cl2->cbar[2*i+1][0]<=ye4 - fM1 ))|| |
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| |
799 |
((cl2->cbar[2*i+1][0]>=ye5 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
800 |
(cl2->cbar[2*i+1][0]<=ye6 - fM1 ))))|| |
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| |
801 |
|
|
802 |
(((track_coordy[2*i+1][0]>=(-4.104+fM))&& |
(((track_coordy[(2*i)+1][0]>=(-4.104+fM))&& |
803 |
(track_coordy[2*i+1][0]<=(3.704-fM)))&& |
(track_coordy[(2*i)+1][0]<=(3.704-fM)))&& |
804 |
(((cl2->cbar[2*i+1][0]>=ye1 + fM1)&& |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
805 |
(cl2->cbar[2*i+1][0]<=ye2 - fM1 ))|| |
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| |
806 |
((cl2->cbar[2*i+1][0]>=ye3 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
807 |
(cl2->cbar[2*i+1][0]<=ye4 - fM1))|| |
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1))|| |
808 |
((cl2->cbar[2*i+1][0]>=ye5 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
809 |
(cl2->cbar[2*i+1][0]<=ye6 - fM1 ))))|| |
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| |
810 |
|
|
811 |
(((track_coordy[2*i+1][0]>=(3.946+fM))&& |
(((track_coordy[(2*i)+1][0]>=(3.946+fM))&& |
812 |
(track_coordy[2*i+1][0]<=(11.754-fM)))&& |
(track_coordy[(2*i)+1][0]<=(11.754-fM)))&& |
813 |
(((cl2->cbar[2*i+1][0]>=ye1 + fM1)&& |
(((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& |
814 |
(cl2->cbar[2*i+1][0]<=ye2 - fM1))|| |
(cl2->cbar[(2*i)+1][0]<=ye2 - fM1))|| |
815 |
((cl2->cbar[2*i+1][0]>=ye3 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& |
816 |
(cl2->cbar[2*i+1][0]<=ye4 - fM1 ))|| |
(cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| |
817 |
((cl2->cbar[2*i+1][0]>=ye5 + fM1)&& |
((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& |
818 |
(cl2->cbar[2*i+1][0]<=ye6 - fM1 )))) |
(cl2->cbar[(2*i)+1][0]<=ye6 - fM1 )))) |
819 |
){ |
){ |
820 |
fYesel = true; |
fYesel = true; |
821 |
fYeout = i; |
fYeout = i; |
889 |
// Count the number of sections in which the event is contained |
// Count the number of sections in which the event is contained |
890 |
// |
// |
891 |
fCount = (Float_t)((Int_t)fXesel+(Int_t)fXosel+(Int_t)fYesel+(Int_t)fYosel); |
fCount = (Float_t)((Int_t)fXesel+(Int_t)fXosel+(Int_t)fYesel+(Int_t)fYosel); |
|
if ( debug ) printf(" IsInside XE %i XO %i YE %i YO %i => SEL %i \n",fXesel,fXosel,fYesel,fYosel,fSel); |
|
892 |
// |
// |
893 |
if ( indep ){ |
if ( indep ){ |
894 |
// |
// |
911 |
}; |
}; |
912 |
// |
// |
913 |
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); |
914 |
|
if ( debug ) printf(" IsInside XE %i XO %i YE %i YO %i => SEL %i \n",fXesel,fXosel,fYesel,fYosel,fSel); |
915 |
// |
// |
916 |
// finish exit |
// finish exit |
917 |
// |
// |
963 |
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0. ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad)); |
if ( (fM1+0.122-0.244*(Float_t)fRad) < 0. ) 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)); |
964 |
// |
// |
965 |
if ( fLong ){ |
if ( fLong ){ |
966 |
|
if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n"); |
967 |
// |
// |
968 |
// use long fit to measure energy NOT IMPLEMENTED YET |
// use long fit to measure energy |
969 |
|
// |
970 |
|
if ( this->IsInsideAcceptance(section) ){ |
971 |
|
// |
972 |
|
if ( debug ) printf(" ==================================================================> LONG INSIDE! \n"); |
973 |
|
// |
974 |
|
Float_t myene[2][22]; |
975 |
|
memset(myene,0,(sizeof(Float_t))*2*22); |
976 |
|
for (Int_t j=0; j<11; j++){ |
977 |
|
if ( section.Contains("XE") ) myene[1][2*j] = en_xep[j]; |
978 |
|
if ( section.Contains("YO") ) myene[0][2*j] = en_yop[j]; |
979 |
|
if ( section.Contains("XO") ) myene[1][(2*j)+1] = en_xop[j]; |
980 |
|
if ( section.Contains("YE") ) myene[0][(2*j)+1] = en_yep[j]; |
981 |
|
}; |
982 |
|
clong->UnMaskSections(); |
983 |
|
if ( !(section.Contains("YE")) ) clong->MaskSection("YE"); |
984 |
|
if ( !(section.Contains("YO")) ) clong->MaskSection("YO"); |
985 |
|
if ( !(section.Contains("XO")) ) clong->MaskSection("XO"); |
986 |
|
if ( !(section.Contains("XE")) ) clong->MaskSection("XE"); |
987 |
|
clong->ForceNextFit(); |
988 |
|
clong->SetEnergies(myene); |
989 |
|
if ( debug ){ |
990 |
|
clong->Fit(true); |
991 |
|
} else { |
992 |
|
clong->Fit(); |
993 |
|
}; |
994 |
|
if ( clong->GetLowerLimit() != 0. || clong->GetUpperLimit() != 0. ){ |
995 |
|
fXOen_maxplane = clong->Get_defE0(); |
996 |
|
} else { |
997 |
|
fXOen_maxplane = clong->Get_E0(); |
998 |
|
}; |
999 |
|
fYOen_maxplane = 0.; |
1000 |
|
fYEen_maxplane = 0.; |
1001 |
|
fXEen_maxplane = 0.; |
1002 |
|
fEnergy=fXOen_maxplane/fConv_rxo; |
1003 |
|
if ( fEnergy != fEnergy || clong->Get_fitresult() != 0 ) fEnergy = -1.; |
1004 |
|
// if ( fEnergy != fEnergy ) fEnergy = 1.; |
1005 |
|
// |
1006 |
|
} else { |
1007 |
|
// |
1008 |
|
// if the event is not in the acceptance, return a negative energy. |
1009 |
|
// |
1010 |
|
if ( debug ) printf(" Outside acceptance \n"); |
1011 |
|
fEnergy *= -1.; |
1012 |
|
// |
1013 |
|
}; |
1014 |
// |
// |
1015 |
} else { |
} else { |
1016 |
// |
// |