ATLAS Offline Software
TestMacroHelpers.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef ISOLATIONSELECTION_TESTMARCOHELPERS_H
6 #define ISOLATIONSELECTION_TESTMARCOHELPERS_H
7 
8 #ifndef XAOD_STANDALONE
15 namespace CP {
16 
17  class IsolationWP;
19  public:
20  IsoCorrectionTestHelper(MuonVal::MuonTesterTree& outTree, const std::string& ContainerName, const std::vector<std::unique_ptr<IsolationWP>>& WP);
22 
24  void SetSelectionDecorator(const std::string& acc);
26  void SetIsolationDecorator(const std::string& acc);
28  void SetUpdatedIsoDecorator(const std::string& acc);
29 
31  void SetBackupPreFix(const std::string& prefix);
32 
37  void SetClusters(const ClusterSet& clusters);
38  void SetFlowElements(const PflowSet& flows);
39 
40  bool init() override final;
41  bool fill(const EventContext& ctx) override final;
42 
43  private:
44  float Charge(const xAOD::IParticle* P) const;
46  MuonVal::VectorBranch<float>& Corrected);
47 
48  std::string m_cont_name{};
49 
55 
58 
60 
64 
70  Accessor{std::make_unique<IsoVariableHelper>(T, prefix)},
71  original_cones{parent.parent().newVector<float>(parent.name() + "_Orig_" + Accessor->name())},
72  corrected_cones{parent.parent().newVector<float>(parent.name() + "_Corr_" + Accessor->name())} {}
76  };
77  std::vector<IsolationBranches> m_iso_branches;
78 
79  std::optional<CharAccessor> m_acc_used_for_corr{std::nullopt};
80  std::optional<CharAccessor> m_acc_passDefault{std::nullopt};
81  std::optional<CharAccessor> m_acc_passCorrected{std::nullopt};
82 
85 
86  };
87 } // namespace CP
88 #endif
89 #endif
CP::IsoCorrectionTestHelper::m_assoc_pflow_eta
MuonVal::VectorBranch< float > & m_assoc_pflow_eta
Definition: TestMacroHelpers.h:66
CP::IsoCorrectionTestHelper::SetBackupPreFix
void SetBackupPreFix(const std::string &prefix)
Specify whether the vanilla isolation variable is backuped to another set of decorators.
Definition: TestMacroHelpers.cxx:63
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
CP::IsoCorrectionTestHelper::IsolationBranches::corrected_cones
MuonVal::VectorBranch< float > & corrected_cones
Definition: TestMacroHelpers.h:75
CP::IsoCorrectionTestHelper::FillIsolationBranches
StatusCode FillIsolationBranches(const xAOD::IParticle *P, const IsoHelperPtr &Acc, MuonVal::VectorBranch< float > &Original, MuonVal::VectorBranch< float > &Corrected)
Definition: TestMacroHelpers.cxx:167
CP::IsoHelperPtr
std::unique_ptr< IsoVariableHelper > IsoHelperPtr
Definition: IsoVariableHelper.h:16
CP::IsoCorrectionTestHelper::m_assoc_pflow_phi
MuonVal::VectorBranch< float > & m_assoc_pflow_phi
Definition: TestMacroHelpers.h:67
IsoCloseByCorrectionTest.WP
WP
Definition: IsoCloseByCorrectionTest.py:56
MuonVal::MuonTesterBranch
Definition: MuonTesterBranch.h:21
CP::PflowSet
std::set< FlowElementPtr > PflowSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:74
CP::IsoCorrectionTestHelper::m_Q
MuonVal::VectorBranch< int > & m_Q
Definition: TestMacroHelpers.h:54
CP::IsoCorrectionTestHelper::m_corr_passIso
MuonVal::VectorBranch< bool > & m_corr_passIso
Definition: TestMacroHelpers.h:57
MuonTesterTreeDict.h
Defs.h
MuonVal::VectorBranch< float >
CP::IsoCorrectionTestHelper::m_assoc_track_pt
MuonVal::VectorBranch< float > & m_assoc_track_pt
Definition: TestMacroHelpers.h:59
CP::IsoCorrectionTestHelper::m_flows
PflowSet m_flows
Definition: TestMacroHelpers.h:84
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::IsoCorrectionTestHelper::SetFlowElements
void SetFlowElements(const PflowSet &flows)
Definition: TestMacroHelpers.cxx:33
CP::IsoCorrectionTestHelper::SetUpdatedIsoDecorator
void SetUpdatedIsoDecorator(const std::string &acc)
Pipe the name of te decorator encoding whether the object already passed the corrected isolation.
Definition: TestMacroHelpers.cxx:60
CP::IsoCorrectionTestHelper::m_assoc_cluster_et
MuonVal::VectorBranch< float > & m_assoc_cluster_et
Definition: TestMacroHelpers.h:61
CP::IsoCorrectionTestHelper::m_phi
MuonVal::VectorBranch< float > & m_phi
Definition: TestMacroHelpers.h:52
CP::IsoCorrectionTestHelper::IsoCorrectionTestHelper
IsoCorrectionTestHelper(MuonVal::MuonTesterTree &outTree, const std::string &ContainerName, const std::vector< std::unique_ptr< IsolationWP >> &WP)
Definition: TestMacroHelpers.cxx:34
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
CP::IsoCorrectionTestHelper::SetIsolationDecorator
void SetIsolationDecorator(const std::string &acc)
Pipe the name of te decorator encoding whether the object already passed the vanilla isolation.
Definition: TestMacroHelpers.cxx:57
CP::IsoCorrectionTestHelper::Charge
float Charge(const xAOD::IParticle *P) const
Definition: TestMacroHelpers.cxx:159
CP::IsoCorrectionTestHelper::m_clusters
ClusterSet m_clusters
Definition: TestMacroHelpers.h:83
CP::IsoCorrectionTestHelper::m_assoc_cluster_phi
MuonVal::VectorBranch< float > & m_assoc_cluster_phi
Definition: TestMacroHelpers.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IsoVariableHelper.h
CP::IsoCorrectionTestHelper::m_cont_name
std::string m_cont_name
Definition: TestMacroHelpers.h:48
IParticleContainer.h
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
CP::IsoCorrectionTestHelper::IsolationBranches::Accessor
IsoHelperPtr Accessor
Definition: TestMacroHelpers.h:73
CP::IsoCorrectionTestHelper
Definition: TestMacroHelpers.h:18
makePlot.Particles
Particles
Definition: makePlot.py:25
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
CP::IsoCorrectionTestHelper::m_pt
MuonVal::VectorBranch< float > & m_pt
Definition: TestMacroHelpers.h:50
CP::IsoCorrectionTestHelper::m_assoc_pflow_et
MuonVal::VectorBranch< float > & m_assoc_pflow_et
Definition: TestMacroHelpers.h:65
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
CP::IsoCorrectionTestHelper::m_assoc_cluster_eta
MuonVal::VectorBranch< float > & m_assoc_cluster_eta
Definition: TestMacroHelpers.h:62
MuonVal::MuonTesterTree::newVector
VectorBranch< T > & newVector(const std::string &name)
Creates new branches and returns their reference.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonVal::MuonTesterTree::name
std::string name() const
Name of the tree.
Definition: MuonTesterTree.cxx:20
CP::IsoCorrectionTestHelper::m_iso_branches
std::vector< IsolationBranches > m_iso_branches
Definition: TestMacroHelpers.h:77
CP::IsoCorrectionTestHelper::m_e
MuonVal::VectorBranch< float > & m_e
Definition: TestMacroHelpers.h:53
CP::IsoCorrectionTestHelper::fill
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition: TestMacroHelpers.cxx:32
CP::ClusterSet
std::set< CaloClusterPtr > ClusterSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:73
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
IsolationCloseByCorrectionTool.h
CP::IsoCorrectionTestHelper::m_acc_used_for_corr
std::optional< CharAccessor > m_acc_used_for_corr
Definition: TestMacroHelpers.h:79
CP::IsoCorrectionTestHelper::IsolationBranches::IsolationBranches
IsolationBranches(IsoCorrectionTestHelper &parent, IsoType T, const std::string &prefix)
Definition: TestMacroHelpers.h:69
HLTSeedingRoIToolDefs::eFexEM::ContainerName
const char ContainerName[]
Definition: HLTSeedingRoIToolDefs.cxx:9
CP::IsoCorrectionTestHelper::m_eta
MuonVal::VectorBranch< float > & m_eta
Definition: TestMacroHelpers.h:51
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
CP::IsoCorrectionTestHelper::IsolationBranches
Definition: TestMacroHelpers.h:68
CP::IsoCorrectionTestHelper::m_acc_passCorrected
std::optional< CharAccessor > m_acc_passCorrected
Definition: TestMacroHelpers.h:81
CP::IsoCorrectionTestHelper::SetClusters
void SetClusters(const ClusterSet &clusters)
set the list of all clusters from the Cluster container matched by the IsolationCloseByCorrectionTool...
Definition: TestMacroHelpers.cxx:53
CP::IsoCorrectionTestHelper::IsolationBranches::original_cones
MuonVal::VectorBranch< float > & original_cones
Definition: TestMacroHelpers.h:74
CP::IsoCorrectionTestHelper::SetSelectionDecorator
void SetSelectionDecorator(const std::string &acc)
Pipe the name of the decorator selecting the objects dumped to the TTree.
Definition: TestMacroHelpers.cxx:54
CP::IsoCorrectionTestHelper::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition: TestMacroHelpers.cxx:31
CP::IsoCorrectionTestHelper::m_acc_passDefault
std::optional< CharAccessor > m_acc_passDefault
Definition: TestMacroHelpers.h:80
CP::IsoCorrectionTestHelper::m_orig_passIso
MuonVal::VectorBranch< bool > & m_orig_passIso
Definition: TestMacroHelpers.h:56
CP::IsoCorrectionTestHelper::Fill
StatusCode Fill(const xAOD::IParticleContainer *Particles)
Definition: TestMacroHelpers.cxx:69