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

Print MC event details for a range of event numbers. More...

#include <PrintMC.h>

Inheritance diagram for PrintMC:
Collaboration diagram for PrintMC:

Public Member Functions

 PrintMC (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
bool filterPassed (const EventContext &ctx) const
void setFilterPassed (bool state, const EventContext &ctx) const
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::GenEventevent_const (const EventContext &ctx) const
 Access the current signal event (const).
const McEventCollectionevents_const (const EventContext &ctx) const
 Access the current event's McEventCollection (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.
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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.

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

SG::ReadHandleKey< xAOD::EventInfom_evtInfoKey
std::string m_keyout
bool m_VerboseOutput
std::string m_printsty
bool m_vertexinfo
uint64_t m_firstEvt
uint64_t m_lastEvt
bool m_trustHepMC
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

Properties

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.
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.

Detailed Description

Print MC event details for a range of event numbers.

Definition at line 12 of file PrintMC.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PrintMC()

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

Definition at line 21 of file PrintMC.cxx.

22 : GenBase(name, pSvcLocator)
23{
24 // Declare JO interface
25 declareProperty("VerboseOutput", m_VerboseOutput=true, "Print out detailed information or not");
26 declareProperty("PrintStyle", m_printsty="Barcode", "Type of info to print out: 'Barcode' or 'Vertex'");
27 declareProperty("VertexInfo", m_vertexinfo=false, "Print out vertex information");
28 declareProperty("TrustHepMC", m_trustHepMC=false, "Use the event numbers in the HepMC record to choose the events to print");
29 declareProperty("FirstEvent", m_firstEvt=1, "Lowest event number to print");
30 declareProperty("LastEvent", m_lastEvt=100000000, "Highest event number to print");
31}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition GenBase.cxx:11
bool m_vertexinfo
Definition PrintMC.h:28
std::string m_printsty
Definition PrintMC.h:27
bool m_trustHepMC
Definition PrintMC.h:31
uint64_t m_firstEvt
Definition PrintMC.h:29
bool m_VerboseOutput
Definition PrintMC.h:26
uint64_t m_lastEvt
Definition PrintMC.h:30

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/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.

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/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

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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 EventContext & ctx) const
inlineinherited

Access the current signal event (const).

Definition at line 83 of file GenBase.h.

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

◆ events_const()

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

Access the current event's McEventCollection (const).

Definition at line 97 of file GenBase.h.

97 {
98 SG::ReadHandle<McEventCollection> ret = SG::makeHandle(m_mcevents_const, ctx);
99 if (!ret.isValid())
100 ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
101 return ret.cptr();
102 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition GenBase.h:145
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< Gaudi::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 PrintMC::execute ( const EventContext & ctx)
overridevirtual
Todo
Avoid use of unprotected std::cout: stringstream + MsgStream would be better
Todo
I get the feeling VerboseOutput is being abused here...
Todo
Looks like misuse of the verbose output flag
Todo
Isn't this if (m_VerboseOutput... redundant?
Todo
Isn't this if (m_VerboseOutput... redundant?
Todo
Is there no better way to detect unspecified masses than == 0? Final state photons should be 0

Reimplemented from GenBase.

Definition at line 53 of file PrintMC.cxx.

53 {
54 // If output already turned off by passing last dumped event, just return
56 if (!m_VerboseOutput) return StatusCode::SUCCESS;
57
58 // Loop over all events in McEventCollection
59
60 for (const HepMC::GenEvent* evt : *events_const(ctx)) {
61
62 // Get event number from HepMC
63 uint64_t evtnum = std::max(0,evt->event_number());
64 // Override with evtnum from Athena if enabled and functional
65 if (!m_trustHepMC) {
66 SG::ReadHandle<xAOD::EventInfo> evtInfo(m_evtInfoKey, ctx);
67 evtnum = evtInfo->eventNumber();
68 }
69
70 // Return immediately if event number is outside the print range
71 if (evtnum < m_firstEvt) {
72 return StatusCode::SUCCESS;
73 }
74 if (evtnum > m_lastEvt) {
76 m_VerboseOutput = false;
77 return StatusCode::SUCCESS;
78 }
79
80 // Printout header
81 ATH_MSG_INFO(">>> PrintMC from execute");
82
83 // VERTEX format
85 if (m_VerboseOutput && m_printsty == "Vertex") {
86 HepMC::Print::line(std::cout, *evt); // standard HepMC dump of vertex list
87 }
88 // BARCODE format
90 else if (m_VerboseOutput && m_printsty == "Barcode") {
91 drawLine(std::cout);
92
93 std::cout << "GenEvent: #" << evt->event_number()
94 << " ID=" << HepMC::signal_process_id(evt)
95 << " SignalProcessGenVertex Barcode: "
97 std::cout << " Entries this event: " << evt->vertices_size() << " vertices, "
98 << evt->particles_size() << " particles.\n";
99 if (evt->heavy_ion()) {
100 std::cout << " HeavyIon: jatt=" << evt->heavy_ion()->Ncoll_hard
101 << " np=" << evt->heavy_ion()->Npart_proj
102 << " nt=" << evt->heavy_ion()->Npart_targ
103 << " ncoll=" << evt->heavy_ion()->Ncoll
104 << " specn=" << evt->heavy_ion()->spectator_neutrons
105 << " specp=" << evt->heavy_ion()->spectator_protons
106 << " n01=" << evt->heavy_ion()->N_Nwounded_collisions
107 << " n10=" << evt->heavy_ion()->Nwounded_N_collisions
108 << " n11=" << evt->heavy_ion()->Nwounded_Nwounded_collisions
109 << " impact=" << evt->heavy_ion()->impact_parameter
110 << " evplane=" << evt->heavy_ion()->event_plane_angle
111 << " ecc=" << evt->heavy_ion()->eccentricity
112 << " sigmaNNinel=" << evt->heavy_ion()->sigma_inel_NN
113 << std::endl;
114 }
115 else {
116 std::cout << "HeavyIon: EMPTY"
117 << std::endl;
118 }
119
120
121 // Weights
122 std::cout << " Weights(" << evt->weights().size() << ")=";
123 for ( auto wgt = evt->weights().begin();
124 wgt != evt->weights().end(); wgt++ ) { std::cout << *wgt << " "; }
125 std::cout << "\n";
126 std::cout << " EventScale " << (evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::event_scale)? evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::event_scale)->value():0.0)
127 << " [energy] \t alphaQCD=" << (evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::alphaQCD)? evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::alphaQCD)->value():0.0)
128 << "\t alphaQED=" << (evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::alphaQED)? evt->attribute<HepMC3::DoubleAttribute>(HepMCStr::alphaQED)->value():0.0) << std::endl;
129
130 if (evt->pdf_info()) {
131 std::cout << "PdfInfo: id1=" << evt->pdf_info()->parton_id[0]
132 << " id2=" << evt->pdf_info()->parton_id[1]
133 << " x1=" << evt->pdf_info()->x[0]
134 << " x2=" << evt->pdf_info()->x[1]
135 << " q=" << evt->pdf_info()->scale
136 << " xpdf1=" << evt->pdf_info()->pdf_id[0]
137 << " xpdf2=" << evt->pdf_info()->pdf_id[1]
138 << std::endl;
139 }
140 else {
141 std::cout << "PdfInfo: EMPTY"
142 << std::endl;
143 }
144
145 // Print a legend to describe the particle info
146 char particle_legend[120];
147 sprintf( particle_legend," %9s %8s %-15s %4s %8s %8s (%9s,%9s,%9s,%9s,%9s)",
148 "Barcode","PDG ID","Name","Stat","ProdVtx","DecayVtx","Px","Py","Pz","E ","m");
149 std::cout << std::endl;
150 std::cout << " GenParticle Legend\n" << particle_legend << "\n";
151 if (m_vertexinfo) {
152 sprintf( particle_legend," %60s (%9s,%9s,%9s,%9s)"," ","Vx","Vy","Vz","Vct ");
153 std::cout << particle_legend << std::endl;
154 }
155 drawLine(std::cout);
156
157 // Print all particles
158 for (auto p: *evt) {
159 int p_bcode = HepMC::barcode(p);
160 int p_pdg_id = p->pdg_id();
161 HepMC::FourVector mom=p->momentum();
162 int p_stat = p->status();
163 int p_prodvtx = p->production_vertex()?HepMC::barcode(p->production_vertex()):0;
164 int p_endvtx = p->end_vertex()?HepMC::barcode(p->end_vertex()):0;
165 HepMC::FourVector prodvtx=p->production_vertex()?p->production_vertex()->position():HepMC::FourVector(0.0,0.0,0.0,0.0);
166 // Access the PDG table to get the particle name (and mass?)
167 std::string sname;
168 double p_mass = p->generated_mass();
169 const HepPDT::ParticleData* ap = particleData(std::abs(p_pdg_id));
170 if (!ap) {
171 ATH_MSG_DEBUG("PID " << std::abs(p_pdg_id) << " is not in particle data table");
172 } else {
173 const double p_charge = ap->charge() * (p_pdg_id < 0 ? -1 : 1); // assuming that charged leptons are in the PDT...
174 // Build particle name string
175 sname = ap->name();
176 if (p_charge < 0) {
177 const size_t plusidx = sname.rfind("+");
178 if (plusidx != std::string::npos) {
179 sname.replace(plusidx, 1, "-");
180 }
181 }
182 }
183 // PDG table missing or exceptions
184 // quarks & gluons
185 if (p_pdg_id == 21) sname="g";
186 else if (p_pdg_id == 1) sname="d";
187 else if (p_pdg_id == -1) sname="d~";
188 else if (p_pdg_id == 2) sname="u";
189 else if (p_pdg_id == -2) sname="u~";
190 else if (p_pdg_id == 3) sname="s";
191 else if (p_pdg_id == -3) sname="s~";
192 else if (p_pdg_id == 4) sname="c";
193 else if (p_pdg_id == -4) sname="c~";
194 else if (p_pdg_id == 5) sname="b";
195 else if (p_pdg_id == -5) sname="b~";
196 else if (p_pdg_id == 6) sname="t";
197 else if (p_pdg_id == -6) sname="t~";
198 // shower-specific
199 else if (p_pdg_id == 91) sname="cluster";
200 else if (p_pdg_id == 92) sname="string";
201 else if (p_pdg_id == 9922212) sname="remn";
202 else if (p_pdg_id == 2101) sname="ud";
203 else if (p_pdg_id == 2203) sname="uu";
204
205 // Calc mass if missing
207 if (p_mass == 0 && (p_stat == 2 || (p_stat != 1 && p_pdg_id != 22))) {
208 p_mass = mom.m();
209 }
210
211 const char* p_name = sname.c_str() ;
212 char particle_entries[120];
213 sprintf(particle_entries, " %9i %8i %-15s %4i %8i %8i (%+9.3g,%+9.3g,%+9.3g,%+9.3g,%9.3g)",
214 p_bcode, p_pdg_id, p_name, p_stat, p_prodvtx, p_endvtx, mom.px(), mom.py(),mom.pz(), mom.e(), p_mass);
215 std::cout << particle_entries << "\n";
216 if (m_vertexinfo) {
217 sprintf(particle_entries," %60s (%+9.3g,%+9.3g,%+9.3g,%+9.3g)"," ",prodvtx.x(), prodvtx.y(),prodvtx.z(), prodvtx.t());
218 std::cout << particle_entries << "\n";
219 }
220 }
221
222 }
223
224 }
225 // End of execution for each event
226 return StatusCode::SUCCESS;
227}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
void drawLine(std::ostream &os)
Definition PrintMC.cxx:16
if(pathvar)
const HepPDT::ParticleData * particleData(int pid) const
Access an element in the particle data table.
Definition GenBase.h:124
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition PrintMC.h:20
for(size_t i=0;i< m_blockFillers.size();i++)
Fill one block.
const std::string event_scale
const std::string alphaQED
const std::string alphaQCD
int signal_process_id(const GenEvent &evt)
Definition GenEvent.h:572
int barcode(const T *p)
Definition Barcode.h:15
HepMC3::FourVector FourVector
ConstGenVertexPtr signal_process_vertex(const GenEvent *e)
Definition GenEvent.h:597
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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

◆ filterPassed() [1/2]

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return filterPassed( Gaudi::Hive::currentContext() );
96}
bool filterPassed() const

◆ filterPassed() [2/2]

bool AthAlgorithm::filterPassed ( const EventContext & ctx) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 return execState( ctx ).filterPassed();
100}

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ initialize()

StatusCode PrintMC::initialize ( )
overridevirtual

Reimplemented from GenBase.

Definition at line 34 of file PrintMC.cxx.

34 {
36 if(!m_trustHepMC) ATH_CHECK(m_evtInfoKey.initialize());
37
38 // Check settings
39 if (m_printsty != "Barcode" && m_printsty != "Vertex") {
40 ATH_MSG_ERROR("Unknown PrintStyle: " << m_printsty << "! Choose Barcode/Vertex");
41 return StatusCode::FAILURE;
42 }
43
44 // Check that last > first
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
Definition GenBase.cxx:17

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::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.

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 111 of file AthAlgorithm.h.

111{ return false; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::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 124 of file GenBase.h.

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

◆ particleTable()

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

Get a particle data table.

Definition at line 116 of file GenBase.h.

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

◆ partPropSvc()

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

Access the particle property service.

Definition at line 111 of file GenBase.h.

111 {
112 return m_ppSvc;
113 }

◆ pdt()

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

Shorter alias to get a particle data table.

Definition at line 121 of file GenBase.h.

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

◆ 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< Gaudi::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed() [1/2]

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 102 of file AthAlgorithm.cxx.

102 {
103 setFilterPassed( state, Gaudi::Hive::currentContext() );
104}
void setFilterPassed(bool state) const

◆ setFilterPassed() [2/2]

void AthAlgorithm::setFilterPassed ( bool state,
const EventContext & ctx ) const
inherited

Definition at line 106 of file AthAlgorithm.cxx.

106 {
107 execState( ctx ).setFilterPassed(state);
108}

◆ 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< Gaudi::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< Gaudi::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< Gaudi::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 }

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtInfoKey

SG::ReadHandleKey<xAOD::EventInfo> PrintMC::m_evtInfoKey
private
Initial value:
{this
, "EventInfo"
, "EventInfo"
, "ReadHandleKey for xAOD::EventInfo" }

Definition at line 20 of file PrintMC.h.

20 {this
21 , "EventInfo"
22 , "EventInfo"
23 , "ReadHandleKey for xAOD::EventInfo" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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 114 of file AthAlgorithm.h.

◆ m_firstEvt

uint64_t PrintMC::m_firstEvt
private

Definition at line 29 of file PrintMC.h.

◆ m_keyout

std::string PrintMC::m_keyout
private

Definition at line 25 of file PrintMC.h.

◆ m_lastEvt

uint64_t PrintMC::m_lastEvt
private

Definition at line 30 of file PrintMC.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

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

Definition at line 134 of file GenBase.h.

134{};

◆ 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 145 of file GenBase.h.

145{ 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 136 of file GenBase.h.

136{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 142 of file GenBase.h.

142{this, "PartPropSvc", "PartPropSvc"};

◆ m_printsty

std::string PrintMC::m_printsty
private

Definition at line 27 of file PrintMC.h.

◆ m_trustHepMC

bool PrintMC::m_trustHepMC
private

Definition at line 31 of file PrintMC.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_VerboseOutput

bool PrintMC::m_VerboseOutput
private

Definition at line 26 of file PrintMC.h.

◆ m_vertexinfo

bool PrintMC::m_vertexinfo
private

Definition at line 28 of file PrintMC.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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