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 bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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).

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
std::shared_ptr< GenDatam_gendata {nullptr}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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

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 15 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:31
std::string m_printsty
Definition PrintMC.h:30
bool m_trustHepMC
Definition PrintMC.h:34
uint64_t m_firstEvt
Definition PrintMC.h:32
bool m_VerboseOutput
Definition PrintMC.h:29
uint64_t m_lastEvt
Definition PrintMC.h:33

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

72 {
73 if (events()->empty())
74 ATH_MSG_ERROR("McEventCollection is empty during first event access");
75 return *(events()->begin());
76 }
#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 79 of file GenBase.h.

79 {
80 const McEventCollection* coll = events_const(ctx);
81 if (coll->empty())
82 ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
83 return *(coll->begin());
84 }
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:93

◆ events_const()

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

Access the current event's McEventCollection (const).

Definition at line 93 of file GenBase.h.

93 {
94 SG::ReadHandle<McEventCollection> ret = SG::makeHandle(m_mcevents_const, ctx);
95 if (!ret.isValid())
96 ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
97 return ret.cptr();
98 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition GenBase.h:117
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 55 of file PrintMC.cxx.

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

◆ 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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode PrintMC::initialize ( )
overridevirtual

Reimplemented from GenBase.

Definition at line 34 of file PrintMC.cxx.

34 {
36 m_gendata = std::make_shared<GenData>();
37 if(!m_trustHepMC) ATH_CHECK(m_evtInfoKey.initialize());
38
39 // Check settings
40 if (m_printsty != "Barcode" && m_printsty != "Vertex") {
41 ATH_MSG_ERROR("Unknown PrintStyle: " << m_printsty << "! Choose Barcode/Vertex");
42 return StatusCode::FAILURE;
43 }
44
45 // Check that last > first
47
48 m_gendata = std::make_shared<GenData>();
49 return StatusCode::SUCCESS;
50}
#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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

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

◆ 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()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ 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 23 of file PrintMC.h.

23 {this
24 , "EventInfo"
25 , "EventInfo"
26 , "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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_firstEvt

uint64_t PrintMC::m_firstEvt
private

Definition at line 32 of file PrintMC.h.

◆ m_gendata

std::shared_ptr<GenData> PrintMC::m_gendata {nullptr}
private

Definition at line 35 of file PrintMC.h.

35{nullptr};

◆ m_keyout

std::string PrintMC::m_keyout
private

Definition at line 28 of file PrintMC.h.

◆ m_lastEvt

uint64_t PrintMC::m_lastEvt
private

Definition at line 33 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 108 of file GenBase.h.

108{};

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

117{ 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 110 of file GenBase.h.

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

◆ m_printsty

std::string PrintMC::m_printsty
private

Definition at line 30 of file PrintMC.h.

◆ m_trustHepMC

bool PrintMC::m_trustHepMC
private

Definition at line 34 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 29 of file PrintMC.h.

◆ m_vertexinfo

bool PrintMC::m_vertexinfo
private

Definition at line 31 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: