| 12 | 
  */ | 
  */ | 
| 13 | 
 CaloPreSampler::CaloPreSampler(){ | 
 CaloPreSampler::CaloPreSampler(){ | 
| 14 | 
   Clear(); | 
   Clear(); | 
| 15 | 
 }; | 
 } | 
| 16 | 
  | 
  | 
| 17 | 
 CaloPreSampler::CaloPreSampler(PamLevel2 *l2p){   | 
 CaloPreSampler::CaloPreSampler(PamLevel2 *l2p){   | 
| 18 | 
   // | 
   // | 
| 30 | 
   cstrip = new CaloStrip(false); | 
   cstrip = new CaloStrip(false); | 
| 31 | 
   //  c1 = new CaloLevel1(); | 
   //  c1 = new CaloLevel1(); | 
| 32 | 
   pcalo = new CaloLevel2(); | 
   pcalo = new CaloLevel2(); | 
| 33 | 
   N = 3; | 
   N = 4; | 
| 34 | 
  | 
   NC = 22-N;  | 
| 35 | 
   debug = false; | 
   debug = false; | 
| 36 | 
   sel = true; | 
   sel = true; | 
| 37 | 
   cont = false; | 
   cont = false; | 
| 67 | 
   printf(" Reading magnetic field maps at %s\n",(q4->PATH+q4->NAME).Data()); | 
   printf(" Reading magnetic field maps at %s\n",(q4->PATH+q4->NAME).Data()); | 
| 68 | 
   trk->LoadField(q4->PATH+q4->NAME); | 
   trk->LoadField(q4->PATH+q4->NAME); | 
| 69 | 
   // | 
   // | 
| 70 | 
 }; | 
 } | 
| 71 | 
  | 
  | 
| 72 | 
  | 
 void CaloPreSampler::SetNoWpreSampler(Int_t n){ | 
| 73 | 
  | 
   if ( NC+n < 23 ){ | 
| 74 | 
  | 
     N = n; | 
| 75 | 
  | 
   } else { | 
| 76 | 
  | 
     printf(" ERROR! Calorimeter is made of 22 W planes\n"); | 
| 77 | 
  | 
     printf(" you are giving N presampler = %i and N calo = %i \n",n,NC); | 
| 78 | 
  | 
     printf(" WARNING: using default values NWpre = 4, NWcalo = 18\n"); | 
| 79 | 
  | 
     NC = 18; | 
| 80 | 
  | 
     N = 4; | 
| 81 | 
  | 
   }; | 
| 82 | 
  | 
 } | 
| 83 | 
  | 
  | 
| 84 | 
  | 
 void CaloPreSampler::SetNoWcalo(Int_t n){ | 
| 85 | 
  | 
   if ( N+n < 23 ){ | 
| 86 | 
  | 
     NC = n; | 
| 87 | 
  | 
   } else { | 
| 88 | 
  | 
     printf(" ERROR! Calorimeter is made of 22 W planes\n"); | 
| 89 | 
  | 
     printf(" you are giving N W presampler = %i and N W calo = %i \n",N,n); | 
| 90 | 
  | 
     printf(" WARNING: using default values NWpre = 4, NWcalo = 18\n"); | 
| 91 | 
  | 
     NC = 18; | 
| 92 | 
  | 
     N = 4; | 
| 93 | 
  | 
   }; | 
| 94 | 
  | 
 } | 
| 95 | 
  | 
  | 
| 96 | 
 void CaloPreSampler::Clear(){ | 
 void CaloPreSampler::Clear(){ | 
| 97 | 
   // | 
   // | 
| 98 | 
   pcalo->Clear(); | 
   pcalo->Clear(); | 
| 99 | 
   // | 
   // | 
| 100 | 
 }; | 
 } | 
| 101 | 
  | 
  | 
| 102 | 
 void CaloPreSampler::Print(){ | 
 void CaloPreSampler::Print(){ | 
| 103 | 
   // | 
   // | 
| 119 | 
   }; | 
   }; | 
| 120 | 
   printf("========================================================================\n"); | 
   printf("========================================================================\n"); | 
| 121 | 
   // | 
   // | 
| 122 | 
 }; | 
 } | 
| 123 | 
  | 
  | 
| 124 | 
 void CaloPreSampler::Delete(){ | 
 void CaloPreSampler::Delete(){ | 
| 125 | 
   Clear(); | 
   Clear(); | 
| 126 | 
   delete pcalo; | 
   delete pcalo; | 
| 127 | 
   //delete this; | 
   //delete this; | 
| 128 | 
 }; | 
 } | 
| 129 | 
  | 
  | 
| 130 | 
  | 
  | 
| 131 | 
 void CaloPreSampler::Process(){ | 
 void CaloPreSampler::Process(){ | 
| 209 | 
       if ( plane < (22 - N) ){ | 
       if ( plane < (22 - N) ){ | 
| 210 | 
         // | 
         // | 
| 211 | 
         if ( emulate18 && plane == (18 - N) ) mip = 0.; | 
         if ( emulate18 && plane == (18 - N) ) mip = 0.; | 
| 212 | 
  | 
         if ( plane >= NC ) mip = 0.; | 
| 213 | 
         event->clevel1->estrip[strip][plane][view] = mip; | 
         event->clevel1->estrip[strip][plane][view] = mip; | 
| 214 | 
         // | 
         // | 
| 215 | 
       }; | 
       }; | 
| 221 | 
       if ( plane >= N ){ | 
       if ( plane >= N ){ | 
| 222 | 
         // | 
         // | 
| 223 | 
         if ( emulate18 && plane == (18 + N) ) mip = 0.; | 
         if ( emulate18 && plane == (18 + N) ) mip = 0.; | 
| 224 | 
  | 
         if ( (plane-N) >= NC ) mip = 0.; | 
| 225 | 
         event->clevel1->estrip[strip][(plane-N)][view] = mip; | 
         event->clevel1->estrip[strip][(plane-N)][view] = mip; | 
| 226 | 
         // | 
         // | 
| 227 | 
       }; | 
       }; | 
| 498 | 
   if ( debug ) this->Print(); | 
   if ( debug ) this->Print(); | 
| 499 | 
   if ( debug ) printf(" exit \n"); | 
   if ( debug ) printf(" exit \n"); | 
| 500 | 
   // | 
   // | 
| 501 | 
 }; | 
 } |