Skip to content
Snippets Groups Projects
Commit 6dafac75 authored by John Derek Chapman's avatar John Derek Chapman Committed by Johannes Elmsheuser
Browse files

Clean-up HepMcParticleLink constructors in TrkTruthCreatorTools

(DecayInFly/Elastic)TruthTrajectoryBuilder::buildTruthTrajectory(...) - avoid using eventIndex=0 with IS_EVENTNUM in HepMcParticleLink constructors
parent 863574bc
No related branches found
No related tags found
30 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71279Draft: ATR-29330: Move L1_4J15 and the HLT chains seeded by it in the MC Menu,!71199Clean-up HepMcParticleLink constructors in TrkTruthCreatorTools
......@@ -40,7 +40,7 @@ void DecayInFlyTruthTrajectoryBuilder::
buildTruthTrajectory(TruthTrajectory *result, const HepMC::ConstGenParticlePtr& input) const
{
result->clear();
if(input) {
if (input) {
HepMC::ConstGenParticlePtr next{nullptr};
HepMC::ConstGenParticlePtr current = input;
......@@ -48,22 +48,25 @@ buildTruthTrajectory(TruthTrajectory *result, const HepMC::ConstGenParticlePtr&
// in the TruthTrajectory, so we need to use a tmp storage while
// traversing the structure.
std::stack<HepMC::ConstGenParticlePtr> tmp;
while( (next = getDaughter(current)) ) {
while ( (next = getDaughter(current)) ) {
tmp.push(current = next);
}
// All particles in the TruthTrajectory will be from the same GenEvent
const int eventNumber = input->parent_event()->event_number();
// copy the outer half to result
while(!tmp.empty()) {
result->emplace_back(tmp.top(),0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
while (!tmp.empty()) {
result->emplace_back(tmp.top(), eventNumber, HepMcParticleLink::IS_EVENTNUM);
tmp.pop();
}
// The input particle itself
result->emplace_back(input,0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
result->emplace_back(input, eventNumber, HepMcParticleLink::IS_EVENTNUM);
// Now continue towards the interaction point
while( (next = getMother(current)) ) {
result->emplace_back(current = next,0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
while ( (next = getMother(current)) ) {
result->emplace_back(current = next, eventNumber, HepMcParticleLink::IS_EVENTNUM);
}
}
}
......
......@@ -39,33 +39,36 @@ StatusCode ElasticTruthTrajectoryBuilder::initialize() {
void ElasticTruthTrajectoryBuilder::
buildTruthTrajectory(TruthTrajectory *result, const HepMC::ConstGenParticlePtr& input) const
{
result->clear();
if(input) {
HepMC::ConstGenParticlePtr next(nullptr);
HepMC::ConstGenParticlePtr current = input;
// Extend trajectory outwards. The last particle should go at [0]
// in the TruthTrajectory, so we need to use a tmp storage while
// traversing the structure.
std::stack<HepMC::ConstGenParticlePtr> tmp;
while( (next = getDaughter(current)) ) {
tmp.push(current = next);
}
// copy the outer half to result
while(!tmp.empty()) {
result->emplace_back(tmp.top(),0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
tmp.pop();
}
// The input particle itself
result->emplace_back(input,0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
// Now continue towards the interaction point
while( (next = getMother(current)) ) {
result->emplace_back(current = next,0,HepMcParticleLink::IS_EVENTNUM); // FIXME should not be using eventIndex=0 with IS_EVENTNUM either obtain event number from GenParticlePtr or use IS_POSITION
}
}
result->clear();
if (input) {
HepMC::ConstGenParticlePtr next(nullptr);
HepMC::ConstGenParticlePtr current = input;
// Extend trajectory outwards. The last particle should go at [0]
// in the TruthTrajectory, so we need to use a tmp storage while
// traversing the structure.
std::stack<HepMC::ConstGenParticlePtr> tmp;
while ( (next = getDaughter(current)) ) {
tmp.push(current = next);
}
// All particles in the TruthTrajectory will be from the same GenEvent
const int eventNumber = input->parent_event()->event_number();
// copy the outer half to result
while (!tmp.empty()) {
result->emplace_back(tmp.top(), eventNumber, HepMcParticleLink::IS_EVENTNUM);
tmp.pop();
}
// The input particle itself
result->emplace_back(input, eventNumber, HepMcParticleLink::IS_EVENTNUM);
// Now continue towards the interaction point
while ( (next = getMother(current)) ) {
result->emplace_back(current = next, eventNumber, HepMcParticleLink::IS_EVENTNUM);
}
}
}
//================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment