|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/IIncidentSvc.h"
14 m_incidentSvc(
"IncidentSvc",
name),
16 m_vertexIncrement(-1),
19 m_secondaryIncrement(1),
20 m_currentSecondary(1),
22 m_barcodeGenerationOffset(1e8)
40 CHECK( m_incidentSvc.retrieve() );
43 m_incidentSvc->addListener(
this, IncidentType::BeginEvent);
46 return StatusCode::SUCCESS;
53 m_currentVertex += m_vertexIncrement;
56 if ( m_currentVertex > 0)
59 <<
" will return a vertex barcode greater than 0: "
60 << m_currentVertex <<
". Possibly Integer Underflow?");
62 return m_currentVertex;
70 m_currentSecondary += m_secondaryIncrement;
73 if ( m_currentSecondary < 0)
75 ATH_MSG_ERROR(
"ValidationBarcodeSvc::newSecondaryParticle(...)"
76 <<
" will return a particle barcode of less than 0: "
77 << m_currentSecondary <<
". Possibly Integer Overflow?");
79 int primGen =
int( (parentBC-m_particleGenerationIncrement) / m_barcodeGenerationOffset);
80 int returnBC = m_currentSecondary + (primGen+1)*m_barcodeGenerationOffset;
89 m_currentSecondary += m_secondaryIncrement;
92 if ( m_currentSecondary < 0)
94 ATH_MSG_ERROR(
"ValidationBarcodeSvc::newGeneratedParticle(...)"
95 <<
" will return a particle barcode of less than 0: "
96 << m_currentSecondary <<
". Possibly Integer Overflow?");
98 int primGen =
int( (parentBC-m_particleGenerationIncrement) / m_barcodeGenerationOffset);
99 int returnBC = m_currentSecondary + (primGen+1)*m_barcodeGenerationOffset;
108 m_currentVertex += m_vertexIncrement;
111 if ( m_currentVertex > 0)
113 ATH_MSG_ERROR(
"ValidationBarcodeSvc::newGeneratedVertex(...)"
114 <<
" will return a vertex barcode greater than 0: "
115 << m_currentVertex <<
". Possibly Integer Underflow?");
117 return m_currentVertex;
124 return m_firstSecondary;
131 return m_firstVertex;
138 if ( inc.type() == IncidentType::BeginEvent )
140 ATH_MSG_VERBOSE(
"'BeginEvent' incident caught. Resetting Vertex and Particle barcode counters.");
141 m_currentVertex = m_firstVertex - m_vertexIncrement;
142 m_currentSecondary = m_firstSecondary - m_secondaryIncrement;
152 return StatusCode::SUCCESS;
constexpr int SIM_BARCODE_THRESHOLD
Constant defining the barcode threshold for simulated particles, eg. can be used to separate generato...
virtual int secondaryVertexBcOffset() const override
Return the secondary vertex offset.
virtual int newSimulationVertex() override
Generate a new unique vertex barcode, based on the parent particle barcode and the physics process co...
#define ATH_MSG_VERBOSE(x)
virtual int secondaryParticleBcOffset() const override
Return the secondary particle and vertex offsets.
ValidationBarcodeSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual int newGeneratedVertex() override
Generate a new unique vertex barcode below the simulation offset.
#define CHECK(...)
Evaluate an expression and check for errors.
int m_barcodeGenerationOffset
not sure why this is needed...
AthROOTErrorHandlerSvc * svc
constexpr int SIM_REGENERATION_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
virtual StatusCode initialize() override
Athena algorithm's interface methods.
virtual int newSecondaryParticle(int parentBC=HepMC::UNDEFINED_ID) override
Generate a new unique barcode for a secondary particle, based on the parent particle barcode.
virtual StatusCode finalize() override
framework methods
virtual ~ValidationBarcodeSvc()
Destructor.
virtual int newGeneratedParticle(int parentBC=HepMC::UNDEFINED_ID) override
Generate a new unique particle barcode below the simulation offset (for particles from pre-defined de...
virtual void handle(const Incident &inc) override
Incident to reset the barcodes at the beginning of the event.