|
ATLAS Offline Software
|
#include <MuonTruthClassifierFallback.h>
|
| MuonTruthClassifierFallback (const std::string &t, const std::string &n, const IInterface *p) |
| Constructor with parameters. More...
|
|
| ~MuonTruthClassifierFallback ()=default |
| Destructor. More...
|
|
StatusCode | initialize () override |
|
virtual StatusCode | addBranches () const override |
| Pass the thinning service
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 |
|
|
SG::ReadHandleKey< xAOD::IParticleContainer > | m_containerKey {this, "ContainerKey", "", "Key of the container to be decorated"} |
|
SG::ReadHandleKey< xAOD::TruthEventContainer > | m_truthSGKey {this, "TruthSGKey", "TruthEvents", "Key of the truth event container"} |
|
SG::ReadHandleKey< xAOD::TruthPileupEventContainer > | m_truthPileupSGKey |
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthMuonSGKey {this, "TruthMuonContainerKey", "MuonTruthParticles", ""} |
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_dR_Key {this, "dRDecoration", ""} |
| Key properties are overwirrten during initialize. More...
|
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_type_Key {this, "typeDecoration", ""} |
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_origin_Key {this, "originDecoration", ""} |
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_PU_dR_Key {this, "dRDecorationPU", ""} |
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_PU_type_Key {this, "typeDecorationPU", ""} |
|
SG::WriteDecorHandleKey< xAOD::IParticleContainer > | m_Truth_PU_origin_Key {this, "originDecorationPU", ""} |
|
Gaudi::Property< float > | m_minPt {this, "MinPt", 2500} |
|
ToolHandle< IMCTruthClassifier > | m_mcTruthClassifier {this, "MCTruthClassifierTool", "", "Handle of the MC truth classifier"} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
◆ StoreGateSvc_t
◆ MuonTruthClassifierFallback()
DerivationFramework::MuonTruthClassifierFallback::MuonTruthClassifierFallback |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~MuonTruthClassifierFallback()
DerivationFramework::MuonTruthClassifierFallback::~MuonTruthClassifierFallback |
( |
| ) |
|
|
default |
◆ addBranches()
StatusCode DerivationFramework::MuonTruthClassifierFallback::addBranches |
( |
| ) |
const |
|
overridevirtual |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 60 of file MuonTruthClassifierFallback.cxx.
62 const EventContext& ctx = Gaudi::Hive::currentContext();
65 if (!
parts.isValid()) {
67 return StatusCode::FAILURE;
72 return StatusCode::FAILURE;
75 if (!tpec.isValid()) {
76 ATH_MSG_DEBUG(
"No truth pileup collection with name " <<
m_truthPileupSGKey.fullKey() <<
" found in StoreGate. Pile-up information will not be filled");
80 if (!truthMuons.isValid()) {
82 return StatusCode::FAILURE;
92 if (dR > minDR)
continue;
98 for (
size_t parti = 0; parti <
event->nTruthParticles(); parti++) {
104 if (dR > minDR)
continue;
110 decorator_dR(*
part) = closest ? std::sqrt(minDR) : -1;
112 int newType{-1}, newOrigin{-1};
113 if (closest && closest->
isMuon()) {
114 newType = acc_tT(*closest);
115 newOrigin = acc_tO(*closest);
116 }
else if (closest) {
119 newOrigin =
res.second;
121 decorator_type(*
part) = newType;
122 decorator_origin(*
part) = newOrigin;
124 decorator_pu_dR(*
part) = -1;
125 decorator_pu_type(*
part) = -1;
126 decorator_pu_origin(*
part) = -1;
130 if (tpec.isValid()) {
132 for (
auto event : *tpec) {
133 for (
size_t parti = 0; parti <
event->nTruthParticles(); parti++) {
139 if (dR > minDR)
continue;
140 closestPileup = tpart;
144 decorator_pu_dR(*
part) = (closestPileup ? std::sqrt(minDR) : -1);
145 int newPileupType{-1}, newPileupOrigin{-1};
148 newPileupType =
res.first;
149 newPileupOrigin =
res.second;
151 decorator_pu_type(*
part) = newPileupType;
152 decorator_pu_origin(*
part) = newPileupOrigin;
156 return StatusCode::SUCCESS;
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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
◆ initialize()
StatusCode DerivationFramework::MuonTruthClassifierFallback::initialize |
( |
| ) |
|
|
override |
◆ 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& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ 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.
◆ 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.
◆ updateVHKA()
◆ m_containerKey
◆ m_detStore
◆ m_evtStore
◆ m_mcTruthClassifier
ToolHandle<IMCTruthClassifier> DerivationFramework::MuonTruthClassifierFallback::m_mcTruthClassifier {this, "MCTruthClassifierTool", "", "Handle of the MC truth classifier"} |
|
private |
◆ m_minPt
Gaudi::Property<float> DerivationFramework::MuonTruthClassifierFallback::m_minPt {this, "MinPt", 2500} |
|
private |
◆ m_Truth_dR_Key
◆ m_Truth_origin_Key
◆ m_Truth_PU_dR_Key
◆ m_Truth_PU_origin_Key
◆ m_Truth_PU_type_Key
◆ m_Truth_type_Key
◆ m_truthMuonSGKey
◆ m_truthPileupSGKey
Initial value:{this, "TruthPileupContainerKey", "TruthPileupEvents",
"Key of the pile-up event container"}
Definition at line 38 of file MuonTruthClassifierFallback.h.
◆ m_truthSGKey
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuonSGKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_type_Key
SG::ReadHandleKey< xAOD::TruthPileupEventContainer > m_truthPileupSGKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthSGKey
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
Class providing the definition of the 4-vector interface.
virtual void setOwner(IDataHandleHolder *o)=0
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
Gaudi::Property< float > m_minPt
POOL::TEvent event(POOL::TEvent::kClassAccess)
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...
Class describing a truth particle in the MC record.
std::pair< std::vector< unsigned int >, bool > res
Class describing a signal truth event in the MC record.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_origin_Key
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_PU_origin_Key
SG::ReadHandleKey< xAOD::IParticleContainer > m_containerKey
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isMuon() const
Whether the particle is a muon (or antimuon)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_PU_type_Key
virtual double pt() const override final
The transverse momentum ( ) of the particle.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_dR_Key
Key properties are overwirrten during initialize.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
double charge() const
Physical charge.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_Truth_PU_dR_Key