@@ -144,7 +144,7 @@ bool Detector::ProcessHits(FairVolume* v)
144144 // Update track status
145145 trkStat = 1 ;
146146 // Create the hits from TR photons if electron/positron is entering the drift volume
147- const bool ele = (TMath::Abs (fMC ->TrackPid ()) == 11 ); // electron PDG code.
147+ const bool ele = (std::fabs (fMC ->TrackPid ()) == 11 ); // electron PDG code.
148148 if (mTRon && ele) {
149149 createTRhit (det);
150150 }
@@ -164,8 +164,8 @@ bool Detector::ProcessHits(FairVolume* v)
164164
165165 // Calculate the charge according to GEANT Edep
166166 // Create a new dEdx hit
167- const float enDep = TMath::Max (fMC ->Edep (), 0.0 ) * 1e9 ; // Energy in eV
168- const int totalChargeDep = (int )(enDep / mWion ); // Total charge
167+ const float enDep = std::max (fMC ->Edep (), 0.0 ) * 1e9 ; // Energy in eV
168+ const int totalChargeDep = (int )(enDep / mWion ); // Total charge
169169
170170 // Store those hits with enDep bigger than the ionization potential of the gas mixture for in-flight tracks
171171 // or store hits of tracks that are entering or exiting
@@ -176,7 +176,10 @@ bool Detector::ProcessHits(FairVolume* v)
176176 double pos[3 ] = {xp, yp, zp};
177177 double loc[3 ] = {-99 , -99 , -99 };
178178 gGeoManager ->MasterToLocal (pos, loc); // Go to the local coordinate system (locR, locC, locT)
179- const float locC = loc[0 ], locR = loc[1 ], locT = loc[2 ];
179+ float locC = loc[0 ], locR = loc[1 ], locT = loc[2 ];
180+ if (drRegion) {
181+ locT = locT - 0.5 * (TRDGeometry::drThick () + TRDGeometry::amThick ()); // Relative to middle of amplification region
182+ }
180183 addHit (xp, yp, zp, locC, locR, locT, tof, totalChargeDep, trackID, det, drRegion);
181184 stack->addHit (GetDetId ());
182185 return true ;
@@ -199,7 +202,7 @@ void Detector::createTRhit(int det)
199202
200203 float px, py, pz, etot;
201204 fMC ->TrackMomentum (px, py, pz, etot);
202- float pTot = TMath::Sqrt (px * px + py * py + pz * pz);
205+ float pTot = std::sqrt (px * px + py * py + pz * pz);
203206 std::vector<float > photonEnergyContainer; // energy in keV
204207 mTR ->createPhotons (11 , pTot, photonEnergyContainer); // Create TR photons
205208 if (photonEnergyContainer.size () > mMaxNumberOfTRPhotons ) {
@@ -264,7 +267,8 @@ void Detector::createTRhit(int det)
264267 double pos[3 ] = {x, y, z};
265268 double loc[3 ] = {-99 , -99 , -99 };
266269 gGeoManager ->MasterToLocal (pos, loc); // Go to the local coordinate system (locR, locC, locT)
267- const float locC = loc[0 ], locR = loc[1 ], locT = loc[2 ];
270+ float locC = loc[0 ], locR = loc[1 ], locT = loc[2 ];
271+ locT = locT - 0.5 * (TRDGeometry::drThick () + TRDGeometry::amThick ()); // Relative to middle of amplification region
268272 addHit (x, y, z, locC, locR, locT, tof, totalChargeDep, trackID, det, true ); // All TR hits are in drift region
269273 stack->addHit (GetDetId ());
270274 }
0 commit comments