Skip to content
Snippets Groups Projects
Commit 641c39ac authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'SimDocPart2_main' into 'main'

Clean-up of AtlasG4EventUserInfo

See merge request !71699
parents be0de0df aac0c8c3
No related branches found
No related tags found
29 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,!71699Clean-up of AtlasG4EventUserInfo
......@@ -72,7 +72,7 @@ namespace G4UA
G4RunManager::GetRunManager()->GetCurrentEvent()->GetUserInformation());
auto* track = a_step->GetTrack();
if ( atlasG4EvtUserInfo &&
( atlasG4EvtUserInfo->GetLastProcessedBarcode() != track->GetTrackID() ||
( atlasG4EvtUserInfo->GetLastProcessedTrackID() != track->GetTrackID() ||
atlasG4EvtUserInfo->GetLastProcessedStep() != track->GetCurrentStepNumber() ) )
{
// We haven't performed any calibration processing for this
......@@ -86,7 +86,7 @@ namespace G4UA
m_defaultSD->Hit( step_nc );
// Update the step info
atlasG4EvtUserInfo->SetLastProcessedBarcode( track->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedTrackID( track->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedStep( track->GetCurrentStepNumber() );
}
}
......
......@@ -163,7 +163,7 @@ namespace CaloG4
G4RunManager::GetRunManager()->GetCurrentEvent()->GetUserInformation());
if ( atlasG4EvtUserInfo ) {
// Update the step info
atlasG4EvtUserInfo->SetLastProcessedBarcode( a_step->GetTrack()->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedTrackID( a_step->GetTrack()->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedStep( a_step->GetTrack()->GetCurrentStepNumber() );
}
}
......
......@@ -84,7 +84,7 @@ G4bool LArG4H6WarmTCSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
AtlasG4EventUserInfo * atlasG4EvtUserInfo = dynamic_cast<AtlasG4EventUserInfo*>(G4RunManager::GetRunManager()->GetCurrentEvent()->GetUserInformation());
if ( atlasG4EvtUserInfo ) {
// Update the step info
atlasG4EvtUserInfo->SetLastProcessedBarcode( aStep->GetTrack()->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedTrackID( aStep->GetTrack()->GetTrackID() );
atlasG4EvtUserInfo->SetLastProcessedStep( aStep->GetTrack()->GetCurrentStepNumber() );
}
}
......
......@@ -37,15 +37,6 @@ public:
*/
void SetHepMCEvent(HepMC::GenEvent*);
int GetNrOfPrimaryParticles() const; // Never called. TODO Remove
void SetNrOfPrimaryParticles(int nr); // Only called in ISF::InputConverter::ISF_to_G4Event(...). TODO Remove
int GetNrOfPrimaryVertices() const; // Never called. TODO Remove
void SetNrOfPrimaryVertices(int nr); // Only called in ISF::InputConverter::ISF_to_G4Event(...). TODO Remove
void SetVertexPosition(const G4ThreeVector&); // Never called. TODO Remove
const G4ThreeVector GetVertexPosition() const; // Never called. TODO Remove
/**
* @brief return a pointer to the HepMC::GenParticle used to create
* the current G4PrimaryParticle. (Used in G4VFastSimulationModel
......@@ -84,14 +75,14 @@ public:
* ensure that unprocessed G4Steps are passed to the default
* CaloCalibrationHit sensitive detector. TODO Rename
*/
int GetLastProcessedBarcode() const { return m_last_processed_barcode; }
int GetLastProcessedTrackID() const { return m_lastProcessedTrackID; }
/**
* @brief record the value of G4Track::GetTrackID() for the current
* G4Step. Should be called by all CaloCalibrationHit Sensitive
* Detectors after they process a G4Step. TODO Check this. TODO
* Rename
*/
void SetLastProcessedBarcode(int b) { m_last_processed_barcode = b; }
void SetLastProcessedTrackID(int trackID) { m_lastProcessedTrackID = trackID; }
/**
* @brief return the value of the G4Track::GetCurrentStepNumber()
......@@ -101,21 +92,18 @@ public:
* that unprocessed G4Steps are passed to the default
* CaloCalibrationHit sensitive detector.
*/
int GetLastProcessedStep() const { return m_last_processed_step; }
int GetLastProcessedStep() const { return m_lastProcessedStep; }
/**
* @brief record value of the G4Track::GetCurrentStepNumber() for
* the current G4Step. Should be called by all CaloCalibrationHit
* Sensitive Detectors after they process a G4Step. TODO Check this
* is done.
*/
void SetLastProcessedStep(int s) { m_last_processed_step = s; }
void SetLastProcessedStep(int stepNumber) { m_lastProcessedStep = stepNumber; }
void Print() const {}
private:
G4ThreeVector m_vertexPosition; // TODO Remove
int m_nrOfPrimaryParticles{0}; // TODO Remove
int m_nrOfPrimaryVertices{0}; // TODO Remove
HepMC::GenEvent *m_theEvent{};
HepMC::ConstGenParticlePtr m_currentPrimary{};
HepMC::GenParticlePtr m_currentlyTraced{};
......@@ -124,8 +112,8 @@ private:
// ID and step number of the last G4Step processed by a
// CaloCalibrationHit SD Both are needed, because a particle might
// have only one step
int m_last_processed_barcode{};
int m_last_processed_step{};
int m_lastProcessedTrackID{0};
int m_lastProcessedStep{0};
};
#endif // MCTRUTH_ATLASG4EVENTUSERINFO_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "MCTruth/AtlasG4EventUserInfo.h"
HepMC::GenEvent* AtlasG4EventUserInfo::GetHepMCEvent()
{
return m_theEvent;
return m_theEvent;
}
void AtlasG4EventUserInfo::SetHepMCEvent(HepMC::GenEvent* ev)
{
m_theEvent=ev;
}
int AtlasG4EventUserInfo::GetNrOfPrimaryParticles() const
{
return m_nrOfPrimaryParticles;
}
void AtlasG4EventUserInfo::SetNrOfPrimaryParticles(int nr)
{
m_nrOfPrimaryParticles=nr;
}
int AtlasG4EventUserInfo::GetNrOfPrimaryVertices() const
{
return m_nrOfPrimaryVertices;
}
void AtlasG4EventUserInfo::SetNrOfPrimaryVertices(int nr)
{
m_nrOfPrimaryVertices=nr;
}
void AtlasG4EventUserInfo::SetVertexPosition(const G4ThreeVector& vtx)
{
m_vertexPosition=vtx;
}
const G4ThreeVector AtlasG4EventUserInfo::GetVertexPosition() const
{
return m_vertexPosition;
m_theEvent=ev;
}
......@@ -474,7 +474,6 @@ G4Event* ISF::InputConverter::ISF_to_G4Event(const ISF::ISFParticleVector& ispVe
// retrieve world solid (volume)
const G4VSolid *worldSolid = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume()->GetSolid();
int n_pp=0;
for ( ISF::ISFParticle *ispPtr: ispVector ) {
ISF::ISFParticle &isp = *ispPtr;
if ( !isInsideG4WorldVolume(isp, worldSolid) ) {
......@@ -491,12 +490,11 @@ G4Event* ISF::InputConverter::ISF_to_G4Event(const ISF::ISFParticleVector& ispVe
continue;
}
this->addG4PrimaryVertex(g4evt,isp,useHepMC,shadowGenEvent);
n_pp++;
}
AtlasG4EventUserInfo *atlasG4EvtUserInfo=new AtlasG4EventUserInfo();
atlasG4EvtUserInfo->SetNrOfPrimaryParticles(n_pp);
atlasG4EvtUserInfo->SetNrOfPrimaryVertices(n_pp); // special case for ISF batches of particles
atlasG4EvtUserInfo->SetLastProcessedTrackID(0); // TODO Check if it is better to set this to -1 initially
atlasG4EvtUserInfo->SetLastProcessedStep(0); // TODO Check if it is better to set this to -1 initially
atlasG4EvtUserInfo->SetHepMCEvent(genEvent);
g4evt->SetUserInformation(atlasG4EvtUserInfo);
......
......@@ -242,7 +242,7 @@ G4bool TileGeoG4CalibSD::ProcessHits(G4Step* step, G4TouchableHistory* /*ROhist*
// Update the event information to note that this step has been dealt with
if ( m_atlasG4EvtUserInfo ) {
// Update the step info
m_atlasG4EvtUserInfo->SetLastProcessedBarcode( step->GetTrack()->GetTrackID() );
m_atlasG4EvtUserInfo->SetLastProcessedTrackID( step->GetTrack()->GetTrackID() );
m_atlasG4EvtUserInfo->SetLastProcessedStep( step->GetTrack()->GetCurrentStepNumber() );
}
......
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