99 G4double thisStepEnergyDeposit = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
100 G4double thisStepLength = a_step->GetStepLength() /
Units::mm;
104 ATH_MSG_DEBUG(
"****** LArBarrelPresamplerCalculator: Step energy,length "
105 << thisStepEnergyDeposit <<
" " << thisStepLength);
107 if(thisStepEnergyDeposit <= 0. || thisStepLength <= 0.)
113 G4StepPoint *thisStepPoint = a_step->GetPreStepPoint();
114 G4StepPoint *thisStepBackPoint = a_step->GetPostStepPoint();
115 G4ThreeVector startPoint = thisStepPoint->GetPosition();
116 G4ThreeVector endPoint = thisStepBackPoint->GetPosition();
120 << startPoint.x() <<
" " << startPoint.y() <<
" "
123 << endPoint.x() <<
" " << endPoint.y() <<
" "
130 const G4NavigationHistory* g4navigation = thisStepPoint->GetTouchable()->GetHistory();
131 G4int ndep = g4navigation->GetDepth();
138 const G4String presamplerName((
m_detectorName.empty()) ?
"LAr::Barrel::Presampler" :
140 for (G4int ii=0;ii<=ndep;ii++) {
141 G4VPhysicalVolume* v1 = g4navigation->GetVolume(ii);
143 ATH_MSG_DEBUG(
" Level,VolumeName " << ii <<
" " << v1->GetName());
146 if (v1->GetName()==presamplerName) idep=ii;
154 ATH_MSG_WARNING(
" LArBarrelPresamplerCalculator::Process Presampler volume not found !!");
159 const G4AffineTransform transformation = g4navigation->GetTransform(idep);
162 G4ThreeVector startPointinLocal =
163 transformation.TransformPoint(startPoint);
164 G4ThreeVector endPointinLocal =
165 transformation.TransformPoint (endPoint);
169 << startPointinLocal.x() <<
" " << startPointinLocal.y() <<
" "
170 << startPointinLocal.z());
172 << endPointinLocal.x() <<
" " << endPointinLocal.y() <<
" "
173 << endPointinLocal.z());
181 if (
m_IflCur) nsub_step=(
int) (thisStepLength*(1./dstep)) + 1;
183 G4double delta=1./((
double) nsub_step);
185 ATH_MSG_DEBUG(
" nsub_step,delta " << nsub_step <<
" " << delta);
188 G4double
energy = a_step->GetTotalEnergyDeposit() * a_step->GetTrack()->GetWeight();
190 const double EField = 10. ;
191 const double wholeStepLengthCm = a_step->GetStepLength() /
CLHEP::cm;
192 energy = (*m_birksLaw)(
energy, wholeStepLengthCm, EField);
200 for (G4int
i=0;
i<nsub_step;
i++) {
207 G4double fraction=(((G4double)
i)+0.5)*delta;
208 G4ThreeVector subinLocal=startPointinLocal*(1-fraction) + endPointinLocal*fraction;
209 G4double xloc = subinLocal.x();
210 G4double yloc = subinLocal.y();
211 G4double zloc = subinLocal.z();
226 zSide = ( startPoint.z() > 0.) ? 1 : -1;
228 G4int region = currentCellData.
region;
231 G4int sampling = currentCellData.
sampling;
241 if (sampling !=0 || region != 0 ||
242 etaBin <0 || etaBin > 60 || phiBin <0 || phiBin>63)
continue;
263 tof = thisStepPoint->GetGlobalTime() /
Units::ns;
274 G4int imodule = currentCellData.
module;
275 G4double x0 = currentCellData.
distElec;
276 G4double y0 = currentCellData.
xElec;
283 if (imodule==0 || imodule ==1) {
294 ATH_MSG_WARNING(
" LArBarrelPresamplerCalculator: cannot get map for module " << imodule);
297 double current0,current1,current2,
gap;
300 cm->GetAll(x0,y0,&
gap,¤t0,¤t1,¤t2);
302 ATH_MSG_DEBUG(
" module,x0,y0,current0 from map " << imodule <<
" " << x0 <<
" " << y0 <<
" " << current0);
306 Current =
energy*current0;
313 for (
unsigned int j=0; j<hdata.size(); j++) {
314 if (hdata[j].
id==identifier2) {
315 hdata[j].energy += Current;
316 hdata[j].time +=
time*Current;
322 hdata.emplace_back(
LArHitData{identifier2,
time*Current, Current});
330 ATH_MSG_DEBUG(
"Number of hits for this step " << m_nhits <<
" " << hdata.size());
334 for (
unsigned int i=0;
i<hdata.size();
i++) {
335 if (std::fabs(hdata[
i].
energy)>1
e-6) hdata[
i].time=hdata[
i].time/hdata[
i].energy;
336 else hdata[
i].time=0.;
342 if (!hdata.empty())
return true;