ATLAS Offline Software
Loading...
Searching...
No Matches
LegacyBarcodeSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef BARCODESERVICES_LEGACYBARCODESVC_H
6#define BARCODESERVICES_LEGACYBARCODESVC_H 1
7
8// STL includes
9#include <string>
10
11// FrameWork includes
12#include "GaudiKernel/ServiceHandle.h"
14
15//include
17
18#include "tbb/concurrent_unordered_map.h"
19
20
21
22namespace Barcode {
23
31
32 class LegacyBarcodeSvc : public extends<AthService, IBarcodeSvc> {
33 public:
34
36 LegacyBarcodeSvc( const std::string& name, ISvcLocator* pSvcLocator );
37
39 virtual ~LegacyBarcodeSvc() = default;
40
42 virtual StatusCode initialize() override;
43
45 virtual StatusCode initializeBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override;
46
48 virtual StatusCode resetBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override;
49
51 virtual int newSecondaryParticle( int) override;
52
54 virtual int newGeneratedParticle(int ) override;
55
57 virtual int newSimulationVertex() override;
58
60 virtual int newGeneratedVertex() override;
61
64 virtual void registerLargestGeneratedParticleBC( int bc) override;
65 virtual void registerLargestGeneratedVtxBC( int bc) override;
66 virtual void registerLargestSecondaryParticleBC( int bc) override;
67 virtual void registerLargestSimulationVtxBC( int bc) override;
68
70 virtual int secondaryParticleBcOffset() const override;
71 virtual int secondaryVertexBcOffset() const override;
72
73 private:
74
78
82
95
96 using LegacyBarcodeSvcThreadMap_t = tbb::concurrent_unordered_map
97 < std::thread::id, BarcodeInfo, std::hash<std::thread::id> >;
99
101
102 };
103
104
105} // end 'Barcode' namespace
106
107#endif //> !BARCODESERVICES_LEGACYBARCODESVC_H
virtual void registerLargestGeneratedParticleBC(int bc) override
Inform the BarcodeSvc about the largest particle and vertex Barcodes in the event input.
virtual int secondaryParticleBcOffset() const override
Return the secondary particle and vertex offsets.
virtual StatusCode initialize() override
Athena algorithm's interface methods.
int m_firstVertex
barcode information used for GenVertices
virtual void registerLargestGeneratedVtxBC(int bc) override
virtual int newGeneratedVertex() override
Generate a new unique vertex barcode below the simulation offset.
tbb::concurrent_unordered_map< std::thread::id, BarcodeInfo, std::hash< std::thread::id > > LegacyBarcodeSvcThreadMap_t
virtual StatusCode resetBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
Reset barcodes.
LegacyBarcodeSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
virtual int newSecondaryParticle(int) override
Generate a new unique barcode for a secondary particle above the simulation offset.
virtual StatusCode initializeBarcodes(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
Construct and insert a new set of barcode members.
virtual int secondaryVertexBcOffset() const override
Return the secondary vertex offset.
virtual void registerLargestSimulationVtxBC(int bc) override
virtual ~LegacyBarcodeSvc()=default
Destructor.
int m_firstSecondary
barcode information used for secondary GenParticles
virtual void registerLargestSecondaryParticleBC(int bc) override
virtual int newSimulationVertex() override
Generate a new unique vertex barcode above the simulation offset.
LegacyBarcodeSvcThreadMap_t m_bcThreadMap
virtual int newGeneratedParticle(int) override
Generate a new unique particle barcode below the simulation offset (for particles from pre-defined de...
BarcodeInfo(int csv, int csp, int cgv, int cgp)