| 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; |
| 41 |
rigdefault = 50.; |
rigdefault = 50.; |
| 42 |
nox = false; |
nox = false; |
| 43 |
noy = false; |
noy = false; |
| 44 |
|
forcecalo = false; |
| 45 |
// |
// |
| 46 |
Clear(); |
Clear(); |
| 47 |
// |
// |
| 68 |
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()); |
| 69 |
trk->LoadField(q4->PATH+q4->NAME); |
trk->LoadField(q4->PATH+q4->NAME); |
| 70 |
// |
// |
| 71 |
}; |
} |
| 72 |
|
|
| 73 |
|
void CaloPreSampler::SetNoWpreSampler(Int_t n){ |
| 74 |
|
if ( NC+n < 23 ){ |
| 75 |
|
N = n; |
| 76 |
|
} else { |
| 77 |
|
printf(" ERROR! Calorimeter is made of 22 W planes\n"); |
| 78 |
|
printf(" you are giving N presampler = %i and N calo = %i \n",n,NC); |
| 79 |
|
printf(" WARNING: using default values NWpre = 4, NWcalo = 18\n"); |
| 80 |
|
NC = 18; |
| 81 |
|
N = 4; |
| 82 |
|
}; |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
void CaloPreSampler::SetNoWcalo(Int_t n){ |
| 86 |
|
if ( N+n < 23 ){ |
| 87 |
|
NC = n; |
| 88 |
|
} else { |
| 89 |
|
printf(" ERROR! Calorimeter is made of 22 W planes\n"); |
| 90 |
|
printf(" you are giving N W presampler = %i and N W calo = %i \n",N,n); |
| 91 |
|
printf(" WARNING: using default values NWpre = 4, NWcalo = 18\n"); |
| 92 |
|
NC = 18; |
| 93 |
|
N = 4; |
| 94 |
|
}; |
| 95 |
|
} |
| 96 |
|
|
| 97 |
void CaloPreSampler::Clear(){ |
void CaloPreSampler::Clear(){ |
| 98 |
// |
// |
| 99 |
pcalo->Clear(); |
pcalo->Clear(); |
| 100 |
// |
// |
| 101 |
}; |
} |
| 102 |
|
|
| 103 |
void CaloPreSampler::Print(){ |
void CaloPreSampler::Print(){ |
| 104 |
// |
// |
| 120 |
}; |
}; |
| 121 |
printf("========================================================================\n"); |
printf("========================================================================\n"); |
| 122 |
// |
// |
| 123 |
}; |
} |
| 124 |
|
|
| 125 |
void CaloPreSampler::Delete(){ |
void CaloPreSampler::Delete(){ |
| 126 |
Clear(); |
Clear(); |
| 127 |
delete pcalo; |
delete pcalo; |
| 128 |
//delete this; |
//delete this; |
| 129 |
}; |
} |
| 130 |
|
|
| 131 |
|
|
| 132 |
void CaloPreSampler::Process(){ |
void CaloPreSampler::Process(){ |
| 209 |
if ( sel ){ |
if ( sel ){ |
| 210 |
if ( plane < (22 - N) ){ |
if ( plane < (22 - N) ){ |
| 211 |
// |
// |
| 212 |
if ( emulate18 && plane == (18 - N) ) mip = 0.; |
if ( emulate18 && plane == (18 - N) && view == 0 ) mip = 0.; |
| 213 |
|
if ( plane >= NC ) mip = 0.; |
| 214 |
event->clevel1->estrip[strip][plane][view] = mip; |
event->clevel1->estrip[strip][plane][view] = mip; |
| 215 |
// |
// |
| 216 |
}; |
}; |
| 221 |
if ( cont ){ |
if ( cont ){ |
| 222 |
if ( plane >= N ){ |
if ( plane >= N ){ |
| 223 |
// |
// |
| 224 |
if ( emulate18 && plane == (18 + N) ) mip = 0.; |
if ( emulate18 && plane == (18 + N) && view == 0 ) mip = 0.; |
| 225 |
|
if ( (plane-N) >= NC ) mip = 0.; |
| 226 |
event->clevel1->estrip[strip][(plane-N)][view] = mip; |
event->clevel1->estrip[strip][(plane-N)][view] = mip; |
| 227 |
// |
// |
| 228 |
}; |
}; |
| 266 |
// |
// |
| 267 |
// use only N W planes |
// use only N W planes |
| 268 |
// |
// |
| 269 |
event->clevel1->npla = 22-N; |
// event->clevel1->npla = 22-N; |
| 270 |
|
event->clevel1->npla = NC; |
| 271 |
// |
// |
| 272 |
S3 = 0; |
S3 = 0; |
| 273 |
S2 = 0; |
S2 = 0; |
| 358 |
// conditions are: 0) no track from the tracker 1) we have a track fit both in x and y 2) no problems with calo for this event 3) no selftrigger event |
// conditions are: 0) no track from the tracker 1) we have a track fit both in x and y 2) no problems with calo for this event 3) no selftrigger event |
| 359 |
// |
// |
| 360 |
// if ( trackanyway && !filled && event->clevel2->npcfit[0] >= 2 && event->clevel2->npcfit[1] >= 2 && event->clevel2->good != 0 && event->clevel2->trigty < 2. ){ |
// if ( trackanyway && !filled && event->clevel2->npcfit[0] >= 2 && event->clevel2->npcfit[1] >= 2 && event->clevel2->good != 0 && event->clevel2->trigty < 2. ){ |
| 361 |
if ( trackanyway && m3 ){ |
if ( (trackanyway && m3) || forcecalo ){ |
| 362 |
if ( debug ) printf(" Event with a track not fitted by the tracker \n"); |
if ( debug ) printf(" Event with a track not fitted by the tracker \n"); |
| 363 |
// |
// |
| 364 |
// Disable "track mode" in the fortran routine |
// Disable "track mode" in the fortran routine |
| 500 |
if ( debug ) this->Print(); |
if ( debug ) this->Print(); |
| 501 |
if ( debug ) printf(" exit \n"); |
if ( debug ) printf(" exit \n"); |
| 502 |
// |
// |
| 503 |
}; |
} |