ATLAS Offline Software
EventFeatureStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 //EventFeature EventFeatureStore::m_invalidConstReference = EventFeature();
9 //EventFeature EventFeatureStore::m_invalidReference = EventFeature();
10 
11 
13  : DataVector<EventFeature>(own)
14 { }
15 
17 { }
18 
20  const std::string& tag,
21  const EventFeature* &pFeature) const
22 {
23  const_iterator fFeat(this->find(type,tag));
24  if ( fFeat != this->end() )
25  {
26  pFeature = *fFeat;
27  return true;
28  }
29  return false;
30 }
31 
33  const std::string& tag,
34  EventFeature* &pFeature)
35 {
36  iterator fFeat(this->find(type,tag));
37  if ( fFeat != this->end() )
38  {
39  pFeature = *fFeat;
40  return true;
41  }
42  return false;
43 }
44 
46  type,
47  const std::string& tag)
48 {
49  iterator fFeat(this->begin());
50  iterator lFeat(this->end());
51  while ( fFeat != lFeat && ( type != (*fFeat)->type() ||
52  tag != (*fFeat)->tag() ) )
53  { ++fFeat; }
54  return fFeat;
55 }
56 
59  const std::string& tag) const
60 {
61  const_iterator fFeat(this->begin());
62  const_iterator lFeat(this->end());
63  while ( fFeat != lFeat && ( type != (*fFeat)->type() ||
64  tag != (*fFeat)->tag() ) )
65  { ++fFeat; }
66  return fFeat;
67 }
68 
70 {
71  iterator fFeat(this->begin());
72  iterator lFeat(this->end());
73  while ( fFeat != lFeat && (*fFeat) != pFeature ) { ++fFeat; }
74  return fFeat;
75 }
76 
78 EventFeatureStore::find(const EventFeature* pFeature) const
79 {
80  const_iterator fFeat(this->begin());
81  const_iterator lFeat(this->end());
82  while ( fFeat != lFeat && (*fFeat) != pFeature ) { ++fFeat; }
83  return fFeat;
84 }
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
EventFeatureStore::EventFeatureStore
EventFeatureStore(SG::OwnershipPolicy own=SG::OWN_ELEMENTS)
Standard DataVector constructor.
Definition: EventFeatureStore.cxx:12
EventFeatureStore.h
EventFeatureStore::find
virtual const_iterator find(EventFeature::FeatureType type, const std::string &tag) const
Find EventFeature by identifiers (const access)
Definition: EventFeatureStore.cxx:58
EventFeature
Basic container for event feature data.
Definition: EventFeature.h:18
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
EventFeatureStore::~EventFeatureStore
virtual ~EventFeatureStore()
Baseclass destructor.
Definition: EventFeatureStore.cxx:16
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
EventFeature::FeatureType
FeatureType
@
Definition: EventFeature.h:24
DataVector< EventFeature >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
EventFeatureStore::retrieve
virtual bool retrieve(EventFeature::FeatureType type, const std::string &tag, const EventFeature *&pFeature) const
Retrieve method for EventFeature (const retrieve)
Definition: EventFeatureStore.cxx:19
DataVector< EventFeature >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.