4 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
8 ////////////////////////////////////////////////////
9 // Inlined Methods for MissingETComponent::Weight //
10 ////////////////////////////////////////////////////
12 inline xAOD::MissingETComponent_v1::Weight::Weight()
13 : m_wpx(MissingETBase::Numerical::wpxDefault())
14 , m_wpy(MissingETBase::Numerical::wpyDefault())
15 , m_wet(MissingETBase::Numerical::wetDefault())
18 inline xAOD::MissingETComponent_v1::Weight::Weight(double wpx,double wpy,double wet)
19 : m_wpx(wpx), m_wpy(wpy), m_wet(wet)
22 // inline xAOD::MissingETComponent_v1::Weight::Weight(const Weight& wght)
23 // : m_wpx(wght.wpx()), m_wpy(wght.wpy()), m_wet(wght.wet())
26 inline xAOD::MissingETComponent_v1::Weight::~Weight()
29 inline bool xAOD::MissingETComponent_v1::Weight::operator!=(const Weight& wght) const
30 { return !this->operator==(wght); }
32 // ------------------------------------------------------------------ Accessors
33 inline double xAOD::MissingETComponent_v1::Weight::wpx() const { return m_wpx; }
34 inline double xAOD::MissingETComponent_v1::Weight::wpy() const { return m_wpy; }
35 inline double xAOD::MissingETComponent_v1::Weight::wet() const { return m_wet; }
36 inline double& xAOD::MissingETComponent_v1::Weight::wpx() { return m_wpx; }
37 inline double& xAOD::MissingETComponent_v1::Weight::wpy() { return m_wpy; }
38 inline double& xAOD::MissingETComponent_v1::Weight::wet() { return m_wet; }
40 // -------------------------------------------------------------------- Setters
41 inline void xAOD::MissingETComponent_v1::Weight::setWpx(double wpx) { this->wpx() = wpx; }
42 inline void xAOD::MissingETComponent_v1::Weight::setWpy(double wpy) { this->wpy() = wpy; }
43 inline void xAOD::MissingETComponent_v1::Weight::setWet(double wet) { this->wet() = wet; }
45 ////////////////////////////////////////////
46 // Inlined Methods for MissingETComponent //
47 ////////////////////////////////////////////
49 template<class POBJ,class LINK>
50 void xAOD::MissingETComponent_v1::f_setObject(const POBJ* pObj,LINK& elemLink)
52 if ( pObj == 0 ) { return; /* FIXME throw some kind of exception */ }
53 typename LINK::BaseConstPointer pCont =
54 dynamic_cast<typename LINK::BaseConstPointer>(pObj->container());
55 // valid pointer to container of (storable) object
56 if ( pCont != 0 ) { elemLink.toIndexedElement(*pCont,pObj->index()); }
57 // POD, not storable - we still use ElementLink to hold the pointer
58 else { elemLink.setElement(pObj); }
63 bool xAOD::MissingETComponent_v1::f_setLink(LINK& elemLink)
66 if ( *(elemLink) == 0 ) { return false; }
67 // check if object is storable
70 typename LINK::BaseConstPointer pCont = dynamic_cast<typename LINK::BaseConstPointer>((*(elemLink))->container());
72 if ( pCont != 0 ) { elemLink.toIndexedElement(*pCont,(*(elemLink))->index()); return true; }
73 else { return false; }
77 inline bool xAOD::MissingETComponent_v1::addObject(const IParticle* pPart,const Weight& wght)
78 { return this->addObject(pPart,wght.wpx(),wght.wpy(),wght.wet()); }
80 // ------------------------------------------------------------------- MET link
81 inline const MissingETBase::Types::metlink_t& xAOD::MissingETComponent_v1::metLink() const
82 { static const SG::AuxElement::Accessor<MissingETBase::Types::metlink_t> acc("metLink"); return acc(*this); }
83 inline MissingETBase::Types::metlink_t& xAOD::MissingETComponent_v1::f_metLink()
84 { static const SG::AuxElement::Accessor<MissingETBase::Types::metlink_t> acc("metLink"); return acc(*this); }
86 // ---------------------------------------------------------------- object link
87 inline const MissingETBase::Types::objlink_vector_t& xAOD::MissingETComponent_v1::objectLinks() const
88 { static const SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); return acc(*this); }
89 inline MissingETBase::Types::objlink_vector_t& xAOD::MissingETComponent_v1::f_objectLinks()
90 { static const SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); return acc(*this); }
92 // ---------------------------------------------------------- kinematic weights
93 inline const std::vector<double>& xAOD::MissingETComponent_v1::wpx() const
94 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wpx"); return acc(*this); }
95 inline double xAOD::MissingETComponent_v1::wpx(const IParticle* pPart) const
96 { return this->wpx(this->findIndex(pPart)); }
98 inline const std::vector<double>& xAOD::MissingETComponent_v1::wpy() const
99 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wpy"); return acc(*this); }
100 inline double xAOD::MissingETComponent_v1::wpy(const IParticle* pPart) const
101 { return this->wpy(this->findIndex(pPart)); }
103 inline const std::vector<double>& xAOD::MissingETComponent_v1::wet() const
104 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wet"); return acc(*this); }
105 inline double xAOD::MissingETComponent_v1::wet(const IParticle* pPart) const
106 { return this->wet(this->findIndex(pPart)); }
108 inline std::vector<double>& xAOD::MissingETComponent_v1::f_wpx()
109 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wpx"); return acc(*this); }
111 inline std::vector<double>& xAOD::MissingETComponent_v1::f_wpy()
112 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wpy"); return acc(*this); }
113 inline std::vector<double>& xAOD::MissingETComponent_v1::f_wet()
114 { static const SG::AuxElement::Accessor<std::vector<double> > acc("wet"); return acc(*this); }
116 // -- non-coventional Weight generator
117 inline xAOD::MissingETComponent_v1::Weight xAOD::MissingETComponent_v1::weight(const IParticle* pPart) const
118 { return this->weight(this->findIndex(pPart)); }
120 // ---------------------------------------------------------------- status word
121 inline MissingETBase::Types::bitmask_t xAOD::MissingETComponent_v1::statusWord() const
122 { static const SG::AuxElement::Accessor<MissingETBase::Types::bitmask_t> acc("statusWord"); return acc(*this); }
124 inline MissingETBase::Types::bitmask_t& xAOD::MissingETComponent_v1::f_statusWord()
125 { static const SG::AuxElement::Accessor<MissingETBase::Types::bitmask_t> acc("statusWord"); return acc(*this); }
126 // --------------------------------------------------- MET object and container
127 inline const xAOD::MissingET* xAOD::MissingETComponent_v1::metObject() const
128 { return *(this->metLink()); }
130 inline const xAOD::MissingETContainer_v1* xAOD::MissingETComponent_v1::metObjectContainer() const
131 { return this->metObject() != 0 ? this->metLink().getStorableObjectPointer() : (const MissingETContainer_v1*)0; }
133 inline size_t xAOD::MissingETComponent_v1::metObjectIndex() const
134 { return this->metObject() != 0 ? this->metLink().index() : MissingETBase::Numerical::invalidIndex(); }
135 // ------------------------------------------------------------ List management
136 inline size_t xAOD::MissingETComponent_v1::size() const { return this->objectLinks().size(); }
137 inline bool xAOD::MissingETComponent_v1::empty() const { return this->objectLinks().empty(); }
138 inline bool xAOD::MissingETComponent_v1::removeContrib(size_t pIdx)
139 { return ( pIdx != MissingETBase::Numerical::invalidIndex() && pIdx < this->size() ) ? this->f_removeContrib(pIdx) : false; }
140 inline bool xAOD::MissingETComponent_v1::removeContrib(const IParticle* pPart) { return this->removeContrib(this->findIndex(pPart)); }
141 inline bool xAOD::MissingETComponent_v1::resetContrib(const IParticle* pPart) { return this->resetContrib(this->findIndex(pPart)); }
142 // ---------------------------------------------------------------- Comparators
143 inline bool xAOD::MissingETComponent_v1::operator!=(const xAOD::MissingETComponent_v1& compDescr) const
144 { return !this->operator==(compDescr); }
145 // ------------------------------------------------ Set contribution parameters
146 inline bool xAOD::MissingETComponent_v1::setWpx(const IParticle* pPart,double wpx)
147 { return this->setWpx(this->findIndex(pPart),wpx); }
148 inline bool xAOD::MissingETComponent_v1::setWpy(const IParticle* pPart,double wpy)
149 { return this->setWpy(this->findIndex(pPart),wpy); }
150 inline bool xAOD::MissingETComponent_v1::setWet(const IParticle* pPart,double wet)
151 { return this->setWet(this->findIndex(pPart),wet); }
152 inline bool xAOD::MissingETComponent_v1::setWeight(const IParticle* pPart,const Weight& wght)
153 { return this->setWeight(this->findIndex(pPart),wght.wpx(),wght.wpy(),wght.wet()); }
154 inline bool xAOD::MissingETComponent_v1::setWeight(const IParticle* pPart,double wpx,double wpy,double wet)
155 { return this->setWeight(this->findIndex(pPart),wpx,wpy,wet); }
156 inline bool xAOD::MissingETComponent_v1::setWeight(size_t pIdx,const Weight& wght)
157 { return this->setWeight(pIdx,wght.wpx(),wght.wpy(),wght.wet()); }
158 // ----------------------------------------- Set MET object link and statusword
159 inline bool xAOD::MissingETComponent_v1::setStatusWord(MissingETBase::Types::bitmask_t sw)
160 { if ( sw == this->statusWord() ) { return false; } else { this->f_statusWord() = sw; return true; } }
161 inline bool xAOD::MissingETComponent_v1::mergeStatusWord(MissingETBase::Types::bitmask_t sw)
162 { if ( sw == this->statusWord() ) { return false; } else { this->f_statusWord() |= sw; return true; } }
163 inline bool xAOD::MissingETComponent_v1::clearStatusWord()
164 { return this->setStatusWord(MissingETBase::Status::clearedStatus()); }
166 ////////////////////////////////////////
167 // Inlined Global Namespace Operators //
168 ////////////////////////////////////////
170 inline MissingETBase::Types::weight_t operator+(const MissingETBase::Types::weight_t& w0,const MissingETBase::Types::weight_t& w1)
171 { MissingETBase::Types::weight_t w(w0); w += w1; return w; }
173 inline MissingETBase::Types::weight_t operator-(const MissingETBase::Types::weight_t& w0,const MissingETBase::Types::weight_t& w1)
174 { MissingETBase::Types::weight_t w(w0); w -= w1; return w; }
176 inline MissingETBase::Types::weight_t operator*(const MissingETBase::Types::weight_t& w0,const MissingETBase::Types::weight_t& w1)
177 { MissingETBase::Types::weight_t w(w0); w *= w1; return w; }
179 inline MissingETBase::Types::weight_t operator/(const MissingETBase::Types::weight_t& w0,const MissingETBase::Types::weight_t& w1)
180 { MissingETBase::Types::weight_t w(w0); w /= w1; return w; }
182 inline MissingETBase::Types::weight_t operator*(const MissingETBase::Types::weight_t& wght,double scale)
183 { MissingETBase::Types::weight_t w(wght); w *= scale; return w; }
185 inline MissingETBase::Types::weight_t operator*(double scale,const MissingETBase::Types::weight_t& wght)
186 { MissingETBase::Types::weight_t w(wght); w *= scale; return w; }
188 inline MissingETBase::Types::weight_t operator/(const MissingETBase::Types::weight_t& wght,double scale)
189 { MissingETBase::Types::weight_t w(wght); w /= scale; return w; }
191 ///////////////////////////////////////////////////////////////
192 // The rest of the file contains doxygen documentation only! //
193 ///////////////////////////////////////////////////////////////
195 /*! @class xAOD::MissingETComponent_v1
199 * This class provides a data object with links to physics or signal objects contributing to a given MET term.
200 * Each component object features (1) a link to the MissingET object it describes, (2) the reconstruction status of the MET term,
201 * (3) links to the contributing signal/physics objects, and (4) a list of kinematic weights characterizing each object contribution.
203 * MissingETComponent_v1 supports adding and removing objects from a MET contribution, and the modification of the kinematic weights of existing entries.
204 * It provides constructors for a @link xAOD::MissingETComponent_v1::MissingETComponent_v1(bool) non-functional default object @endlink without data store
205 * attached, and for various fully functional objects with (initially internal) data store wwith different initial data loads. The most basic functional
206 * object is constructed with just a link to the corresponding xAOD::MissingET
207 * @link xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET*,MissingETBase::Types::bitmask_t) object and an optional statusword @endlink.
208 * Other options construct objects with the link to the MET object, the optional statusword, and a reference to the first contributing physics or signal
209 * object and the associated kinematic weight, which can be provided using a xAOD::MissingETComponent::Weight
210 * @link xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET*,const IParticle*,const Weight&,MissingETBase::Types::bitmask_t) object @endlink,
212 * @link xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET*,const IParticle*,double,double,double,MissingETBase::Types::bitmask_t) three weight
213 * parameters @endlink.
215 * The MET component object is not storable by itself. It needs to collected into a xAOD::MissingETComponentMap_v1, with an attached xAOD::MissingETAuxComponentMap_v1 object
216 * implementing the storable data structure..
218 * (1) Link to MissingET object
220 * This link is realized by an ElementLink (EL) from the component to the xAOD::MissingET object. The specific type of this EL is given by
221 * MissingETBase::Types::metlink_t. The EL can be incomplete, meaning it can be instantiated with a plain-old-data (POD) MissingET object not
222 * collected into a storable MissingETContainer_v1 yet. Once the MissingET object is collected into a container, the link can be updated using
223 * MissingETComponent_v1::updateMETLink().
227 * The MET term can be qualified with a status indicator as provided in MissingETBase::Status. Logical combinations of these status indicators are possible. The status is
228 * a dataword of type MissingETBase::Types::bitmask_t. The statusword is typically set by the tool reconstructing a specific MET term. It should not be confused
229 * with the source of the MET object, which hhholds different information using the same MissingETBase::Types::bitmask_t.
231 * (3) Links to contributing objects
233 * The links to the objects contributing to a given MET object are stored in a vector of type MissingETBase::Types::objlink_vector_t. Each
234 * signal/physics object should contribute only once to a given MET. Any attempt to add the same object reference again leads to
235 * addition of the provided kinematic weights to the stored kinematic weights. This behaviour can produce unrealistic weights this way, suggesting
236 * that adding physics or signal objects should be done within the well controlled context of a MET reconstruction tool.
238 * (4) Kinematic weights
240 * The kinematic weights @f$ (w_{x},w_{y},w_{\rm T}) @f$ are scale factors applied to the object kinematics @f$ (p_{x},p_{y},p_{\rm T}) @f$ such that
241 * the contribution to the corresponding MET variables
242 * @f$ (p_{x}^{\rm miss}, p_{y}^{\rm miss}, \Sigma E_{\rm T}) @f$ is given by @f$ (w_{x} p_{x}, w_{y} p_{y}, w_{\rm T} p_{\rm T}) @f$. The overall MET contribution
243 * of all @f$ i = 1 \ldots N @f$ objects of the same type (e.g., electrons, photons, jets,...) is then given by
245 * p_{x}^{\rm miss} & = & - \sum_{i = 1}^{N} w_{x,i} p_{x,i} \ \
246 * p_{y}^{\rm miss} & = & - \sum_{i = 1}^{N} w_{y,i} p_{y,i} \ \
247 * \Sigma E_{\rm T} & = & \sum_{i = 1}^{N} w_{{\rm T},i} p_{{\rm T},i}
249 * The individual weights are stored in vectors index-parallel to the link vector.
251 * @anchor contrib_set_intro
252 * <b>Setting data in a MET component</b>
253 * (@ref contrib_set "link to code documentation")
255 * These methods establish a link to the xAOD::MissingET object in a (new) MET contribution. The link list to the contributing object and the lists
256 * storing the kinematic weights and the list of statuswords are empty. One of these methods needs to be invoked before attempting to set
257 * object data for the referenced MET object.
259 * If this method is invoked for a component which already had links to contributing objects, the corresponding lists are purged, and the EL to the
260 * xAOD::MissingET object may be overwritten, if the pointer refers to a different object than the one in the original EL. This method acts like a reset of
261 * the MET component object.
263 * @anchor contrib_add_intro
264 * <b>Adding data to the contribution</b>
265 * (@ref contrib_add "link to code documentation")
267 * Add a signal or physics object contribution to the MET object. A new link is added to linked object list if the referenced object is not yet in this list.
268 * If the referenced object is already in the list, the given kinematic weights are added to the weights already stored for the contribution.
269 * No new list entry is generated in this case.
271 * @anchor contrib_manip_intro
272 * <b>Manipulating the contribution data</b>
273 * (@ref contrib_manip "link to code documentation")
275 * The parameters of the contribution from a given object to MET can be modified after the MET component object is created. This involves
276 * a linear search in the list of contributing objects. In addition, objects can be removed from the linked object vector. This again involves a linear search.
277 * Some behaviour is implemented to suppress searches for the same entities and just use the result from the previous search,
279 * Other functions allow updating the EL to the MissingET object, and all other linked physics and signal objects. This is done by setting the
280 * container pointer in these ELs. At most, it involves a loop on all contributing objects, plus the update of the MissingET link
282 * @anchor contrib_alloc_intro
283 * <b> Allocating and accessing contributing objects</b>
284 * (@ref contrib_alloc "link to code documentation")
286 * All allocators (finders) allow to parse the list of contributing objects and find contributions from a given object, as specified by its pointer.
287 * A linear search is performed to find the correct entries in the object lists. The returned results are represented by iterators referencing
288 * valid link objects (ElementLinks) if the requested object is in the contributing store, else a reference to the end of the store is returned.
290 * Contributing objects and their associated parameters can be accessed individually using iterators for const and non-const access. In addition, public references
291 * to the whole contributing object store are available.
293 * Accessing MET and contributing object, object container, and object index does not include an internal validity check. A returned object pointer can be
294 * NULL. It is necessary for clients to test the returned pointer value. The returned value for the index in case of an invalid ElementLink is the default
295 * value of this data type.
297 * @anchor contrib_comp_intro
299 * (@ref contrib_comp "link to code documentation")
301 * Comparators apply equality rules as follows: two MissingETComponent_v1 objects are identical if (1) the are linked to the same MissingET object,
302 * (2) they have the same status, (3) they have the same number of contributing objects, and (4) they have identical lists of contributing objects
303 * and kinematic weights.
304 * The comparisons are applied in the numerical order displayed. The MissingETComponent_v1::operator!= operator is implemented, as it
305 * allows a (fast) return when the first difference between the compared data words is detected.
308 /*! @fn template<class POBJ,class LINK> void xAOD::MissingETComponent_v1::f_setObject(const POBJ* pObj,LINK& elemLink)
310 * Inserts link data into ElementLink, even if incomplete. At least, the pointer of linked object will be set (except if NULL).
312 * @tparam POBJ linked object type
313 * @tparam LINK specific ElementLink type
315 * @param[in] pObj pointer to non-modifiable object to be linked
316 * @param[in] elemLink reference to modifiable ElementLink object. Initial data content of this object are overwritten.
318 * @note This is the generalized implementation for e.g. MissingETComponent_v1::setMET and MissingETComponent_v1::addObject
321 // ----------- MissingETComponent_v1::Weight ------------
323 /*! @class xAOD::MissingETComponent_v1::Weight MissingETComposition_v1.h "versions/MissingETComposition_v1.h"
325 * This object is purely transient. It allows a compact extraction and setting of kinematic weights for component descriptions for MET. In addition,
326 * it helps to implement a clean and well defined algebra for these weights. This structure is not used in the auxiliary data store holding
327 * the data for a MissingETComponent_v1 object.
330 /*! @fn xAOD::MissingETComponent_v1::Weight::Weight()
332 * Constructs a kinematic weight object with settings @f$ (w_{x} = 1, w_{y} = 1, w_{\rm T} = 1) @f$.
335 /*! @fn xAOD::MissingETComponent_v1::Weight::Weight(double wpx,double wpy,double wet)
337 * Construct a kinematic weight object with client provided weights. All numerical values are accepted, there is no consistency or numerical range check on the weights.
339 * @param[in] wpx @f$ w_{x} @f$
340 * @param[in] wpy @f$ w_{y} @f$
341 * @param[in] wet @f$ w_{\rm T} @f$
344 /*! @fn xAOD::MissingETComponent_v1::Weight(const Weight& wght)
346 * @param[in] wght reference to non-modifiable @c Weight object (source).
349 /*! @fn xAOD::MissingETComponent_v1::Weight::operator+=(const Weight& wght)
351 * This operation updates the internal store of @c this object and yields
353 * \mathcal{W} + \mathcal{W}^{\prime} = \left(\begin{array}{c}
354 * w_{x} + w_{x}^{\prime} \\
355 * w_{y} + w_{y}^{\prime} \\
356 * w_{\rm T} + w_{\rm T}^{\prime}
357 * \end{array} \right)
359 * for two weights @f$ \mathcal{W}, \mathcal{W}^{\prime} @f$ added. The result replaces the data content of @f$ \mathcal{W} @f$.
361 * @return Reference to self.
362 * @param[in] wght reference to non-modifiable @c Weight object to be added.
365 /*! @fn xAOD::MissingETComponent_v1::Weight& xAOD::MissingETComponent_v1::Weight::operator-=(const Weight& wght)
367 * This operation updates the internal store of @c this object and yields
369 * \mathcal{W} - \mathcal{W}^{\prime} = \left(\begin{array}{c}
370 * w_{x} - w_{x}^{\prime} \\
371 * w_{y} - w_{y}^{\prime} \\
372 * w_{\rm T} - w_{\rm T}^{\prime}
373 * \end{array} \right)
375 * for weight @f$ \mathcal{W}^{\prime} @f$ subtracted from @f$ \mathcal{W}^{\prime} @f$. The result replaces the data content of
376 * @f$ \mathcal{W} @f$.
378 * @return Reference to self.
379 * @param[in] wght reference to non-modifiable @c Weight object to be subtracted.
382 /*! @fn xAOD::MissingETComponent_v1::Weight& xAOD::MissingETComponent_v1::Weight::operator*=(const Weight& wght)
384 * This operation updates the internal store of @c this object and yields
386 * s \times \mathcal{W} = \left( \begin{array}{c}
387 * w_{x} \times w_{x}^{\prime} \\
388 * w_{y} \times w_{y}^{\prime} \\
389 * w_{\rm T} \times = w_{\rm T}^{\prime}
390 * \end{array} \right)
392 * for weight @f$ \mathcal{W} @f$ multiplied by another weight @f$ \mathcal{W}^{\prime} = (w_{x}^{\prime},w_{y}^{\prime},w_{\rm T}^{\prime}) @f$.
393 * The internal data content of @f$ \mathcal{W} @f$ is modified.
395 * @return Reference to self.
396 * @param[in] wght weight @f$ \mathcal{W}*{\prime} @f$
399 /*! @fn xAOD::MissingETComponent_v1::Weight& xAOD::MissingETComponent_v1::Weight::operaotr/=(const Weight& wght)
401 * This operation updates the internal store of @c this object and yields
403 * \mathcal{W} / s = \left( \begin{array}{c}
404 * w_{x} / w_{x}^{\prime} \\
405 * w_{y} / w_{y}^{\prime} \\
406 * w_{\rm T} / w_{\rm T}^{\prime} / s
407 * \end{array} \right)
409 * for weight @f$ \mathcal{W} @f$ divided by another weight @f$ \mathcal{W}^{\prime} = (w_{x}^{\prime},w_{y}^{\prime},w_{\rm T}^{\prime}) @f$.
410 * The internal data content of @f$ \mathcal{W} @f$ is modified.
412 * @note In case any of the components of @f$ \mathcal{W}^{\prime} @f$ are invalid (have the value 0), the components of the original weight
413 * @f$ \mathcal{W} @f$ are set to (0,0,0).
415 * @return Reference to self.
416 * @param[in] wght weight @f$ \mathcal{W}*{\prime} @f$
419 /*! @fn xAOD::MissingETComponent_v1::Weight& xAOD::MissingETComponent_v1::Weight::operator*=(double scale)
421 * This operation updates the internal store of @c this object and yields
423 * s \times \mathcal{W} = \left( \begin{array}{c}
427 * \end{array} \right)
429 * for weight @f$ \mathcal{W} @f$ multiplied by a scale factor @f$ s @f$. The internal data content of @f$ \mathcal{W} @f$ is modified.
431 * @return Reference to self.
432 * @param[in] scale scale factor @f$ s @f$.
435 /*! @fn xAOD::MissingETComponent_v1::Weight& xAOD::MissingETComponent_v1::Weight::operator/=(double scale)
437 * This operation updates the internal store of @c this object and yields
439 * \mathcal{W} / s = \left( \begin{array}{c}
443 * \end{array} \right)
445 * for weight @f$ \mathcal{W} @f$ divided by a scale factor @f$ s @f$. The internal data content of @f$ \mathcal{W} @f$ is modified.
447 * @note In case an invalid scale factor ( @f$ s = 0 @f$ ) is provided, the original weight @f$ \mathcal{W} @f$ is set to (0,0,0).
449 * @return Reference to self.
450 * @param[in] scale scale factor @f$ s @f$.
453 /*! @fn bool xAOD::MissingETComponent_v1::Weight::operator==(const Weight& wght)
455 * @return @c true if two weights have equal components within the precision defined in MissingETBase::Numerical::precision().
457 * @param[in] wght reference to non-modifiable Weight object to be compared to.
460 /*! @fn bool xAOD::MissingETComponent_v1::Weight::operator!=(const Weight& wght)
462 * @return @c true if two weights are not equal according to the rules applied in Weight::operator==().
464 * @param[in] wght reference to non-modifiable Weight object to be compared to.
467 // ----------- MissingETComponent_v1 --------------------
469 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(bool createStore)
471 * Instantiates a MissingETComponent_v1 object.
473 * @param[in] createStore controls the creation of dedicated store for this data object (optional, default is @c false - no store created).
475 * @warning The capabilities of the generated object are strongly depend on the input parameter.
476 * If the default argument or an explicit argument @c false is used, the created object not have a store for its data.
477 * It cannot be used as a plain old data (POD) object in this case, and any attempt to set or get data will likely cause undesired behaviour
478 * and/or program crashes. When instantiated with this state, It needs to be stored in a xAOD::MissingETComponentMap_v1 object prior to any use.
479 * Providing an explicit argument @c true instantiates a standalone, fully functional POD object with a private store attached. When this
480 * object is stored in a MissingETComponentMap_v1, the data content of this store is copied to the attached MissingETAuxComponentMap_v1 object
481 * and the private store is disabled.
484 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET* pmetObj,MissingETBase::Types::bitmask_t sw)
486 * Instantiates an empty component descriptor for a given MET (xAOD::MissingET) object with a private store attached.
488 * @note The object instantiated with this constructor is a fully functional, yet empty (no links to any contributing
489 * object, but with a link to a MET object), POD object. To persistify its data content, it needs to be store
490 * in a xAOD::MissingETComponentMap_v1 object.
492 * @param[in] pmetObj pointer to non-modifiable xAOD::MissingET object
493 * @param[in] sw status word characterizing the MET term (optional, default is MissingETBase::Status::clearedStatus())
495 * @note If the xAOD::MissingET object pointed to is not associated with a xAOD::MissingETContainer_v1, the link stored here is incomplete.
496 * It is therefore highly recommended to first store the xAOD::MissingET_V1 object before creating a component descriptor. There is also a recovery method
497 * xAOD::MissingETComponent_v1::updateMETLink() available to perform a link update after the MET object is stored in its container.
500 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET* pmetObj,const IParticle* pPart,const Weight& wght,MissingETBase::Types::bitmask_t sw)
502 * This allows construction of a MissingETComponent_v1 object with an initial contribution. This object has then all the features and behaviours as the one
503 * instantiated by xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET*,MissingETBase::Types::bitmask_t), but a contributing objects link
504 * store and the corresponding stores for the kinematic weights filled with first data.
506 * @param[in] pmetObj pointer to object representing a MET term
507 * @param[in] pPart pointer to non-modifiable @c IParticle typed object
508 * @param[in] wght kinematic weights (optional, default are xAOD::MissingETComponent_v1::Weight object defaults)
509 * @param[in] sw status word (optional, default is MissingETBase::Status::clearedStatus())
512 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET* pmetObj,const IParticle* pPart,double wpx,double wpy,double wet,MissingETBase::Types::bitmask_t sw)
514 * Instantiates the same object as xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingET*,const IParticle*,const Weight&,MissingETBase::Types::bitmask_t),
515 * but allows to use individual weight components instead of weight components collected into a xAOD::MissingETComponent_v1::Weight typed object.
517 * @param[in] pmetObj pointer to object representing a MET term
518 * @param[in] pPart pointer to non-modifiable @c IParticle typed object
519 * @param[in] wpx weight @f$ w_{x} @f$
520 * @param[in] wpy weight @f$ w_{y} @f$
521 * @param[in] wet weight @f$ w_{\rm T} @f$
522 * @param[in] sw status word (optional, default is MissingETBase::Status::clearedStatus())
525 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingETComponent_v1& compRef)
527 * This constructor performs a deep copy. The link to the source auxiliary store is severed for the copy, and a POD xAOD::MissingETComponent_v1 object
528 * is instantiated. The ElementLink objects used to establish the links to the xAOD::MissingET object and the contributing signal objects are copied, as well as the
529 * lists of kinematic weights and the status word.
531 * @param[in[] compRef reference to non-modifiable MET component description (the source).
534 /*! @fn xAOD::MissingETComponent_v1::MissingETComponent_v1(const MissingETComponent_v1& compRef,MissingETBase::Types::bitmask_t sw)
536 * This constructor performs a deep copy. The link to the source auxiliary store is severed for the copy, and a POD xAOD::MissingETComponent_v1 object
537 * is instantiated. The ElementLink objects used to establish the links to the xAOD::MissingET object and the contributing signal objects are copied, as well as the
538 * lists of kinematic weights. A new status word can be specified (can be same as the as the one in the source object - no restriction on value).
540 * @param[in] compRef reference to non-modifiable MET component description (the source).
541 * @param[in] sw status word
544 /*! @fn xAOD::MissingETComponent_v1& xAOD::MissingETComponent_v1::operator=(const MissingETComponent_v1& compRef)
546 * @return Reference to component description object with data copied from the source.
548 * @param[in] compRef reference to non-modifiable MET component description (the source).
551 /*! @fn xAOD::MissingETComponent_v1::setMET(const MissingET* pmetObj,MissingETBase::Types::bitmask_t sw)
553 * This function sets a new link to the MET object reference given in its first argument. This can mean that a previously stored link
556 * @return @c true if no previous ElementLink to the referenced xAOD::MissingET object existed. In case of a reset, @c false is returned.
558 * @param[in] pmetObj pointer to non-modifiable MET object.
559 * @param[in] sw status word (optional, default is MissingETBase::Status::clearedStatus())
561 * @note If the referenced xAOD::MissingET object is not yet stored in a xAOD::MissingETContainer_v1 container, the ElementLink in the component description is not complete.
562 * It can be completed invoking xAOD::MissingETComponent_v1::updateMETLink() at any time - assuming the MissingET object is then stored in a container.
564 * (@ref contrib_set_intro "More info")
567 /*! @fn xAOD::MissingETComponent_v1::setMET(const MissingETContainer_v1* pmetCont,size_t pmetIdx,MissingETBase::Types::bitmask_t sw)
569 * @overload bool xAOD::MissingETComponent_v1::setMET(const MissingET* pmetObj,MissingET::Types::bitmask_t sw)
571 * @return @c true if no previous ElementLink to the referenced xAOD::MissingET object existed. In case of a reset, @c false is returned.
573 * @param[in] pmetCont pointer to non-modifiable MET object container
574 * @param[in] pmetIdx index to MET object in container
575 * @param[in] sw status word (optional, default is MissingETBase::Status::clearedStatus())
577 * @note If the referenced xAOD::MissingET object is not yet stored in a xAOD::MissingETContainer_v1 container, the ElementLink in the component description is not complete.
578 * It can be completed invoking xAOD::MissingETComponent_v1::updateMETLink() at any time - assuming the MissingET object is then stored in a container.
580 * (@ref contrib_set_intro "More info")
583 /*! @fn bool xAOD::MissingETComponent_v1::addObject(const IParticle* pPart,const Weight& wght)
585 * @return @c true if new contribution is added. A return value of @c false indicates that the referenced object already contributes to the MET term. There is no
586 * specific failure mode for this operation.
588 * @param[in] pPart pointer to non-modifiable xAOD::IParticle object
589 * @param[in] wght kinematic weight of object in MET (optional, default is defined in the xAOD::MissingETComponent_v1::Weight::Weight() constructor
591 * @note If a contribution from the referenced xAOD::IParticle object already exists, the weights are summed by applying the rules implemented in
592 * xAOD::MissingETCompnent_v1::Weight::operator+=(const Weight&) .
594 * (@ref contrib_add_intro "More info")
597 /*! @fn bool xAOD::MissingETComponent_v1::addObject(const IParticle* pPart,double wpx,double wpy,double wet);
599 * @overload bool xAOD::MissingETComponent_v1::addObject(const IParticle* pPart,const Weight& wght)
601 * @return @c true if new contribution is added. A return value of @c false indicates that the referenced object already contributes to the MET term. There is no
602 * specific failure mode for this operation.
604 * @param[in] pPart pointer to non-modifiable IParticle object
605 * @param[in] wpx kinematic weight @f$ w_{x} @f$
606 * @param[in] wpy kinematic weight @f$ w_{y} @f$
607 * @param[in] wet kinematic weight @f$ w_{\rm T} @f$
609 * (@ref contrib_add_intro "More info")
612 /*! @fn bool xAOD::MissingETComposition_v1::removeObject(const IParticle* pPart)
614 * Removing an entry from the internal list of contributing objects requires to also remove the corresponding entries from the lists storing the kinematic weight components.
615 * This is handled internally in a consistent way by this method.
617 * @return @c true indicates a successful execution. If the referenced object cannot be found in the list of contributing objects, @c false is returned.
619 * @param[in] pPart pointer to non-modifiable object to be removed from the contribution.
622 /*! @fn bool xAOD::MissingETComponent_v1::resetContrib(const IParticle* pPart)
624 * Presently only resets the kinematic weight to its default value (defined in xAOD::MissingETComponent_v1::Weight::Weight()).
626 * @note The default weight is not necessarily <tt>(wpx=0, wpy=0, wet=0)</tt> (check MissingETBase::Numerical::wpxDefault(), MissingETBase::Numerical::wpyDefault() and
627 * MissingETBase::Numerical::wetDefault() for the respective default values)! If zero weights are desired, xAOD::MissingETComponent_v1::setWeight(const IParticle*,const Weight&)
628 * should be used with argument <tt>wght = Weight(0.,0.,0.)</tt> (failsafe with this respect).
630 * @return @c true if object is found and successfully reset, @c false if object not found in list of contributing objects.
632 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
634 * @note This method has the same behaviour as the xAOD::MissingETComponent_v1::setWeight method with its default arguments.
637 /*! @fn bool xAOD::MisssingETComponent_v1::setWeight(const IParticle* pPart,const Weight& wght)
639 * This methods sets the kinematic weight for a given object in the MET component description.
640 * Invoking this method with its default weight argument is identical to a reset, as discussed in the documentation for
641 * xAOD::MissingETComponent_v1::resetContrib.
643 * @note This is a true setter implementation, the original weight stored for the referenced particle will be
646 * @return @c true if object is found and data is successfully set, @c false if object not found in list of contributing objects.
648 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
649 * @param[in] wght kinematic weight (optional, defaults to weight defined in xAOD::MissingETComponent_v1::Weight::Weight()
652 /*! @fn bool xAOD::MissingET::setWeight(const IParticle* pPart,double wpx,double wpy,double wet)
654 * @overload xAOD::MissingETComponent_v1::setWeight(const IParticle* pPart,const Weight& wght)
656 * @note This is a true setter implementation, the original weight stored for the referenced particle will be
659 * @return @c true if object is found and data is successfully set, @c false if object not found in list of contributing objects.
661 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
662 * @param[in] wpx kinematic weight @f$ w_{x} @f$
663 * @param[in] wpy kinematic weight @f$ w_{y} @f$
664 * @param[in] wet kinematic weight @f$ w_{\rm T} @f$
667 /*! @fn bool xAOD::MissingETComponent_v1::setWpx(const IParticle* pPart,double wpx)
669 * @return @c true if referenced object is in list of contributing objects, else @c false.
671 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
672 * @param[in] wpx kinematic weight component @f$ w_{x} @f$
674 * @note This is a true setter implementation, the original weight component stored for the referenced particle will be
678 /*! @fn bool xAOD::MissingETComponent_v1::setWpy(const IParticle* pPart,double wpy)
679 * @return @c true if referenced object is in list of contributing objects, else @c false.
681 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
682 * @param[in] wpy kinematic weight component @f$ w_{y} @f$
684 * @note This is a true setter implementation, the original weight component stored for the referenced particle will be
688 /*! @fn bool xAOD::MissingETCompoonent_v1::setWet(const IParticle* pPart,double wet)
690 * @return @c true if referenced object is in list of contributing objects, else @c false.
692 * @param[in] pPart pointer to non-modifiable object searched for in the list of contributing objects
693 * @param[in] wet kinematic weight @f$ w_{\rm T} @f$
695 * @note This is a true setter implementation, the original weight component stored for the referenced particle will be
699 /*! @fn bool xAOD::MissingETComponent_v1::setStatus(MissingETBase::Types::bitmask_t sw)
701 * Invoking this method with its default argument is identical to invoking xAOD::MissingETComponent_v1::clearStatus();
703 * @return @c true if this is a new status word, else @c false.
705 * @param[in] sw new statusword (optional, default is MissingETBase::Status::clearedStatus())
707 * @note This method is a true setter method and thus replaces the stored statusword with the specified one.
710 /*! @fn bool xAOD::MissingETCompsition_v1::mergeStatus(MissingETBase::Types::bitmask_t sw)
712 * @return @c true if this is a new status word, else @c false.
714 * @param[in] sw bit pattern to be merged with stored pattern.
716 * @note This method merges the stored status word with the specified one by applying a bitwise @c OR operation.
719 /*! @fn xAOD::MissingETComposition_v1::clearStatus()
721 * Resets the stored bit pattern completely.
723 * @return @c true if the stored bit pattern was not of cleared (unknown) (MissingETBase::Status::clearedStatus()) status.
726 /*! @fn const std::vector<double>& xAOD::MissingETComponent_v1::wpx() const;
728 * Retrieve the vector containing a weight component for all contributing objects.
730 * @return Reference to non-modifiable vector of weight components.
732 * @warning This method is implemented to follow a convention introduced for other data objects in the xAOD framework. In MissingETComponent_v1, the internal
733 * data stores are understood to be highly linked (index parallel), and the behaviour of this object is designed to support random access to all
734 * of these stores in a synchronized fashion (including replacement and removeable). Clients should not directly access these lists, to assure
735 * consistent data access.
737 /*! @fn bool xAOD::::MissingETComponent_v1::setWpx(const std::vector<double>& wcv)
739 * Fill the vector containing a weight component for all contributing objects.
741 * @param[in] wcv reference to non-modifiable vector of weight components.
743 * @warning This method is implemented to follow a convention introduced for other data objects in the xAOD framework. In MissingETComponent_v1, the internal
744 * data stores are understood to be highly linked (index parallel), and the behaviour of this object is designed to support coherent setting of contributing
745 * object links and weight components. Setting this data for a given configuration without taking advantage of the particular behaviour implemented
746 * in the xAOD::MissingETComponent::setMET and xAOD::add methods is strongly discouraged. But if these direct setters are used, clients need to make sure
747 * that the data is coherent and the store sizes match. Anything else will lead to uncontrollable behaviour and program crashes.
749 /*! @fn const std::vector<double>& xAOD::MissingETComponent_v1::wpy() const
751 * @copydetails xAOD::MissingETComponent_v1::wpx()
753 /*! @fn void xAOD::MissingETComponent_v1::setWpy(const std::vector<double>& wcv)
755 * @copydetails xAOD::MissingETComponent_v1::setWpx(const std::vector<double>&)
757 /*! @fn const std::vector<double>& xAOD::MissingETComponent_v1::wet() const
759 * copydetails xAOD::MissingETComponent_v1::wpx()
761 /*! @fn bool xAOD::MissingETComponent_v1::setWet(const std::vector<double>& wcv)
763 * @copydetails xAOD::MissingETComponent_v1::setWpx(const std::vector<double>&)
765 /*! @fn const MissingETBase::Types::metlink_t& xAOD::MissingETComponent::metLink() const
767 * Retrieve the link to the MET object.
769 * @return Reference to non-modifiable link object holding the link to the xAOD::MissingET object.
771 /*! @fn bool setMetLink(const MissingETBase::Types::metlink_t& metLnk)
773 * Set the link to the MET object.
775 * @param[in] metLnk link object referencing a xAOD::MissingET object.
777 * @warning Setting the link to the MET object should be done using xAOD::MissingETComponent_v1::setMET . This method assures
778 * the correct behaviour and allows to set the statusword at the same time.
780 /*! @fn const MissingETBase::Types::objlink_vector_t& xAOD::MissingETComponent_v1::objectLinks() const
782 * Retrieve the vector of links to the contributing objects.
784 * @return Reference to a non-modifiable vector of link objects holding references to contributing physics or signal objects.
786 * @note Scanning just the vector of links to contributing objects is insufficient to understand the contribution to MET, as this is
787 * only fully described when the associated kinematic weights are included.
789 /*! @fn bool xAOD::MissingETComponent_v1::setObjectLinks(const MissingETBase::Types::objlink_vector_t& objLnks)
791 * Set the list of links for objects contributing to MET.
793 * @param[in] objLnks vector of link objects.
795 * @warning This method is implemented to follow a convention introduced for other data objects in the xAOD framework. In MissingETComponent_v1, the internal
796 * data stores are understood to be highly linked (index parallel), and the behaviour of this object is designed to support coherent setting of contributing
797 * object links and weight components. Setting this data for a given configuration without taking advantage of the particular behaviour implemented
798 * in the xAOD::MissingETComponent::setMET and xAOD::add methods is strongly discouraged. But if these direct setters are used, clients need to make sure
799 * that the data is coherent and the store sizes match. Anything else will lead to uncontrollable behaviour and program crashes.
801 /*! @fn MissingETBase::Types::bitmask_t xAOD::MissingETComponent_t::statusWord() const
803 * Retrieve the statusword.
805 * @return Statusword associated with this MET component.
808 /*! @fn const xAOD::MissingET* xAOD::MissingETComponent_v1::metObject() const
810 * @return Pointer to non-modifiable object representing the MET object the linked objects (see MissingETComponent_v1::objects() ) contribute to.
813 /*! @fn const xAOD::MissingETContainer_v1* xAOD::MissingETComposition_v1::metObjectContainer() const
815 * @return Pointer to non-modifiable object container holding the MET object the linked object (see MissingETComponent::objects() ) contributes to.
818 /*! @fn size_t xAOD::MissingETComponent_v1::metObjectIndex() const
820 * @return Index of MET object in its container.
823 /*! @fn std::vector<const xAOD::IParticle*> xAOD::MissingETComponent_v1::objects() const
825 * This method returns all objects stored in the link list.
827 * @return List of non-modifiable contributing objects pointers.
830 /*! @fn std::vector<const xAOD::IParticle*> xAOD::MissingETComponent_v1::objects(std::vector<Weight>& kinePars) const
832 * This method returns pointer references to all objects stored in the link list, and fills vectors with (index-parallel) kinematic weights and status words.
834 * @return List of non-modifiable contributing objects pointers.
836 * @param[out] kinePars reference to modifiable list of kinematic weights
838 * @note The kinematic parameter list is cleared, to assure index-parallel filling with the returned object pointer list.
841 /*! @fn std::vector<const xAOD::IParticle*> xAOD::MissingETComponent_1::objects(const std::vector<double>* wpxPtr,const std::vector<double>* wpyPtr,const std::vector<double>* wetPtr)
843 * This method returns pointerr references to all objects stored in the link list, and assigns references to non-modifiable vectors of weight components to the corresponding arguments.
845 * @return List of non-modifiable contributing objects pointers.
847 * @param[inout] wpxPtr dataword holding pointer reference to non-modifiable list of @f$ w_{x} @f$ weight components.
848 * @param[inout] wpyPtr dataword holding pointer reference to non-modifiable list of @f$ w_{y} @f$ weight components.
849 * @param[inout] wetPtr dataword holding pointer reference to non-modifiable list of @f$ w_{\rm T} @f$ weight components.
851 * @note The difference to the behaviour of xAOD::MissingETComponent_v1::objects(std::vector<Weight>&) is that clients cannot modify the lists of weight components.
854 /*! @fn double xAOD::MissingETComponent_v1::wpx(const IParticle* pPart) const
856 * @return Stored weight component @f$ w_{x} @f$ for a given contributing object if the corresponding objecct reference is found in the
857 * contributing obbject list.
859 * @param[in] pPart pointer to non-modifiable (contributing) object
861 * @note Involves linear search.
864 /* Weight weight(size_t pIdx) const */
866 // /*! @brief Component weight @f$ w_{y} @f$
868 // * @return Stored component weight @f$ w_{y} @f$ for a given contributing object.
870 // * @param[in] pPart pointer to non-modifiable (contributing) object
872 // * @note Involves linear search.
874 // double wpy(const IParticle* pPart) const;
877 // * @return Stored component weight @f$ w_{\rm T} @f$ for a given contributing object.
879 // * @param[in] pPart pointer to non-modifiable (contributing) object
881 // * @note Involves linear search.
884 // Weight weight(const IParticle* pPart) const; /*!< @brief Get kinematic weight for a given object */
885 // /*! @brief Component weight object
887 // * @return Weight object with actually stored component weights. If the given object reference is not valid, the default weight
888 // * MissingETComponent_v1::Weight::Weight() is returned.