 |
ATLAS Offline Software
|
#include <TauTruthMatchingTool.h>
|
| virtual TLorentzVector | getTruthTauP4Vis (const xAOD::TauJet &xTau) override final |
| |
| virtual TLorentzVector | getTruthTauP4Vis (const xAOD::TruthParticle &xTruthTau) const override final |
| |
| virtual TLorentzVector | getTruthTauP4Invis (const xAOD::TauJet &xTau) override final |
| |
| virtual TLorentzVector | getTruthTauP4Invis (const xAOD::TruthParticle &xTruthTau) const override final |
| |
| virtual TauAnalysisTools::TruthMatchedParticleType | getTruthParticleType (const xAOD::TauJet &xTau) override final |
| |
| virtual int | getNTauDecayParticles (const xAOD::TauJet &xTau, int iPdgId, bool bCompareAbsoluteValues=false) override final |
| |
| virtual int | getNTauDecayParticles (const xAOD::TruthParticle &xTruthTau, int iPdgId, bool bCompareAbsoluteValues=false) const override final |
| |
| virtual xAOD::TauJetParameters::DecayMode | getDecayMode (const xAOD::TauJet &xTau) override final |
| |
| virtual xAOD::TauJetParameters::DecayMode | getDecayMode (const xAOD::TruthParticle &xTruthTau) const override final |
| |
| virtual StatusCode | lockDecorations (const xAOD::TauJetContainer &taus) const override final |
| | Decorations produced by an algorithm need to be locked; otherwise, they will be ignored by deep copies. More...
|
| |
| virtual void | print () const =0 |
| | Print the state of the tool. More...
|
| |
| virtual void | print () const |
| | Print the state of the tool. More...
|
| |
| virtual StatusCode | sysInitialize () |
| | Function initialising the tool in the correct way in Athena. 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 | 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, V, H > &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 |
| |
|
| virtual StatusCode | initialize () override final |
| |
| virtual std::unique_ptr< ITruthTausEvent > | getEvent () const override final |
| |
| virtual const xAOD::TruthParticle * | getTruth (const xAOD::TauJet &xTau) override final |
| |
| virtual const xAOD::TruthParticle * | getTruth (const xAOD::TauJet &xTau, ITruthTausEvent &truthTausEVent) const override final |
| |
| virtual std::vector< const xAOD::TruthParticle * > | getTruth (const std::vector< const xAOD::TauJet * > &vTaus) override final |
| |
| StatusCode | findTruthTau (const xAOD::TauJet &xTau, TruthTausEvent &truthTausEvent) const |
| |
| StatusCode | checkTruthMatch (const xAOD::TauJet &xTau, const xAOD::TruthParticleContainer &xTauContainer, const TruthTausEvent &truthTausEvent) const |
| |
| virtual void | setTruthMatchingMode () override |
| |
| virtual StatusCode | retrieveTruthTaus () override |
| |
| virtual StatusCode | retrieveTruthTaus (ITruthTausEvent &truthTausEvent, const EventContext &ctx) const override |
| |
| StatusCode | buildTruthTausFromTruthParticles (TruthTausEvent &truthTausEvent, const EventContext &ctx) const |
| |
| StatusCode | examineTruthTau (const xAOD::TruthParticle &xTruthParticle) const |
| |
| StatusCode | examineTruthTauDecay (const xAOD::TruthParticle &xTruthParticle, TauTruthInfo &truthInfo) const |
| |
| void | printDecay (const xAOD::TruthParticle &xTruthParticle, int depth=0) const |
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| | specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
| |
|
| Gaudi::Property< double > | m_dMaxDeltaR {this, "MaxDeltaR", 0.2} |
| |
| CxxUtils::CachedValue< bool > | m_bIsTruthMatchedAvailable |
| |
| CxxUtils::CachedValue< bool > | m_bIsTruthParticleLinkAvailable |
| |
| SG::ConstAccessor< double > | m_accPtVis |
| |
| SG::ConstAccessor< double > | m_accEtaVis |
| |
| SG::ConstAccessor< double > | m_accPhiVis |
| |
| SG::ConstAccessor< double > | m_accMVis |
| |
| Gaudi::Property< bool > | m_bWriteInvisibleFourMomentum { this, "WriteInvisibleFourMomentum", false} |
| |
| Gaudi::Property< bool > | m_bWriteVisibleChargedFourMomentum { this, "WriteVisibleChargedFourMomentum", false} |
| |
| Gaudi::Property< bool > | m_bWriteVisibleNeutralFourMomentum { this, "WriteVisibleNeutralFourMomentum", false} |
| |
| Gaudi::Property< bool > | m_bWriteDecayModeVector { this, "WriteDecayModeVector", true} |
| |
| Gaudi::Property< bool > | m_bWriteVertices { this, "WriteVertices", true} |
| |
| SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthTauInputContainer { this, "TruthTauContainerName", "TruthTaus", "Truth tau input container name (truth matching mode)" } |
| |
| SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthParticleContainer { this, "TruthParticleContainerName", "TruthParticles", "Truth particles input container name" } |
| |
| SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthElectronContainer { this, "TruthElectronContainerName", "TruthElectrons", "Truth electrons input container name" } |
| |
| SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthMuonContainer { this, "TruthMuonContainerName", "TruthMuons", "Truth muons input container name" } |
| |
| SG::ReadHandleKey< xAOD::JetContainer > | m_truthJetContainer { this, "TruthJetContainerName", "AntiKt4TruthDressedWZJets", "Truth jets input container name" } |
| |
| SG::WriteHandleKey< xAOD::TruthParticleContainer > | m_truthTauOutputContainer { this, "NewTruthTauContainerName", "TruthTaus", "Truth tau output container name" } |
| |
| SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_originReadDecorKey {this, "inputClassifierParticleOrigin", "TruthParticles.classifierParticleOrigin", "Particle origin"} |
| |
| SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_typeReadDecorKey {this, "inputClassifierParticleType", "TruthParticles.classifierParticleType", "Particle type"} |
| |
| SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", "TruthParticles.classifierParticleOutCome", "Particle outcome"} |
| |
| SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationReadDecorKey {this, "inputClassification", "TruthParticles.Classification", "Classification code"} |
| |
| SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_linkDecoratorKey {this, "originalTruthParticle", "TruthTaus.originalTruthParticle", "Name of the decoration linking to the original truth particle"} |
| |
| SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_originDecoratorKey {this, "classifierParticleOrigin", "TruthTaus.classifierParticleOrigin", "Name of the decoration which records the particle origin"} |
| |
| SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_typeDecoratorKey {this, "classifierParticleType", "TruthTaus.classifierParticleType", "Name of the decoration which records the particle type"} |
| |
| SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeDecoratorKey {this, "classifierParticleOutCome", "TruthTaus.classifierParticleOutCome", "Name of the decoration which records the particle outcome"} |
| |
| SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationDecoratorKey {this, "Classification", "TruthTaus.Classification", "Name of the decoration which records the particle classification"} |
| |
| bool | m_truthMatchingMode = false |
| |
| MetaStore_t | m_inputMetaStore |
| | Object accessing the input metadata store. More...
|
| |
| MetaStore_t | m_outputMetaStore |
| | Object accessing the output metadata store. More...
|
| |
| bool | m_beginInputFileCalled |
| | Flag helping to discover when the tool misses the opening of the first input file. More...
|
| |
| bool | m_useIncidents |
| |
| 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 |
| |
Definition at line 23 of file TauTruthMatchingTool.h.
◆ MetaStore_t
◆ MetaStorePtr_t
Type of the metadata store pointer in standalone mode.
Definition at line 68 of file AsgMetadataTool.h.
◆ StoreGateSvc_t
◆ beginEvent()
| StatusCode asg::AsgMetadataTool::beginEvent |
( |
| ) |
|
|
protectedvirtualinherited |
Function called when a new events is loaded.
Dummy implementation that can be overridden by the derived tool.
Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, TauAnalysisTools::TauSelectionTool, TauAnalysisTools::DiTauSelectionTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, Trig::TrigDecisionTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, Trig::TrigConfBunchCrossingTool, xAODMaker::TriggerMenuMetaDataTool, and Trig::xAODBunchCrossingTool.
Definition at line 201 of file AsgMetadataTool.cxx.
204 return StatusCode::SUCCESS;
◆ beginInputFile()
| StatusCode asg::AsgMetadataTool::beginInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
Function called when a new input file is opened.
Dummy implementation that can be overridden by the derived tool.
Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, PMGTools::PMGTruthWeightTool, BookkeeperTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.
Definition at line 185 of file AsgMetadataTool.cxx.
188 return StatusCode::SUCCESS;
◆ buildTruthTausFromTruthParticles()
| StatusCode BuildTruthTaus::buildTruthTausFromTruthParticles |
( |
TruthTausEvent & |
truthTausEvent, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
privateinherited |
Definition at line 161 of file BuildTruthTaus.cxx.
174 for (
auto xTruthParticle : *truthTausEvent.m_xTruthParticleContainer)
176 if ( xTruthParticle->isTau() )
178 auto xTruthTau = std::make_unique<xAOD::TruthParticle>();
179 xTruthTau->makePrivateStore( *xTruthParticle );
187 truthTausEvent.m_xTruthTauContainer->push_back(std::move(xTruthTau));
191 typeDecorator(*truthTau) = typeReadDecor.
isAvailable() ? typeReadDecor(*xTruthParticle) : -1234;
192 originDecorator(*truthTau) = originReadDecor.isAvailable() ? originReadDecor(*xTruthParticle) : -1234;
193 outcomeDecorator(*truthTau) = outcomeReadDecor.isAvailable() ? outcomeReadDecor(*xTruthParticle) : -1234;
194 classificationDecorator(*truthTau) = classificationReadDecor.isAvailable() ? classificationReadDecor(*xTruthParticle) : -1234;
198 linkDecorator(*truthTau) = lTruthParticleLink;
201 return StatusCode::SUCCESS;
◆ checkTruthMatch()
Definition at line 305 of file TauTruthMatchingTool.cxx.
308 const xAOD::Jet* xTruthJetMatch =
nullptr;
313 for (
auto xTruthTauIt : xTruthTauContainer)
315 TLorentzVector vTruthVisTLV;
316 vTruthVisTLV.SetPtEtaPhiM(
m_accPtVis(*xTruthTauIt),
323 if (
static_cast<bool>(accIsHadronicTau(*xTruthTauIt)))
328 xTruthMatch = xTruthTauIt;
334 if (!xTruthMatch and truthTausEvent.m_xTruthMuonContainerConst)
337 for (
auto xTruthMuonIt : *truthTausEvent.m_xTruthMuonContainerConst)
341 if (xTruthMuonIt->pt()<dPtMax)
344 xTruthMatch = xTruthMuonIt;
345 dPtMax = xTruthMuonIt->
pt();
350 if (!xTruthMatch and truthTausEvent.m_xTruthElectronContainerConst)
353 for (
auto xTruthElectronIt : *truthTausEvent.m_xTruthElectronContainerConst)
357 if (xTruthElectronIt->pt()<dPtMax)
360 xTruthMatch = xTruthElectronIt;
361 dPtMax = xTruthElectronIt->
pt();
366 if (truthTausEvent.m_xTruthJetContainerConst)
369 for (
auto xTruthJetIt : *truthTausEvent.m_xTruthJetContainerConst)
373 if (xTruthJetIt->pt()<dPtMax)
375 xTruthJetMatch = xTruthJetIt;
376 dPtMax = xTruthJetIt->
pt();
382 decIsTruthMatched(xTau) = (
char)
true;
384 decIsTruthMatched(xTau) = (
char)
false;
389 decTruthJetLink(xTau) = lTruthParticleLink;
394 decTruthJetLink(xTau) = lTruthParticleLink;
405 decTruthParticleLink(xTau) = lTruthParticleLink;
407 else if (eTruthMatchedParticleType ==
TruthMuon)
410 decTruthParticleLink(xTau) = lTruthParticleLink;
415 decTruthParticleLink(xTau) = lTruthParticleLink;
421 decTruthParticleLink(xTau) = lTruthParticleLink;
424 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()
◆ endInputFile()
| StatusCode asg::AsgMetadataTool::endInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ examineTruthTau()
Definition at line 205 of file BuildTruthTaus.cxx.
209 return StatusCode::FAILURE;
213 TauTruthInfo truthInfo;
216 if (xDecayVertex ==
nullptr)
217 return StatusCode::FAILURE;
218 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
221 if (xTruthDaughter ==
nullptr)
223 ATH_MSG_ERROR(
"Truth daughter of tau decay was not found in "<<
m_truthParticleContainer.
key() <<
" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
224 return StatusCode::FAILURE;
228 if ( xTruthDaughter->
isTau() )
231 return StatusCode::FAILURE;
237 if (truthInfo.m_bIsHadronicTau)
241 if ( truthInfo.m_iNChargedDaughters%2 == 0 )
243 ATH_MSG_WARNING(
"found tau with even multiplicity: " << truthInfo.m_iNChargedDaughters);
257 decPtVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Pt();
258 decEtaVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Eta();
259 decPhiVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Phi();
260 decMVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.M();
262 decNumCharged(xTruthParticle) = truthInfo.m_iNChargedDaughters;
263 decNumChargedPion(xTruthParticle) = truthInfo.m_iNChargedPions;
264 decNumNeutral(xTruthParticle) = truthInfo.m_iNNeutralPions+truthInfo.m_iNNeutralOthers;
265 decNumNeutralPion(xTruthParticle) = truthInfo.m_iNNeutralPions;
268 decIsHadronicTau(xTruthParticle) = (
char)truthInfo.m_bIsHadronicTau;
272 TLorentzVector vTruthInvisTLV = xTruthParticle.
p4() - truthInfo.m_vTruthVisTLV;
277 decPtInvis(xTruthParticle) = vTruthInvisTLV.Pt();
278 decEtaInvis(xTruthParticle) = vTruthInvisTLV.Eta();
279 decPhiInvis(xTruthParticle) = vTruthInvisTLV.Phi();
280 decMInvis(xTruthParticle) = vTruthInvisTLV.M();
289 decPtVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Pt();
290 decEtaVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Eta();
291 decPhiVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Phi();
292 decMVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.M();
301 decPtVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Pt();
302 decEtaVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Eta();
303 decPhiVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Phi();
304 decMVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.M();
310 decDecayModeVector(xTruthParticle) = truthInfo.m_vDecayMode;
320 decDecayVertexX(xTruthParticle) = truthInfo.m_vDecayVertex.X();
321 decDecayVertexY(xTruthParticle) = truthInfo.m_vDecayVertex.Y();
322 decDecayVertexZ(xTruthParticle) = truthInfo.m_vDecayVertex.Z();
329 decProdVertexX(xTruthParticle) = truthInfo.m_vProdVertex.X();
330 decProdVertexY(xTruthParticle) = truthInfo.m_vProdVertex.Y();
331 decProdVertexZ(xTruthParticle) = truthInfo.m_vProdVertex.Z();
334 return StatusCode::SUCCESS;
◆ examineTruthTauDecay()
Definition at line 338 of file BuildTruthTaus.cxx.
344 return StatusCode::SUCCESS;
346 truthInfo.m_vDecayVertex.SetXYZ(xDecayVertex->
x(),xDecayVertex->
y(),xDecayVertex->
z());
350 truthInfo.m_vProdVertex.SetXYZ(xProdVertex->
x(),xProdVertex->
y(),xProdVertex->
z());
352 truthInfo.m_vProdVertex.SetXYZ(-1234,-1234,-1234);
355 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
358 if (xTruthDaughter ==
nullptr)
360 ATH_MSG_ERROR(
"Truth daughter of tau decay was not found in "<<
m_truthParticleContainer.
key() <<
" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
361 return StatusCode::FAILURE;
364 int iAbsPdgId = xTruthDaughter->
absPdgId();
365 int iPdgId = xTruthDaughter->
pdgId();
370 if ( iAbsPdgId != 111 && iAbsPdgId != 311 && iAbsPdgId != 310 && iAbsPdgId != 130 )
382 truthInfo.m_vDecayMode.push_back(iPdgId);
387 truthInfo.m_bIsHadronicTau =
true;
397 truthInfo.m_vTruthVisTLV += xTruthDaughter->
p4();
400 truthInfo.m_vTruthVisTLVCharged += xTruthDaughter->
p4();
403 truthInfo.m_vTruthVisTLVNeutral += xTruthDaughter->
p4();
409 truthInfo.m_iNChargedDaughters++;
411 if (iAbsPdgId==211) truthInfo.m_iNChargedPions++;
412 else truthInfo.m_iNChargedOthers++;
418 if (iAbsPdgId==111) truthInfo.m_iNNeutralPions++;
419 else truthInfo.m_iNNeutralOthers++;
422 return StatusCode::SUCCESS;
◆ 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
◆ findTruthTau()
| StatusCode TauTruthMatchingTool::findTruthTau |
( |
const xAOD::TauJet & |
xTau, |
|
|
TruthTausEvent & |
truthTausEvent |
|
) |
| const |
|
private |
Definition at line 275 of file TauTruthMatchingTool.cxx.
286 accTruthParticleLink(
"truthParticleLink");
291 return StatusCode::SUCCESS;
299 return checkTruthMatch(xTau, *truthTausEvent.m_xTruthTauContainerConst, truthTausEvent);
301 return checkTruthMatch(xTau, *truthTausEvent.m_xTruthTauContainer, truthTausEvent);
◆ getDecayMode() [1/2]
◆ getDecayMode() [2/2]
◆ getEvent()
|
|
finaloverrideprivatevirtual |
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
| ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
| const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
| ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getNTauDecayParticles() [1/2]
| int TauTruthMatchingTool::getNTauDecayParticles |
( |
const xAOD::TauJet & |
xTau, |
|
|
int |
iPdgId, |
|
|
bool |
bCompareAbsoluteValues = false |
|
) |
| |
|
finaloverridevirtual |
◆ getNTauDecayParticles() [2/2]
| int TauTruthMatchingTool::getNTauDecayParticles |
( |
const xAOD::TruthParticle & |
xTruthTau, |
|
|
int |
iPdgId, |
|
|
bool |
bCompareAbsoluteValues = false |
|
) |
| const |
|
finaloverridevirtual |
Implements TauAnalysisTools::ITauTruthMatchingTool.
Definition at line 197 of file TauTruthMatchingTool.cxx.
201 if (!accDecayModeVector.isAvailable(xTruthTau))
207 for(
auto iPdgId2 : accDecayModeVector(xTruthTau))
208 if (!bCompareAbsoluteValues)
210 if (iPdgId2 == iPdgId) iNum++;
214 if (std::abs(iPdgId2) == std::abs(iPdgId)) iNum++;
◆ getProperty()
template<class T >
| const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getTruth() [1/3]
|
|
finaloverrideprivatevirtual |
◆ getTruth() [2/3]
|
|
finaloverrideprivatevirtual |
◆ getTruth() [3/3]
|
|
finaloverrideprivatevirtual |
Implements TauAnalysisTools::ITauTruthMatchingTool.
Definition at line 55 of file TauTruthMatchingTool.cxx.
58 TruthTausEvent& truthTausEvent =
dynamic_cast<TruthTausEvent&
> (itruthTausEvent);
59 const EventContext& ctx = Gaudi::Hive::currentContext();
64 ATH_MSG_WARNING(
"There was a failure in finding the matched truth tau");
71 ATH_MSG_DEBUG(
"TauJetContainer has truthParticleLink available while IsTruthMatched not available. Re-evaluate IsTruthMatched");
73 if (accTruthParticleLink(xTau)) {
74 decIsTruthMatched(xTau) = (
char)
true;
76 decIsTruthMatched(xTau) = (
char)
false;
81 if (
static_cast<bool>(accIsTruthMatched(xTau)))
83 if (accTruthParticleLink(xTau).isValid())
85 return *accTruthParticleLink(xTau);
◆ getTruthParticleType()
◆ getTruthTauP4Invis() [1/2]
◆ getTruthTauP4Invis() [2/2]
◆ getTruthTauP4Vis() [1/2]
◆ getTruthTauP4Vis() [2/2]
◆ handle()
| void asg::AsgMetadataTool::handle |
( |
const Incident & |
inc | ) |
|
|
protectedvirtualinherited |
Function receiving incidents from IncidentSvc/TEvent.
Reimplemented in Trig::TrigDecisionTool.
Definition at line 135 of file AsgMetadataTool.cxx.
141 if( inc.type() == IncidentType::BeginInputFile ) {
145 throw std::runtime_error(
"Couldn't call beginInputFile()" );
147 }
else if( inc.type() == IncidentType::EndInputFile ) {
150 throw std::runtime_error(
"Couldn't call endInputFile()" );
152 }
else if( inc.type() == IncidentType::BeginEvent ) {
160 throw std::runtime_error(
"Couldn't call beginInputFile()" );
165 throw std::runtime_error(
"Couldn't call beginEvent()" );
168 #ifdef XAOD_STANDALONE
169 }
else if( inc.type() == IncidentType::MetaDataStop ) {
172 throw std::runtime_error(
"Couldn't call metaDataStop()" );
175 #endif // XAOD_STANDALONE
177 ATH_MSG_WARNING(
"Unknown incident type received in AsgMetaDataTool: " << inc.type() );
◆ initialize()
| StatusCode TauTruthMatchingTool::initialize |
( |
| ) |
|
|
finaloverrideprivatevirtual |
◆ 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.
◆ inputMetaStore()
| AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the input metadata store.
Definition at line 93 of file AsgMetadataTool.cxx.
95 #ifdef XAOD_STANDALONE
97 #else // XAOD_STANDALONE
99 #endif // XAOD_STANDALONE
◆ lockDecorations()
Decorations produced by an algorithm need to be locked; otherwise, they will be ignored by deep copies.
The interfaces of this tool take a single object at a time, so we can't do the locking there. Instead, call this method after all taus in a container have been processed.
Implements TauAnalysisTools::ITauTruthMatchingTool.
Definition at line 436 of file TauTruthMatchingTool.cxx.
442 taus_nc.lockDecoration (decIsTruthMatched.auxid());
443 taus_nc.lockDecoration (decTruthJetLink.auxid());
444 taus_nc.lockDecoration (decTruthParticleLink.auxid());
445 return StatusCode::SUCCESS;
◆ metaDataStop()
| StatusCode asg::AsgMetadataTool::metaDataStop |
( |
| ) |
|
|
protectedvirtualinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
| const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ 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.
◆ outputMetaStore()
| AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the output metadata store.
Definition at line 102 of file AsgMetadataTool.cxx.
104 #ifdef XAOD_STANDALONE
106 #else // XAOD_STANDALONE
108 #endif // XAOD_STANDALONE
◆ print() [1/2]
| void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, LundVariablesTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
| virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, LundVariablesTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ printDecay()
Definition at line 425 of file BuildTruthTaus.cxx.
430 if (xDecayVertex ==
nullptr)
433 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
436 if (xTruthDaughter ==
nullptr)
438 ATH_MSG_WARNING(
"Truth daughter of tau decay was not found in "<<
m_truthParticleContainer.
key() <<
" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
442 <<
" e "<<xTruthDaughter->
e()
443 <<
" eta "<<xTruthDaughter->
p4().Eta()
444 <<
" phi "<<xTruthDaughter->
p4().Phi()
445 <<
" pdgid "<<xTruthDaughter->
pdgId()
446 <<
" status "<<xTruthDaughter->
status()
◆ renounce()
◆ renounceArray()
◆ retrieveTruthTaus() [1/3]
| StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
| ) |
|
|
overrideprivatevirtualinherited |
◆ retrieveTruthTaus() [2/3]
| StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
ITruthTausEvent & |
truthTausEvent, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
overrideprivatevirtualinherited |
◆ retrieveTruthTaus() [3/3]
| StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
TruthTausEvent & |
truthTausEvent, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
protectedinherited |
Definition at line 96 of file BuildTruthTaus.cxx.
102 if (!truthElectronsHandle.isValid()) {
103 ATH_MSG_ERROR (
"Could not retrieve " << truthElectronsHandle.key());
104 return StatusCode::FAILURE;
106 truthTausEvent.m_xTruthElectronContainerConst = truthElectronsHandle.cptr();
111 if (!truthMuonsHandle.isValid()) {
112 ATH_MSG_ERROR (
"Could not retrieve " << truthMuonsHandle.key());
113 return StatusCode::FAILURE;
115 truthTausEvent.m_xTruthMuonContainerConst = truthMuonsHandle.cptr();
120 if (!truthJetsHandle.isValid()) {
121 ATH_MSG_ERROR (
"Could not retrieve " << truthJetsHandle.key());
122 return StatusCode::FAILURE;
124 truthTausEvent.m_xTruthJetContainerConst = truthJetsHandle.cptr();
128 if (!truthTausHandle.isValid()) {
129 ATH_MSG_ERROR (
"Could not retrieve " << truthTausHandle.key());
130 return StatusCode::FAILURE;
132 truthTausEvent.m_xTruthTauContainerConst = truthTausHandle.cptr();
137 if (!truthParticlesHandle.isValid()) {
138 ATH_MSG_ERROR (
"Could not retrieve " << truthParticlesHandle.key());
139 return StatusCode::FAILURE;
141 truthTausEvent.m_xTruthParticleContainer = truthParticlesHandle.cptr();
143 auto truthTausOutput = std::make_unique<xAOD::TruthParticleContainer>();
144 auto truthTausOutputAux = std::make_unique<xAOD::TruthParticleAuxContainer>();
145 truthTausOutput->setStore(truthTausOutputAux.get());
146 truthTausEvent.m_xTruthTauContainer = truthTausOutput.get();
149 ATH_CHECK(writeHandle.record(std::move(truthTausOutput), std::move(truthTausOutputAux)));
154 return StatusCode::SUCCESS;
◆ setTruthMatchingMode()
| virtual void TauAnalysisTools::BuildTruthTaus::setTruthMatchingMode |
( |
| ) |
|
|
inlineoverrideprivatevirtualinherited |
◆ setUseIncidents()
| void asg::AsgMetadataTool::setUseIncidents |
( |
const bool |
flag | ) |
|
|
inlineprotectedinherited |
◆ sysInitialize()
| StatusCode asg::AsgMetadataTool::sysInitialize |
( |
| ) |
|
|
virtualinherited |
Function initialising the tool in the correct way in Athena.
This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.
Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.
Definition at line 115 of file AsgMetadataTool.cxx.
117 #ifndef XAOD_STANDALONE
124 incSvc->addListener(
this, IncidentType::BeginEvent, 0,
false );
129 #endif // not XAOD_STANDALONE
132 return StatusCode::SUCCESS;
◆ 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_accEtaVis
◆ m_accMVis
◆ m_accPhiVis
◆ m_accPtVis
◆ m_beginInputFileCalled
| bool asg::AsgMetadataTool::m_beginInputFileCalled |
|
privateinherited |
Flag helping to discover when the tool misses the opening of the first input file.
Definition at line 126 of file AsgMetadataTool.h.
◆ m_bIsTruthMatchedAvailable
◆ m_bIsTruthParticleLinkAvailable
◆ m_bTruthTauAvailable
| bool TauAnalysisTools::BuildTruthTaus::m_bTruthTauAvailable {} |
|
protectedinherited |
◆ m_bWriteDecayModeVector
| Gaudi::Property<bool> TauAnalysisTools::BuildTruthTaus::m_bWriteDecayModeVector { this, "WriteDecayModeVector", true} |
|
privateinherited |
◆ m_bWriteInvisibleFourMomentum
| Gaudi::Property<bool> TauAnalysisTools::BuildTruthTaus::m_bWriteInvisibleFourMomentum { this, "WriteInvisibleFourMomentum", false} |
|
privateinherited |
◆ m_bWriteVertices
| Gaudi::Property<bool> TauAnalysisTools::BuildTruthTaus::m_bWriteVertices { this, "WriteVertices", true} |
|
privateinherited |
◆ m_bWriteVisibleChargedFourMomentum
| Gaudi::Property<bool> TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleChargedFourMomentum { this, "WriteVisibleChargedFourMomentum", false} |
|
privateinherited |
◆ m_bWriteVisibleNeutralFourMomentum
| Gaudi::Property<bool> TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleNeutralFourMomentum { this, "WriteVisibleNeutralFourMomentum", false} |
|
privateinherited |
◆ m_classificationDecoratorKey
◆ m_classificationReadDecorKey
◆ m_detStore
◆ m_dMaxDeltaR
| Gaudi::Property<double> TauAnalysisTools::TauTruthMatchingTool::m_dMaxDeltaR {this, "MaxDeltaR", 0.2} |
|
private |
◆ m_evtStore
◆ m_inputMetaStore
◆ m_linkDecoratorKey
◆ m_originDecoratorKey
◆ m_originReadDecorKey
◆ m_outcomeDecoratorKey
◆ m_outcomeReadDecorKey
◆ m_outputMetaStore
◆ m_truthElectronContainer
◆ m_truthJetContainer
◆ m_truthMatchingMode
| bool TauAnalysisTools::BuildTruthTaus::m_truthMatchingMode = false |
|
privateinherited |
◆ m_truthMuonContainer
◆ m_truthParticleContainer
◆ m_truthTauInputContainer
◆ m_truthTauOutputContainer
◆ m_truthTausEvent
| TruthTausEvent TauAnalysisTools::BuildTruthTaus::m_truthTausEvent |
|
protectedinherited |
◆ m_typeDecoratorKey
◆ m_typeReadDecorKey
◆ m_useIncidents
| bool asg::AsgMetadataTool::m_useIncidents |
|
privateinherited |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
size_t nOutgoingParticles() const
Get the number of outgoing particles.
@ depth
pointing depth of the shower as calculated in egammaqgcld
int absPdgId() const
Absolute PDG ID code (often useful)
const T * ptr() const
Return a pointer to the cached value.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
bool isValid() const
Test to see if the value is valid.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
float y() const
Vertex y displacement.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
bool hasDecayVtx() const
Check for a decay vertex on this particle.
virtual double e() const override final
The total energy of the particle.
Handle class for reading a decoration on an object.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
bool hasProdVtx() const
Check for a production vertex on this particle.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
bool isTau() const
Whether the particle is a tau (or antitau)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool isCharged() const
Whether the particle is electrically charged.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
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.
void set(const T &val) const
Set the value, assuming it is currently invalid.
float x() const
Vertex x displacement.
int status() const
Status code.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
bool isDecayed(const T &p)
Identify if the particle decayed.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
float z() const
Vertex longitudinal distance along the beam line form the origin.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
bool isNeutrino() const
Whether the particle is a neutrino (or antineutrino)
#define ATLAS_THREAD_SAFE
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
int pdgId() const
PDG ID code.
virtual double pt() const
The transverse momentum ( ) of the particle.
bool isNeutral() const
Whether the particle is electrically neutral.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
bool isHadron() const
Whether the particle is a hadron.