Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <DiTauTruthMatchingTool.h>
|
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 > &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 () |
|
virtual void | getTruth (const xAOD::DiTauJet &xDiTau) |
| get pointer to the truth matched particle. More...
|
|
virtual void | getTruth (const std::vector< const xAOD::DiTauJet * > &vDiTaus) |
|
StatusCode | findTruthTau (const xAOD::DiTauJet &xDiTau) |
|
StatusCode | checkTruthMatch (const xAOD::DiTauJet &xDiTau, const xAOD::TruthParticleContainer &xTauContainer) const |
|
StatusCode | truthMatch (const TLorentzVector &vSubjetTLV, const xAOD::TruthParticleContainer &xTruthTauContainer, const xAOD::TruthParticle *&xTruthMatch, TruthMatchedParticleType &eTruthMatchedParticleType) const |
|
ElementLink< xAOD::TruthParticleContainer > | checkTruthLepton (const xAOD::IParticle *pLepton) const |
|
virtual void | setTruthMatchingMode () override |
|
virtual StatusCode | retrieveTruthTaus () override |
|
virtual StatusCode | retrieveTruthTaus (ITruthTausEvent &truthTausEvent) const override |
|
StatusCode | buildTruthTausFromTruthParticles (TruthTausEvent &truthTausEvent) 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 > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
double | m_dMaxDeltaR |
|
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 |
|
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" } |
|
bool | m_truthMatchingMode = false |
|
bool | m_bWriteInvisibleFourMomentum {} |
|
bool | m_bWriteVisibleChargedFourMomentum {} |
|
bool | m_bWriteVisibleNeutralFourMomentum {} |
|
bool | m_bWriteDecayModeVector {} |
|
bool | m_bWriteVertices {} |
|
asg::AnaToolHandle< IMCTruthClassifier > | m_tMCTruthClassifier |
|
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 27 of file DiTauTruthMatchingTool.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 196 of file AsgMetadataTool.cxx.
199 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, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.
Definition at line 180 of file AsgMetadataTool.cxx.
183 return StatusCode::SUCCESS;
◆ buildTruthTausFromTruthParticles()
StatusCode BuildTruthTaus::buildTruthTausFromTruthParticles |
( |
TruthTausEvent & |
truthTausEvent | ) |
const |
|
privateinherited |
Definition at line 166 of file BuildTruthTaus.cxx.
170 bool copyDressedPhotons =
false;
172 for (
auto xTruthParticle : *truthTausEvent.m_xTruthParticleContainer)
174 if ( xTruthParticle->isTau() )
176 auto xTruthTau = std::make_unique<xAOD::TruthParticle>();
177 xTruthTau->makePrivateStore( *xTruthParticle );
191 if (truthTausEvent.m_xTruthTauContainer->empty() &&
192 dressedPhotonAcc.isAvailable ( *xTruthParticle ) &&
193 !dressedPhotonAcc.isAvailable ( *xTruthTau ))
195 copyDressedPhotons =
true;
197 if (copyDressedPhotons)
199 dressedPhotonAcc( *xTruthTau ) = dressedPhotonAcc( *xTruthParticle );
206 decClassifierParticleType(*xTruthTau) = pClassification.first;
207 decClassifierParticleOrigin(*xTruthTau) = pClassification.second;
212 accOriginalTruthParticle(*xTruthTau) = lTruthParticleLink;
214 truthTausEvent.m_xTruthTauContainer->push_back(std::move(xTruthTau));
217 return StatusCode::SUCCESS;
◆ checkTruthLepton()
Definition at line 324 of file DiTauTruthMatchingTool.cxx.
327 if(!accTruthParticleLink.isAvailable(*pLepton)){
328 return truthParticleLink;
330 truthParticleLink = accTruthParticleLink(*pLepton);
331 return truthParticleLink;
◆ checkTruthMatch()
Definition at line 104 of file DiTauTruthMatchingTool.cxx.
106 std::vector<const xAOD::TruthParticle*> vTruthMatch;
107 std::vector<TruthMatchedParticleType> vTruthMatchedParticleType;
119 for (
int i = 0;
i < accNSubjets(xDiTau); ++
i)
124 vTruthMatch.push_back(xTruthMatch);
125 vTruthMatchedParticleType.push_back(eTruthMatchedParticleType);
129 for (
int i = 0;
i < accNSubjets(xDiTau); ++
i)
131 TLorentzVector vSubjetTLV;
132 vSubjetTLV.SetPtEtaPhiE(xDiTau.
subjetPt(
i),
139 vTruthMatchedParticleType.at(
i)).isFailure() )
141 ATH_MSG_WARNING(
"There was a failure in matching truth taus with subjet " <<
i);
142 return StatusCode::FAILURE;
147 xRemainingTruthTaus.
end(),
148 vTruthMatch.at(
i)) );
152 bool bTruthMatched =
true;
155 std::vector< ElementLink < xAOD::TruthParticleContainer > > vTruthLinks;
156 for (
int i = 0;
i < accNSubjets(xDiTau); ++
i)
165 vTruthLinks.push_back(lTruthParticleLink);
167 else if (eTruthMatchedParticleType ==
TruthMuon)
170 vTruthLinks.push_back(lTruthParticleLink);
175 vTruthLinks.push_back(lTruthParticleLink);
181 vTruthLinks.push_back(lTruthParticleLink);
184 if (
i == 0 ||
i == 1) bTruthMatched =
false;
189 decTruthParticleLinks (
"truthParticleLinks");
190 decTruthParticleLinks(xDiTau) = vTruthLinks;
194 decTruthTaus (
"TruthTaus");
195 decTruthTaus(xDiTau) = vTruthLinks;
209 if(accElLink.isAvailable(xDiTau) && accMuLink.isAvailable(xDiTau))
210 ATH_MSG_ERROR(
"Links to reco electron and reco muon available for one ditau candidate.");
211 if(accElLink.isAvailable(xDiTau)){
213 if ((accTruthType.isAvailable(*pElectron) && accTruthOrigin.isAvailable(*pElectron)))
215 mcTruthType = accTruthType(*pElectron);
216 mcTruthOrigin = accTruthOrigin(*pElectron);
220 if(accMuLink.isAvailable(xDiTau)){
222 if (accTruthType.isAvailable(*pMuon) && accTruthOrigin.isAvailable(*pMuon))
224 mcTruthType = accTruthType(*pMuon);
225 mcTruthOrigin = accTruthOrigin(*pMuon);
232 decClassifierParticleType(xDiTau) = mcTruthType;
233 decClassifierParticleOrigin(xDiTau) = mcTruthOrigin;
234 decTruthLeptonLink(xDiTau) = lTruthLeptonLink;
250 if ( accNSubjets(xDiTau) < 2) {
251 decIsTruthMatched(xDiTau) = (
char)
false;
252 decIsTruthHadronic(xDiTau) = (
char)
false;
253 decTruthLeadPt(xDiTau) = -1234.;
254 decTruthLeadEta(xDiTau) = -1234.;
255 decTruthLeadPhi(xDiTau) = -1234.;
256 decTruthLeadM(xDiTau) = -1234.;
257 decTruthLeadPdgID(xDiTau) = -1234.;
258 decTruthSubleadPt(xDiTau) = -1234.;
259 decTruthSubleadEta(xDiTau) = -1234.;
260 decTruthSubleadPhi(xDiTau) = -1234.;
261 decTruthSubleadM(xDiTau) = -1234.;
262 decTruthSubleadPdgID(xDiTau) = -1234.;
263 decTruthDeltaR(xDiTau) = -1234.;
264 decTruthMass(xDiTau) = -1234.;
265 return StatusCode::SUCCESS;
268 decIsTruthMatched(xDiTau) = (
char)bTruthMatched;
276 decIsTruthHadronic(xDiTau) = (
char)
false;
278 if (accIsTruthHadronic(xDiTau))
280 TLorentzVector tlvTruthTau1;
281 TLorentzVector tlvTruthTau2;
282 tlvTruthTau1.SetPtEtaPhiM(
m_accPtVis(*(*vTruthLinks.at(0))),
286 tlvTruthTau2.SetPtEtaPhiM(
m_accPtVis(*(*vTruthLinks.at(1))),
291 decTruthLeadPt(xDiTau) =
std::max(tlvTruthTau1.Pt(), tlvTruthTau2.Pt());
292 decTruthLeadEta(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau1.Eta() : tlvTruthTau2.Eta();
293 decTruthLeadPhi(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau1.Phi() : tlvTruthTau2.Phi();
294 decTruthLeadM(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau1.M() : tlvTruthTau2.M();
295 decTruthLeadPdgID(xDiTau) = (*vTruthLinks.at(0))->pdgId();
296 decTruthSubleadPt(xDiTau) =
std::min(tlvTruthTau1.Pt(), tlvTruthTau2.Pt());
297 decTruthSubleadEta(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau2.Eta() : tlvTruthTau1.Eta();
298 decTruthSubleadPhi(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau2.Phi() : tlvTruthTau1.Phi();
299 decTruthSubleadM(xDiTau) = (tlvTruthTau1.Pt() > tlvTruthTau2.Pt()) ? tlvTruthTau2.M() : tlvTruthTau1.M();
300 decTruthSubleadPdgID(xDiTau) = (*vTruthLinks.at(1))->pdgId();
301 decTruthDeltaR(xDiTau) = tlvTruthTau1.DeltaR(tlvTruthTau2);
302 decTruthMass(xDiTau) = (tlvTruthTau1 + tlvTruthTau2).M();
306 decTruthLeadPt(xDiTau) = -1234.;
307 decTruthLeadEta(xDiTau) = -1234.;
308 decTruthLeadPhi(xDiTau) = -1234.;
309 decTruthLeadM(xDiTau) = -1234.;
310 decTruthLeadPdgID(xDiTau) = -1234.;
311 decTruthSubleadPt(xDiTau) = -1234.;
312 decTruthSubleadEta(xDiTau) = -1234.;
313 decTruthSubleadPhi(xDiTau) = -1234.;
314 decTruthSubleadM(xDiTau) = -1234.;
315 decTruthSubleadPdgID(xDiTau) = -1234.;
316 decTruthDeltaR(xDiTau) = -1234.;
317 decTruthMass(xDiTau) = -1234.;
320 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 221 of file BuildTruthTaus.cxx.
225 return StatusCode::FAILURE;
229 TauTruthInfo truthInfo;
232 if (xDecayVertex ==
nullptr)
233 return StatusCode::FAILURE;
234 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
237 if (xTruthDaughter ==
nullptr)
239 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.");
240 return StatusCode::FAILURE;
244 if ( xTruthDaughter->
isTau() )
247 return StatusCode::FAILURE;
253 if (truthInfo.m_bIsHadronicTau)
257 if ( truthInfo.m_iNChargedDaughters%2 == 0 )
259 ATH_MSG_WARNING(
"found tau with even multiplicity: " << truthInfo.m_iNChargedDaughters);
273 decPtVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Pt();
274 decEtaVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Eta();
275 decPhiVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Phi();
276 decMVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.M();
278 decNumCharged(xTruthParticle) = truthInfo.m_iNChargedDaughters;
279 decNumChargedPion(xTruthParticle) = truthInfo.m_iNChargedPions;
280 decNumNeutral(xTruthParticle) = truthInfo.m_iNNeutralPions+truthInfo.m_iNNeutralOthers;
281 decNumNeutralPion(xTruthParticle) = truthInfo.m_iNNeutralPions;
284 decIsHadronicTau(xTruthParticle) = (
char)truthInfo.m_bIsHadronicTau;
288 TLorentzVector vTruthInvisTLV = xTruthParticle.
p4() - truthInfo.m_vTruthVisTLV;
293 decPtInvis(xTruthParticle) = vTruthInvisTLV.Pt();
294 decEtaInvis(xTruthParticle) = vTruthInvisTLV.Eta();
295 decPhiInvis(xTruthParticle) = vTruthInvisTLV.Phi();
296 decMInvis(xTruthParticle) = vTruthInvisTLV.M();
305 decPtVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Pt();
306 decEtaVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Eta();
307 decPhiVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Phi();
308 decMVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.M();
317 decPtVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Pt();
318 decEtaVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Eta();
319 decPhiVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Phi();
320 decMVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.M();
326 decDecayModeVector(xTruthParticle) = truthInfo.m_vDecayMode;
336 decDecayVertexX(xTruthParticle) = truthInfo.m_vDecayVertex.X();
337 decDecayVertexY(xTruthParticle) = truthInfo.m_vDecayVertex.Y();
338 decDecayVertexZ(xTruthParticle) = truthInfo.m_vDecayVertex.Z();
345 decProdVertexX(xTruthParticle) = truthInfo.m_vProdVertex.X();
346 decProdVertexY(xTruthParticle) = truthInfo.m_vProdVertex.Y();
347 decProdVertexZ(xTruthParticle) = truthInfo.m_vProdVertex.Z();
350 return StatusCode::SUCCESS;
◆ examineTruthTauDecay()
Definition at line 354 of file BuildTruthTaus.cxx.
360 return StatusCode::SUCCESS;
362 truthInfo.m_vDecayVertex.SetXYZ(xDecayVertex->
x(),xDecayVertex->
y(),xDecayVertex->
z());
366 truthInfo.m_vProdVertex.SetXYZ(xProdVertex->
x(),xProdVertex->
y(),xProdVertex->
z());
368 truthInfo.m_vProdVertex.SetXYZ(-1234,-1234,-1234);
371 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
374 if (xTruthDaughter ==
nullptr)
376 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.");
377 return StatusCode::FAILURE;
380 int iAbsPdgId = xTruthDaughter->
absPdgId();
381 int iPdgId = xTruthDaughter->
pdgId();
386 if ( iAbsPdgId != 111 && iAbsPdgId != 311 && iAbsPdgId != 310 && iAbsPdgId != 130 )
398 truthInfo.m_vDecayMode.push_back(iPdgId);
403 truthInfo.m_bIsHadronicTau =
true;
413 truthInfo.m_vTruthVisTLV += xTruthDaughter->
p4();
416 truthInfo.m_vTruthVisTLVCharged += xTruthDaughter->
p4();
419 truthInfo.m_vTruthVisTLVNeutral += xTruthDaughter->
p4();
425 truthInfo.m_iNChargedDaughters++;
427 if (iAbsPdgId==211) truthInfo.m_iNChargedPions++;
428 else truthInfo.m_iNChargedOthers++;
434 if (iAbsPdgId==111) truthInfo.m_iNNeutralPions++;
435 else truthInfo.m_iNNeutralOthers++;
438 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()
◆ 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
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getTruth() [1/2]
◆ getTruth() [2/2]
◆ handle()
void asg::AsgMetadataTool::handle |
( |
const Incident & |
inc | ) |
|
|
protectedvirtualinherited |
Function receiving incidents from IncidentSvc/TEvent.
Reimplemented in Trig::TrigDecisionTool.
Definition at line 130 of file AsgMetadataTool.cxx.
136 if( inc.type() == IncidentType::BeginInputFile ) {
140 throw std::runtime_error(
"Couldn't call beginInputFile()" );
142 }
else if( inc.type() == IncidentType::EndInputFile ) {
145 throw std::runtime_error(
"Couldn't call endInputFile()" );
147 }
else if( inc.type() == IncidentType::BeginEvent ) {
155 throw std::runtime_error(
"Couldn't call beginInputFile()" );
160 throw std::runtime_error(
"Couldn't call beginEvent()" );
163 #ifdef XAOD_STANDALONE
164 }
else if( inc.type() == IncidentType::MetaDataStop ) {
167 throw std::runtime_error(
"Couldn't call metaDataStop()" );
170 #endif // XAOD_STANDALONE
172 ATH_MSG_WARNING(
"Unknown incident type received in AsgMetaDataTool: " << inc.type() );
◆ initialize()
StatusCode DiTauTruthMatchingTool::initialize |
( |
| ) |
|
|
privatevirtual |
◆ 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 88 of file AsgMetadataTool.cxx.
90 #ifdef XAOD_STANDALONE
92 #else // XAOD_STANDALONE
94 #endif // XAOD_STANDALONE
◆ 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 97 of file AsgMetadataTool.cxx.
99 #ifdef XAOD_STANDALONE
101 #else // XAOD_STANDALONE
103 #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, 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, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ printDecay()
Definition at line 441 of file BuildTruthTaus.cxx.
446 if (xDecayVertex ==
nullptr)
449 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->
nOutgoingParticles(); ++iOutgoingParticle )
452 if (xTruthDaughter ==
nullptr)
454 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.");
458 <<
" e "<<xTruthDaughter->
e()
459 <<
" eta "<<xTruthDaughter->
p4().Eta()
460 <<
" phi "<<xTruthDaughter->
p4().Phi()
461 <<
" pdgid "<<xTruthDaughter->
pdgId()
462 <<
" status "<<xTruthDaughter->
status()
◆ renounce()
◆ renounceArray()
◆ retrieveTruthTaus() [1/3]
StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
| ) |
|
|
overrideprivatevirtualinherited |
◆ retrieveTruthTaus() [2/3]
StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
ITruthTausEvent & |
truthTausEvent | ) |
const |
|
overrideprivatevirtualinherited |
◆ retrieveTruthTaus() [3/3]
StatusCode BuildTruthTaus::retrieveTruthTaus |
( |
TruthTausEvent & |
truthTausEvent | ) |
const |
|
protectedinherited |
Definition at line 99 of file BuildTruthTaus.cxx.
101 const EventContext& ctx = Gaudi::Hive::currentContext();
107 if (!truthElectronsHandle.isValid()) {
108 ATH_MSG_ERROR (
"Could not retrieve " << truthElectronsHandle.key());
109 return StatusCode::FAILURE;
111 truthTausEvent.m_xTruthElectronContainerConst = truthElectronsHandle.cptr();
116 if (!truthMuonsHandle.isValid()) {
117 ATH_MSG_ERROR (
"Could not retrieve " << truthMuonsHandle.key());
118 return StatusCode::FAILURE;
120 truthTausEvent.m_xTruthMuonContainerConst = truthMuonsHandle.cptr();
125 if (!truthJetsHandle.isValid()) {
126 ATH_MSG_ERROR (
"Could not retrieve " << truthJetsHandle.key());
127 return StatusCode::FAILURE;
129 truthTausEvent.m_xTruthJetContainerConst = truthJetsHandle.cptr();
133 if (!truthTausHandle.isValid()) {
134 ATH_MSG_ERROR (
"Could not retrieve " << truthTausHandle.key());
135 return StatusCode::FAILURE;
137 truthTausEvent.m_xTruthTauContainerConst = truthTausHandle.cptr();
142 if (!truthParticlesHandle.isValid()) {
143 ATH_MSG_ERROR (
"Could not retrieve " << truthParticlesHandle.key());
144 return StatusCode::FAILURE;
146 truthTausEvent.m_xTruthParticleContainer = truthParticlesHandle.cptr();
148 auto truthTausOutput = std::make_unique<xAOD::TruthParticleContainer>();
149 auto truthTausOutputAux = std::make_unique<xAOD::TruthParticleAuxContainer>();
150 truthTausOutput->setStore(truthTausOutputAux.get());
151 truthTausEvent.m_xTruthTauContainer = truthTausOutput.get();
156 ATH_CHECK(writeHandle.record(std::move(truthTausOutput), std::move(truthTausOutputAux)));
159 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 110 of file AsgMetadataTool.cxx.
112 #ifndef XAOD_STANDALONE
119 incSvc->addListener(
this, IncidentType::BeginEvent, 0,
false );
124 #endif // not XAOD_STANDALONE
127 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.
◆ truthMatch()
Definition at line 335 of file DiTauTruthMatchingTool.cxx.
340 for (
auto xTruthTauIt : xTruthTauContainer)
342 TLorentzVector vTruthVisTLV;
343 vTruthVisTLV.SetPtEtaPhiM(
m_accPtVis(*xTruthTauIt),
350 if ((
bool)accIsHadronicTau(*xTruthTauIt))
355 xTruthMatch = xTruthTauIt;
365 if (vSubjetTLV.DeltaR(xTruthMuonIt->p4()) <=
m_dMaxDeltaR)
367 if (xTruthMuonIt->pt()<dPtMax)
371 xTruthMatch = xTruthMuonIt;
372 dPtMax = xTruthMuonIt->
pt();
380 for (
auto xTruthElectronIt : *
m_truthTausEvent.m_xTruthElectronContainerConst)
382 if (vSubjetTLV.DeltaR(xTruthElectronIt->p4()) <=
m_dMaxDeltaR)
384 if (xTruthElectronIt->pt()<dPtMax)
387 xTruthMatch = xTruthElectronIt;
388 dPtMax = xTruthElectronIt->
pt();
393 return StatusCode::SUCCESS;
◆ 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
bool TauAnalysisTools::BuildTruthTaus::m_bWriteDecayModeVector {} |
|
privateinherited |
◆ m_bWriteInvisibleFourMomentum
bool TauAnalysisTools::BuildTruthTaus::m_bWriteInvisibleFourMomentum {} |
|
privateinherited |
◆ m_bWriteVertices
bool TauAnalysisTools::BuildTruthTaus::m_bWriteVertices {} |
|
privateinherited |
◆ m_bWriteVisibleChargedFourMomentum
bool TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleChargedFourMomentum {} |
|
privateinherited |
◆ m_bWriteVisibleNeutralFourMomentum
bool TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleNeutralFourMomentum {} |
|
privateinherited |
◆ m_detStore
◆ m_dMaxDeltaR
double TauAnalysisTools::DiTauTruthMatchingTool::m_dMaxDeltaR |
|
private |
◆ m_evtStore
◆ m_inputMetaStore
◆ m_outputMetaStore
◆ m_tMCTruthClassifier
◆ 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_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.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool isValid() const
Test to see if the value is valid.
float subjetPhi(unsigned int numSubjet) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
#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.
float subjetE(unsigned int numSubjet) const
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.
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.
Class describing a truth particle in the MC record.
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.
float subjetEta(unsigned int numSubjet) const
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.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
int status() const
Status code.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const =0
#define ATH_MSG_WARNING(x)
bool isDecayed(const T &p)
Identify if the particle decayed.
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)
float subjetPt(unsigned int numSubjet) const
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
iterator erase(iterator position)
Remove element at a given position.
int pdgId() const
PDG ID code.
bool isNeutral() const
Whether the particle is electrically neutral.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool isHadron() const
Whether the particle is a hadron.