|
ATLAS Offline Software
|
Go to the documentation of this file.
14 m_vertexIncrement(-1),
16 m_particleIncrement(1)
25 ATH_MSG_DEBUG(
"LegacyBarcodeSvc start of initialize in thread ID: " << std::this_thread::get_id() );
30 return StatusCode::SUCCESS;
36 std::lock_guard<std::mutex> barcodeLock(barcodeMutex);
41 const auto tid = std::this_thread::get_id();
42 auto bcPair = m_bcThreadMap.find(tid);
43 if ( bcPair == m_bcThreadMap.end() ) {
46 ATH_MSG_DEBUG(
"initializeBarcodes: initialized new barcodes for thread ID " << tid );
47 ATH_CHECK( this->resetBarcodes(largestGeneratedParticleBC, largestGeneratedVertexBC) );
48 ATH_MSG_DEBUG(
"initializeBarcodes: reset new barcodes for thread ID " << tid );
50 ATH_MSG_ERROR(
"initializeBarcodes: failed to initialize new barcode for thread ID " << tid );
53 ATH_MSG_DEBUG(
"initializeBarcodes: barcodes for this thread ID found, did not construct new" );
54 ATH_CHECK( this->resetBarcodes(largestGeneratedParticleBC, largestGeneratedVertexBC) );
55 ATH_MSG_DEBUG(
"initializeBarcodes: reset existing barcodes for thread ID " << tid );
57 return StatusCode::SUCCESS;
62 const auto tid = std::this_thread::get_id();
63 auto bcPair = m_bcThreadMap.find(tid);
64 if ( bcPair == m_bcThreadMap.end() ) {
65 ATH_MSG_WARNING(
"getBarcodeInfo: failed to find BarcodeInfo for thread ID " << tid <<
", created a new one." );
67 auto result = m_bcThreadMap.insert( std::make_pair( tid, barcodeInfo ) );
69 auto bcPair = m_bcThreadMap.find(tid);
70 return bcPair->second;
72 ATH_MSG_ERROR (
"getBarcodeInfo: could not add a the new BarcodeInfo object to the map!" );
73 return m_bcThreadMap.begin()->second;
75 return bcPair->second;
89 <<
" will return a vertex barcode greater than "
110 <<
" will return a particle barcode of less than "
131 <<
" will return a vertex barcode greater than 0: "
139 <<
" will return a vertex barcode below "
158 <<
" will return a particle barcode of less than 0: "
166 <<
" will return a particle barcode below "
176 ATH_MSG_DEBUG(
"registering largest generated particle barcode" );
183 ATH_MSG_DEBUG(
"registering largest generated particle barcode" );
199 return m_firstSecondary;
205 return m_firstVertex;
218 return StatusCode::SUCCESS;
constexpr int SIM_BARCODE_THRESHOLD
Constant defining the barcode threshold for simulated particles, eg. can be used to separate generato...
virtual void registerLargestSecondaryParticleBC(int bc) override
virtual void registerLargestSimulationVtxBC(int bc) override
virtual StatusCode resetBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
Reset barcodes.
#define ATH_MSG_VERBOSE(x)
virtual int newSecondaryParticle(int) override
Generate a new unique barcode for a secondary particle above the simulation offset.
int currentSimulationVertex
virtual void registerLargestGeneratedVtxBC(int bc) override
int currentGeneratedParticle
::StatusCode StatusCode
StatusCode definition for legacy code.
LegacyBarcodeSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
virtual int newGeneratedVertex() override
Generate a new unique vertex barcode below the simulation offset.
AthROOTErrorHandlerSvc * svc
virtual int secondaryParticleBcOffset() const override
Return the secondary particle and vertex offsets.
constexpr int UNDEFINED_ID
virtual StatusCode initializeBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
Construct and insert a new set of barcode members.
int currentSecondaryParticle
virtual int newSimulationVertex() override
Generate a new unique vertex barcode above the simulation offset.
virtual void registerLargestGeneratedParticleBC(int bc) override
Inform the BarcodeSvc about the largest particle and vertex Barcodes in the event input.
virtual int secondaryVertexBcOffset() const override
Return the secondary vertex offset.
#define ATH_MSG_WARNING(x)
BarcodeInfo & getBarcodeInfo()
virtual int newGeneratedParticle(int) override
Generate a new unique particle barcode below the simulation offset (for particles from pre-defined de...
virtual StatusCode initialize() override
Athena algorithm's interface methods.
int currentGeneratedVertex