--- calo/flight/CaloEnergy/src/CaloEnergy.cpp 2009/08/11 13:28:27 1.5 +++ calo/flight/CaloEnergy/src/CaloEnergy.cpp 2009/08/12 14:54:52 1.8 @@ -46,6 +46,7 @@ // cp->ForceCaloFit(); // cp->SetDebug(true); // cp->Process(); + if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); } @@ -538,38 +539,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; @@ -971,7 +981,11 @@ } 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(); + }; fYOen_maxplane = 0.; fYEen_maxplane = 0.; fXEen_maxplane = 0.;