Skip to content

Commit dbbb8a3

Browse files
committed
Test for TPC patch with old failing seed
1 parent 74c640e commit dbbb8a3

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

Detectors/TPC/simulation/src/Detector.cxx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,29 @@ Bool_t Detector::ProcessHits(FairVolume* vol)
142142
// TODO: Temporary hack to process only one sector
143143
// if (sectorID != 0) return kFALSE;
144144

145+
// ---| momentum and beta gamma |---
146+
static TLorentzVector momentum; // static to make avoid creation/deletion of this expensive object
147+
fMC->TrackMomentum(momentum);
148+
149+
const float time = fMC->TrackTime() * 1.0e9;
150+
const int trackID = fMC->GetStack()->GetCurrentTrackNumber();
151+
const int detID = vol->getMCid();
152+
o2::data::Stack* stack = (o2::data::Stack*)fMC->GetStack();
153+
if (fMC->IsTrackEntering() || fMC->IsTrackExiting()) {
154+
stack->addTrackReference(o2::TrackReference(position.X(), position.Y(), position.Z(), momentum.X(), momentum.Y(),
155+
momentum.Z(), fMC->TrackLength(), time, trackID, GetDetId()));
156+
lastReferenceR = fMC->TrackLength();
157+
}
158+
if (TMath::Abs(lastReferenceR - fMC->TrackLength()) > kMaxDistRef) { /// we can speedup
159+
stack->addTrackReference(o2::TrackReference(position.X(), position.Y(), position.Z(), momentum.X(), momentum.Y(),
160+
momentum.Z(), fMC->TrackLength(), time, trackID, GetDetId()));
161+
lastReferenceR = fMC->TrackLength();
162+
}
163+
145164
// ---| remove clusters between the IFC and the FC strips |---
146165
// those should not enter the active readout area
147166
// do coarse selection before, to limit number of transformations
167+
148168
if (detParam.ExcludeFCGap) {
149169
const auto rCluster = std::sqrt(position.X() * position.X() + position.Y() * position.Y());
150170
const float rodRin = 81.5 + 2.2; // radial position of the inner field cage rods + radial size of the field cage rods
@@ -164,24 +184,6 @@ Bool_t Detector::ProcessHits(FairVolume* vol)
164184
}
165185
}
166186

167-
// ---| momentum and beta gamma |---
168-
static TLorentzVector momentum; // static to make avoid creation/deletion of this expensive object
169-
fMC->TrackMomentum(momentum);
170-
171-
const float time = fMC->TrackTime() * 1.0e9;
172-
const int trackID = fMC->GetStack()->GetCurrentTrackNumber();
173-
const int detID = vol->getMCid();
174-
o2::data::Stack* stack = (o2::data::Stack*)fMC->GetStack();
175-
if (fMC->IsTrackEntering() || fMC->IsTrackExiting()) {
176-
stack->addTrackReference(o2::TrackReference(position.X(), position.Y(), position.Z(), momentum.X(), momentum.Y(),
177-
momentum.Z(), fMC->TrackLength(), time, trackID, GetDetId()));
178-
}
179-
if (TMath::Abs(lastReferenceR - fMC->TrackLength()) > kMaxDistRef) { /// we can speedup
180-
stack->addTrackReference(o2::TrackReference(position.X(), position.Y(), position.Z(), momentum.X(), momentum.Y(),
181-
momentum.Z(), fMC->TrackLength(), time, trackID, GetDetId()));
182-
lastReferenceR = fMC->TrackLength();
183-
}
184-
185187
// ===| CONVERT THE ENERGY LOSS TO IONIZATION ELECTRONS |=====================
186188
//
187189
// The energy loss is implemented directly below and taken GEANT3,

run/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ o2_add_test_command(NAME o2sim_G3
255255
pythia8pp
256256
--chunkSize
257257
10
258+
--seed
259+
15946057944514955802
258260
--configKeyValues
259261
"align-geom.mDetectors=none"
260262
LABELS g3 sim long
@@ -334,4 +336,4 @@ install(FILES o2-sim-client.py PERMISSIONS GROUP_READ GROUP_EXECUTE OWNER_EXECUT
334336
install(DIRECTORY SimExamples/
335337
DESTINATION examples
336338
PATTERN *
337-
PERMISSIONS GROUP_READ GROUP_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ)
339+
PERMISSIONS GROUP_READ GROUP_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ)

run/checkStack.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ int main(int argc, char** argv)
144144
for (auto& trackID : trackidsinTPC) {
145145
auto tpc_trackrefs = mcreader.getTrackRefs(eventID, trackID);
146146
LOG(debug) << " Track " << trackID << " has " << tpc_trackrefs.size() << " TrackRefs";
147-
// assert(tpc_trackrefs.size() > 0);
147+
assert(tpc_trackrefs.size() > 0);
148148
for (auto& ref : tpc_trackrefs) {
149149
assert(ref.getTrackID() == trackID);
150150
}

0 commit comments

Comments
 (0)