ATLAS Offline Software
Loading...
Searching...
No Matches
DumpMC Class Reference

Dump MC event record. More...

#include <DumpMC.h>

Inheritance diagram for DumpMC:
Collaboration diagram for DumpMC:

Public Member Functions

 DumpMC (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Event collection accessors (const and non-const)
HepMC::GenEvent *event ATLAS_NOT_CONST_THREAD_SAFE ()
 Access the current signal event (first in the McEventCollection)
McEventCollection *events ATLAS_NOT_CONST_THREAD_SAFE ()
 Access the current event's McEventCollection.
const HepMC::GenEvent * event_const () const
 Access the current signal event (const)
const McEventCollectionevents_const () const
 Access the current event's McEventCollection (const)
const McEventCollectionevents_const (const EventContext &ctx) const
Particle data accessors
const ServiceHandle< IPartPropSvc > partPropSvc () const
 Access the particle property service.
const HepPDT::ParticleDataTable & particleTable () const
 Get a particle data table.
const HepPDT::ParticleDataTable & pdt () const
 Shorter alias to get a particle data table.
const HepPDT::ParticleData * particleData (int pid) const
 Access an element in the particle data table.

Public Attributes

std::string m_keyout
bool m_VerboseOutput
bool m_DeepCopy
bool m_EtaPhi
bool m_PrintQuasiStableParticles

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

Properties
std::string m_mcEventKey {}
 StoreGate key for the MC event collection (defaults to GEN_EVENT)
BooleanProperty m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
 Flag to determine if a new MC event collection should be made if it doesn't exist.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Utility event-mangling functions

Todo
Replace with HepMC units when available
ServiceHandle< IPartPropSvc > m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
 Handle on the particle property service.
SG::ReadHandleKey< McEventCollectionm_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
 Const handle to the MC event collection.
void GeVToMeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1000.
void MeVToGeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1/1000.
void cmTomm (HepMC::GenEvent *evt)
 Scale event lengths by x 10.
void mmTocm (HepMC::GenEvent *evt)
 Scale event lengths by x 1/10.

Detailed Description

Dump MC event record.

Definition at line 12 of file DumpMC.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DumpMC()

DumpMC::DumpMC ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 11 of file DumpMC.cxx.

12 : GenBase(name, pSvcLocator)
13{
14 declareProperty("McEventOutputKey", m_keyout="GEN_EVENT");
15 declareProperty("VerboseOutput", m_VerboseOutput=true);
16 declareProperty("DeepCopy", m_DeepCopy=false);
17 declareProperty("EtaPhi", m_EtaPhi=false);
18 declareProperty("PrintQuasiStableParticles", m_PrintQuasiStableParticles=false);
19}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_keyout
Definition DumpMC.h:19
bool m_PrintQuasiStableParticles
Definition DumpMC.h:23
bool m_EtaPhi
Definition DumpMC.h:22
bool m_DeepCopy
Definition DumpMC.h:21
bool m_VerboseOutput
Definition DumpMC.h:20
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition GenBase.cxx:11

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]

HepMC::GenEvent *event GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inlineinherited

Access the current signal event (first in the McEventCollection)

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

Definition at line 76 of file GenBase.h.

76 {
77 if (events()->empty())
78 ATH_MSG_ERROR("McEventCollection is empty during first event access");
79 return *(events()->begin());
80 }
#define ATH_MSG_ERROR(x)
static const Attributes_t empty

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]

McEventCollection *events GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inherited

Access the current event's McEventCollection.

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

◆ cmTomm()

void GenBase::cmTomm ( HepMC::GenEvent * evt)
protectedinherited

Scale event lengths by x 10.

Definition at line 78 of file GenBase.cxx.

78 {
79 for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
80 const HepMC::FourVector fv((*vtx)->position().x() * 10,
81 (*vtx)->position().y() * 10,
82 (*vtx)->position().z() * 10,
83 (*vtx)->position().t() * 10);
84 (*vtx)->set_position(fv);
85 }
86}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ event_const()

const HepMC::GenEvent * GenBase::event_const ( ) const
inlineinherited

Access the current signal event (const)

Definition at line 83 of file GenBase.h.

83 {
84 if (events_const()->empty())
85 ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
86 return *(events_const()->begin());
87 }
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition GenBase.h:96

◆ events_const() [1/2]

const McEventCollection * GenBase::events_const ( ) const
inlineinherited

Access the current event's McEventCollection (const)

Definition at line 96 of file GenBase.h.

96 {
97 return events_const( getContext() );
98 }

◆ events_const() [2/2]

const McEventCollection * GenBase::events_const ( const EventContext & ctx) const
inlineinherited

Definition at line 99 of file GenBase.h.

99 {
100 SG::ReadHandle<McEventCollection> ret = SG::makeHandle(m_mcevents_const, ctx);
101 if (!ret.isValid())
102 ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
103 return ret.cptr();
104 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition GenBase.h:163
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode DumpMC::execute ( )
virtual

Reimplemented from GenBase.

Definition at line 32 of file DumpMC.cxx.

32 {
33 if (m_DeepCopy) {
34 McEventCollection* mcCollptra = new McEventCollection();
35 // Fill the new McEventCollection with a copy of the initial HepMC::GenEvent
36 for(const HepMC::GenEvent* evt : *events_const()) {
37 mcCollptra->push_back(new HepMC::GenEvent(*evt));
38 }
39 // Loop over all events in McEventCollection
40 for (McEventCollection::iterator evt = mcCollptra->begin(); evt != mcCollptra->end(); ++evt) {
41#ifdef HEPMC3
42 std::vector<HepMC::GenVertexPtr> lambda_vertices_to_remove;
43 for (auto part: **evt){
44 const int abspid = std::abs(part->pdg_id());
45 if (abspid != 310 && abspid != 3122 && abspid != 3222 && abspid != 3112 && abspid != 3322 && abspid != 3312 && abspid != 3334 ) continue;
46 if (!part->end_vertex()) continue;
47 lambda_vertices_to_remove.push_back(part->end_vertex());
48 part->set_status(1);
49 }
50 for (auto v: lambda_vertices_to_remove) (*evt)->remove_vertex(std::move(v));
51#else
52 // Loop over the vertices of the event
53 std::set<int> Lambdas;
54 std::set<int> vtx_to_delete;
55 for (HepMC::GenEvent::vertex_const_iterator vtx = (*evt)->vertices_begin(); vtx != (*evt)->vertices_end(); ++vtx) {
56 // Loop over the particles that produced the vertex
57 if ( vtx_to_delete.find((*vtx)->barcode()) == vtx_to_delete.end() &&
58 (*vtx)->particles_in_const_begin() != (*vtx)->particles_in_const_end() ) {
59 HepMC::GenVertex::particles_in_const_iterator part = (*vtx)->particles_in_const_begin();
60 bool lambda_not_found = true;
61 const int abspid = std::abs((*part)->pdg_id());
62 do {
63 if (abspid == 310 || abspid == 3122 || abspid == 3222 || abspid == 3112 ||
64 abspid == 3322 || abspid == 3312 || abspid == 3334 ) {
65 lambda_not_found = false;
66 Lambdas.insert((*part)->barcode());
67 vtx_to_delete.insert((*vtx)->barcode());
68 // In case a lambda was found, store in vertices to be deleted all the vertices
69 // that the products of Lambda created
70 for (HepMC::GenVertex::vertex_iterator desc = (*vtx)->vertices_begin(HepMC::descendants);
71 desc != (*vtx)->vertices_end(HepMC::descendants); ++desc) {
72 vtx_to_delete.insert((*desc)->barcode());
73 }
74 }
75 ++part;
76 } while (part != (*vtx)->particles_in_const_end() && lambda_not_found);
77 }
78 }
79
80 // Set Lambda's status to stable
81 for (std::set<int>::iterator l = Lambdas.begin(); l != Lambdas.end(); ++l) {
82 HepMC::GenParticle* lam = (*evt)->barcode_to_particle(*l);
83 lam->set_status(1);
84 }
85 // Delete all Lambda vertices from the event
86 for (std::set<int>::iterator v = vtx_to_delete.begin(); v != vtx_to_delete.end(); ++v) {
87 HepMC::GenVertex* vdel = (*evt)->barcode_to_vertex(*v);
88 (*evt)->remove_vertex(vdel);
89 delete vdel;
90 }
91#endif
92 }
93
94 if (evtStore()->record(mcCollptra, m_keyout).isFailure()){
95 ATH_MSG_ERROR("Could not record McEventCollection");
96 return StatusCode::FAILURE;
97 }
98 }
99
100 // Loop over all events in McEventCollection
101 for(const HepMC::GenEvent* evt : *events_const()) {
102 auto pdfinfo = evt->pdf_info();
103 auto ion = evt->heavy_ion();
104#ifdef HEPMC3
105 if (pdfinfo) {
106 std::cout << "PdfInfo: "
107 << pdfinfo->parton_id[0] << ", "
108 << pdfinfo->parton_id[1] << ", "
109 << pdfinfo->x[0] << ", "
110 << pdfinfo->x[1] << ", "
111 << pdfinfo->scale << ", "
112 << pdfinfo->xf[0] << ", "
113 << pdfinfo->xf[1] << ", "
114 << pdfinfo->pdf_id[0] << ", "
115 << pdfinfo->pdf_id[1]
116 << std::endl;
117 }
118
119 if (ion) {
120 std::cout << std::endl;
121 std::cout << "Heavy Ion: "
122 << ion->Ncoll_hard <<", "
123 << ion->Npart_proj <<" , "
124 << ion->Npart_targ<< ", "
125 << ion->Ncoll<< ", "
126 << ion->spectator_neutrons << ", "
127 << ion->spectator_protons << ", "
128 << ion->N_Nwounded_collisions << ", "
129 << ion->Nwounded_N_collisions << ", "
130 << ion->Nwounded_Nwounded_collisions << ", "
131 << ion->impact_parameter << ", "
132 << ion->event_plane_angle << ", "
133 << ion->eccentricity << ", "
134 << ion->sigma_inel_NN
135 << std::endl;
136 }
137#else
138 if (pdfinfo) {
139 std::cout << "PdfInfo: "
140 << pdfinfo->id1() << ", "
141 << pdfinfo->id2() << ", "
142 << pdfinfo->x1() << ", "
143 << pdfinfo->x2() << ", "
144 << pdfinfo->scalePDF() << ", "
145 << pdfinfo->pdf1() << ", "
146 << pdfinfo->pdf2() << ", "
147 << pdfinfo->pdf_id1() << ", "
148 << pdfinfo->pdf_id2()
149 << std::endl;
150 }
151
152 if (ion) {
153 std::cout << std::endl;
154 std::cout << "Heavy Ion: "
155 << ion->Ncoll_hard() <<", "
156 << ion->Npart_proj() <<" , "
157 << ion->Npart_targ()<< ", "
158 << ion->Ncoll()<< ", "
159 << ion->spectator_neutrons() << ", "
160 << ion->spectator_protons() << ", "
161 << ion->N_Nwounded_collisions() << ", "
162 << ion->Nwounded_N_collisions() << ", "
163 << ion->Nwounded_Nwounded_collisions() << ", "
164 << ion->impact_parameter() << ", "
165 << ion->event_plane_angle() << ", "
166 << ion->eccentricity() << ", "
167 << ion->sigma_inel_NN()
168 << std::endl;
169 }
170#endif
171 if (m_VerboseOutput) {
172 if (!m_EtaPhi) {
173 HepMC::Print::line(std::cout,*evt); // standard HepMc dump
174 } else { // sort particles by rapidity and then dump
175 // Loop over all particles in the event and build up the grid
176 for (auto part: *evt) {
177 double rapid =part->momentum().pseudoRapidity();
178 double phi = part->momentum().phi(); //phi is in range -pi to pi
179 double et=part->momentum().perp();
180 int p_stat=part->status();
181 int p_id = part->pdg_id();
182 std::cout << " eta = " << rapid<< " Phi = " << phi << " Et = " <<et/GeV << " Status= " << p_stat << " PDG ID= "<< p_id << std::endl;
183 }
184 }
186 for (const auto& pitr: *evt) {
187 int p_stat=pitr->status();
188 if(p_stat==2 && pitr->production_vertex() && pitr->end_vertex()) {
189 const auto& prodVtx = pitr->production_vertex()->position();
190 const auto& endVtx = pitr->end_vertex()->position();
191 const CLHEP::HepLorentzVector lv0( prodVtx.x(), prodVtx.y(), prodVtx.z(), prodVtx.t() );
192 const CLHEP::HepLorentzVector lv1( endVtx.x(), endVtx.y(), endVtx.z(), endVtx.t() );
193
194 CLHEP::HepLorentzVector dist4D(lv1);
195 dist4D-=lv0;
196 CLHEP::Hep3Vector dist3D=dist4D.vect();
197 if(dist3D.mag()>1*Gaudi::Units::mm) {
198 const auto& GenMom = pitr->momentum();
199 const CLHEP::HepLorentzVector mom( GenMom.x(), GenMom.y(), GenMom.z(), GenMom.t() );
200 ATH_MSG_INFO("Quasi stable particle "<<pitr);
201 ATH_MSG_INFO(" Prod V:"<<pitr->production_vertex ());
202 ATH_MSG_INFO(" Decay V:"<<pitr->end_vertex ());
203 ATH_MSG_INFO(" gamma(Momentum)="<<mom.gamma()<<" gamma(Vertices)="<<dist4D.gamma());
204 }
205 }
206 }
207 }
208 }
209 }
210 return StatusCode::SUCCESS;
211}
Scalar phi() const
phi method
#define ATH_MSG_INFO(x)
float et(const xAOD::jFexSRJetRoI *j)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
void line(std::ostream &os, const GenEvent &e)
Definition GenEvent.h:678

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ GeVToMeV()

void GenBase::GeVToMeV ( HepMC::GenEvent * evt)
protectedinherited

Scale event energies/momenta by x 1000.

Todo
Add HepMC units awareness and do it differently when HepMC provides this functionality directly (and reference-based FourVector accessors)

Definition at line 58 of file GenBase.cxx.

58 {
59 for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
60 const HepMC::FourVector fv((*p)->momentum().px() * 1000,
61 (*p)->momentum().py() * 1000,
62 (*p)->momentum().pz() * 1000,
63 (*p)->momentum().e() * 1000);
64 (*p)->set_momentum(fv);
65 (*p)->set_generated_mass(1000 * (*p)->generated_mass());
66 }
67}

◆ initialize()

StatusCode DumpMC::initialize ( )
virtual

Reimplemented from GenBase.

Definition at line 22 of file DumpMC.cxx.

22 {
25 ATH_MSG_FATAL("Input and output MC event keys cannot be the same (" << m_mcEventKey << ")");
26 return StatusCode::FAILURE;
27 }
28 return StatusCode::SUCCESS;
29}
#define ATH_MSG_FATAL(x)
#define CHECK(...)
Evaluate an expression and check for errors.
std::string m_mcEventKey
StoreGate key for the MC event collection (defaults to GEN_EVENT)
Definition GenBase.h:137
virtual StatusCode initialize() override
Definition GenBase.cxx:17

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ MeVToGeV()

void GenBase::MeVToGeV ( HepMC::GenEvent * evt)
protectedinherited

Scale event energies/momenta by x 1/1000.

Definition at line 68 of file GenBase.cxx.

68 {
69 for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
70 const HepMC::FourVector fv((*p)->momentum().px() / 1000,
71 (*p)->momentum().py() / 1000,
72 (*p)->momentum().pz() / 1000,
73 (*p)->momentum().e() / 1000);
74 (*p)->set_momentum(fv);
75 (*p)->set_generated_mass((*p)->generated_mass() / 1000);
76 }
77}

◆ mmTocm()

void GenBase::mmTocm ( HepMC::GenEvent * evt)
protectedinherited

Scale event lengths by x 1/10.

Definition at line 87 of file GenBase.cxx.

87 {
88 for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
89 const HepMC::FourVector fv((*vtx)->position().x() / 10,
90 (*vtx)->position().y() / 10,
91 (*vtx)->position().z() / 10,
92 (*vtx)->position().t() / 10);
93 (*vtx)->set_position(fv);
94 }
95}

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ particleData()

const HepPDT::ParticleData * GenBase::particleData ( int pid) const
inlineinherited

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

126 {
127 return pdt().particle(HepPDT::ParticleID(std::abs(pid)));
128 }
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition GenBase.h:123

◆ particleTable()

const HepPDT::ParticleDataTable & GenBase::particleTable ( ) const
inlineinherited

Get a particle data table.

Definition at line 118 of file GenBase.h.

118 {
119 return *(m_ppSvc->PDT());
120 }
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Definition GenBase.h:160

◆ partPropSvc()

const ServiceHandle< IPartPropSvc > GenBase::partPropSvc ( ) const
inlineinherited

Access the particle property service.

Definition at line 113 of file GenBase.h.

113 {
114 return m_ppSvc;
115 }

◆ pdt()

const HepPDT::ParticleDataTable & GenBase::pdt ( ) const
inlineinherited

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123{ return particleTable(); }
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Definition GenBase.h:118

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_DeepCopy

bool DumpMC::m_DeepCopy

Definition at line 21 of file DumpMC.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EtaPhi

bool DumpMC::m_EtaPhi

Definition at line 22 of file DumpMC.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_keyout

std::string DumpMC::m_keyout

Definition at line 19 of file DumpMC.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

StoreGate key for the MC event collection (defaults to GEN_EVENT)

Definition at line 137 of file GenBase.h.

137{};

◆ m_mcevents_const

SG::ReadHandleKey<McEventCollection> GenBase::m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
privateinherited

Const handle to the MC event collection.

Definition at line 163 of file GenBase.h.

163{ this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" };

◆ m_mkMcEvent

BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
protectedinherited

Flag to determine if a new MC event collection should be made if it doesn't exist.

Definition at line 139 of file GenBase.h.

139{this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"};

◆ m_ppSvc

ServiceHandle<IPartPropSvc> GenBase::m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
privateinherited

Handle on the particle property service.

Definition at line 160 of file GenBase.h.

160{this, "PartPropSvc", "PartPropSvc"};

◆ m_PrintQuasiStableParticles

bool DumpMC::m_PrintQuasiStableParticles

Definition at line 23 of file DumpMC.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_VerboseOutput

bool DumpMC::m_VerboseOutput

Definition at line 20 of file DumpMC.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: