ATLAS Offline Software
MissingETComponent_v1.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef XAODMISSINGET_VERSIONS_MISSINGETCOMPONENT_V1_H
8 #define XAODMISSINGET_VERSIONS_MISSINGETCOMPONENT_V1_H
9 
11 
12 #include "xAODBase/IParticle.h"
14 
17 
18 #include <vector>
19 
20 namespace xAOD
21 {
24  {
25  public:
27  class Weight
28  {
29  public:
30  Weight();
31  Weight(double wpx,double wpy,double wet);
32  // Weight(const Weight& wght); /*!< @brief Copy constructor */
33  ~Weight();
36  double wpx() const;
37  double wpy() const;
38  double wet() const;
42  void setWpx(double wpx);
43  void setWpy(double wpy);
44  void setWet(double wet);
48  double& wpx();
49  double& wpy();
50  double& wet();
51  Weight& operator+=(const Weight& wght);
52  Weight& operator-=(const Weight& wght);
53  Weight& operator*=(const Weight& wght);
54  Weight& operator*=(double scale);
55  Weight& operator/=(const Weight& wght);
56  Weight& operator/=(double scale);
60  bool operator==(const Weight& wght) const;
61  bool operator!=(const Weight& wght) const;
63  private:
66  double m_wpx;
67  double m_wpy;
68  double m_wet;
70  }; // MissingETComponent_v1::Weight
71 
72  MissingETComponent_v1(bool createStore=false);
81  virtual ~MissingETComponent_v1();
96  bool addObject(const IParticle* pPart,const Weight& wght=Weight());
97  bool addObject(const IParticle* pPart,double wpx,double wpy,double wet);
104  const std::vector<double>& wpx() const;
105  double wpx(const IParticle* pPart) const;
106  double wpx(size_t pIdx) const;
107  //
108  bool setWpx(const std::vector<double>& wcv);
109  bool setWpx(const IParticle* pPart,double wpx);
110  bool setWpx(size_t pIdx,double wpx);
111  //
112  const std::vector<double>& wpy() const;
113  double wpy(const IParticle* pPart) const;
114  double wpy(size_t pIdx) const;
115  //
116  bool setWpy(const std::vector<double>& wpyVector);
117  bool setWpy(const IParticle* pPart,double wpy);
118  bool setWpy(size_t pIdx,double wpy);
119  //
120  const std::vector<double>& wet() const;
121  double wet(const IParticle* pPart) const;
122  double wet(size_t pIdx) const;
123  //
124  bool setWet(const std::vector<double>& wcv);
125  bool setWet(const IParticle* pPart,double wet);
126  bool setWet(size_t pIdx,double wet);
127  //
128  bool setWeight(const IParticle* pPart,const Weight& wght=Weight());
129  bool setWeight(const IParticle* pPart,double wpx,double wpy,double wet);
130  bool setWeight(size_t pIdx,const Weight& wght=Weight());
131  bool setWeight(size_t pIdx,double wpx,double wpy,double wet);
132  //
134  bool setMetLink(const MissingETBase::Types::metlink_t& metLnk);
145  bool removeContrib(const IParticle* pPart);
146  bool removeContrib(size_t pIdx);
147  bool removeContrib();
148  bool resetContrib(const IParticle* pPart);
149  bool resetContrib(size_t pIdx);
150  bool resetContrib();
157  const MissingET* metObject() const;
159  size_t metObjectIndex() const;
160  std::vector<const IParticle*> objects() const;
161  std::vector<const IParticle*> objects(std::vector<Weight>& kinePars) const;
162  std::vector<const IParticle*> objects(const std::vector<double>*& wpxPtr,
163  const std::vector<double>*& wpyPtr,
164  const std::vector<double>*& wetPtr) const;
165  Weight weight(const IParticle* pPart) const;
166  Weight weight(size_t pIdx) const;
190  size_t findIndex(const IParticle* pPart) const;
200  // void updateLinks();
202  // void updateMETLink();
203  size_t size() const;
205  bool empty() const;
213  bool operator==(const MissingETComponent_v1& contrib) const;
214  bool operator!=(const MissingETComponent_v1& contrib) const;
217  protected:
219  void createPrivateStore();
220 
229  std::vector<double>& f_wpx();
230  std::vector<double>& f_wpy();
231  std::vector<double>& f_wet();
240  bool f_removeContrib(size_t pIdx);
254  template<class POBJ,class LINK> void f_setObject(const POBJ* pObj,LINK& elemLink);
255  template<class LINK> bool f_setLink(LINK& elemLink);
257  }; // MissingETComponenet_v1
258 }
259 
260 namespace MissingETBase
261 {
262  namespace Types
263  {
265  typedef std::vector<weight_t> weight_vector_t;
266  }
267 }
268 
288 #endif
xAOD::MissingETComponent_v1::removeContrib
bool removeContrib(const IParticle *pPart)
Remove a contribution referenced by an object pointer.
xAOD::MissingETComponent_v1::Weight::setWpx
void setWpx(double wpx)
Set .
xAOD::MissingETComponent_v1::setMET
bool setMET(const MissingET *pmetObj, MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
Set MET object by object pointer reference.
Definition: MissingETComponent_v1.cxx:249
xAOD::MissingETComponent_v1::setWeight
bool setWeight(const IParticle *pPart, const Weight &wght=Weight())
Set the kinematic weight of an object contribution referenced by pointer.
IParticle.h
xAOD::MissingETComponent_v1::setWpy
bool setWpy(const std::vector< double > &wpyVector)
Set the vector of weight components
Definition: MissingETComponent_v1.cxx:228
xAOD::MissingETComponent_v1::operator==
bool operator==(const MissingETComponent_v1 &contrib) const
Definition: MissingETComponent_v1.cxx:328
xAOD::MissingETComponent_v1::~MissingETComponent_v1
virtual ~MissingETComponent_v1()
Assignment operator.
Definition: MissingETComponent_v1.cxx:116
xAOD::MissingETComponent_v1::weight
Weight weight(const IParticle *pPart) const
Get kinematic weight for a given object.
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
xAOD::MissingETComponent_v1::resetContrib
bool resetContrib(const IParticle *pPart)
Reset the contribution parameters of an object referenced by a pointer.
xAOD::MissingETComponent_v1::clearStatusWord
bool clearStatusWord()
Clear statusword.
xAOD::MissingETComponent_v1::setWpx
bool setWpx(const std::vector< double > &wcv)
Set the vector of weight components
Definition: MissingETComponent_v1.cxx:226
xAOD::MissingETComponent_v1::Weight::m_wpy
double m_wpy
Definition: MissingETComponent_v1.h:67
xAOD::MissingETComponent_v1::Weight::wet
double & wet()
Returns reference to modifiable data word storing .
xAOD::MissingETComponent_v1::Weight::wpy
double & wpy()
Returns reference to modifiable data word storing .
xAOD::MissingETComponent_v1::resetContrib
bool resetContrib()
Reset all contribution parameters.
Definition: MissingETComponent_v1.cxx:197
xAOD::MissingETComponent_v1::mergeStatusWord
bool mergeStatusWord(MissingETBase::Types::bitmask_t sw)
Merge patterns into the MET term status.
xAOD::MissingETComponent_v1::Weight::wet
double wet() const
Returns .
xAOD::MissingETComponent_v1::Weight::Weight
Weight()
Default constructor.
MissingETCompositionBase.h
MissingETBase
General namespace for MET EDM software.
Definition: MissingETAssociation_v1.h:454
xAOD::MissingETComponent_v1::Weight::operator/=
Weight & operator/=(const Weight &wght)
Divide two weights.
Definition: MissingETComponent_v1.cxx:30
xAOD::MissingETComponent_v1::wpx
const std::vector< double > & wpx() const
Get the vector of weight components
xAOD::MissingETComponent_v1::wet
const std::vector< double > & wet() const
Get the vector of weight components
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
MissingETBase::Types::weight_vector_t
std::vector< weight_t > weight_vector_t
Vector type for kinematic weight containers.
Definition: MissingETComponent_v1.h:265
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
operator/
MissingETBase::Types::weight_t operator/(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Divide kinematic weights.
D3PD::Types
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.
Definition: PhysicsAnalysis/D3PDMaker/D3PDMakerUtils/D3PDMakerUtils/Types.h:61
operator+
MissingETBase::Types::weight_t operator+(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Add kinematic weights.
xAOD::MissingETComponent_v1::Weight::operator+=
Weight & operator+=(const Weight &wght)
Add another weight.
Definition: MissingETComponent_v1.cxx:18
xAOD::MissingETComponent_v1::Weight::operator!=
bool operator!=(const Weight &wght) const
Inequality operator.
xAOD::MissingETComponent_v1::setStatusWord
bool setStatusWord(MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
Set the statusword of a MET term.
xAOD::MissingETComponent_v1::operator=
MissingETComponent_v1 & operator=(const MissingETComponent_v1 &compDescr)
Definition: MissingETComponent_v1.cxx:103
MissingETBase::Types::weight_t
xAOD::MissingETComponent_v1::Weight weight_t
Type for kinematic weight.
Definition: MissingETComponent_v1.h:264
xAOD::MissingETComponent_v1::Weight::setWpy
void setWpy(double wpy)
Set .
xAOD::MissingETComponent_v1::wpy
double wpy(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
xAOD::MissingETComponent_v1::size
size_t size() const
[Deprecated] Update all internally used ElementLink instances
xAOD::MissingETComponent_v1::f_wpx
std::vector< double > & f_wpx()
xAOD::MissingETComponent_v1::createPrivateStore
void createPrivateStore()
Function initialising the object to work in standalone mode.
Definition: MissingETComponent_v1.cxx:341
xAOD::MissingETComponent_v1::f_setLink
bool f_setLink(LINK &elemLink)
xAOD::MissingETComponent_v1::f_wpy
std::vector< double > & f_wpy()
xAOD::MissingETComponent_v1::setMetLink
bool setMetLink(const MissingETBase::Types::metlink_t &metLnk)
Set the link to the MET object.
Definition: MissingETComponent_v1.cxx:264
xAOD::MissingETComponent_v1::Weight::Weight
Weight(double wpx, double wpy, double wet)
Constructor with parameters.
MissingETBase::Types::objlink_vector_t
std::vector< objlink_t > objlink_vector_t
Vector of object links type.
Definition: MissingETCompositionBase.h:58
xAOD::MissingETComponent_v1::MissingETComponent_v1
MissingETComponent_v1(bool createStore=false)
Default constructor.
Definition: MissingETComponent_v1.cxx:56
xAOD::MissingETComponent_v1::metObjectContainer
const MissingETContainer_v1 * metObjectContainer() const
Access MET object container holding MET object.
xAOD::MissingETComponent_v1::Weight::setWet
void setWet(double wet)
Set .
xAOD::MissingETComponent_v1::setWet
bool setWet(const std::vector< double > &wcv)
Set the vector of weight components
Definition: MissingETComponent_v1.cxx:230
IParticleContainer.h
xAOD::MissingETComponent_v1::metObjectIndex
size_t metObjectIndex() const
Access index of MET object in its container.
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
xAOD::MissingETComponent_v1::setWeight
bool setWeight(size_t pIdx, const Weight &wght=Weight())
Set the kinematic weight of an object contribution referenced by index.
xAOD::MissingETComponent_v1::removeContrib
bool removeContrib(size_t pIdx)
Remove a contribution referenced by an index.
operator-
MissingETBase::Types::weight_t operator-(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Subtract kinematic weights.
xAOD::MissingETComponent_v1::addObject
bool addObject(const IParticle *pPart, const Weight &wght=Weight())
Add object (particle) from pointer reference with optional kinematic weight.
xAOD::MissingETComponent_v1::f_statusWord
MissingETBase::Types::bitmask_t & f_statusWord()
MissingETComponent_v1.icc
xAOD::MissingETComponent_v1::Weight::wpy
double wpy() const
Returns .
xAOD::MissingETComponent_v1::Weight::operator-=
Weight & operator-=(const Weight &wght)
Subtract another weight.
Definition: MissingETComponent_v1.cxx:21
xAOD::MissingETComponent_v1::objectLinks
const MissingETBase::Types::objlink_vector_t & objectLinks() const
Get the vector of links to the contributing physics or signal objects.
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
xAOD::MissingETComponent_v1::setWeight
bool setWeight(const IParticle *pPart, double wpx, double wpy, double wet)
Set the kinematic weight components of an object contribution referenced by pointer.
xAOD::MissingETComponent_v1::f_objectLinks
MissingETBase::Types::objlink_vector_t & f_objectLinks()
Non-const link reference.
xAOD::MissingETComponent_v1::setObjectLinks
bool setObjectLinks(const MissingETBase::Types::objlink_vector_t &objLnks)
Set the vector of links to the contributing physics or signal objects.
Definition: MissingETComponent_v1.cxx:270
xAOD::MissingETComponent_v1::f_metLink
MissingETBase::Types::metlink_t & f_metLink()
Non-const link reference
xAOD::MissingETComponent_v1::Weight::m_wpx
double m_wpx
Definition: MissingETComponent_v1.h:66
xAOD::MissingETComponent_v1::wpx
double wpx(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
xAOD::MissingETComponent_v1::statusWord
MissingETBase::Types::bitmask_t statusWord() const
Get the statusword.
xAOD::MissingETComponent_v1::findIndex
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
Definition: MissingETComponent_v1.cxx:213
xAOD::MissingETComponent_v1::Weight::wpx
double wpx() const
Returns .
xAOD::MissingETComponent_v1::objects
std::vector< const IParticle * > objects(std::vector< Weight > &kinePars) const
Access contributing objects and retrieve kinematic weights.
xAOD::MissingETComponent_v1::removeContrib
bool removeContrib()
Remove all contributions.
Definition: MissingETComponent_v1.cxx:165
xAOD::MissingETComponent_v1::f_wet
std::vector< double > & f_wet()
xAOD::MissingETComponent_v1::metObject
const MissingET * metObject() const
Access MET object.
xAOD::MissingETComponent_v1::Weight::m_wet
double m_wet
Definition: MissingETComponent_v1.h:68
xAOD::MissingETComponent_v1::wpy
const std::vector< double > & wpy() const
Get the vector of weight components
xAOD::MissingETComponent_v1::operator!=
bool operator!=(const MissingETComponent_v1 &contrib) const
Equality.
xAOD::MissingETComponent_v1::Weight::operator==
bool operator==(const Weight &wght) const
Equality comparator.
Definition: MissingETComponent_v1.cxx:44
xAOD::MissingETComponent_v1::wet
double wet(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
xAOD::MissingETComponent_v1::Weight::~Weight
~Weight()
Data class destructor.
xAOD::MissingETComponent_v1::Weight
Kinematic weight descriptor.
Definition: MissingETComponent_v1.h:28
xAOD::MissingETComponent_v1::copyData
void copyData(const MissingETComponent_v1 &compDescr, MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
xAOD::MissingETComponent_v1::setWpy
bool setWpy(const IParticle *pPart, double wpy)
Set kinematic weight component for a given contributing object referenced by pointer.
xAOD::MissingETComponent_v1::Weight::operator*=
Weight & operator*=(const Weight &wght)
Multiply two weights.
Definition: MissingETComponent_v1.cxx:24
xAOD::MissingETComponent_v1::setWet
bool setWet(const IParticle *pPart, double wet)
Set kinematic weight for a given contributing object referenced by pointer.
xAOD::MissingETComponent_v1::f_setObject
void f_setObject(const POBJ *pObj, LINK &elemLink)
Generalized link manager.
xAOD::MissingETComponent_v1::metLink
const MissingETBase::Types::metlink_t & metLink() const
Get the link to the MET object.
xAOD::MissingETComponent_v1::f_removeContrib
bool f_removeContrib(size_t pIdx)
Copy the contribution data from a source.
Definition: MissingETComponent_v1.cxx:172
MissingETBase::Status::clearedStatus
static Types::bitmask_t clearedStatus()
Cleared term tag accessor.
Definition: MissingETCompositionBase.h:115
operator*
MissingETBase::Types::weight_t operator*(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Multiply kinematic weights.
xAOD::MissingETComponent_v1::Weight::wpx
double & wpx()
Returns reference to modifiable dataword storing .
xAOD::MissingETComponent_v1::setWpx
bool setWpx(const IParticle *pPart, double wpx)
Set kinematic weight component for a given contributing object referenced by pointer.
MissingETContainer.h
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::MissingETComponent_v1
MET component descriptor contains object links and corresponding parameters.
Definition: MissingETComponent_v1.h:24
xAOD::MissingETComponent_v1::empty
bool empty() const
Empty list of contributing objects indicator.
xAOD::MissingETComponent_v1::objects
std::vector< const IParticle * > objects() const
Access contributing objects.
Definition: MissingETComponent_v1.cxx:295