ATLAS Offline Software
Loading...
Searching...
No Matches
MissingET_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
8
9using namespace xAOD;
10
11// Static accessors
15namespace {
16 // register attributes' types early (before I/O) for schema evolution
18}
19
20MissingET_v1::MissingET_v1( bool createStore )
21 : SG::AuxElement() {
22
23 if( createStore ) {
25 setName(this->name());
26 }
27}
28
29MissingET_v1::MissingET_v1( const std::string& name,
31 : SG::AuxElement() {
32
34 setName( name );
35 setSource( src );
36
37}
38
40 const std::string& name,
42 : SG::AuxElement() {
43
45 setName( name );
46 setSource( src );
47 this->f_mpx() = mpx;
48 this->f_mpy() = mpy;
49 this->f_sumet() = sumet;
50}
51
52MissingET_v1::MissingET_v1( const IParticle* particle, const std::string& name,
54 : SG::AuxElement() {
55
57 setName( name );
58 setSource( src );
59 add( particle->p4().Px(), particle->p4().Py(), particle->pt() );
60}
61
62// CHECK use makePrivateStore to control that behaviour ??
69
72
74// Note: the add(...) methods are virtual and should therefore not be inlined.
76
77void MissingET_v1::add(const IParticle* particle)
78{
79 // retrieve kinematics
80 EXTRACT_PX( float, px, (*particle) );
81 EXTRACT_PY( float, py, (*particle) );
82 // add
83 this->add(px,py,particle->pt());
84}
85
86void MissingET_v1::add(const IParticle* particle,float scale)
87{
88 // retrieve kinematics
89 EXTRACT_SCALED_PX( float, px, (*particle), scale);
90 EXTRACT_SCALED_PY( float ,py, (*particle), scale);
91 float pt(particle->pt()*scale);
92 // add
93 this->add(px,py,pt);
94}
95
96void xAOD::MissingET_v1::add(float px,float py, float pt)
97{ this->f_mpx() -= px; this->f_mpy() -= py; this->f_sumet() += pt; }
98
100{
101 setName( met.name() );
102 setSource( met.source() );
103 this->f_mpx() = met.mpx();
104 this->f_mpy() = met.mpy();
105 this->f_sumet() = met.sumet();
106 return *this;
107}
108
110{
111 EXTRACT_PX( float, px, (*particle) );
112 EXTRACT_PY( float, py, (*particle) );
113 this->add(-px,-py,-particle->pt());
114 return *this;
115}
116
#define EXTRACT_SCALED_PY(_T_, _V_, _P_, _S_)
#define EXTRACT_SCALED_PX(_T_, _V_, _P_, _S_)
#define EXTRACT_PY(_T_, _V_, _P_)
#define EXTRACT_PX(_T_, _V_, _P_)
void makePrivateStore()
Create a new (empty) private store for this object.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
AuxElement()
Default constructor.
Class providing the definition of the 4-vector interface.
float sumet() const
Returns.
MissingET_v1 & operator-=(const IParticle *part)
Remove particle kinematics to MET.
void clear()
Clear/reset the data store.
void add(const IParticle *particle)
Add particle kinematics to MET.
void setSource(MissingETBase::Types::bitmask_t src)
Set the source of the MET object.
float & f_mpy()
Returns reference to store.
~MissingET_v1()
Implementation class destructor.
void createPrivateStore()
Function initialising the object to work in standalone mode.
static const SG::AuxElement::Accessor< float > m_acc_mpy
void updateHash()
Update the hash to match the current name.
MissingET_v1(bool createStore=false)
Default constructor.
static const SG::AuxElement::Accessor< float > m_acc_sumet
float & f_mpx()
Returns reference to store.
const std::string & name() const
Identifier getters.
float mpx() const
Returns .
MissingET_v1 & operator=(const MissingET_v1 &met)
Add particle kinematics to MET.
static const SG::AuxElement::Accessor< float > m_acc_mpx
void setName(const std::string &name)
Set the name of the MET object.
float & f_sumet()
Returns reference to store.
float mpy() const
Returns .
uint64_t bitmask_t
Type for status word bit mask.
Forward declaration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
static Types::bitmask_t unknown()
static const std::string & unknownString()
Access unknown string indicator.