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; |
39 |
simulation = false; |
simulation = false; |
40 |
withtrk = true; |
withtrk = true; |
41 |
rigdefault = 50.; |
rigdefault = 50.; |
42 |
|
nox = false; |
43 |
|
noy = false; |
44 |
// |
// |
45 |
Clear(); |
Clear(); |
46 |
// |
// |
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(){ |
197 |
// |
// |
198 |
mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip); |
mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip); |
199 |
// |
// |
200 |
|
// Mask x or y view if nox and/or noy are true (default false) |
201 |
|
// |
202 |
|
if ( nox && view == 0 ) mip = 0.; |
203 |
|
if ( noy && view == 1 ) mip = 0.; |
204 |
|
// |
205 |
// Selection mode: fill the matrix only for plane < (22 - N) REMEMBER N = number of W planes to be used as presampler, ie if N = 2 then we want to use planes from 0 to 19 |
// Selection mode: fill the matrix only for plane < (22 - N) REMEMBER N = number of W planes to be used as presampler, ie if N = 2 then we want to use planes from 0 to 19 |
206 |
// included so plane < (22 - 2) |
// included so plane < (22 - 2) |
207 |
// |
// |
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 |
}; |
}; |
265 |
// |
// |
266 |
// use only N W planes |
// use only N W planes |
267 |
// |
// |
268 |
event->clevel1->npla = 22-N; |
// event->clevel1->npla = 22-N; |
269 |
|
event->clevel1->npla = NC; |
270 |
// |
// |
271 |
S3 = 0; |
S3 = 0; |
272 |
S2 = 0; |
S2 = 0; |
499 |
if ( debug ) this->Print(); |
if ( debug ) this->Print(); |
500 |
if ( debug ) printf(" exit \n"); |
if ( debug ) printf(" exit \n"); |
501 |
// |
// |
502 |
}; |
} |