--- calo/flight/CaloEnergy/src/CaloEnergy.cpp 2009/08/11 13:28:27 1.5 +++ calo/flight/CaloEnergy/src/CaloEnergy.cpp 2009/08/17 08:36:29 1.10 @@ -46,6 +46,7 @@ // cp->ForceCaloFit(); // cp->SetDebug(true); // cp->Process(); + if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); } @@ -190,7 +191,8 @@ // // fM = 2. + 0.096; // real position from cbar - fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. + // fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. + fM1 = 2. - 0.122 + 0.096; // due to calculation of xe1 etc. if ( fM1 < 0. ) fM1 = 0.; // CaloStrip *cs = new CaloStrip(fSimu); @@ -377,6 +379,10 @@ printf(" energyxo:.............. %f \n",energyxo); printf(" energyye:.............. %f \n",energyye); printf(" energyyo:.............. %f \n",energyyo); + printf(" fXEen_maxplane:........ %f \n",fXEen_maxplane); + printf(" fXOen_maxplane:........ %f \n",fXOen_maxplane); + printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); + printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); printf(" x0max :.............. %f \n",x0max); printf(" debug :.............. %i \n",debug); @@ -538,38 +544,47 @@ Int_t wpl = (Int_t)roundf(x0max/0.76); Bool_t isY = false; if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; + xomax_en = 0.; + yemax_en = 0.; + xemax_en = 0.; + yomax_en = 0.; + // if ( !(wpl%2) ){ // 0, 2, 4, ... if ( isY ){ - yomax_en = 1000.; - xemax_en = 500.; + if ( section.Contains("YO") ) yomax_en = 1000.; + if ( section.Contains("XE") ) xemax_en = 500.; fMax_planeyo=wpl/2; fMax_planexe=wpl/2; + if ( section.Contains("XO") ) xomax_en = 10.; + if ( section.Contains("YE") ) yemax_en = 5.; } else { - yomax_en = 500.; - xemax_en = 1000.; + if ( section.Contains("YO") ) yomax_en = 500.; + if ( section.Contains("XE") ) xemax_en = 1000.; fMax_planeyo=wpl/2; fMax_planexe=wpl/2; + if ( section.Contains("XO") ) xomax_en = 5.; + if ( section.Contains("YE") ) yemax_en = 10.; }; - xomax_en = 0.; - yemax_en = 0.; } else { // 1, 3, 5, ... if ( isY ){ - yemax_en = 1000.; - xomax_en = 500.; + if ( section.Contains("YE") ) yemax_en = 1000.; + if ( section.Contains("XO") ) xomax_en = 500.; fMax_planeye=(wpl-1)/2; fMax_planexo=(wpl-1)/2; + if ( section.Contains("XE") ) xemax_en = 10.; + if ( section.Contains("YO") ) yomax_en = 5.; } else { - yemax_en = 500.; - xomax_en = 1000.; + if ( section.Contains("YE") ) yemax_en = 500.; + if ( section.Contains("XO") ) xomax_en = 1000.; fMax_planeye=(wpl-1)/2; fMax_planexo=(wpl-1)/2; + if ( section.Contains("XE") ) xemax_en = 5.; + if ( section.Contains("YO") ) yomax_en = 10.; }; - xemax_en = 0.; - yomax_en = 0.; }; - if ( debug ) printf(" x0max %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,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); }; // Int_t nPl = fPl; @@ -712,7 +727,10 @@ // event is contained (or partially contained) hence we can integrate energy up to the maximum and calculate the energy as measured by this section // if ( fXosel ){ - 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++){ + 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]); + }; fEnergyxo = fXOen_maxplane/fConv_rxo; }; }; @@ -761,7 +779,10 @@ fXesel = true; }; if ( fXesel ){ - 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++){ + 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]); + }; fEnergyxe = fXEen_maxplane/fConv_rxe; }; }; @@ -971,7 +992,12 @@ } else { clong->Fit(); }; - fXOen_maxplane = clong->Get_E0(); + if ( clong->GetLowerLimit() != 0. || clong->GetUpperLimit() != 0. ){ + fXOen_maxplane = clong->Get_defE0(); + } else { + fXOen_maxplane = clong->Get_E0(); + }; + fMax_plane = clong->Get_tmax(); fYOen_maxplane = 0.; fYEen_maxplane = 0.; fXEen_maxplane = 0.;