Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Detector : public o2::base::DetImpl<Detector>
int mHitCounter = 0;
int mElectronCounter = 0;
int mStepCounter = 0;
ElementalHit mHitLast{}; ///<! buffer last processed hit to be able to fill it to mHitsPerSectorCollection

/// Create the detector materials
virtual void CreateMaterials();
Expand Down
12 changes: 12 additions & 0 deletions Detectors/TPC/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,24 @@ Bool_t Detector::ProcessHits(FairVolume* vol)
mHitCounter++;
mElectronCounter += numberOfElectrons;
currentgroup->addHit(position.X(), position.Y(), position.Z(), time, numberOfElectrons);

// add last buffered hit, which was not yet added to the currentgroup
if (mHitLast.GetEnergyLoss() >= 0) {
currentgroup->addHit(mHitLast.GetX(), mHitLast.GetY(), mHitLast.GetZ(), mHitLast.GetTime(), mHitLast.GetEnergyLoss());
mHitLast.mELoss = -1;
groupCounter++;
mHitCounter++;
mElectronCounter += mHitLast.GetEnergyLoss();
}
}
// finish group
else {
oldTrackId = trackID;
oldSectorId = sectorID;
groupCounter = 0;

// buffer this hit, otherwise it wouldnt be stored in the HitGroup
mHitLast = ElementalHit(position.X(), position.Y(), position.Z(), time, numberOfElectrons);
}

// LOG(info) << "tpc::AddHit" << FairLogger::endl
Expand Down