100 G4double thisStepEnergyDeposit = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
101 G4double thisStepLength = a_step->GetStepLength() /
Units::mm;
105 ATH_MSG_DEBUG(
"****** LArBarrelPresamplerCalculator: Step energy,length "
106 << thisStepEnergyDeposit <<
" " << thisStepLength);
108 if(thisStepEnergyDeposit <= 0. || thisStepLength <= 0.)
114 G4StepPoint *thisStepPoint = a_step->GetPreStepPoint();
115 G4StepPoint *thisStepBackPoint = a_step->GetPostStepPoint();
116 G4ThreeVector startPoint = thisStepPoint->GetPosition();
117 G4ThreeVector endPoint = thisStepBackPoint->GetPosition();
121 << startPoint.x() <<
" " << startPoint.y() <<
" "
124 << endPoint.x() <<
" " << endPoint.y() <<
" "
131 const G4NavigationHistory* g4navigation = thisStepPoint->GetTouchable()->GetHistory();
132 G4int ndep = g4navigation->GetDepth();
139 const G4String presamplerName((
m_detectorName.empty()) ?
"LAr::Barrel::Presampler" :
141 for (G4int ii=0;ii<=ndep;ii++) {
142 G4VPhysicalVolume* v1 = g4navigation->GetVolume(ii);
144 ATH_MSG_DEBUG(
" Level,VolumeName " << ii <<
" " << v1->GetName());
147 if (v1->GetName()==presamplerName) idep=ii;
155 ATH_MSG_WARNING(
" LArBarrelPresamplerCalculator::Process Presampler volume not found !!");
160 const G4AffineTransform transformation = g4navigation->GetTransform(idep);
163 G4ThreeVector startPointinLocal =
164 transformation.TransformPoint(startPoint);
165 G4ThreeVector endPointinLocal =
166 transformation.TransformPoint (endPoint);
170 << startPointinLocal.x() <<
" " << startPointinLocal.y() <<
" "
171 << startPointinLocal.z());
173 << endPointinLocal.x() <<
" " << endPointinLocal.y() <<
" "
174 << endPointinLocal.z());
182 if (
m_IflCur) nsub_step=(
int) (thisStepLength*(1./dstep)) + 1;
184 G4double delta=1./((
double) nsub_step);
186 ATH_MSG_DEBUG(
" nsub_step,delta " << nsub_step <<
" " << delta);
189 G4double
energy = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
191 const double EField = 10. ;
192 const double wholeStepLengthCm = a_step->GetStepLength() /
CLHEP::cm;
193 energy = (*m_birksLaw)(
energy, wholeStepLengthCm, EField);
201 for (G4int
i=0;
i<nsub_step;
i++) {
208 G4double fraction=(((G4double)
i)+0.5)*delta;
209 G4ThreeVector subinLocal=startPointinLocal*(1-fraction) + endPointinLocal*fraction;
210 G4double xloc = subinLocal.x();
211 G4double yloc = subinLocal.y();
212 G4double zloc = subinLocal.z();
227 zSide = ( startPoint.z() > 0.) ? 1 : -1;
229 G4int region = currentCellData.
region;
232 G4int sampling = currentCellData.
sampling;
242 if (sampling !=0 || region != 0 ||
243 etaBin <0 || etaBin > 60 || phiBin <0 || phiBin>63)
continue;
264 tof = thisStepPoint->GetGlobalTime() /
Units::ns;
275 G4int imodule = currentCellData.
module;
277 G4double
y0 = currentCellData.
xElec;
284 if (imodule==0 || imodule ==1) {
295 ATH_MSG_WARNING(
" LArBarrelPresamplerCalculator: cannot get map for module " << imodule);
298 double current0,current1,current2,
gap;
301 cm->GetAll(x0,y0,&
gap,¤t0,¤t1,¤t2);
303 ATH_MSG_DEBUG(
" module,x0,y0,current0 from map " << imodule <<
" " << x0 <<
" " << y0 <<
" " << current0);
307 Current =
energy*current0;
314 for (
unsigned int j=0; j<hdata.size(); j++) {
315 if (hdata[j].
id==identifier2) {
316 hdata[j].energy += Current;
317 hdata[j].time +=
time*Current;
324 hdata.push_back(newdata);
332 ATH_MSG_DEBUG(
"Number of hits for this step " << m_nhits <<
" " << hdata.size());
336 for (
unsigned int i=0;
i<hdata.size();
i++) {
337 if (std::fabs(hdata[
i].
energy)>1
e-6) hdata[
i].time=hdata[
i].time/hdata[
i].energy;
338 else hdata[
i].time=0.;
344 if (!hdata.empty())
return true;