ATLAS Offline Software
MissingETCompositionBase.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef XAODMISSINGET_VERSIONS_MISSINGETCOMPOSITIONBASE_H
8 #define XAODMISSINGET_VERSIONS_MISSINGETCOMPOSITIONBASE_H
9 
11 
12 #include "xAODBase/IParticle.h"
14 
16 #include "AthLinks/ElementLink.h"
17 #include "CxxUtils/bitmask.h"
18 
20 
21 #include "xAODJet/JetContainer.h"
22 
23 #include <vector>
24 #include <iterator>
25 
27 namespace MissingETBase
28 {
29  namespace Types
30  {
51 
58  typedef std::vector<objlink_t> objlink_vector_t;
59  typedef std::vector<const xAOD::IParticle*> object_vector_t;
61  } // namespace MissingETBase::Types
62 
70  struct Status
71  {
73  enum class Reco : Types::bitmask_t {
74  Total = 0x01000000,
75  ContributedTerm = 0x02000000,
76  CorrectedTerm = 0x04000000,
77  AlternativeTerm = 0x08000000,
78  StandAlone = 0x00000000,
80  };
82  enum class Vertex : Types::bitmask_t {
83  Primary = 0x00100000,
84  Secondary = 0x00200000,
85  Event = 0x00010000,
86  Nominal = 0x00020000,
87  Specific = 0x00040000,
88  NoVertex = 0x00000000,
90  };
97  Corrected = 0x00001000,
98  Pileup = 0x00001100,
99  PileupCalo = 0x00001110,
100  PileupTrack = 0x00001120,
101  PileupSTVF = 0x00001121,
102  PileupJetVertex = 0x00001122,
103  PileupJetArea = 0x00001140,
104  NotCorrected = 0x00000000,
106  };
107 
122  struct Tags
123  {
124  static Types::bitmask_t setPattern(Reco rec, Vertex vtx, Correction cor) { return ( rec | vtx ) | cor; }
125 
130 
131  template<class T>
132  static bool hasPattern(Types::bitmask_t sw, T pat) { return ( sw & pat ) == static_cast<Types::bitmask_t>(pat); }
133 
134  static bool isTotal(Types::bitmask_t sw) { return hasPattern(sw,Reco::Total); }
138  }; // struct MissingETBase::Status::Tags
139  }; // struct MissingETBase::Status
140 
141  namespace Container
142  {
158  template<class ITER>
159  size_t iteratorDiff(ITER first,ITER last) { return (size_t)(std::distance(first,last)); }
173  template<class ITER>
174  ITER iteratorAdvance(ITER iter,size_t step) { ITER fIter(iter); std::advance(iter,step); return fIter; }
176  } // namespace MissingETBase::Container
177 
179  namespace UsageHandler
180  {
182  enum Policy {
183  AllCalo = 0x0010,
184  OnlyCluster = 0x0011,
185  OnlyTrack = 0x0012,
186  TrackCluster = 0x0014,
187  PhysicsObject = 0x0020,
188  ParticleFlow = 0x0040,
189  TruthParticle = 0x0100,
190  UnknownPolicy = 0x0000 };
191  } // namespace MissingETBase::OverlapHandler
192 } // namespace MissingETBase
193 #endif
194 
MissingETBase::Status::generalSummedTag
static const Types::bitmask_t generalSummedTag
General summed MET tag.
Definition: MissingETCompositionBase.h:111
MissingETBase::Status::contributedTerm
static Types::bitmask_t contributedTerm()
General contribution tag accesssor.
Definition: MissingETCompositionBase.h:117
MissingETBase::UsageHandler::UnknownPolicy
@ UnknownPolicy
Unknown policy.
Definition: MissingETCompositionBase.h:190
MissingETBase::Types::objlink_t
ElementLink< xAOD::IParticleContainer > objlink_t
Link to contributing object.
Definition: MissingETCompositionBase.h:47
MissingETBase::UsageHandler::PhysicsObject
@ PhysicsObject
Physics object based.
Definition: MissingETCompositionBase.h:187
IParticle.h
MissingETBase::Status::Vertex::Nominal
@ Nominal
Primary vertex is nominal vertex.
MissingETBase::Status::generalSoftTermTag
static const Types::bitmask_t generalSoftTermTag
General soft term contribution tag.
Definition: MissingETCompositionBase.h:114
MissingETBase::Status::Vertex::Primary
@ Primary
MET (term) is calculated with respect to primary vertex.
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
Event
Definition: trigbs_orderedMerge.cxx:42
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
MissingETBase::Status::Tags::isAlternativeTerm
static bool isAlternativeTerm(Types::bitmask_t sw)
Definition: MissingETCompositionBase.h:136
MissingETBase
General namespace for MET EDM software.
Definition: MissingETAssociation_v1.h:454
MissingETBase::Status::Correction::Corrected
@ Corrected
Indicator for corrected MET.
MissingETBase::Status::Tags::contributedTerm
static Types::bitmask_t contributedTerm(Vertex vtx=Vertex::Nominal, Correction cor=Correction::NotCorrected)
Definition: MissingETCompositionBase.h:127
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
MissingETBase::UsageHandler::OnlyCluster
@ OnlyCluster
CaloCluster based only.
Definition: MissingETCompositionBase.h:184
MissingETBase::Status::Tags::alternativeTerm
static Types::bitmask_t alternativeTerm(Vertex vtx=Vertex::Nominal, Correction cor=Correction::NotCorrected)
Definition: MissingETCompositionBase.h:129
MissingETBase::Status::Tags::correctedTerm
static Types::bitmask_t correctedTerm(Vertex vtx=Vertex::Nominal, Correction cor=Correction::Corrected)
Definition: MissingETCompositionBase.h:128
MissingETBase::Status::Correction::NotCorrected
@ NotCorrected
No MET specific correction applied to term.
D3PD::Types
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.
Definition: PhysicsAnalysis/D3PDMaker/D3PDMakerUtils/D3PDMakerUtils/Types.h:61
MissingETBase::Status::Vertex::Secondary
@ Secondary
MET (term) is calculated with respect to secondary vertex.
MissingETBase::Status::Tags::isContributedTerm
static bool isContributedTerm(Types::bitmask_t sw)
Definition: MissingETCompositionBase.h:135
MissingETBase::Status::Correction::PileupCalo
@ PileupCalo
Calorimeter signal based pile-up correction.
MissingETBase::Status::Tags::total
static Types::bitmask_t total(Vertex vtx=Vertex::Nominal, Correction cor=Correction::NotCorrected)
Definition: MissingETCompositionBase.h:126
Container
storage of the time histories of all the cells
MissingETBase::Types::jetlink_t
ElementLink< xAOD::JetContainer > jetlink_t
Link to Jet object.
Definition: MissingETCompositionBase.h:42
MissingETBase::Status::Reco::ContributedTerm
@ ContributedTerm
Contribution to total MET.
MissingETBase::Status::Correction::PileupTrack
@ PileupTrack
Reconstructed track based pile-up correction.
MissingETBase::Status::contributedHardTerm
static Types::bitmask_t contributedHardTerm()
General hard term contribution tag accessor.
Definition: MissingETCompositionBase.h:118
MissingETBase::Types::objlink_vector_t
std::vector< objlink_t > objlink_vector_t
Vector of object links type.
Definition: MissingETCompositionBase.h:58
MissingETBase::Types::const_signal_vector_t
ConstDataVector< xAOD::IParticleContainer > const_signal_vector_t
Definition: MissingETCompositionBase.h:50
IParticleContainer.h
MissingETBase::Status::Reco::StandAlone
@ StandAlone
Unknown/standalone reconstruction.
MissingETBase::Container::iteratorDiff
size_t iteratorDiff(ITER first, ITER last)
Difference (number of steps) between two iterators.
Definition: MissingETCompositionBase.h:159
MissingETBase::Status::generalHardTermTag
static const Types::bitmask_t generalHardTermTag
General hard term contribution tag.
Definition: MissingETCompositionBase.h:113
MissingETBase::Status::Correction
Correction
Indicator for correction.
Definition: MissingETCompositionBase.h:96
MissingETBase::Status::Correction::PileupSTVF
@ PileupSTVF
STVF correction is applied.
MissingETBase::Status::Vertex::ATH_BITMASK
@ ATH_BITMASK
bitmask.h
Helpers for treating a class enum as a bitmask.
MissingETBase::UsageHandler::TrackCluster
@ TrackCluster
Both cluster and track based.
Definition: MissingETCompositionBase.h:186
MissingETBase::Status::Reco::ATH_BITMASK
@ ATH_BITMASK
MissingETBase.h
MissingETBase::Status::Correction::ATH_BITMASK
@ ATH_BITMASK
MissingETBase::Status::Reco::Total
@ Total
Total MET for given composition.
MissingETBase::Status::Tags::hasPattern
static bool hasPattern(Types::bitmask_t sw, T pat)
Definition: MissingETCompositionBase.h:132
dso-stats.pat
pat
Definition: dso-stats.py:39
MissingETBase::UsageHandler::Policy
Policy
Policies on usage checks.
Definition: MissingETCompositionBase.h:182
MissingETBase::UsageHandler::AllCalo
@ AllCalo
Inclusive except tracks.
Definition: MissingETCompositionBase.h:183
MissingETBase::UsageHandler::OnlyTrack
@ OnlyTrack
Track based only.
Definition: MissingETCompositionBase.h:185
MissingETBase::Status::Tags::setPattern
static Types::bitmask_t setPattern(Reco rec, Vertex vtx, Correction cor)
Definition: MissingETCompositionBase.h:124
Reco
Definition: TrackCounting.h:24
MissingETBase::Status::Tags::isTotal
static bool isTotal(Types::bitmask_t sw)
Definition: MissingETCompositionBase.h:134
MissingETBase::Status::Vertex::Specific
@ Specific
MET term is calculated with respect to object vertices.
MissingETBase::UsageHandler::ParticleFlow
@ ParticleFlow
Particle Flow Object based.
Definition: MissingETCompositionBase.h:188
MissingETBase::Status::Correction::PileupJetArea
@ PileupJetArea
Jet area based pileup correction.
MissingETBase::Status::Reco::CorrectedTerm
@ CorrectedTerm
Corrected term (replaces default contributed term.
JetContainer.h
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
DeMoScan.first
bool first
Definition: DeMoScan.py:536
MissingETBase::Status::generalContribTag
static const Types::bitmask_t generalContribTag
General contribution tag.
Definition: MissingETCompositionBase.h:112
MissingETBase::Container::iteratorAdvance
ITER iteratorAdvance(ITER iter, size_t step)
Advance an iterator by a number of steps.
Definition: MissingETCompositionBase.h:174
MissingETBase::Status::Correction::Pileup
@ Pileup
MET term is pile-up corrected.
LArCellBinning.step
step
Definition: LArCellBinning.py:158
MissingETBase::Types::metlink_t
ElementLink< xAOD::MissingETContainer > metlink_t
Link to MissingET object.
Definition: MissingETCompositionBase.h:37
MissingETBase::Status::contributedSoftTerm
static Types::bitmask_t contributedSoftTerm()
General soft term contribution tag accessor.
Definition: MissingETCompositionBase.h:119
MissingETBase::Status::summedTerm
static Types::bitmask_t summedTerm()
General summed term tag accessor.
Definition: MissingETCompositionBase.h:116
MissingETBase::Status::clearedStatusTag
static const Types::bitmask_t clearedStatusTag
General cleared term tag.
Definition: MissingETCompositionBase.h:110
MissingETBase::Status::clearedStatus
static Types::bitmask_t clearedStatus()
Cleared term tag accessor.
Definition: MissingETCompositionBase.h:115
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
MissingETBase::Status
Namespace for status word tags.
Definition: MissingETCompositionBase.h:71
MissingETBase::Status::Vertex::NoVertex
@ NoVertex
Unknown vertex.
MissingETContainer.h
MissingETBase::Types::object_vector_t
std::vector< const xAOD::IParticle * > object_vector_t
Vector of object type.
Definition: MissingETCompositionBase.h:59
MissingETBase::Status::Tags
Definition: MissingETCompositionBase.h:123
MissingETBase::Status::Tags::isStandAlone
static bool isStandAlone(Types::bitmask_t sw)
Definition: MissingETCompositionBase.h:137
MissingETBase::Status::Correction::PileupJetVertex
@ PileupJetVertex
JVF based filter is applied.
MissingETBase::Status::Vertex
Vertex
Indicator for vertex choice in MET reconstruction.
Definition: MissingETCompositionBase.h:82
MissingETBase::Status::Reco::AlternativeTerm
@ AlternativeTerm
Alternative term.