--- calo/flight/CaloEnergy/src/CaloEnergy.cpp 2009/08/20 09:02:13 1.13 +++ calo/flight/CaloEnergy/src/CaloEnergy.cpp 2010/06/30 12:20:09 1.21 @@ -45,6 +45,8 @@ delete clong; clong = new CaloLong(L2); clong->SplitInto(0,22); + // clong->HeavyTail(true); + clong->HeavyTail(false); }; if ( cp ) delete cp; cp = NULL; @@ -61,7 +63,7 @@ // cp->ForceCaloFit(); // cp->SetDebug(true); // cp->Process(); - if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); + if ( clong ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); } @@ -70,8 +72,10 @@ fLong = true; if ( !clong ){ clong = new CaloLong(L2); - if ( cp ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); + if ( cp ) clong->SetCaloLevel2Pointer(cp->GetCaloLevel2Pointer()); clong->SplitInto(0,22); + // clong->HeavyTail(true); + clong->HeavyTail(false); }; // } @@ -91,6 +95,7 @@ asntr = "start"; // debug = false; + usepl18x = false; // indep = false; // @@ -118,6 +123,8 @@ fYomin = 1000; fYemin = 1000; // + this->UseCaloPreSampler(); // use it by default, to go back to "standard" mode use CaloEnergy::UseLevel2(). + // } void CaloEnergy::DefineGeometry(){ // @@ -272,6 +279,8 @@ entot[0] = 0.; entot[1] = 0.; // + X0pl = 0.76; + // } void CaloEnergy::Print(){ @@ -328,6 +337,7 @@ printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); printf(" x0max :.............. %f \n",x0max); + printf(" X0pl :.............. %f \n",X0pl); printf(" debug :.............. %i \n",debug); printf("========================================================================\n"); @@ -521,11 +531,22 @@ // for (Int_t ch=0; ch< L2->GetCaloLevel1()->istrip; ch++){ en = L2->GetCaloLevel1()->DecodeEstrip(ch,view,plane,strip); + // + if ( !usepl18x && view==0 && plane==18 ) en = 0.; + // enstrip[view][plane][strip]=en; }; // 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)); // + // inclination factor (stolen from Daniele's code) + // + Float_t ytgx = 0; + Float_t ytgy = 0; + ytgx = 0.76 * cl2->tanx[0]; + ytgy = 0.76 * cl2->tany[0]; + X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); + // // sum energy plane by plane for each sections // Float_t fen_xep[11]; @@ -641,9 +662,11 @@ // if ( x0max > 0. ){ if ( debug ) printf(" CALCULATE MAX PLANE GIVEN X0 ASSUMING PERPENDICULAR TRACK \n"); - Int_t wpl = (Int_t)roundf(x0max/0.76); + // Int_t wpl = (Int_t)roundf(x0max/0.76); + Int_t wpl = (Int_t)roundf(x0max/X0pl); Bool_t isY = false; - if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; + // if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; + if ( ((x0max/X0pl)-(Float_t)wpl) > 0. ) isY = true; xomax_en = 0.; yemax_en = 0.; xemax_en = 0.; @@ -684,7 +707,8 @@ if ( section.Contains("YO") ) yomax_en = 10.; }; }; - 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); + // 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); + if ( debug ) printf(" x0max %f x0max/X0pl %f X0pl %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/X0pl),X0pl,wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo); }; // Int_t nPl = fPl; @@ -1116,7 +1140,7 @@ // // check if the cylinder of integration can go out of the sensor given the frame which has been set (if we use all the calorimeter fRad is < 0 and the printout is suppressed) // - 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.000000001 ) 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 ( fLong ){ if ( debug ) printf(" ==================================================================> LONGITUDINAL FIT! \n");