|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef XAOD_STANDALONE
35 const std::vector<std::unique_ptr<IsolationWP>>&
WPs) :
39 for (
const std::unique_ptr<IsolationWP>&
W :
WPs) {
40 for (
const auto& C :
W->conditions()) {
41 for (
unsigned int t = 0;
t < C->num_types(); ++
t) {
43 bool add = std::find_if(m_iso_branches.begin(), m_iso_branches.end(), [iso_type](
const IsolationBranches&
known) {
44 return known.Accessor->isotype() == iso_type;
45 }) == m_iso_branches.end();
46 if (
add) m_iso_branches.emplace_back(*
this, iso_type,
"");
65 branch.Accessor = std::make_unique<IsoVariableHelper>(
branch.Accessor->isotype(),
prefix);
71 Error(
"IsoCorrectionTestHelper::Fill()",
"No particles given");
72 return StatusCode::FAILURE;
85 Error(
"IsoCorrectionTestHelper()",
"Failed to fill isolation");
86 return StatusCode::FAILURE;
89 if (
m_acc_passDefault != std::nullopt && !(*m_acc_passDefault).isAvailable(*
object)) {
90 Error(
"IsoCorrectionTestHelper()",
"It has not been stored whether the particle passes the default isolation");
91 return StatusCode::FAILURE;
96 Error(
"IsoCorrectionTestHelper()",
"It has not been stored whether the particle passes the corrected isolation.");
97 return StatusCode::FAILURE;
108 assoc_track =
mu->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
110 assoc_cluster =
mu->cluster();
114 return xAOD::P4Helpers::deltaR2(a, mu) < xAOD::P4Helpers::deltaR2(b, mu);
120 assoc_cluster =
el->caloCluster(0);
125 return xAOD::P4Helpers::deltaR2(a, object) < xAOD::P4Helpers::deltaR2(b, object);
130 if (acc_assocCaloIsDec.
isAvailable(*
object) && acc_assocCaloIsDec(*
object)) {
134 }
else if (assoc_cluster) {
143 if (acc_assocPflowIsDec.
isAvailable(*
object) && acc_assocPflowIsDec(*
object)) {
147 }
else if (assoc_flow) {
157 return StatusCode::SUCCESS;
164 return acc_charge(*
P);
169 if (!Acc)
return StatusCode::SUCCESS;
171 if (Acc->getOriginalIsolation(
P, IsoValue).code() !=
CorrectionCode::Ok)
return StatusCode::FAILURE;
173 if (Acc->getIsolation(
P, IsoValue).code() !=
CorrectionCode::Ok)
return StatusCode::FAILURE;
175 return StatusCode::SUCCESS;
virtual double pt() const override final
The transverse momentum ( ) of the particle.
MuonVal::VectorBranch< float > & m_assoc_pflow_eta
void SetBackupPreFix(const std::string &prefix)
Specify whether the vanilla isolation variable is backuped to another set of decorators.
Electron_v1 Electron
Definition of the current "egamma version".
StatusCode FillIsolationBranches(const xAOD::IParticle *P, const IsoHelperPtr &Acc, MuonVal::VectorBranch< float > &Original, MuonVal::VectorBranch< float > &Corrected)
std::unique_ptr< IsoVariableHelper > IsoHelperPtr
MuonVal::VectorBranch< float > & m_assoc_pflow_phi
std::set< FlowElementPtr > PflowSet
MuonVal::VectorBranch< int > & m_Q
MuonVal::VectorBranch< bool > & m_corr_passIso
Small helper struct to have sets of particle pointers sorted by pt.
Helper class to provide constant type-safe access to aux data.
MuonVal::VectorBranch< float > & m_assoc_track_pt
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
void SetFlowElements(const PflowSet &flows)
void SetUpdatedIsoDecorator(const std::string &acc)
Pipe the name of te decorator encoding whether the object already passed the corrected isolation.
MuonVal::VectorBranch< float > & m_assoc_cluster_et
MuonVal::VectorBranch< float > & m_phi
IsoCorrectionTestHelper(MuonVal::MuonTesterTree &outTree, const std::string &ContainerName, const std::vector< std::unique_ptr< IsolationWP >> &WP)
void SetIsolationDecorator(const std::string &acc)
Pipe the name of te decorator encoding whether the object already passed the vanilla isolation.
float Charge(const xAOD::IParticle *P) const
MuonVal::VectorBranch< float > & m_assoc_cluster_phi
::StatusCode StatusCode
StatusCode definition for legacy code.
IsolationType
Overall enumeration for isolation types in xAOD files.
MuonVal::VectorBranch< float > & m_pt
MuonVal::VectorBranch< float > & m_assoc_pflow_et
bool add(const std::string &hname, TKey *tobj)
MuonVal::VectorBranch< float > & m_assoc_cluster_eta
void push_back(const T &value)
Adds a new element at the end of the vector.
For the flow elements we need a special derivate which also contains the weights.
std::vector< IsolationBranches > m_iso_branches
MuonVal::VectorBranch< float > & m_e
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...
std::set< CaloClusterPtr > ClusterSet
struct TBPatternUnitContext Muon
@ Ok
The correction was done successfully.
std::optional< CharAccessor > m_acc_used_for_corr
MuonVal::VectorBranch< float > & m_eta
SG::AuxElement::ConstAccessor< float > FloatAccessor
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
std::optional< CharAccessor > m_acc_passCorrected
void SetClusters(const ClusterSet &clusters)
set the list of all clusters from the Cluster container matched by the IsolationCloseByCorrectionTool...
void SetSelectionDecorator(const std::string &acc)
Pipe the name of the decorator selecting the objects dumped to the TTree.
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
SG::AuxElement::ConstAccessor< char > CharAccessor
std::optional< CharAccessor > m_acc_passDefault
MuonVal::VectorBranch< bool > & m_orig_passIso
StatusCode Fill(const xAOD::IParticleContainer *Particles)