ATLAS Offline Software
MissingETContainer_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 
7 #include <functional>
8 
9 using namespace xAOD;
10 
12  : DataVector<xAOD::MissingET_v1>(ownPolicy,trackIndices)
13 { }
14 
16  SG::OwnershipPolicy ownPolicy,SG::IndexTrackingPolicy trackIndices)
17  : DataVector<xAOD::MissingET_v1>(first,last,ownPolicy,trackIndices)
18 { }
19 
21 { }
22 
23 
24 const MissingET_v1* MissingETContainer_v1::operator[](const std::string& name) const
25 {
26  const_iterator fObj(this->find(name));
27  return fObj != this->end() ? *fObj : (const MissingET_v1*)nullptr;
28 }
29 
31 {
32  iterator fObj(this->find(name));
33  return fObj != this->end() ? *fObj : (MissingET_v1*)nullptr;
34 }
35 
36 // MissingETContainer_v1::const_iterator MissingETContainer_v1::find(const std::string& name) const
37 // {
38 // const_iterator fObj(this->begin());
39 // const_iterator lObj(this->end());
40 // while ( fObj != lObj && (*fObj)->name() != name ) { ++fObj; }
41 // return fObj;
42 // }
43 
44 // MissingETContainer_v1::iterator MissingETContainer_v1::find(const std::string& name)
45 // {
46 // iterator fObj(this->begin());
47 // iterator lObj(this->end());
48 // while ( fObj != lObj && (*fObj)->name() != name ) { ++fObj; }
49 // return fObj;
50 // }
51 
53 {
54  const_iterator fObj(this->begin());
55  const_iterator lObj(this->end());
56  size_t hash_tmp = std::hash<std::string>()(name);
57  while ( fObj != lObj && (*fObj)->nameHash() != hash_tmp ) { ++fObj; }
58  return fObj;
59 }
60 
62 {
63  iterator fObj(this->begin());
64  iterator lObj(this->end());
65  size_t hash_tmp = std::hash<std::string>()(name);
66  while ( fObj != lObj && (*fObj)->nameHash() != hash_tmp ) { ++fObj; }
67  return fObj;
68 }
69 
71 {
72  const_iterator fObj(this->begin());
73  const_iterator lObj(this->end());
74  while ( fObj != lObj && !MissingETBase::Source::hasPattern((*fObj)->source(),src) ) { ++fObj; }
75  return fObj;
76 }
77 
79 {
80  iterator fObj(this->begin());
81  iterator lObj(this->end());
82  while ( fObj != lObj && !MissingETBase::Source::hasPattern((*fObj)->source(),src) ) { ++fObj; }
83  return fObj;
84 }
85 
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
MissingETBase::Source::hasPattern
static bool hasPattern(E bits, F mask)
Generic check for given pattern.
Definition: MissingETBase.h:382
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
MissingETContainer_v1.h
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
xAOD::MissingETContainer_v1::operator[]
const MissingET_v1 * operator[](const std::string &name) const
Allocate a non-modifiable xAOD::MissingET_v1 object by name.
Definition: MissingETContainer_v1.cxx:24
xAOD::MissingETContainer_v1::find
const_iterator find(const std::string &name) const
Find non-modifiable MET object by name.
Definition: MissingETContainer_v1.cxx:52
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
xAOD::MissingETContainer_v1::MissingETContainer_v1
MissingETContainer_v1(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
Default constructor.
Definition: MissingETContainer_v1.cxx:11
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DataVector< MissingET_v1 >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DeMoScan.first
bool first
Definition: DeMoScan.py:536
SG::IndexTrackingPolicy
IndexTrackingPolicy
Definition: IndexTrackingPolicy.h:37
xAOD::MissingETContainer_v1::~MissingETContainer_v1
virtual ~MissingETContainer_v1()
Base class destructor.
Definition: MissingETContainer_v1.cxx:20
DataVector< MissingET_v1 >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.