| 35 | 
   // | 
   // | 
| 36 | 
 } | 
 } | 
| 37 | 
  | 
  | 
| 38 | 
  | 
 void CaloEnergy::Delete(){ | 
| 39 | 
  | 
   Clear(); | 
| 40 | 
  | 
   delete this; | 
| 41 | 
  | 
 } | 
| 42 | 
  | 
  | 
| 43 | 
  | 
 void CaloEnergy::UseLevel2(){ | 
| 44 | 
  | 
   if ( clong ){ | 
| 45 | 
  | 
     delete clong; | 
| 46 | 
  | 
     clong = new CaloLong(L2); | 
| 47 | 
  | 
     clong->SplitInto(0,22); | 
| 48 | 
  | 
   }; | 
| 49 | 
  | 
   if ( cp ) delete cp; | 
| 50 | 
  | 
   cp = NULL; | 
| 51 | 
  | 
 } | 
| 52 | 
  | 
  | 
| 53 | 
 void CaloEnergy::UseCaloPreSampler(){ | 
 void CaloEnergy::UseCaloPreSampler(){ | 
| 54 | 
   // | 
   // | 
| 55 | 
   // 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 | 
| 61 | 
 //   cp->ForceCaloFit(); | 
 //   cp->ForceCaloFit(); | 
| 62 | 
 //   cp->SetDebug(true); | 
 //   cp->SetDebug(true); | 
| 63 | 
 //   cp->Process(); | 
 //   cp->Process(); | 
| 64 | 
  | 
   if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer()); | 
| 65 | 
 } | 
 } | 
| 66 | 
  | 
  | 
| 67 | 
  | 
  | 
| 94 | 
   // | 
   // | 
| 95 | 
   indep = false; | 
   indep = false; | 
| 96 | 
   // | 
   // | 
| 97 | 
  | 
   fAllpl = true; | 
| 98 | 
   fLong = false; | 
   fLong = false; | 
| 99 | 
   fPl = 1; | 
   fPl = 1; | 
| 100 | 
   fRad = -1; | 
   fRad = -1; | 
| 102 | 
   clong = NULL; | 
   clong = NULL; | 
| 103 | 
   x0max = -1.; | 
   x0max = -1.; | 
| 104 | 
   // | 
   // | 
| 105 | 
  | 
   multicol = false; | 
| 106 | 
  | 
   // | 
| 107 | 
   this->DefineGeometry(); | 
   this->DefineGeometry(); | 
| 108 | 
   fXosel =true; | 
   fXosel =true; | 
| 109 | 
   fXesel = true; | 
   fXesel = true; | 
| 117 | 
   fXemin = 1000; | 
   fXemin = 1000; | 
| 118 | 
   fYomin = 1000; | 
   fYomin = 1000; | 
| 119 | 
   fYemin = 1000; | 
   fYemin = 1000; | 
| 120 | 
  | 
   // | 
| 121 | 
 } | 
 } | 
 | 
  | 
  | 
 | 
 void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) fXomin = plane; | 
  | 
 | 
   if ( section.Contains("XE") ) fXemin = plane; | 
  | 
 | 
   if ( section.Contains("YO") ) fYomin = plane; | 
  | 
 | 
   if ( section.Contains("YE") ) fYemin = plane; | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 void CaloEnergy::SetMinimumContainment(Int_t plane){ | 
  | 
 | 
   this->SetMinimumContainment("XEXOYEYO",plane); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Int_t CaloEnergy::GetMinimumContainment(TString section){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) return(fXomin); | 
  | 
 | 
   if ( section.Contains("XE") ) return(fXemin); | 
  | 
 | 
   if ( section.Contains("YE") ) return(fYemin); | 
  | 
 | 
   if ( section.Contains("YO") ) return(fYomin); | 
  | 
 | 
   printf(" ERROR: section not recognized \n"); | 
  | 
 | 
   return(-1000); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) fConv_rxo = conv; | 
  | 
 | 
   if ( section.Contains("XE") ) fConv_rxe = conv; | 
  | 
 | 
   if ( section.Contains("YO") ) fConv_ryo = conv; | 
  | 
 | 
   if ( section.Contains("YE") ) fConv_rye = conv; | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 void CaloEnergy::SetConversionFactor(Float_t conv){ | 
  | 
 | 
   this->SetConversionFactor("XEXOYEYO",conv); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Float_t CaloEnergy::GetConversionFactor(TString section){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) return(fConv_rxo); | 
  | 
 | 
   if ( section.Contains("XE") ) return(fConv_rxe); | 
  | 
 | 
   if ( section.Contains("YO") ) return(fConv_ryo); | 
  | 
 | 
   if ( section.Contains("YE") ) return(fConv_rye); | 
  | 
 | 
   printf(" ERROR: section not recognized \n"); | 
  | 
 | 
   return(-1000.); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Int_t CaloEnergy::GetMaxplane(TString section){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) return fMax_planexo; | 
  | 
 | 
   if ( section.Contains("XE") ) return fMax_planexe; | 
  | 
 | 
   if ( section.Contains("YO") ) return fMax_planeyo; | 
  | 
 | 
   if ( section.Contains("YE") ) return fMax_planeye; | 
  | 
 | 
   return(-1); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( section.Contains("XO") ) return xomax_en; | 
  | 
 | 
   if ( section.Contains("XE") ) return xemax_en; | 
  | 
 | 
   if ( section.Contains("YO") ) return yomax_en; | 
  | 
 | 
   if ( section.Contains("YE") ) return yemax_en; | 
  | 
 | 
   return(-1); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Float_t CaloEnergy::GetMaxEnergy(TString section){ | 
  | 
 | 
   section.ToUpper(); | 
  | 
 | 
   if ( fLong ){  | 
  | 
 | 
     this->Process(section);     | 
  | 
 | 
     return fXOen_maxplane; | 
  | 
 | 
   } else { | 
  | 
 | 
     if ( section.Contains("XO") ) return fXOen_maxplane; | 
  | 
 | 
     if ( section.Contains("XE") ) return fXEen_maxplane; | 
  | 
 | 
     if ( section.Contains("YO") ) return fYOen_maxplane; | 
  | 
 | 
     if ( section.Contains("YE") ) return fYEen_maxplane; | 
  | 
 | 
   }; | 
  | 
 | 
   return(-1); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
 | 
 Float_t CaloEnergy::GetMaxEnergy(){    | 
  | 
 | 
   if ( fLong ){ | 
  | 
 | 
     if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); | 
  | 
 | 
     this->Process(asntr); | 
  | 
 | 
   }; | 
  | 
 | 
   return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); | 
  | 
 | 
 } | 
  | 
 | 
  | 
  | 
| 122 | 
 void CaloEnergy::DefineGeometry(){ | 
 void CaloEnergy::DefineGeometry(){ | 
| 123 | 
   // | 
   // | 
| 124 | 
   // 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 | 
| 125 | 
   // | 
   // | 
| 126 | 
   // | 
   //  fM = 2. + 0.096; // real position from cbar BUG the 0.096 is already taken into account in the border calculation made by Giovanna | 
| 127 | 
   fM = 2. + 0.096; // real position from cbar | 
   fM = 2. ; // real position from cbar  | 
| 128 | 
   fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. | 
   //  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 | 
| 129 | 
  | 
   fM1 = 2. - 0.122 - 0.096 + 0.096; // due to calculation of xe1 etc. | 
| 130 | 
   if ( fM1 < 0. ) fM1 = 0.; | 
   if ( fM1 < 0. ) fM1 = 0.; | 
| 131 | 
   // | 
   // | 
| 132 | 
   CaloStrip *cs = new CaloStrip(fSimu); | 
   CaloStrip *cs = new CaloStrip(fSimu); | 
| 134 | 
   // view y plane 0 strip 0 | 
   // view y plane 0 strip 0 | 
| 135 | 
   cs->Set(1,0,0); | 
   cs->Set(1,0,0); | 
| 136 | 
   xe1= cs->GetY(); | 
   xe1= cs->GetY(); | 
 | 
   //  z1= cs->GetZ(); | 
  | 
| 137 | 
   // view y plane 0 strip 31 | 
   // view y plane 0 strip 31 | 
| 138 | 
   cs->Set(1,0,31); | 
   cs->Set(1,0,31); | 
| 139 | 
   xe2= cs->GetY(); | 
   xe2= cs->GetY(); | 
| 149 | 
   // view y plane 0 strip 95 | 
   // view y plane 0 strip 95 | 
| 150 | 
   cs->Set(1,0,95); | 
   cs->Set(1,0,95); | 
| 151 | 
   xe6= cs->GetY(); | 
   xe6= cs->GetY(); | 
 | 
  | 
  | 
| 152 | 
   // view x plane 0 strip 0 | 
   // view x plane 0 strip 0 | 
| 153 | 
   cs->Set(0,0,0); | 
   cs->Set(0,0,0); | 
| 154 | 
   yo1= cs->GetX(); | 
   yo1= cs->GetX(); | 
 | 
   //  z2= cs->GetZ(); | 
  | 
| 155 | 
   // view x plane 0 strip 31 | 
   // view x plane 0 strip 31 | 
| 156 | 
   cs->Set(0,0,31); | 
   cs->Set(0,0,31); | 
| 157 | 
   yo2= cs->GetX(); | 
   yo2= cs->GetX(); | 
| 167 | 
   // view x plane 0 strip 95 | 
   // view x plane 0 strip 95 | 
| 168 | 
   cs->Set(0,0,95); | 
   cs->Set(0,0,95); | 
| 169 | 
   yo6= cs->GetX(); | 
   yo6= cs->GetX(); | 
 | 
  | 
  | 
 | 
    | 
  | 
| 170 | 
   // view y plane 1 strip 0 | 
   // view y plane 1 strip 0 | 
| 171 | 
   cs->Set(1,1,0); | 
   cs->Set(1,1,0); | 
| 172 | 
   xo1= cs->GetY(); | 
   xo1= cs->GetY(); | 
 | 
   //  z3= cs->GetZ(); | 
  | 
| 173 | 
   // view y plane 1 strip 31 | 
   // view y plane 1 strip 31 | 
| 174 | 
   cs->Set(1,1,31); | 
   cs->Set(1,1,31); | 
| 175 | 
   xo2= cs->GetY(); | 
   xo2= cs->GetY(); | 
| 184 | 
   xo5= cs->GetY(); | 
   xo5= cs->GetY(); | 
| 185 | 
   // view y plane 1 strip 95 | 
   // view y plane 1 strip 95 | 
| 186 | 
   cs->Set(1,1,95); | 
   cs->Set(1,1,95); | 
| 187 | 
   xo6= cs->GetY(); | 
   xo6= cs->GetY();   | 
 | 
    | 
  | 
| 188 | 
   // view x plane 1 strip 0 | 
   // view x plane 1 strip 0 | 
| 189 | 
   cs->Set(0,1,0); | 
   cs->Set(0,1,0); | 
| 190 | 
   ye1= cs->GetX(); | 
   ye1= cs->GetX(); | 
 | 
   //  z4= cs->GetZ(); | 
  | 
| 191 | 
   // view x plane 1 strip 31 | 
   // view x plane 1 strip 31 | 
| 192 | 
   cs->Set(0,1,31); | 
   cs->Set(0,1,31); | 
| 193 | 
   ye2= cs->GetX(); | 
   ye2= cs->GetX(); | 
| 203 | 
   // view x plane 1 strip 95 | 
   // view x plane 1 strip 95 | 
| 204 | 
   cs->Set(0,1,95); | 
   cs->Set(0,1,95); | 
| 205 | 
   ye6= cs->GetX(); | 
   ye6= cs->GetX(); | 
 | 
  | 
  | 
| 206 | 
   // | 
   // | 
| 207 | 
   for (Int_t p = 0; p<22; p ++){ | 
   for (Int_t p = 0; p<22; p ++){ | 
| 208 | 
     for (Int_t v = 0; v<2; v++ ){    | 
     for (Int_t v = 0; v<2; v++ ){    | 
| 241 | 
   yomax_en= 0.;  | 
   yomax_en= 0.;  | 
| 242 | 
   yemax_en= 0.;  | 
   yemax_en= 0.;  | 
| 243 | 
   // | 
   // | 
| 244 | 
  memset(enstrip,0,2*22*96*(sizeof(Float_t)));   | 
   memset(enstrip,0,2*22*96*(sizeof(Float_t)));   | 
| 245 | 
   en = 0.; | 
   en = 0.; | 
| 246 | 
   view = 0; | 
   view = 0; | 
| 247 | 
   plane = 0; | 
   plane = 0; | 
| 263 | 
   memset(en_xop,0,11*sizeof(Float_t)); | 
   memset(en_xop,0,11*sizeof(Float_t)); | 
| 264 | 
   memset(en_yop,0,11*sizeof(Float_t)); | 
   memset(en_yop,0,11*sizeof(Float_t)); | 
| 265 | 
   // | 
   // | 
| 266 | 
  | 
   fColumn = -1; | 
| 267 | 
  | 
   fColXE = -1; | 
| 268 | 
  | 
   fColXO = -1; | 
| 269 | 
  | 
   fColYE = -1; | 
| 270 | 
  | 
   fColYO = -1; | 
| 271 | 
  | 
   memset(encol,0,2*3*sizeof(Float_t)); | 
| 272 | 
  | 
   entot[0] = 0.; | 
| 273 | 
  | 
   entot[1] = 0.; | 
| 274 | 
  | 
   // | 
| 275 | 
 } | 
 } | 
| 276 | 
  | 
  | 
| 277 | 
 void CaloEnergy::Print(){ | 
 void CaloEnergy::Print(){ | 
| 304 | 
   printf(" fM1     :.............. %f \n",fM1);  | 
   printf(" fM1     :.............. %f \n",fM1);  | 
| 305 | 
   printf(" fRad    :.............. %i \n",fRad);  | 
   printf(" fRad    :.............. %i \n",fRad);  | 
| 306 | 
   printf(" fPl     :.............. %i \n",fPl);  | 
   printf(" fPl     :.............. %i \n",fPl);  | 
| 307 | 
  | 
   printf(" fColumn :.............. %i \n",fColumn);  | 
| 308 | 
  | 
   printf(" multicol:.............. %i \n",multicol);  | 
| 309 | 
  | 
   printf(" encol x :.............. %f \n",this->GetEncol(0));  | 
| 310 | 
  | 
   printf(" encol y :.............. %f \n",this->GetEncol(1));  | 
| 311 | 
  | 
   printf(" entot x :.............. %f \n",this->GetEntot(0));  | 
| 312 | 
  | 
   printf(" entot y :.............. %f \n",this->GetEntot(1));  | 
| 313 | 
  | 
   printf(" fColXE  :.............. %i \n",fColXE);  | 
| 314 | 
  | 
   printf(" fColXO  :.............. %i \n",fColXO);  | 
| 315 | 
  | 
   printf(" fColYE  :.............. %i \n",fColYE);  | 
| 316 | 
  | 
   printf(" fColYO  :.............. %i \n",fColYO);  | 
| 317 | 
   printf(" fConv_rxe ............. %f \n",fConv_rxe);  | 
   printf(" fConv_rxe ............. %f \n",fConv_rxe);  | 
| 318 | 
   printf(" fConv_rxo ............. %f \n",fConv_rxo);  | 
   printf(" fConv_rxo ............. %f \n",fConv_rxo);  | 
| 319 | 
   printf(" fConv_ryo ............. %f \n",fConv_ryo);  | 
   printf(" fConv_ryo ............. %f \n",fConv_ryo);  | 
| 323 | 
   printf(" energyxo:.............. %f \n",energyxo);  | 
   printf(" energyxo:.............. %f \n",energyxo);  | 
| 324 | 
   printf(" energyye:.............. %f \n",energyye);  | 
   printf(" energyye:.............. %f \n",energyye);  | 
| 325 | 
   printf(" energyyo:.............. %f \n",energyyo);  | 
   printf(" energyyo:.............. %f \n",energyyo);  | 
| 326 | 
  | 
   printf(" fXEen_maxplane:........ %f \n",fXEen_maxplane); | 
| 327 | 
  | 
   printf(" fXOen_maxplane:........ %f \n",fXOen_maxplane); | 
| 328 | 
  | 
   printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane); | 
| 329 | 
  | 
   printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane); | 
| 330 | 
   printf(" x0max   :.............. %f \n",x0max);  | 
   printf(" x0max   :.............. %f \n",x0max);  | 
| 331 | 
   printf(" debug   :.............. %i \n",debug);  | 
   printf(" debug   :.............. %i \n",debug);  | 
| 332 | 
  | 
  | 
| 334 | 
   // | 
   // | 
| 335 | 
 } | 
 } | 
| 336 | 
  | 
  | 
| 337 | 
 void CaloEnergy::Delete(){ | 
 void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){ | 
| 338 | 
   Clear(); | 
   section.ToUpper(); | 
| 339 | 
   delete this; | 
   if ( section.Contains("XO") ) fXomin = plane; | 
| 340 | 
  | 
   if ( section.Contains("XE") ) fXemin = plane; | 
| 341 | 
  | 
   if ( section.Contains("YO") ) fYomin = plane; | 
| 342 | 
  | 
   if ( section.Contains("YE") ) fYemin = plane; | 
| 343 | 
  | 
 } | 
| 344 | 
  | 
  | 
| 345 | 
  | 
 void CaloEnergy::SetMinimumContainment(Int_t plane){ | 
| 346 | 
  | 
   this->SetMinimumContainment("XEXOYEYO",plane); | 
| 347 | 
  | 
 } | 
| 348 | 
  | 
  | 
| 349 | 
  | 
 void CaloEnergy::SetConversionFactor(TString section, Float_t conv){ | 
| 350 | 
  | 
   section.ToUpper(); | 
| 351 | 
  | 
   if ( section.Contains("XO") ) fConv_rxo = conv; | 
| 352 | 
  | 
   if ( section.Contains("XE") ) fConv_rxe = conv; | 
| 353 | 
  | 
   if ( section.Contains("YO") ) fConv_ryo = conv; | 
| 354 | 
  | 
   if ( section.Contains("YE") ) fConv_rye = conv; | 
| 355 | 
  | 
 } | 
| 356 | 
  | 
  | 
| 357 | 
  | 
 void CaloEnergy::SetConversionFactor(Float_t conv){ | 
| 358 | 
  | 
   this->SetConversionFactor("XEXOYEYO",conv); | 
| 359 | 
  | 
 } | 
| 360 | 
  | 
  | 
| 361 | 
  | 
 Int_t CaloEnergy::GetMinimumContainment(TString section){ | 
| 362 | 
  | 
   section.ToUpper(); | 
| 363 | 
  | 
   if ( section.Contains("XO") ) return(fXomin); | 
| 364 | 
  | 
   if ( section.Contains("XE") ) return(fXemin); | 
| 365 | 
  | 
   if ( section.Contains("YE") ) return(fYemin); | 
| 366 | 
  | 
   if ( section.Contains("YO") ) return(fYomin); | 
| 367 | 
  | 
   printf(" ERROR: section not recognized \n"); | 
| 368 | 
  | 
   return(-1000); | 
| 369 | 
  | 
 } | 
| 370 | 
  | 
  | 
| 371 | 
  | 
 Float_t CaloEnergy::GetConversionFactor(TString section){ | 
| 372 | 
  | 
   section.ToUpper(); | 
| 373 | 
  | 
   if ( section.Contains("XO") ) return(fConv_rxo); | 
| 374 | 
  | 
   if ( section.Contains("XE") ) return(fConv_rxe); | 
| 375 | 
  | 
   if ( section.Contains("YO") ) return(fConv_ryo); | 
| 376 | 
  | 
   if ( section.Contains("YE") ) return(fConv_rye); | 
| 377 | 
  | 
   printf(" ERROR: section not recognized \n"); | 
| 378 | 
  | 
   return(-1000.); | 
| 379 | 
  | 
 } | 
| 380 | 
  | 
  | 
| 381 | 
  | 
 Int_t CaloEnergy::GetMaxplane(TString section){ | 
| 382 | 
  | 
   section.ToUpper(); | 
| 383 | 
  | 
   if ( section.Contains("XO") ) return fMax_planexo; | 
| 384 | 
  | 
   if ( section.Contains("XE") ) return fMax_planexe; | 
| 385 | 
  | 
   if ( section.Contains("YO") ) return fMax_planeyo; | 
| 386 | 
  | 
   if ( section.Contains("YE") ) return fMax_planeye; | 
| 387 | 
  | 
   return(-1); | 
| 388 | 
  | 
 } | 
| 389 | 
  | 
  | 
| 390 | 
  | 
 Int_t CaloEnergy::GetColumn(TString section){ | 
| 391 | 
  | 
   section.ToUpper(); | 
| 392 | 
  | 
   if ( section.Contains("XO") ) return fColXO; | 
| 393 | 
  | 
   if ( section.Contains("XE") ) return fColXE; | 
| 394 | 
  | 
   if ( section.Contains("YO") ) return fColYO; | 
| 395 | 
  | 
   if ( section.Contains("YE") ) return fColYE; | 
| 396 | 
  | 
   return(-1); | 
| 397 | 
  | 
 } | 
| 398 | 
  | 
  | 
| 399 | 
  | 
 Float_t CaloEnergy::GetMipEnergyAtMaxplane(TString section){ | 
| 400 | 
  | 
   printf(" WARNING: OBSOLETE METHOD, use GetMipEnergyAtMaxplane(TString) instead! \n"); | 
| 401 | 
  | 
   return (this->GetEnergyAtMaxplane(section)); | 
| 402 | 
  | 
 } | 
| 403 | 
  | 
  | 
| 404 | 
  | 
 Float_t CaloEnergy::GetEnergyAtMaxplane(TString section){ | 
| 405 | 
  | 
   section.ToUpper(); | 
| 406 | 
  | 
   if ( section.Contains("XO") ) return xomax_en; | 
| 407 | 
  | 
   if ( section.Contains("XE") ) return xemax_en; | 
| 408 | 
  | 
   if ( section.Contains("YO") ) return yomax_en; | 
| 409 | 
  | 
   if ( section.Contains("YE") ) return yemax_en; | 
| 410 | 
  | 
   return(-1); | 
| 411 | 
  | 
 } | 
| 412 | 
  | 
  | 
| 413 | 
  | 
 Float_t CaloEnergy::GetMaxEnergy(TString section){ | 
| 414 | 
  | 
   printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy(TString) instead! \n"); | 
| 415 | 
  | 
   return (this->GetMipEnergy(section)); | 
| 416 | 
  | 
 } | 
| 417 | 
  | 
  | 
| 418 | 
  | 
 Float_t CaloEnergy::GetMipEnergy(TString section){ | 
| 419 | 
  | 
   section.ToUpper(); | 
| 420 | 
  | 
   if ( fLong ){  | 
| 421 | 
  | 
     this->Process(section);     | 
| 422 | 
  | 
     return fXOen_maxplane; | 
| 423 | 
  | 
   } else { | 
| 424 | 
  | 
     if ( section.Contains("XO") ) return fXOen_maxplane; | 
| 425 | 
  | 
     if ( section.Contains("XE") ) return fXEen_maxplane; | 
| 426 | 
  | 
     if ( section.Contains("YO") ) return fYOen_maxplane; | 
| 427 | 
  | 
     if ( section.Contains("YE") ) return fYEen_maxplane; | 
| 428 | 
  | 
   }; | 
| 429 | 
  | 
   return(-1); | 
| 430 | 
  | 
 } | 
| 431 | 
  | 
  | 
| 432 | 
  | 
 Float_t CaloEnergy::GetEncol(Int_t i){    | 
| 433 | 
  | 
   if ( fColumn > -1 && (((fXesel || fXosel)&&i==1) || ((fYesel || fYosel)&&i==0)) ){ | 
| 434 | 
  | 
     Int_t t = -1; | 
| 435 | 
  | 
     if ( i == 0 ){ | 
| 436 | 
  | 
       if ( fColumn == 0 || fColumn == 3 || fColumn == 6 ) t = 0; | 
| 437 | 
  | 
       if ( fColumn == 1 || fColumn == 4 || fColumn == 7 ) t = 1; | 
| 438 | 
  | 
       if ( fColumn == 2 || fColumn == 5 || fColumn == 8 ) t = 2; | 
| 439 | 
  | 
     } else { | 
| 440 | 
  | 
       if ( fColumn == 0 || fColumn == 1 || fColumn == 2 ) t = 0; | 
| 441 | 
  | 
       if ( fColumn == 3 || fColumn == 4 || fColumn == 5 ) t = 1; | 
| 442 | 
  | 
       if ( fColumn == 6 || fColumn == 7 || fColumn == 8 ) t = 2; | 
| 443 | 
  | 
     }; | 
| 444 | 
  | 
     if ( debug ) printf(" encol: i %i t %i encol %f \n",i,t,encol[i][t]); | 
| 445 | 
  | 
     return encol[i][t]; | 
| 446 | 
  | 
   }; | 
| 447 | 
  | 
   return(-1.); | 
| 448 | 
  | 
 } | 
| 449 | 
  | 
  | 
| 450 | 
  | 
 Float_t CaloEnergy::GetMaxEnergy(){    | 
| 451 | 
  | 
   printf(" WARNING: OBSOLETE METHOD, use GetMipEnergy() instead! \n"); | 
| 452 | 
  | 
   return (this->GetMipEnergy()); | 
| 453 | 
  | 
 } | 
| 454 | 
  | 
  | 
| 455 | 
  | 
 Float_t CaloEnergy::GetMipEnergy(){    | 
| 456 | 
  | 
   if ( fLong ){ | 
| 457 | 
  | 
     if ( debug ) printf(" oh! call process! with asntr %s and sntr %s \n",asntr.Data(),sntr.Data()); | 
| 458 | 
  | 
     this->Process(asntr); | 
| 459 | 
  | 
   }; | 
| 460 | 
  | 
   return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)); | 
| 461 | 
 } | 
 } | 
| 462 | 
  | 
  | 
| 463 | 
  | 
  | 
| 524 | 
     enstrip[view][plane][strip]=en; | 
     enstrip[view][plane][strip]=en; | 
| 525 | 
   }; | 
   }; | 
| 526 | 
   // | 
   // | 
| 527 | 
  | 
   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)); | 
| 528 | 
  | 
   // | 
| 529 | 
   // sum energy plane by plane for each sections  | 
   // sum energy plane by plane for each sections  | 
| 530 | 
   // | 
   // | 
| 531 | 
  | 
   Float_t fen_xep[11]; | 
| 532 | 
  | 
   Float_t fen_xop[11]; | 
| 533 | 
  | 
   Float_t fen_yep[11]; | 
| 534 | 
  | 
   Float_t fen_yop[11]; | 
| 535 | 
  | 
   memset(fen_xep,0,11*sizeof(Float_t)); | 
| 536 | 
  | 
   memset(fen_xop,0,11*sizeof(Float_t)); | 
| 537 | 
  | 
   memset(fen_yep,0,11*sizeof(Float_t)); | 
| 538 | 
  | 
   memset(fen_yop,0,11*sizeof(Float_t)); | 
| 539 | 
  | 
   // | 
| 540 | 
   for (Int_t i=0;i<11;i++){ | 
   for (Int_t i=0;i<11;i++){ | 
| 541 | 
     for(strip=0; strip<96; strip++) { | 
     for(strip=0; strip<96; strip++) { | 
| 542 | 
  | 
       fen_xep[i] += enstrip[1][2*i][strip]; | 
| 543 | 
  | 
       fen_yop[i] += enstrip[0][2*i][strip]; | 
| 544 | 
  | 
       fen_xop[i] += enstrip[1][(2*i)+1][strip]; | 
| 545 | 
  | 
       fen_yep[i] += enstrip[0][(2*i)+1][strip]; | 
| 546 | 
       if ( fRad < 0 ){ | 
       if ( fRad < 0 ){ | 
| 547 | 
         // | 
         // | 
| 548 | 
         // run over all the strips of the plane | 
         // run over all the strips of the plane | 
| 549 | 
         // | 
         // | 
| 550 | 
         en_xep[i] += enstrip[1][2*i][strip]; | 
         en_xep[i] += enstrip[1][2*i][strip]; | 
| 551 | 
         en_yop[i] += enstrip[0][2*i][strip]; | 
         en_yop[i] += enstrip[0][2*i][strip]; | 
| 555 | 
         // | 
         // | 
| 556 | 
         // use only the strips inside a cylinder of given radius fRad | 
         // use only the strips inside a cylinder of given radius fRad | 
| 557 | 
         // | 
         // | 
| 558 | 
         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 &&  | 
| 559 | 
         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];  | 
              (strip >= (cl2->cibar[2*i][1]-1-fRad)) &&  (strip <= (cl2->cibar[2*i][1]-1+fRad)) ) en_xep[i] += enstrip[1][2*i][strip];  | 
| 560 | 
         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];  | 
  | 
| 561 | 
         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][0] >= 1 && cl2->cibar[2*i][0] <= 96 &&  | 
| 562 | 
  | 
              (strip >= (cl2->cibar[2*i][0]-1-fRad)) &&  (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip];  | 
| 563 | 
  | 
  | 
| 564 | 
  | 
         if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 &&  | 
| 565 | 
  | 
              (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];  | 
| 566 | 
  | 
  | 
| 567 | 
  | 
         if ( cl2->cibar[(2*i)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 &&  | 
| 568 | 
  | 
              (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];  | 
| 569 | 
       }; | 
       }; | 
| 570 | 
     }; | 
     }; | 
| 571 | 
  | 
     if ( debug ) printf(" ex_xep[%i] %f cibar %i \n",i,en_xep[i],cl2->cibar[2*i][1]); | 
| 572 | 
  | 
     if ( debug ) printf(" ex_xop[%i] %f cibar %i \n",i,en_xop[i],cl2->cibar[(2*i)+1][1]); | 
| 573 | 
  | 
     if ( debug ) printf(" ex_yep[%i] %f cibar %i \n",i,en_yep[i],cl2->cibar[(2*i)+1][0]); | 
| 574 | 
  | 
     if ( debug ) printf(" ex_yop[%i] %f cibar %i \n",i,en_yop[i],cl2->cibar[2*i][0]); | 
| 575 | 
     energyxe += en_xep[i]; | 
     energyxe += en_xep[i]; | 
| 576 | 
     energyyo += en_yop[i]; | 
     energyyo += en_yop[i]; | 
| 577 | 
     energyxo += en_xop[i]; | 
     energyxo += en_xop[i]; | 
| 585 | 
   Int_t yon = 0; | 
   Int_t yon = 0; | 
| 586 | 
   Int_t xon = 0; | 
   Int_t xon = 0; | 
| 587 | 
   Int_t yen = 0; | 
   Int_t yen = 0; | 
| 588 | 
  | 
   Float_t en = 0.; | 
| 589 | 
   // | 
   // | 
| 590 | 
   if ( section.Contains("XE") ){ | 
   if ( section.Contains("XE") ){ | 
| 591 | 
     yon++; | 
     yon++; | 
| 592 | 
     xon++; | 
     xon++; | 
| 593 | 
     yen++; | 
     yen++; | 
| 594 | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
| 595 | 
       if(en_xep[ipl] > xemax_en) { | 
       en = fen_xep[ipl]; | 
| 596 | 
         xemax_en = en_xep[ipl]; | 
       if ( !fAllpl ) en = en_xep[ipl]; | 
| 597 | 
  | 
       if(en > xemax_en) { | 
| 598 | 
  | 
         xemax_en = en; | 
| 599 | 
         fMax_planexe = ipl; | 
         fMax_planexe = ipl; | 
| 600 | 
       }; | 
       }; | 
| 601 | 
     }; | 
     }; | 
| 605 | 
     xon++; | 
     xon++; | 
| 606 | 
     yen++; | 
     yen++; | 
| 607 | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
| 608 | 
       if(en_yop[ipl] > yomax_en) { | 
       en = fen_yop[ipl]; | 
| 609 | 
         yomax_en = en_yop[ipl]; | 
       if ( !fAllpl ) en = en_yop[ipl]; | 
| 610 | 
  | 
       if(en > yomax_en) { | 
| 611 | 
  | 
         yomax_en = en; | 
| 612 | 
         fMax_planeyo = ipl; | 
         fMax_planeyo = ipl; | 
| 613 | 
       }; | 
       }; | 
| 614 | 
     }; | 
     }; | 
| 617 | 
   if ( section.Contains("XO") ){ | 
   if ( section.Contains("XO") ){ | 
| 618 | 
     yen++; | 
     yen++; | 
| 619 | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
| 620 | 
       if(en_xop[ipl] > xomax_en) { | 
       en = fen_xop[ipl]; | 
| 621 | 
         xomax_en = en_xop[ipl]; | 
       if ( !fAllpl ) en = en_xop[ipl]; | 
| 622 | 
  | 
       if(en > xomax_en) { | 
| 623 | 
  | 
         xomax_en = en; | 
| 624 | 
         fMax_planexo = ipl; | 
         fMax_planexo = ipl; | 
| 625 | 
       }; | 
       }; | 
| 626 | 
     }; | 
     }; | 
| 628 | 
   // | 
   // | 
| 629 | 
   if ( section.Contains("YE") ){ | 
   if ( section.Contains("YE") ){ | 
| 630 | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
     for (Int_t ipl =0; ipl < 11; ipl ++) { | 
| 631 | 
       if(en_yep[ipl] > yemax_en) { | 
       en = fen_yep[ipl]; | 
| 632 | 
         yemax_en = en_yep[ipl]; | 
       if ( !fAllpl ) en = en_yep[ipl]; | 
| 633 | 
  | 
       if(en > yemax_en) { | 
| 634 | 
  | 
         yemax_en = en; | 
| 635 | 
         fMax_planeye = ipl; | 
         fMax_planeye = ipl; | 
| 636 | 
       }; | 
       }; | 
| 637 | 
     }; | 
     }; | 
| 644 | 
     Int_t wpl = (Int_t)roundf(x0max/0.76); | 
     Int_t wpl = (Int_t)roundf(x0max/0.76); | 
| 645 | 
     Bool_t isY = false; | 
     Bool_t isY = false; | 
| 646 | 
     if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; | 
     if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true; | 
| 647 | 
  | 
     xomax_en = 0.; | 
| 648 | 
  | 
     yemax_en = 0.; | 
| 649 | 
  | 
     xemax_en = 0.; | 
| 650 | 
  | 
     yomax_en = 0.; | 
| 651 | 
  | 
     // | 
| 652 | 
     if ( !(wpl%2) ){ | 
     if ( !(wpl%2) ){ | 
| 653 | 
       // 0, 2, 4, ... | 
       // 0, 2, 4, ... | 
| 654 | 
       if ( isY ){ | 
       if ( isY ){ | 
| 655 | 
         yomax_en = 1000.; | 
         if ( section.Contains("YO") ) yomax_en = 1000.; | 
| 656 | 
         xemax_en = 500.; | 
         if ( section.Contains("XE") ) xemax_en = 500.; | 
| 657 | 
         fMax_planeyo=wpl/2; | 
         fMax_planeyo=wpl/2; | 
| 658 | 
         fMax_planexe=wpl/2; | 
         fMax_planexe=wpl/2; | 
| 659 | 
  | 
         if ( section.Contains("XO") ) xomax_en = 10.; | 
| 660 | 
  | 
         if ( section.Contains("YE") ) yemax_en = 5.; | 
| 661 | 
       } else { | 
       } else { | 
| 662 | 
         yomax_en = 500.; | 
         if ( section.Contains("YO") ) yomax_en = 500.; | 
| 663 | 
         xemax_en = 1000.; | 
         if ( section.Contains("XE") ) xemax_en = 1000.; | 
| 664 | 
         fMax_planeyo=wpl/2; | 
         fMax_planeyo=wpl/2; | 
| 665 | 
         fMax_planexe=wpl/2; | 
         fMax_planexe=wpl/2; | 
| 666 | 
  | 
         if ( section.Contains("XO") ) xomax_en = 5.; | 
| 667 | 
  | 
         if ( section.Contains("YE") ) yemax_en = 10.; | 
| 668 | 
       }; | 
       }; | 
 | 
       xomax_en = 0.; | 
  | 
 | 
       yemax_en = 0.; | 
  | 
| 669 | 
     } else { | 
     } else { | 
| 670 | 
       // 1, 3, 5, ... | 
       // 1, 3, 5, ... | 
| 671 | 
       if ( isY ){ | 
       if ( isY ){ | 
| 672 | 
         yemax_en = 1000.; | 
         if ( section.Contains("YE") ) yemax_en = 1000.; | 
| 673 | 
         xomax_en = 500.; | 
         if ( section.Contains("XO") ) xomax_en = 500.; | 
| 674 | 
         fMax_planeye=(wpl-1)/2; | 
         fMax_planeye=(wpl-1)/2; | 
| 675 | 
         fMax_planexo=(wpl-1)/2; | 
         fMax_planexo=(wpl-1)/2; | 
| 676 | 
  | 
         if ( section.Contains("XE") ) xemax_en = 10.; | 
| 677 | 
  | 
         if ( section.Contains("YO") ) yomax_en = 5.; | 
| 678 | 
       } else { | 
       } else { | 
| 679 | 
         yemax_en = 500.; | 
         if ( section.Contains("YE") ) yemax_en = 500.; | 
| 680 | 
         xomax_en = 1000.; | 
         if ( section.Contains("XO") ) xomax_en = 1000.; | 
| 681 | 
         fMax_planeye=(wpl-1)/2; | 
         fMax_planeye=(wpl-1)/2; | 
| 682 | 
         fMax_planexo=(wpl-1)/2; | 
         fMax_planexo=(wpl-1)/2; | 
| 683 | 
  | 
         if ( section.Contains("XE") ) xemax_en = 5.; | 
| 684 | 
  | 
         if ( section.Contains("YO") ) yomax_en = 10.; | 
| 685 | 
       }; | 
       }; | 
 | 
       xemax_en = 0.; | 
  | 
 | 
       yomax_en = 0.; | 
  | 
| 686 | 
     }; | 
     }; | 
| 687 | 
     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); | 
| 688 | 
   }; | 
   }; | 
| 689 | 
   // | 
   // | 
| 690 | 
   Int_t nPl = fPl; | 
   Int_t nPl = fPl; | 
| 756 | 
   // | 
   // | 
| 757 | 
   // 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 | 
| 758 | 
   // | 
   // | 
 | 
   Float_t  track_coordx[22][2]; | 
  | 
 | 
   Float_t  track_coordy[22][2]; | 
  | 
| 759 | 
   // | 
   // | 
| 760 | 
   Float_t tgx_cl2; | 
   Float_t tgx_cl2; | 
| 761 | 
   Float_t tgy_cl2;   | 
   Float_t tgy_cl2;   | 
| 765 | 
   for (Int_t p=0; p<22; p++){     | 
   for (Int_t p=0; p<22; p++){     | 
| 766 | 
     track_coordy[p][1] = cl2->cbar[p][1];  | 
     track_coordy[p][1] = cl2->cbar[p][1];  | 
| 767 | 
     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; | 
| 768 | 
  | 
     //    track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2; | 
| 769 | 
     track_coordx[p][0] = cl2->cbar[p][0]; | 
     track_coordx[p][0] = cl2->cbar[p][0]; | 
| 770 | 
     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; | 
| 771 | 
  | 
     //    track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2; | 
| 772 | 
     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]); | 
| 773 | 
   }; | 
   }; | 
| 774 | 
   // | 
   // | 
| 776 | 
   // | 
   // | 
| 777 | 
   if ( section.Contains("XO") ){ | 
   if ( section.Contains("XO") ){ | 
| 778 | 
     // | 
     // | 
| 779 | 
     // check event is inside XO acceptance | 
     // find the column hit in the first plane | 
| 780 | 
  | 
     // | 
| 781 | 
  | 
     Int_t ix = -1; | 
| 782 | 
  | 
     Int_t iy = -1; | 
| 783 | 
  | 
     if ( track_coordx[(2*0)+1][1] >= (-12.054+fM) && track_coordx[(2*0)+1][1] <= (-4.246-fM) ) ix = 0; | 
| 784 | 
  | 
     if ( track_coordx[(2*0)+1][1] >= ( -4.004+fM) && track_coordx[(2*0)+1][1] <= ( 3.804-fM) ) ix = 1; | 
| 785 | 
  | 
     if ( track_coordx[(2*0)+1][1] >= (  4.046+fM) && track_coordx[(2*0)+1][1] <= (11.854-fM) ) ix = 2; | 
| 786 | 
  | 
     if ( cl2->cbar[(2*0)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo2 - fM1) ) iy = 0; | 
| 787 | 
  | 
     if ( cl2->cbar[(2*0)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo4 - fM1) ) iy = 1; | 
| 788 | 
  | 
     if ( cl2->cbar[(2*0)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*0)+1][1] <= (xo6 - fM1) ) iy = 2; | 
| 789 | 
  | 
     if ( ix > -1 && iy > -1 ) fColXO = ix + iy*3; | 
| 790 | 
  | 
     // | 
| 791 | 
  | 
     // check event is inside XO acceptance, if multicol is false (SingleColumn mode) then the track must be contained in a column. | 
| 792 | 
     // | 
     // | 
| 793 | 
     for (Int_t i=0; i<11; i++) { | 
     for (Int_t i=0; i<11; i++) { | 
| 794 | 
       if | 
       if (( | 
| 795 | 
         ( | 
            ( track_coordx[(2*i)+1][1] >= (-12.054+fM) && track_coordx[(2*i)+1][1] <= (-4.246-fM) && (ix == 0 || multicol) ) || | 
| 796 | 
          (((track_coordx[(2*i)+1][1]>=(-12.054+fM))&& | 
            ( track_coordx[(2*i)+1][1] >= ( -4.004+fM) && track_coordx[(2*i)+1][1] <= ( 3.804-fM) && (ix == 1 || multicol) ) || | 
| 797 | 
            (track_coordx[(2*i)+1][1]<=(-4.246-fM)))&& | 
            ( track_coordx[(2*i)+1][1] >= (  4.046+fM) && track_coordx[(2*i)+1][1] <= (11.854-fM) && (ix == 2 || multicol) ) | 
| 798 | 
           (((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& | 
            ) && ( | 
| 799 | 
             (cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)+1][1] >= (xo1 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo2 - fM1) && (iy == 0 || multicol) ) || | 
| 800 | 
            ((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& | 
                  ( cl2->cbar[(2*i)+1][1] >= (xo3 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo4 - fM1) && (iy == 1 || multicol) ) ||       | 
| 801 | 
             (cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)+1][1] >= (xo5 + fM1) && cl2->cbar[(2*i)+1][1] <= (xo6 - fM1) && (iy == 2 || multicol) ) | 
| 802 | 
            ((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& | 
                  )){ | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordx[(2*i)+1][1]>=(-4.004+fM))&& | 
  | 
 | 
            (track_coordx[(2*i)+1][1]<=(3.804-fM)))&& | 
  | 
 | 
           (((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo2 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo4 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordx[(2*i)+1][1]>=(4.046+fM))&& | 
  | 
 | 
            (track_coordx[(2*i)+1][1]<=(11.854-fM)))&& | 
  | 
 | 
           (((cl2->cbar[(2*i)+1][1]>=xo1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo2 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][1]>=xo3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo4 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][1]>=xo5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][1]<=xo6 - fM1 )))) | 
  | 
 | 
          ){ | 
  | 
| 803 | 
         fXosel = true; | 
         fXosel = true; | 
| 804 | 
         fXoout = i; | 
         fXoout = i; | 
| 805 | 
       } else { | 
       } else { | 
| 819 | 
     // 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 | 
| 820 | 
     // | 
     // | 
| 821 | 
     if ( fXosel ){ | 
     if ( fXosel ){ | 
| 822 | 
       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++){        | 
| 823 | 
  | 
         fXOen_maxplane += en_xop[iplm];  | 
| 824 | 
  | 
         if ( debug ) printf(" XO iplm %i fXOen_maxplane %f  en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]); | 
| 825 | 
  | 
       }; | 
| 826 | 
       fEnergyxo = fXOen_maxplane/fConv_rxo; | 
       fEnergyxo = fXOen_maxplane/fConv_rxo; | 
| 827 | 
  | 
       // | 
| 828 | 
  | 
       for (Int_t i=0;i<11;i++){ | 
| 829 | 
  | 
         for(strip=0; strip<96; strip++) { | 
| 830 | 
  | 
           // | 
| 831 | 
  | 
           // run over all the strips of the plane | 
| 832 | 
  | 
           // | 
| 833 | 
  | 
           if ( strip >=  0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)+1][strip]; | 
| 834 | 
  | 
           if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)+1][strip]; | 
| 835 | 
  | 
           if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)+1][strip]; | 
| 836 | 
  | 
           entot[1] += enstrip[1][(2*i)+1][strip]; | 
| 837 | 
  | 
           // | 
| 838 | 
  | 
         }; | 
| 839 | 
  | 
       }; | 
| 840 | 
     }; | 
     }; | 
| 841 | 
   }; | 
   }; | 
| 842 | 
   // | 
   // | 
| 843 | 
   if ( section.Contains("XE") ){ | 
   if ( section.Contains("XE") ){ | 
| 844 | 
  | 
     // | 
| 845 | 
  | 
     // find the column hit in the first plane | 
| 846 | 
  | 
     // | 
| 847 | 
  | 
     Int_t ix = -1; | 
| 848 | 
  | 
     Int_t iy = -1; | 
| 849 | 
  | 
     if ( track_coordx[(2*0)][1] >= (-11.854+fM) && track_coordx[(2*0)][1] <= (-4.046-fM) ) ix = 0; | 
| 850 | 
  | 
     if ( track_coordx[(2*0)][1] >= ( -3.804+fM) && track_coordx[(2*0)][1] <= ( 4.004-fM) ) ix = 1; | 
| 851 | 
  | 
     if ( track_coordx[(2*0)][1] >= (  4.246+fM) && track_coordx[(2*0)][1] <= (12.054-fM) ) ix = 2; | 
| 852 | 
  | 
     if ( cl2->cbar[(2*0)][1] >= (xe1 + fM1) && cl2->cbar[(2*0)][1] <= (xe2 - fM1) ) iy = 0; | 
| 853 | 
  | 
     if ( cl2->cbar[(2*0)][1] >= (xe3 + fM1) && cl2->cbar[(2*0)][1] <= (xe4 - fM1) ) iy = 1; | 
| 854 | 
  | 
     if ( cl2->cbar[(2*0)][1] >= (xe5 + fM1) && cl2->cbar[(2*0)][1] <= (xe6 - fM1) ) iy = 2; | 
| 855 | 
  | 
     if ( ix > -1 && iy > -1 ) fColXE = ix + iy*3; | 
| 856 | 
  | 
     // | 
| 857 | 
  | 
     // check event is inside XO acceptance | 
| 858 | 
  | 
     // | 
| 859 | 
     for (Int_t i=0; i<11; i++) { | 
     for (Int_t i=0; i<11; i++) { | 
| 860 | 
       if | 
       if (( | 
| 861 | 
         ( | 
            ( track_coordx[(2*i)][1] >= (-11.854+fM) && track_coordx[(2*i)][1] <= (-4.046-fM) && (ix == 0 || multicol) ) || | 
| 862 | 
          (((track_coordx[2*i][1]>=(-11.854+fM))&&  | 
            ( track_coordx[(2*i)][1] >= ( -3.804+fM) && track_coordx[(2*i)][1] <= ( 4.004-fM) && (ix == 1 || multicol) ) || | 
| 863 | 
            (track_coordx[2*i][1]<=(-4.046-fM)))&& | 
            ( track_coordx[(2*i)][1] >= (  4.246+fM) && track_coordx[(2*i)][1] <= (12.054-fM) && (ix == 2 || multicol) ) | 
| 864 | 
           (((cl2->cbar[2*i][1]>=xe1 + fM1)&& | 
            ) && ( | 
| 865 | 
             (cl2->cbar[2*i][1]<=xe2 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)][1] >= (xe1 + fM1) && cl2->cbar[(2*i)][1] <= (xe2 - fM1) && (iy == 0 || multicol) ) || | 
| 866 | 
            ((cl2->cbar[2*i][1]>=xe3 + fM1)&& | 
                  ( cl2->cbar[(2*i)][1] >= (xe3 + fM1) && cl2->cbar[(2*i)][1] <= (xe4 - fM1) && (iy == 1 || multicol) ) ||           | 
| 867 | 
             (cl2->cbar[2*i][1]<=xe4 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)][1] >= (xe5 + fM1) && cl2->cbar[(2*i)][1] <= (xe6 - fM1) && (iy == 2 || multicol) ) | 
| 868 | 
            ((cl2->cbar[2*i][1]>=xe5 + fM1)&& | 
                  )){ | 
 | 
             (cl2->cbar[2*i][1]<=xe6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordx[2*i][1]>=(-3.804+fM))&& | 
  | 
 | 
            (track_coordx[2*i][1]<=(4.004-fM)))&& | 
  | 
 | 
           (((cl2->cbar[2*i][1]>=xe1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe2 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[2*i][1]>=xe3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe4 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[2*i][1]>=xe5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordx[2*i][1]>=(4.246+fM))&& | 
  | 
 | 
            (track_coordx[2*i][1]<=(12.054-fM)))&& | 
  | 
 | 
           (((cl2->cbar[2*i][1]>=xe1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe2 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[2*i][1]>=xe3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe4 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[2*i][1]>=xe5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][1]<=xe6 - fM1 )))) | 
  | 
 | 
          ){ | 
  | 
| 869 | 
         fXesel = true; | 
         fXesel = true; | 
| 870 | 
         fXeout = i; | 
         fXeout = i; | 
| 871 | 
       } else { | 
       } else { | 
| 873 | 
         break; | 
         break; | 
| 874 | 
       }; | 
       }; | 
| 875 | 
     }; | 
     }; | 
| 876 | 
  | 
     // | 
| 877 | 
     if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ | 
     if ( !fXesel && fXeout >= fXemin && fXeout >= (Int_t)(fMax_planexe+nPl) ){ | 
| 878 | 
       if ( debug ) printf(" XE: this event is only partially contained: fXeout %i fXemin %i fMax_planexe + nPl %i \n",fXeout,fXemin,(Int_t)(fMax_planexe+nPl)); | 
       if ( debug ) printf(" XE: this event is only partially contained: fXeout %i fXemin %i fMax_planexe + nPl %i \n",fXeout,fXemin,(Int_t)(fMax_planexe+nPl)); | 
| 879 | 
       fPartsel = true; | 
       fPartsel = true; | 
| 880 | 
       fXesel = true; | 
       fXesel = true; | 
| 881 | 
     }; | 
     }; | 
| 882 | 
     if ( fXesel ){ | 
     if ( fXesel ){ | 
| 883 | 
       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++){ | 
| 884 | 
  | 
         fXEen_maxplane += en_xep[iplm];  | 
| 885 | 
  | 
         if ( debug ) printf(" XE iplm %i fXOen_maxplane %f  en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]); | 
| 886 | 
  | 
       }; | 
| 887 | 
       fEnergyxe = fXEen_maxplane/fConv_rxe; | 
       fEnergyxe = fXEen_maxplane/fConv_rxe; | 
| 888 | 
  | 
       // | 
| 889 | 
  | 
       for (Int_t i=0;i<11;i++){ | 
| 890 | 
  | 
         for(strip=0; strip<96; strip++) { | 
| 891 | 
  | 
           // | 
| 892 | 
  | 
           // run over all the strips of the plane | 
| 893 | 
  | 
           // | 
| 894 | 
  | 
           if ( strip >=  0 && strip < 32 ) encol[1][0] += enstrip[1][(2*i)][strip]; | 
| 895 | 
  | 
           if ( strip >= 32 && strip < 64 ) encol[1][1] += enstrip[1][(2*i)][strip]; | 
| 896 | 
  | 
           if ( strip >= 64 && strip < 96 ) encol[1][2] += enstrip[1][(2*i)][strip]; | 
| 897 | 
  | 
           entot[1] += enstrip[1][(2*i)][strip]; | 
| 898 | 
  | 
           // | 
| 899 | 
  | 
         }; | 
| 900 | 
  | 
       }; | 
| 901 | 
     }; | 
     }; | 
| 902 | 
   };   | 
   };   | 
| 903 | 
   // | 
   // | 
| 904 | 
   if ( section.Contains("YE") ){ | 
   if ( section.Contains("YE") ){ | 
| 905 | 
  | 
     // | 
| 906 | 
  | 
     // find the column hit in the first plane | 
| 907 | 
  | 
     // | 
| 908 | 
  | 
     Int_t ix = -1; | 
| 909 | 
  | 
     Int_t iy = -1; | 
| 910 | 
  | 
     if ( track_coordy[(2*0)+1][0] >= (-12.154+fM) && track_coordy[(2*0)+1][0] <= (-4.346-fM) ) iy = 0; | 
| 911 | 
  | 
     if ( track_coordy[(2*0)+1][0] >= ( -4.104+fM) && track_coordy[(2*0)+1][0] <= ( 3.704-fM) ) iy = 1; | 
| 912 | 
  | 
     if ( track_coordy[(2*0)+1][0] >= (  3.946+fM) && track_coordy[(2*0)+1][0] <= (11.754-fM) ) iy = 2; | 
| 913 | 
  | 
     if ( cl2->cbar[(2*0)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye2 - fM1) ) ix = 0; | 
| 914 | 
  | 
     if ( cl2->cbar[(2*0)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye4 - fM1) ) ix = 1; | 
| 915 | 
  | 
     if ( cl2->cbar[(2*0)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*0)+1][0] <= (ye6 - fM1) ) ix = 2; | 
| 916 | 
  | 
     if ( ix > -1 && iy > -1 ) fColYE = ix + iy*3; | 
| 917 | 
  | 
     // | 
| 918 | 
  | 
     // check event is inside XO acceptance | 
| 919 | 
  | 
     // | 
| 920 | 
     for (Int_t i=0; i<11; i++) { | 
     for (Int_t i=0; i<11; i++) { | 
| 921 | 
       if | 
       if (( | 
| 922 | 
         ( | 
            ( track_coordy[(2*i)+1][0] >= (-12.154+fM) && track_coordy[(2*i)+1][0] <= (-4.346-fM) && (iy == 0 || multicol) ) || | 
| 923 | 
          (((track_coordy[(2*i)+1][0]>=(-12.154+fM))&&  | 
            ( track_coordy[(2*i)+1][0] >= ( -4.104+fM) && track_coordy[(2*i)+1][0] <= ( 3.704-fM) && (iy == 1 || multicol) ) || | 
| 924 | 
            (track_coordy[(2*i)+1][0]<=(-4.346-fM)))&& | 
            ( track_coordy[(2*i)+1][0] >= (  3.946+fM) && track_coordy[(2*i)+1][0] <= (11.754-fM) && (iy == 2 || multicol) ) | 
| 925 | 
           (((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& | 
            ) && ( | 
| 926 | 
             (cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)+1][0] >= (ye1 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye2 - fM1) && (ix == 0 || multicol) ) || | 
| 927 | 
            ((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& | 
                  ( cl2->cbar[(2*i)+1][0] >= (ye3 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye4 - fM1) && (ix == 1 || multicol) ) ||       | 
| 928 | 
             (cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)+1][0] >= (ye5 + fM1) && cl2->cbar[(2*i)+1][0] <= (ye6 - fM1) && (ix == 2 || multicol) ) | 
| 929 | 
            ((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& | 
                  )){ | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordy[(2*i)+1][0]>=(-4.104+fM))&& | 
  | 
 | 
            (track_coordy[(2*i)+1][0]<=(3.704-fM)))&& | 
  | 
 | 
           (((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye2 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye4 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordy[(2*i)+1][0]>=(3.946+fM))&& | 
  | 
 | 
            (track_coordy[(2*i)+1][0]<=(11.754-fM)))&& | 
  | 
 | 
           (((cl2->cbar[(2*i)+1][0]>=ye1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye2 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][0]>=ye3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye4 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[(2*i)+1][0]>=ye5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[(2*i)+1][0]<=ye6 - fM1 )))) | 
  | 
 | 
          ){ | 
  | 
| 930 | 
         fYesel = true; | 
         fYesel = true; | 
| 931 | 
         fYeout = i; | 
         fYeout = i; | 
| 932 | 
       } else { | 
       } else { | 
| 934 | 
         break; | 
         break; | 
| 935 | 
       }; | 
       }; | 
| 936 | 
     }; | 
     }; | 
| 937 | 
  | 
     // | 
| 938 | 
     if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ | 
     if ( !fYesel && fYeout >= fYemin && fYeout >= (Int_t)(fMax_planeye+nPl) ){ | 
| 939 | 
       if ( debug ) printf(" YE: this event is only partially contained: fYeout %i fYemin %i fMax_planeye + nPl %i \n",fYeout,fYemin,(Int_t)(fMax_planeye+nPl)); | 
       if ( debug ) printf(" YE: this event is only partially contained: fYeout %i fYemin %i fMax_planeye + nPl %i \n",fYeout,fYemin,(Int_t)(fMax_planeye+nPl)); | 
| 940 | 
       fPartsel = true; | 
       fPartsel = true; | 
| 943 | 
     if ( fYesel ){ | 
     if ( fYesel ){ | 
| 944 | 
       for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeye+nPl)) ;iplm++) fYEen_maxplane += en_yep[iplm];  | 
       for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeye+nPl)) ;iplm++) fYEen_maxplane += en_yep[iplm];  | 
| 945 | 
       fEnergyye = fYEen_maxplane/fConv_rye; | 
       fEnergyye = fYEen_maxplane/fConv_rye; | 
| 946 | 
  | 
       // | 
| 947 | 
  | 
       for (Int_t i=0;i<11;i++){ | 
| 948 | 
  | 
         for(strip=0; strip<96; strip++) { | 
| 949 | 
  | 
           // | 
| 950 | 
  | 
           // run over all the strips of the plane | 
| 951 | 
  | 
           // | 
| 952 | 
  | 
           if ( strip >=  0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)+1][strip]; | 
| 953 | 
  | 
           if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)+1][strip]; | 
| 954 | 
  | 
           if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)+1][strip]; | 
| 955 | 
  | 
           entot[0] += enstrip[0][(2*i)+1][strip]; | 
| 956 | 
  | 
           // | 
| 957 | 
  | 
         }; | 
| 958 | 
  | 
       }; | 
| 959 | 
  | 
       // | 
| 960 | 
     }; | 
     }; | 
| 961 | 
   };   | 
   };   | 
| 962 | 
   // | 
   // | 
| 963 | 
   if ( section.Contains("YO") ){ | 
   if ( section.Contains("YO") ){ | 
| 964 | 
  | 
     // | 
| 965 | 
  | 
     // find the column hit in the first plane | 
| 966 | 
  | 
     // | 
| 967 | 
  | 
     Int_t ix = -1; | 
| 968 | 
  | 
     Int_t iy = -1; | 
| 969 | 
  | 
     if ( track_coordy[(2*0)][0] >= (-11.954+fM) && track_coordy[(2*0)][0] <= (-4.146-fM) ) iy = 0; | 
| 970 | 
  | 
     if ( track_coordy[(2*0)][0] >= ( -3.904+fM) && track_coordy[(2*0)][0] <= ( 3.904-fM) ) iy = 1; | 
| 971 | 
  | 
     if ( track_coordy[(2*0)][0] >= (  4.146+fM) && track_coordy[(2*0)][0] <= (11.954-fM) ) iy = 2; | 
| 972 | 
  | 
     if ( cl2->cbar[(2*0)][0] >= (yo1 + fM1) && cl2->cbar[(2*0)][0] <= (yo2 - fM1) ) ix = 0; | 
| 973 | 
  | 
     if ( cl2->cbar[(2*0)][0] >= (yo3 + fM1) && cl2->cbar[(2*0)][0] <= (yo4 - fM1) ) ix = 1; | 
| 974 | 
  | 
     if ( cl2->cbar[(2*0)][0] >= (yo5 + fM1) && cl2->cbar[(2*0)][0] <= (yo6 - fM1) ) ix = 2; | 
| 975 | 
  | 
     if ( ix > -1 && iy > -1 ) fColYO = ix + iy*3; | 
| 976 | 
  | 
     // | 
| 977 | 
  | 
     // check event is inside XO acceptance | 
| 978 | 
  | 
     // | 
| 979 | 
     for (Int_t i=0; i<11; i++) { | 
     for (Int_t i=0; i<11; i++) { | 
| 980 | 
       if ( debug ) printf(" i %i track_coordy[2*i][0] %f cl2->cbar[2*i][0] %f \n",i,track_coordy[2*i][0],cl2->cbar[2*i][0]); | 
       if (( | 
| 981 | 
       if ( debug ) printf(" i %i fm %f fm1 %f yo1 %g yo2 %f yo3 %f yo4 %f yo5 %f yo6 %f \n",i,fM,fM1,yo1,yo2,yo3,yo4,yo5,yo6); | 
            ( track_coordy[(2*i)][0] >= (-11.954+fM) && track_coordy[(2*i)][0] <= (-4.146-fM) && (iy == 0 || multicol) ) || | 
| 982 | 
       if | 
            ( track_coordy[(2*i)][0] >= ( -3.904+fM) && track_coordy[(2*i)][0] <= ( 3.904-fM) && (iy == 1 || multicol) ) || | 
| 983 | 
         ( | 
            ( track_coordy[(2*i)][0] >= (  4.146+fM) && track_coordy[(2*i)][0] <= (11.954-fM) && (iy == 2 || multicol) ) | 
| 984 | 
          (((track_coordy[2*i][0]>=(-11.954+fM))&&  | 
            ) && ( | 
| 985 | 
            (track_coordy[2*i][0]<=(-4.146-fM)))&& | 
                  ( cl2->cbar[(2*i)][0] >= (yo1 + fM1) && cl2->cbar[(2*i)][0] <= (yo2 - fM1) && (ix == 0 || multicol) ) || | 
| 986 | 
           (((cl2->cbar[2*i][0]>=yo1 + fM1)&& | 
                  ( cl2->cbar[(2*i)][0] >= (yo3 + fM1) && cl2->cbar[(2*i)][0] <= (yo4 - fM1) && (ix == 1 || multicol) ) ||           | 
| 987 | 
             (cl2->cbar[2*i][0]<=yo2 - fM1 ))|| | 
                  ( cl2->cbar[(2*i)][0] >= (yo5 + fM1) && cl2->cbar[(2*i)][0] <= (yo6 - fM1) && (ix == 2 || multicol) ) | 
| 988 | 
            ((cl2->cbar[2*i][0]>=yo3 + fM1)&& | 
                  )){ | 
 | 
             (cl2->cbar[2*i][0]<=yo4 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[2*i][0]>=yo5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordy[2*i][0]>=(-3.904+fM))&& | 
  | 
 | 
            (track_coordy[2*i][0]<=(+3.904-fM)))&& | 
  | 
 | 
           (((cl2->cbar[2*i][0]>=yo1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo2 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[2*i][0]>=yo3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo4 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[2*i][0]>=yo5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo6 - fM1 ))))|| | 
  | 
 | 
           | 
  | 
 | 
          (((track_coordy[2*i][0]>=(4.146+fM))&& | 
  | 
 | 
            (track_coordy[2*i][0]<=(11.954-fM)))&& | 
  | 
 | 
           (((cl2->cbar[2*i][0]>=yo1 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo2 - fM1))|| | 
  | 
 | 
            ((cl2->cbar[2*i][0]>=yo3 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo4 - fM1 ))|| | 
  | 
 | 
            ((cl2->cbar[2*i][0]>=yo5 + fM1)&& | 
  | 
 | 
             (cl2->cbar[2*i][0]<=yo6 - fM1 )))) | 
  | 
 | 
          ){ | 
  | 
| 989 | 
         fYosel = true; | 
         fYosel = true; | 
| 990 | 
         fYoout = i; | 
         fYoout = i; | 
| 991 | 
       } else { | 
       } else { | 
| 993 | 
         break; | 
         break; | 
| 994 | 
       }; | 
       }; | 
| 995 | 
     }; | 
     }; | 
| 996 | 
  | 
     // | 
| 997 | 
     if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ | 
     if ( !fYosel && fYoout >= fYomin && fYoout >= (Int_t)(fMax_planeyo+nPl) ){ | 
| 998 | 
       if ( debug ) printf(" YO: this event is only partially contained: fYoout %i fYomin %i fMax_planeyo + nPl %i \n",fYoout,fYomin,(Int_t)(fMax_planeyo+nPl)); | 
       if ( debug ) printf(" YO: this event is only partially contained: fYoout %i fYomin %i fMax_planeyo + nPl %i \n",fYoout,fYomin,(Int_t)(fMax_planeyo+nPl)); | 
| 999 | 
       fPartsel = true; | 
       fPartsel = true; | 
| 1002 | 
     if ( fYosel ){ | 
     if ( fYosel ){ | 
| 1003 | 
       for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeyo+nPl)) ;iplm++) fYOen_maxplane += en_yop[iplm];  | 
       for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planeyo+nPl)) ;iplm++) fYOen_maxplane += en_yop[iplm];  | 
| 1004 | 
       fEnergyyo = fYOen_maxplane/fConv_ryo; | 
       fEnergyyo = fYOen_maxplane/fConv_ryo; | 
| 1005 | 
  | 
       // | 
| 1006 | 
  | 
       for (Int_t i=0;i<11;i++){ | 
| 1007 | 
  | 
         for(strip=0; strip<96; strip++) { | 
| 1008 | 
  | 
           // | 
| 1009 | 
  | 
           // run over all the strips of the plane | 
| 1010 | 
  | 
           // | 
| 1011 | 
  | 
           if ( strip >=  0 && strip < 32 ) encol[0][0] += enstrip[0][(2*i)][strip]; | 
| 1012 | 
  | 
           if ( strip >= 32 && strip < 64 ) encol[0][1] += enstrip[0][(2*i)][strip]; | 
| 1013 | 
  | 
           if ( strip >= 64 && strip < 96 ) encol[0][2] += enstrip[0][(2*i)][strip]; | 
| 1014 | 
  | 
           entot[0] += enstrip[0][(2*i)][strip]; | 
| 1015 | 
  | 
           // | 
| 1016 | 
  | 
         }; | 
| 1017 | 
  | 
       }; | 
| 1018 | 
     }; | 
     }; | 
| 1019 | 
   };   | 
   };   | 
| 1020 | 
   // | 
   // | 
| 1040 | 
       fSel = true; | 
       fSel = true; | 
| 1041 | 
     }; | 
     }; | 
| 1042 | 
     fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; | 
     fEnergy = (fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane)/fConv_rxo; | 
| 1043 | 
  | 
     if ( fSel ){ | 
| 1044 | 
  | 
       if ( fXesel ) fColumn = fColXE; | 
| 1045 | 
  | 
       if ( fXosel ){ | 
| 1046 | 
  | 
         if ( fColXO != fColumn && fColumn > -1 ){ | 
| 1047 | 
  | 
           printf(" ERROR! mismatch in column number between different sections! fColumn %i fColXO %i \n",fColumn,fColXO); | 
| 1048 | 
  | 
         } else { | 
| 1049 | 
  | 
           fColumn = fColXO; | 
| 1050 | 
  | 
         }; | 
| 1051 | 
  | 
       }; | 
| 1052 | 
  | 
       if ( fYesel ){ | 
| 1053 | 
  | 
         if ( fColYE != fColumn && fColumn > -1 ){ | 
| 1054 | 
  | 
           printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYE %i \n",fColumn,fColYE); | 
| 1055 | 
  | 
         } else { | 
| 1056 | 
  | 
           fColumn = fColYE; | 
| 1057 | 
  | 
         }; | 
| 1058 | 
  | 
       }; | 
| 1059 | 
  | 
       if ( fYosel ){ | 
| 1060 | 
  | 
         if ( fColYO != fColumn && fColumn > -1 ){ | 
| 1061 | 
  | 
           printf(" ERROR! mismatch in column number between different sections! fColumn %i fColYO %i \n",fColumn,fColYO); | 
| 1062 | 
  | 
         } else { | 
| 1063 | 
  | 
           fColumn = fColYO; | 
| 1064 | 
  | 
         }; | 
| 1065 | 
  | 
       }; | 
| 1066 | 
  | 
     }; | 
| 1067 | 
   }; | 
   }; | 
| 1068 | 
   // | 
   // | 
| 1069 | 
   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); | 
| 1147 | 
       } else { | 
       } else { | 
| 1148 | 
         clong->Fit(); | 
         clong->Fit(); | 
| 1149 | 
       };       | 
       };       | 
| 1150 | 
       fXOen_maxplane = clong->Get_E0(); | 
       if ( clong->GetLowerLimit() != 0. || clong->GetUpperLimit() != 0. ){ | 
| 1151 | 
  | 
         fXOen_maxplane = clong->Get_defE0(); | 
| 1152 | 
  | 
       } else { | 
| 1153 | 
  | 
         fXOen_maxplane = clong->Get_E0(); | 
| 1154 | 
  | 
       }; | 
| 1155 | 
  | 
       fMax_plane = clong->Get_tmax(); | 
| 1156 | 
       fYOen_maxplane  = 0.; | 
       fYOen_maxplane  = 0.; | 
| 1157 | 
       fYEen_maxplane = 0.;  | 
       fYEen_maxplane = 0.;  | 
| 1158 | 
       fXEen_maxplane = 0.; | 
       fXEen_maxplane = 0.; |