@@ -53,6 +53,7 @@ void Detector::InitializeO2Detector()
5353bool Detector::ProcessHits (FairVolume* v)
5454{
5555 TString volname = fMC ->CurrentVolName ();
56+ auto stack = (o2::Data::Stack*)fMC ->GetStack ();
5657
5758 // Treat photons
5859 // photon (Ckov or feedback) hits on module PC (Hpad)
@@ -75,6 +76,7 @@ bool Detector::ProcessHits(FairVolume* v)
7576 Param::Instance ()->Mars2Lors (idch, x, xl, yl); // take LORS position
7677 AddHit (x[0 ], x[1 ], x[2 ], hitTime, etot, tid, idch); // HIT for photon, position at P, etot will be set to Q
7778 GenFee (etot); // generate feedback photons etot is modified in hit ctor to Q of hit
79+ stack->addHit (GetDetId ());
7880 } // photon hit PC and DE >0
7981 return kTRUE ;
8082 } // photon hit PC
@@ -83,7 +85,6 @@ bool Detector::ProcessHits(FairVolume* v)
8385 static Float_t eloss; // need to store mip parameters between different steps
8486 static Double_t in[3 ];
8587
86- auto stack = (o2::Data::Stack*)fMC ->GetStack ();
8788
8889 if (fMC ->IsTrackEntering () && fMC ->TrackCharge () && volname.Contains (" Hpad" )) {
8990 // Trackref stored when entering in the pad volume
@@ -116,10 +117,13 @@ bool Detector::ProcessHits(FairVolume* v)
116117 // HIT for MIP, position near anod plane, eloss will be set to Q
117118 AddHit (out[0 ], out[1 ], out[2 ], hitTime, eloss, tid, idch);
118119 GenFee (eloss); // generate feedback photons
120+ stack->addHit (GetDetId ());
119121 eloss = 0 ;
120122 }
121- } else // just going inside
123+ } else {
124+ // just going inside
122125 eloss += fMC ->Edep (); // collect this step eloss
126+ }
123127 return kTRUE ;
124128 } // MIP in GAP
125129
0 commit comments