29 |
|
|
30 |
void CaloNuclei::Clear(){ |
void CaloNuclei::Clear(){ |
31 |
// |
// |
32 |
|
UN = 0; |
33 |
tr = 0; |
tr = 0; |
34 |
sntr = 0; |
sntr = 0; |
35 |
interplane = 0; |
interplane = 0; |
36 |
preq = 0.; |
preq = 0.; |
37 |
postq = 0.; |
postq = 0.; |
38 |
|
stdedx1 = 0.; |
39 |
|
ethr = 0.; |
40 |
dedx1 = 0.; |
dedx1 = 0.; |
41 |
dedx3 = 0.; |
dedx3 = 0.; |
42 |
qpremean = 0.; |
qpremean = 0.; |
110 |
// |
// |
111 |
Clear(); |
Clear(); |
112 |
// |
// |
113 |
|
if ( debug ) printf(" Always calculate stdedx1 \n"); |
114 |
|
// |
115 |
// Always calculate stdedx1 |
// Always calculate stdedx1 |
116 |
// |
// |
117 |
Int_t view = 0; |
Int_t view = 0; |
137 |
// |
// |
138 |
}; |
}; |
139 |
// |
// |
140 |
|
if ( debug ) printf(" find energy released along the strip of maximum on the first plane and on the two neighbour strips \n"); |
141 |
|
// |
142 |
// find energy released along the strip of maximum on the first plane and on the two neighbour strips |
// find energy released along the strip of maximum on the first plane and on the two neighbour strips |
143 |
// |
// |
144 |
if ( indx > 0 ){ |
if ( indx > 0 ){ |
145 |
Int_t mindx = (Int_t)TMath::LocMax(indx,stfpl); |
Int_t mindx = (Int_t)TMath::LocMax(indx,vfpl); |
146 |
for (Int_t ii=0; ii<indx; ii++){ |
for (Int_t ii=0; ii<indx; ii++){ |
147 |
if ( stfpl[ii] == stfpl[mindx] ) stdedx1 += vfpl[ii]; |
if ( stfpl[ii] == stfpl[mindx] ) stdedx1 += vfpl[ii]; |
148 |
if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii]; |
if ( (mindx-1)>=0 && stfpl[ii] == stfpl[mindx-1] ) stdedx1 += vfpl[ii]; |
152 |
stdedx1 = 0.; |
stdedx1 = 0.; |
153 |
}; |
}; |
154 |
// |
// |
155 |
|
if ( debug ) printf(" if ( !usetrack ) return: usetrack %i ntr %i \n",usetrack,ntr); |
156 |
// |
// |
157 |
// |
// |
158 |
if ( !usetrack ) return; |
// if ( !usetrack ) return; |
159 |
// |
// |
160 |
PamTrack *ptrack = 0; |
PamTrack *ptrack = 0; |
161 |
CaloTrkVar *track = 0; |
CaloTrkVar *track = 0; |
|
if ( ntr >= 0 ){ |
|
|
ptrack = L2->GetTrack(ntr); |
|
|
track = ptrack->GetCaloTrack(); |
|
|
} else { |
|
|
track = L2->GetCaloStoredTrack(ntr); |
|
|
}; |
|
162 |
// |
// |
163 |
if ( !track && ntr >= 0 ){ |
if ( usetrack ){ |
164 |
printf(" ERROR: cannot find any track!\n"); |
if ( ntr >= 0 ){ |
165 |
printf(" ERROR: CaloNuclei variables not completely filled \n"); |
ptrack = L2->GetTrack(ntr); |
166 |
return; |
if ( ptrack ) track = ptrack->GetCaloTrack(); |
167 |
|
} else { |
168 |
|
track = L2->GetCaloStoredTrack(ntr); |
169 |
|
}; |
170 |
|
// |
171 |
|
if ( !track && ntr >= 0 ){ |
172 |
|
printf(" ERROR: cannot find any track!\n"); |
173 |
|
printf(" ERROR: CaloNuclei variables not completely filled \n"); |
174 |
|
return; |
175 |
|
}; |
176 |
|
} else { |
177 |
|
if ( ntr >= 0 ){ |
178 |
|
if ( debug ) printf(" ERROR: you asked not to use a track but you are looking for track number %i !\n",ntr); |
179 |
|
if ( debug ) printf(" ERROR: CaloNuclei variables not completely filled \n"); |
180 |
|
return; |
181 |
|
}; |
182 |
}; |
}; |
183 |
// |
// |
184 |
// Float_t defethr = 6. * 0.90; |
// Float_t defethr = 6. * 0.90; |
504 |
}; |
}; |
505 |
// |
// |
506 |
qpremeanN /= (Float_t)RN; |
qpremeanN /= (Float_t)RN; |
507 |
|
UN = RN; |
508 |
// |
// |
509 |
if ( debug ) printf(" charge is %f \n",sqrt(qpremean)); |
if ( debug ) printf(" charge is %f \n",sqrt(qpremean)); |
510 |
// |
// |
516 |
mesethr = mesethr2; |
mesethr = mesethr2; |
517 |
}; |
}; |
518 |
aldone = true; |
aldone = true; |
519 |
if ( mesethr > defethr ) goto retry; |
if ( mesethr > defethr ){ |
520 |
|
interplane = 0; |
521 |
|
preq = 0.; |
522 |
|
postq = 0.; |
523 |
|
qpremean = 0.; |
524 |
|
qpremeanN = 0.; |
525 |
|
multhit = false; |
526 |
|
gap = false; |
527 |
|
goto retry; |
528 |
|
}; |
529 |
}; |
}; |
530 |
}; |
}; |
531 |
// |
// |