ATLAS Offline Software
Loading...
Searching...
No Matches
GenAnalysis Class Referenceabstract

Base class for evgen-level analyses. More...

#include <GenAnalysis.h>

Inheritance diagram for GenAnalysis:
Collaboration diagram for GenAnalysis:

Public Member Functions

 GenAnalysis (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~GenAnalysis ()
StatusCode initialize ()
 Setup analysis tools and call user-supplied init()
StatusCode execute ()
 Per-event analysis routine: calls user-supplied analyze()
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
Methods for user implementation
virtual StatusCode init ()
virtual StatusCode analyze ()=0
virtual StatusCode finalize ()
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.

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

Histogramming

std::string m_histkey
 Container name for the MC event collection to be analysed.
ServiceHandle< ITHistSvc > m_histSvc
TH1D * bookHisto1D (const std::string &name, const std::string &title, const std::vector< double > &binedges, const std::string &xtitle="", const std::string &ytitle="")
TH1D * bookHisto1D (const std::string &name, const std::string &title, size_t numbins, double low, double high, const std::string &xtitle="", const std::string &ytitle="")
TProfile * bookProfile1D (const std::string &name, const std::string &title, const std::vector< double > &binedges, const std::string &xtitle="", const std::string &ytitle="")
TProfile * bookProfile1D (const std::string &name, const std::string &title, size_t numbins, double low, double high, const std::string &xtitle="", const std::string &ytitle="")
TH2D * bookHisto2D (const std::string &name, const std::string &title, const std::vector< double > &binedgesx, const std::vector< double > &binedgesy, const std::string &xtitle="", const std::string &ytitle="", const std::string &ztitle="")
TH2D * bookHisto2D (const std::string &name, const std::string &title, size_t numbinsx, double xlow, double xhigh, size_t numbinsy, double ylow, double yhigh, const std::string &xtitle="", const std::string &ytitle="", const std::string &ztitle="")
std::string fullhistopath (const std::string &localpath)
 Get a histogram's full path, given the name local to the analysis.
TH1 * histo (const std::string &key)
 Retrieve a histogram (as TH1* base class pointer)
TProfile * profile (const std::string &key)
 Retrieve a profile histogram.
const ServiceHandle< ITHistSvc > histSvc () const
 Directly access the histogram service.

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

Base class for evgen-level analyses.

Author
Andy Buckley

GenAnalysis is a base class which provides convenient access to functions used to make a compact, correct and robust analysis of truth-level data.

The following virtual methods are to be overloaded in the child class: StatusCode init() [optional] StatusCode execute() [mandatory] StatusCode finalize() [optional]

Definition at line 27 of file GenAnalysis.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

◆ GenAnalysis()

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

Definition at line 11 of file GenAnalysis.cxx.

12 : GenBase(name, pSvcLocator),
13 m_histSvc("THistSvc", name)
14{
15 declareProperty("HistKey", m_histkey="genanalysis");
16 declareProperty("THistSvc", m_histSvc);
17}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< ITHistSvc > m_histSvc
Definition GenAnalysis.h:94
std::string m_histkey
Container name for the MC event collection to be analysed.
Definition GenAnalysis.h:93
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition GenBase.cxx:11

◆ ~GenAnalysis()

virtual GenAnalysis::~GenAnalysis ( )
inlinevirtual

Definition at line 31 of file GenAnalysis.h.

31{ }

Member Function Documentation

◆ analyze()

virtual StatusCode GenAnalysis::analyze ( )
pure virtual

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

◆ bookHisto1D() [1/2]

TH1D * GenAnalysis::bookHisto1D ( const std::string & name,
const std::string & title,
const std::vector< double > & binedges,
const std::string & xtitle = "",
const std::string & ytitle = "" )
protected
Todo
Use shorter names (aliases?) like bookH1D, bookP1D, and histo -> hist (or getH1D / getP1D)

Definition at line 39 of file GenAnalysis.cxx.

40 {
41 TH1D* h = new TH1D(path.c_str(), title.c_str(), binedges.size()-1, &binedges.front());
42 h->Sumw2();
43 h->SetXTitle(xtitle.c_str());
44 h->SetYTitle(ytitle.c_str());
45 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
46 if (st.isFailure()) return 0;
47 return h;
48}
const ServiceHandle< ITHistSvc > histSvc() const
Directly access the histogram service.
Definition GenAnalysis.h:83
std::string fullhistopath(const std::string &localpath)
Get a histogram's full path, given the name local to the analysis.
Definition GenAnalysis.h:72
::StatusCode StatusCode
StatusCode definition for legacy code.
path
python interpreter configuration --------------------------------------—
Definition athena.py:128

◆ bookHisto1D() [2/2]

TH1D * GenAnalysis::bookHisto1D ( const std::string & name,
const std::string & title,
size_t numbins,
double low,
double high,
const std::string & xtitle = "",
const std::string & ytitle = "" )
protected

Definition at line 50 of file GenAnalysis.cxx.

51 {
52 TH1D* h = new TH1D(path.c_str(), title.c_str(), numbins, low, high);
53 h->Sumw2();
54 h->SetXTitle(xtitle.c_str());
55 h->SetYTitle(ytitle.c_str());
56 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
57 if (st.isFailure()) return 0;
58 return h;
59}

◆ bookHisto2D() [1/2]

TH2D * GenAnalysis::bookHisto2D ( const std::string & name,
const std::string & title,
const std::vector< double > & binedgesx,
const std::vector< double > & binedgesy,
const std::string & xtitle = "",
const std::string & ytitle = "",
const std::string & ztitle = "" )
protected

Definition at line 85 of file GenAnalysis.cxx.

87 {
88 TH2D* h = new TH2D(path.c_str(), title.c_str(), binedgesx.size()-1, &*binedgesx.begin(), binedgesy.size()-1, &binedgesy.front());
89 h->Sumw2();
90 h->SetXTitle(xtitle.c_str());
91 h->SetYTitle(ytitle.c_str());
92 h->SetZTitle(ztitle.c_str());
93 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
94 if (st.isFailure()) return 0;
95 return h;
96}

◆ bookHisto2D() [2/2]

TH2D * GenAnalysis::bookHisto2D ( const std::string & name,
const std::string & title,
size_t numbinsx,
double xlow,
double xhigh,
size_t numbinsy,
double ylow,
double yhigh,
const std::string & xtitle = "",
const std::string & ytitle = "",
const std::string & ztitle = "" )
protected

Definition at line 98 of file GenAnalysis.cxx.

101 {
102 TH2D* h = new TH2D(path.c_str(), title.c_str(), numbinsx, xlow, xhigh, numbinsy, ylow, yhigh);
103 h->Sumw2();
104 h->SetXTitle(xtitle.c_str());
105 h->SetYTitle(ytitle.c_str());
106 h->SetZTitle(ztitle.c_str());
107 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
108 if (st.isFailure()) return 0;
109 return h;
110}

◆ bookProfile1D() [1/2]

TProfile * GenAnalysis::bookProfile1D ( const std::string & name,
const std::string & title,
const std::vector< double > & binedges,
const std::string & xtitle = "",
const std::string & ytitle = "" )
protected

Definition at line 62 of file GenAnalysis.cxx.

63 {
64 TProfile* h = new TProfile(path.c_str(), title.c_str(), binedges.size()-1, &binedges.front());
65 h->Sumw2();
66 h->SetXTitle(xtitle.c_str());
67 h->SetYTitle(ytitle.c_str());
68 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
69 if (st.isFailure()) return 0;
70 return h;
71}

◆ bookProfile1D() [2/2]

TProfile * GenAnalysis::bookProfile1D ( const std::string & name,
const std::string & title,
size_t numbins,
double low,
double high,
const std::string & xtitle = "",
const std::string & ytitle = "" )
protected

Definition at line 73 of file GenAnalysis.cxx.

74 {
75 TProfile* h = new TProfile(path.c_str(), title.c_str(), numbins, low, high);
76 h->Sumw2();
77 h->SetXTitle(xtitle.c_str());
78 h->SetYTitle(ytitle.c_str());
79 StatusCode st = histSvc()->regHist(fullhistopath(path), h);
80 if (st.isFailure()) return 0;
81 return h;
82}

◆ 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 GenAnalysis::execute ( )
virtual

Per-event analysis routine: calls user-supplied analyze()

Reimplemented from GenBase.

Definition at line 27 of file GenAnalysis.cxx.

27 {
28 if (events()->empty()) {
29 ATH_MSG_ERROR("No events found in McEventCollection");
30 return StatusCode::FAILURE;
31 }
32 return analyze();
33}
virtual StatusCode analyze()=0

◆ 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

◆ finalize()

virtual StatusCode GenAnalysis::finalize ( )
inlinevirtual

Definition at line 42 of file GenAnalysis.h.

42{ return StatusCode::SUCCESS; }

◆ fullhistopath()

std::string GenAnalysis::fullhistopath ( const std::string & localpath)
inlineprotected

Get a histogram's full path, given the name local to the analysis.

Definition at line 72 of file GenAnalysis.h.

72 {
73 return "/" + m_histkey + "/" + name() + "/" + localpath;
74 }

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

◆ histo()

TH1 * GenAnalysis::histo ( const std::string & key)
protected

Retrieve a histogram (as TH1* base class pointer)

Definition at line 114 of file GenAnalysis.cxx.

114 {
115 TH1* h = 0;
116 StatusCode st = histSvc()->getHist(fullhistopath(key), h);
117 if (st.isFailure()) ATH_MSG_WARNING("No histogram with key " << key);
118 return h;
119}
#define ATH_MSG_WARNING(x)

◆ histSvc()

const ServiceHandle< ITHistSvc > GenAnalysis::histSvc ( ) const
inlineprotected

Directly access the histogram service.

Definition at line 83 of file GenAnalysis.h.

83 {
84 return m_histSvc;
85 }

◆ init()

virtual StatusCode GenAnalysis::init ( )
inlinevirtual

Definition at line 40 of file GenAnalysis.h.

40{ return StatusCode::SUCCESS; }

◆ initialize()

StatusCode GenAnalysis::initialize ( )
virtual

Setup analysis tools and call user-supplied init()

Reimplemented from GenBase.

Definition at line 20 of file GenAnalysis.cxx.

20 {
22 CHECK(m_histSvc.retrieve());
23 return init();
24}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode init()
Definition GenAnalysis.h:40
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

◆ profile()

TProfile * GenAnalysis::profile ( const std::string & key)
protected

Retrieve a profile histogram.

Definition at line 121 of file GenAnalysis.cxx.

121 {
122 TH1* h = 0;
123 StatusCode st = histSvc()->getHist(fullhistopath(key), h);
124 if (st.isFailure()) ATH_MSG_WARNING("No histogram with key " << key);
125 return dynamic_cast<TProfile*>(h);
126}

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

◆ 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_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_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_histkey

std::string GenAnalysis::m_histkey
private

Container name for the MC event collection to be analysed.

Definition at line 93 of file GenAnalysis.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> GenAnalysis::m_histSvc
private

Definition at line 94 of file GenAnalysis.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_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.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: