ATLAS Offline Software
Loading...
Searching...
No Matches
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
20namespace xAOD
21{
24 {
25 public:
27 class Weight
28 {
29 public:
31 Weight(double wpx,double wpy,double wet);
32 // Weight(const Weight& wght); /*!< @brief Copy constructor */
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();
82
92
96 bool addObject(const IParticle* pPart,const Weight& wght=Weight());
97 bool addObject(const IParticle* pPart,double wpx,double wpy,double wet);
99
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);
140
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();
154
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;
168
169
190 size_t findIndex(const IParticle* pPart) const;
192
200 // void updateLinks();
202 // void updateMETLink();
203 size_t size() const;
205 bool empty() const;
207
213 bool operator==(const MissingETComponent_v1& contrib) const;
214 bool operator!=(const MissingETComponent_v1& contrib) const;
216
217 protected:
219 void createPrivateStore();
220
229 std::vector<double>& f_wpx();
230 std::vector<double>& f_wpy();
231 std::vector<double>& f_wet();
234
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
260namespace MissingETBase
261{
262 namespace Types
263 {
265 typedef std::vector<weight_t> weight_vector_t;
266 }
267}
268
288#endif
Base class for elements of a container that can have aux data.
MissingETBase::Types::weight_t operator/(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Divide kinematic weights.
MissingETBase::Types::weight_t operator*(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Multiply kinematic weights.
MissingETBase::Types::weight_t operator+(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Add kinematic weights.
MissingETBase::Types::weight_t operator-(const MissingETBase::Types::weight_t &w0, const MissingETBase::Types::weight_t &w1)
Subtract kinematic weights.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
Class providing the definition of the 4-vector interface.
double & wpx()
Returns reference to modifiable dataword storing .
bool operator!=(const Weight &wght) const
Inequality operator.
double & wpy()
Returns reference to modifiable data word storing .
Weight & operator-=(const Weight &wght)
Subtract another weight.
bool operator==(const Weight &wght) const
Equality comparator.
double & wet()
Returns reference to modifiable data word storing .
~Weight()
Data class destructor.
double wpx() const
Returns .
Weight & operator*=(const Weight &wght)
Multiply two weights.
Weight(double wpx, double wpy, double wet)
Constructor with parameters.
double wpy() const
Returns .
double wet() const
Returns .
Weight & operator+=(const Weight &wght)
Add another weight.
Weight & operator/=(const Weight &wght)
Divide two weights.
bool f_removeContrib(size_t pIdx)
Copy the contribution data from a source.
size_t size() const
[Deprecated] Update all internally used ElementLink instances
MissingETComponent_v1 & operator=(const MissingETComponent_v1 &compDescr)
const std::vector< double > & wpx() const
Get the vector of weight components.
MissingETBase::Types::bitmask_t & f_statusWord()
Weight weight(const IParticle *pPart) const
Get kinematic weight for a given object.
bool setWeight(const IParticle *pPart, double wpx, double wpy, double wet)
Set the kinematic weight components of an object contribution referenced by pointer.
const std::vector< double > & wet() const
Get the vector of weight components.
void copyData(const MissingETComponent_v1 &compDescr, MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
bool resetContrib(const IParticle *pPart)
Reset the contribution parameters of an object referenced by a pointer.
bool setWeight(size_t pIdx, const Weight &wght=Weight())
Set the kinematic weight of an object contribution referenced by index.
std::vector< double > & f_wet()
MissingETBase::Types::bitmask_t statusWord() const
Get the statusword.
bool empty() const
Empty list of contributing objects indicator.
std::vector< const IParticle * > objects() const
Access contributing objects.
void f_setObject(const POBJ *pObj, LINK &elemLink)
Generalized link manager.
bool setWet(const std::vector< double > &wcv)
Set the vector of weight components.
bool addObject(const IParticle *pPart, const Weight &wght=Weight())
Add object (particle) from pointer reference with optional kinematic weight.
double wet(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
MissingETBase::Types::objlink_vector_t & f_objectLinks()
Non-const link reference.
bool setMET(const MissingET *pmetObj, MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
Set MET object by object pointer reference.
const MissingETBase::Types::objlink_vector_t & objectLinks() const
Get the vector of links to the contributing physics or signal objects.
std::vector< const IParticle * > objects(std::vector< Weight > &kinePars) const
Access contributing objects and retrieve kinematic weights.
std::vector< double > & f_wpx()
bool removeContrib()
Remove all contributions.
bool setWpx(const IParticle *pPart, double wpx)
Set kinematic weight component for a given contributing object referenced by pointer.
bool resetContrib()
Reset all contribution parameters.
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
MissingETBase::Types::metlink_t & f_metLink()
Non-const link reference.
virtual ~MissingETComponent_v1()
Assignment operator.
void createPrivateStore()
Function initialising the object to work in standalone mode.
bool operator==(const MissingETComponent_v1 &contrib) const
bool clearStatusWord()
Clear statusword.
bool setObjectLinks(const MissingETBase::Types::objlink_vector_t &objLnks)
Set the vector of links to the contributing physics or signal objects.
bool setWet(const IParticle *pPart, double wet)
Set kinematic weight for a given contributing object referenced by pointer.
double wpx(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
const std::vector< double > & wpy() const
Get the vector of weight components.
double wpy(const IParticle *pPart) const
Get the weight component for a given object referenced by pointer.
bool operator!=(const MissingETComponent_v1 &contrib) const
Equality.
MissingETComponent_v1(bool createStore=false)
Default constructor.
const MissingETBase::Types::metlink_t & metLink() const
Get the link to the MET object.
bool f_setLink(LINK &elemLink)
bool removeContrib(const IParticle *pPart)
Remove a contribution referenced by an object pointer.
bool setStatusWord(MissingETBase::Types::bitmask_t sw=MissingETBase::Status::clearedStatus())
Set the statusword of a MET term.
bool setWpy(const std::vector< double > &wpyVector)
Set the vector of weight components.
bool removeContrib(size_t pIdx)
Remove a contribution referenced by an index.
bool setWpy(const IParticle *pPart, double wpy)
Set kinematic weight component for a given contributing object referenced by pointer.
bool mergeStatusWord(MissingETBase::Types::bitmask_t sw)
Merge patterns into the MET term status.
bool setWpx(const std::vector< double > &wcv)
Set the vector of weight components.
const MissingETContainer_v1 * metObjectContainer() const
Access MET object container holding MET object.
bool setMetLink(const MissingETBase::Types::metlink_t &metLnk)
Set the link to the MET object.
bool setWeight(const IParticle *pPart, const Weight &wght=Weight())
Set the kinematic weight of an object contribution referenced by pointer.
std::vector< double > & f_wpy()
const MissingET * metObject() const
Access MET object.
size_t metObjectIndex() const
Access index of MET object in its container.
Container for xAOD::MissingET_v1 objects.
std::vector< weight_t > weight_vector_t
Vector type for kinematic weight containers.
uint64_t bitmask_t
Type for status word bit mask.
ElementLink< xAOD::MissingETContainer > metlink_t
Link to MissingET object.
xAOD::MissingETComponent_v1::Weight weight_t
Type for kinematic weight.
std::vector< objlink_t > objlink_vector_t
Vector of object links type.
General namespace for MET EDM software.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
MissingET_v1 MissingET
Version control by type defintion.
static Types::bitmask_t clearedStatus()
Cleared term tag accessor.