![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <PhotonTruthTool.h>
|
| PhotonTruthTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard Gaudi tool constructor. More...
|
|
virtual StatusCode | initialize () |
| Standard Gaudi initialize method. More...
|
|
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvIf) |
| Standard Gaudi queryInterface method. More...
|
|
const xAOD::TruthParticle * | toTruthParticle (const xAOD::Photon &g) const |
| Go from a photon to a matching TruthParticle . More...
|
|
bool | getMCConv (const xAOD::TruthParticle *truePart, float &RconvMC, float &ZconvMC) const |
| Check a truth particle for a conversion. More...
|
|
bool | isPromptPhotonMC (const xAOD::TruthParticle *truePart) const |
| Test for a prompt photon. More...
|
|
bool | isPromptParticleMC (const xAOD::TruthParticle *truePart) const |
| Test for a prompt particle. More...
|
|
bool | isQuarkBremMC (const xAOD::TruthParticle *truePart) const |
| Test for a brem. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 38 of file PhotonTruthTool.h.
◆ StoreGateSvc_t
◆ PhotonTruthTool()
D3PD::PhotonTruthTool::PhotonTruthTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard Gaudi tool constructor.
- Parameters
-
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
Definition at line 30 of file PhotonTruthTool.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ getMCConv()
Check a truth particle for a conversion.
- Parameters
-
| truePart | The particle to check. |
[out] | RconvMC | Radius of the conversion. |
[out] | ZconvMC | Z of the conversion. |
- Returns
- True if this is a conversion; otherwise false.
Definition at line 92 of file PhotonTruthTool.cxx.
96 RconvMC = +9.999e+10 ;
97 ZconvMC = +9.999e+10 ;
98 if (!truePart)
return false;
101 if (!
v ||
v->nOutgoingParticles() < 2)
112 if (
v->nOutgoingParticles() == 2 ) {
113 int pdgChild[2] = {0};
114 for (
unsigned u=0;
u<2 ; ++
u) {
117 pdgChild[
u] =
p->pdgId();
119 if ( pdgChild[0]+pdgChild[1]==0 && pdgChild[0]*pdgChild[1]==-121 ) {
125 else if ( std::abs(
pdgId) == 11 ) {
127 if (
v->nIncomingParticles()==1 &&
v->nOutgoingParticles()==2 ) {
128 int pdgBrother[2] = {0};
129 for (
unsigned u=0 ;
u<2 ; ++
u ) {
132 pdgBrother[
u] =
p->pdgId();
134 if ( pdgBrother[0]+pdgBrother[1]==(22+
pdgId) &&
135 pdgBrother[0]*pdgBrother[1]==(22*
pdgId) )
◆ getMother()
Get the (first) mother particle of p.
Definition at line 269 of file PhotonTruthTool.cxx.
273 if (!
v ||
v->nIncomingParticles() == 0)
276 return v->incomingParticle(0);
◆ getMothers()
Return list of mother particles of p.
Definition at line 284 of file PhotonTruthTool.cxx.
286 std::vector<const xAOD::TruthParticle*>
out;
290 int n =
v->nIncomingParticles();
292 for (
int i = 0;
i <
n;
i++)
293 out.push_back (
v->incomingParticle(
i));
◆ getMotherVert()
Get the mother vertex for p.
Definition at line 249 of file PhotonTruthTool.cxx.
254 while (
v &&
v->nIncomingParticles() == 1 &&
255 v->incomingParticle(0)->pdgId() ==
p->pdgId())
257 p =
v->incomingParticle(0);
◆ initialize()
StatusCode D3PD::PhotonTruthTool::initialize |
( |
| ) |
|
|
virtual |
◆ inputHandles()
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.
◆ interfaceID()
static const InterfaceID& D3PD::PhotonTruthTool::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ isFinalState()
Test for a final-state particle.
Definition at line 221 of file PhotonTruthTool.cxx.
223 if ( truePart ==
nullptr )
return false;
236 if (!
v)
return false;
237 if (
v->nOutgoingParticles()>0 ) {
◆ isFinalStatePhotonMC()
◆ isPromptParticleMC()
Test for a prompt particle.
Definition at line 159 of file PhotonTruthTool.cxx.
162 if ( truePart == 0 )
return false ;
163 const std::vector<const xAOD::TruthParticle*> mothers =
165 unsigned nmothers = mothers.size() ;
166 if ( nmothers == 0 ) {
170 else if ( nmothers == 1 ) {
174 int aPdgMother = abs(mothers[0]->
pdgId());
175 return (( aPdgMother>=23 && aPdgMother<=39 ) || aPdgMother==5000039 ) ;
181 int nParentPartons = 0 ;
182 for (
unsigned u=0 ;
u<nmothers ; ++
u ) {
183 int pdgMother = mothers[
u]->pdgId() ;
184 if ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) )
187 return ( nParentPartons >= 1 ) ;
◆ isPromptPhotonMC()
◆ isQuarkBremMC()
Test for a brem.
Definition at line 195 of file PhotonTruthTool.cxx.
199 const std::vector<const xAOD::TruthParticle*> mothers =
201 if ( mothers.size() != 1 )
return false ;
202 int pdgMother = mothers[0]->pdgId() ;
203 return ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) ) ;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ queryInterface()
StatusCode D3PD::PhotonTruthTool::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvIf |
|
) |
| |
|
virtual |
Standard Gaudi queryInterface
method.
Definition at line 58 of file PhotonTruthTool.cxx.
63 return StatusCode::SUCCESS;
66 return AthAlgTool::queryInterface( riid, ppvIf );
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ toTruthParticle()
◆ updateVHKA()
◆ m_classifier
◆ m_detStore
◆ m_evtStore
◆ m_rTruthConv
float D3PD::PhotonTruthTool::m_rTruthConv |
|
private |
◆ m_useG4Particles
bool D3PD::PhotonTruthTool::m_useG4Particles |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_zTruthConv
float D3PD::PhotonTruthTool::m_zTruthConv |
|
private |
The documentation for this class was generated from the following files:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
@ u
Enums for curvilinear frames.
virtual void setOwner(IDataHandleHolder *o)=0
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Class describing a truth vertex in the MC record.
bool isStable(const T &p)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
int pdgId() const
PDG ID code.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>