ATLAS Offline Software
LArConditionsContainer.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
20 #ifndef LARRAWCONDITIONS_LARCONDITIONSCONTAINER_H
21 #define LARRAWCONDITIONS_LARCONDITIONSCONTAINER_H
22 
52 // LAr classes
59 
60 
61 template<class T>
64  public CondMultChanCollection<LArConditionsSubset<T> >
65 {
66 
67 public:
68 
69  typedef T LArCondObj;
71  typedef unsigned int FebId;
76  typedef typename ChannelVector::const_iterator ChannelVectorIterator;
77  typedef typename Subset::size_type size_type;
79  typedef typename Subset::Reference Reference;
81  typedef typename Subset::Pointer Pointer;
83 
88  typedef typename std::map<unsigned int, ConditionsMap > GainMap;
89  typedef typename std::pair<unsigned int, ConditionsMap > GainPair;
90  typedef typename GainMap::const_iterator ConstGainMapIterator;
92 
99 
100 
103 
106 
109 
110 
112  void setPdata(const HWIdentifier id,
113  const T& payload,
114  unsigned int gain=0 );
115 
118  unsigned int gain=0) const;
119 
122  unsigned int gain=0);
123 
125  unsigned int coolChannel (const HWIdentifier id,
126  unsigned int gain=0) const;
127 
128 
129 
131  unsigned int groupingType() const;
132 
134  std::string groupingTypeToString() const;
135 
136 
139  unsigned int groupNumber(unsigned int coolChannel) const;
140 
143  unsigned int nGroups() const;
144 
146  unsigned int minGain() const;
147 
149  unsigned int nGains() const;
150 
154 
157 
161 
164 
166  unsigned int conditionsPerChannel(unsigned int coolChannel) const;
167 
169  unsigned int conditionsPerGroup(unsigned int group) const;
170 
172  unsigned int conditionsPerGain(unsigned int gain) const;
173 
175  unsigned int totalNumberOfConditions() const;
176 
178  unsigned int totalNumberOfCorrections() const;
179 
181  bool correctionsApplied() const;
182 
185 
188 
189 
191  /*
192 
193  The following methods are commented out because they don't work any more and/or don't
194  make sense any more since we have now the option to store corrections in the same subsets
195  as the regular data. (And not used anywhere anyway).
196 
197 
201  ConstCorrectionIt findCorrection (HWIdentifier channelId,
202  unsigned int gain) const;
203  ConstCorrectionIt findCorrectionEnd() const;
204 
206  void correctionIndexes(unsigned int gain,
207  std::vector<unsigned int>& indexes) const;
208 
211  ConstCorrectionIt correctionsBegin(unsigned int index) const;
212  ConstCorrectionIt correctionsEnd (unsigned int index) const;
213 
215  size_type correctionsSize(unsigned int gain) const;
216 
217 
220  void removeCorrections();
221  */
222 
223 
227  const T& cond,
228  unsigned int gain,
229  bool corrChannel = true);
230 
231 
233  ConstCorrectionIt undoCorrBegin(unsigned int gain) const;
234  ConstCorrectionIt undoCorrEnd(unsigned int gain) const;
235 
237  ConstConditionsMapIterator begin(unsigned int gain) const ;
239 
242  const std::vector<FebId>& febIds) const ;
244  const std::vector<FebId>& febIds);
245 
248  const HWIdentifier& febId) const ;
250  const HWIdentifier& febId) ;
251 
253  ConstConditionsMapIterator end (unsigned int gain) const ;
254  ConditionsMapIterator end (unsigned int gain);
255 
259 
263 
264 
267  //Returns the COOL channel numbers that have been added
268  std::vector<unsigned> completeCorrectionChannels();
269 
270 
274 
275  //Merge in data from another conditions container of the same type
277 
278 
279 protected:
280 
283 
287 
288 
289 private:
292 
295  unsigned int gain,
296  ConditionsMap& conditionsMap);
298  void sortSubsets();
299 
300 
301  class SubsetSort
302  {
303  public:
305  {
306  return (x->channel() < y->channel());
307  }
308  };
309 
310 // Hide some types from Reflex so they do not get generated in the
311 // dictionary
312 #ifndef __REFLEX__
313  typedef typename std::vector<ConstPointer> TVector;
314  typedef typename TVector::const_iterator TVectorIterator;
315  typedef typename std::map<unsigned int, TVector> TVectorMap ;
316  typedef typename TVectorMap::const_iterator TVectorMapIterator ;
320  typedef typename std::vector<CorrectionVector> CorrectionVectors;
323  typedef typename SubsetDV::iterator iterator;
324 
325 
327  /*mutable*/ bool m_correctionsApplied;
329 #endif
330 };
331 
332 
333 #ifndef __REFLEX__
335 #endif
336 
337 #endif
338 
339 
LArConditionsContainer::ChannelVector
Subset::ChannelVector ChannelVector
Definition: LArConditionsContainer.h:74
CondMultChanCollection::chan_const_iterator
ChanVec::const_iterator chan_const_iterator
Definition: CondMultChanCollection.h:58
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LArConditionsContainer::iov_size_type
MultChanCollection::iov_size_type iov_size_type
Definition: LArConditionsContainer.h:98
LArConditionsContainer::begin
ConditionsMapIterator begin(unsigned int gain)
LArConditionsContainerDB.h
LArConditionsContainer::ConstConditionsMapIterator
ConditionsMap::const_iterator ConstConditionsMapIterator
Definition: LArConditionsContainer.h:86
LArConditionsContainer::applyCorrections
StatusCode applyCorrections()
apply correction set
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
LArConditionsContainer::setPdata
void setPdata(const HWIdentifier id, const T &payload, unsigned int gain=0)
put payload in persistent data
LArConditionsContainer::SubsetSort::operator()
bool operator()(const LArConditionsSubset< T > *x, const LArConditionsSubset< T > *y)
Definition: LArConditionsContainer.h:304
LArConditionsContainer::LArConditionsContainer
LArConditionsContainer(GroupingType type)
constructor defining grouping type
LArConditionsSubset::FebPairReference
Traits::FebPairReference FebPairReference
Definition: LArConditionsSubset.h:131
LArConditionsContainer::removeConditions
void removeConditions()
Remove conditions leaving the corrections - may be needed to only write out the corrections when both...
LArConditionsContainer::iov_end
iov_const_iterator iov_end() const
LArConditionsContainer::ConstCorrectionVecIt
Subset::ConstCorrectionVecIt ConstCorrectionVecIt
Definition: LArConditionsContainer.h:319
LArPhysWaveFromStdNtupleConfig.GroupingType
GroupingType
Definition: LArPhysWaveFromStdNtupleConfig.py:95
LArConditionsContainer::LArCondObj
T LArCondObj
Definition: LArConditionsContainer.h:69
LArConditionsContainer::LArConditionsContainer
LArConditionsContainer()
default constructor
LArConditionsContainer::undoCorrections
StatusCode undoCorrections()
undo corrections that have been already applied
LArConditionsContainer::ConditionsMap
LArConditionsContainerDB< T > ConditionsMap
Typedefs for DB.
Definition: LArConditionsContainer.h:85
LArConditionsContainer::chan_begin
chan_const_iterator chan_begin() const
Access to Channel numbers via iterators - from MultChanCollection.
CondMultChanCollection
A CondMultChanCollection is a template class which can hold a collection of T* objects which are inte...
Definition: CondMultChanCollection.h:52
LArConditionsContainerDB::iteratorT
Declaration of const iterator.
Definition: LArConditionsContainerDB.h:72
LArConditionsContainer.icc
LArConditionsContainer::insertCorrection
StatusCode insertCorrection(HWIdentifier id, const T &cond, unsigned int gain, bool corrChannel=true)
access to corrections -
LArConditionsContainerBase.h
This file contain an implementation base class for LArConditionsContainer.
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArConditionsContainer::begin
ConstConditionsMapIterator begin(unsigned int gain, const std::vector< FebId > &febIds) const
get iterator for all channels for a gain, restricted to a list of FebIds
LArConditionsSubset::ConstCorrectionVecIt
CorrectionVec::const_iterator ConstCorrectionVecIt
Definition: LArConditionsSubset.h:145
LArConditionsContainer::iterator
SubsetDV::iterator iterator
Definition: LArConditionsContainer.h:323
LArConditionsContainer::m_correctionsApplied
bool m_correctionsApplied
Definition: LArConditionsContainer.h:327
LArConditionsContainer::begin
ConditionsMapIterator begin(unsigned int gain, const std::vector< FebId > &febIds)
LArConditionsContainer::iov_const_iterator
MultChanCollection::iov_const_iterator iov_const_iterator
Definition: LArConditionsContainer.h:96
LArConditionsContainer::begin
ConstConditionsMapIterator begin(unsigned int gain, const HWIdentifier &febId) const
get iterator for all channels for a gain, restricted to one Feb
LArConditionsContainer::TVectorMapIterator
TVectorMap::const_iterator TVectorMapIterator
Definition: LArConditionsContainer.h:316
LArConditionsContainer::Traits
LArConditionsSubset< T >::Traits Traits
Definition: LArConditionsContainer.h:73
LArConditionsContainer::undoCorrEnd
ConstCorrectionIt undoCorrEnd(unsigned int gain) const
LArConditionsContainer::FebId
unsigned int FebId
Typedefs for subset.
Definition: LArConditionsContainer.h:71
LArConditionsContainer::CorrectionVector
Subset::CorrectionVec CorrectionVector
Definition: LArConditionsContainer.h:318
HWIdentifier
Definition: HWIdentifier.h:13
x
#define x
LArConditionsContainer::iov_begin
iov_const_iterator iov_begin() const
Access to IOVs via iterators - from MultChanCollection.
LArConditionsContainer::conditionsPerGain
unsigned int conditionsPerGain(unsigned int gain) const
Statistics: number of conditions per gain.
LArConditionsContainer::nGains
unsigned int nGains() const
Number of gain values.
LArConditionsContainer::minGain
unsigned int minGain() const
Mininum gain value.
LArConditionsContainer::coolChannel
unsigned int coolChannel(const HWIdentifier id, unsigned int gain=0) const
Return the COOL channel number for a given online id and gain.
LArConditionsContainer
Definition: LArAutoCorrSym.h:14
LArConditionsSubset::ConstPointer
Traits::ConstPointer ConstPointer
Definition: LArConditionsSubset.h:138
LArConditionsContainer::ConstGainMapIterator
GainMap::const_iterator ConstGainMapIterator
Definition: LArConditionsContainer.h:90
LArConditionsContainer::totalNumberOfConditions
unsigned int totalNumberOfConditions() const
Statistics: total number of conditions.
LArConditionsSubset::ChannelVector
Traits::ChannelVector ChannelVector
Definition: LArConditionsSubset.h:128
LArConditionsContainer::ConstCorrectionIt
Subset::ConstCorrectionVecIt ConstCorrectionIt
Definition: LArConditionsContainer.h:78
LArConditionsContainer::empty
ConstReference empty() const
Access to standard empty value.
LArConditionsContainer::updateConditionsMap
StatusCode updateConditionsMap(FebId id, unsigned int gain, ConditionsMap &conditionsMap)
Update the ConditionsMap for a new FEB ID.
LArConditionsContainer::TVectorMap
std::map< unsigned int, TVector > TVectorMap
Definition: LArConditionsContainer.h:315
LArConditionsSubset::CorrectionVec
std::vector< CorrectionPair > CorrectionVec
Definition: LArConditionsSubset.h:144
LArConditionsContainer::end
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
LArConditionsContainer::groupingType
unsigned int groupingType() const
Type of grouping - defined in LArConditionContainerBase.h.
LArConditionsContainer::ConstPointer
Subset::ConstPointer ConstPointer
Definition: LArConditionsContainer.h:82
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
LArConditionsContainer::MultChanCollection
CondMultChanCollection< Subset > MultChanCollection
Typedefs for MultChan access.
Definition: LArConditionsContainer.h:94
LArConditionsContainer::completeCorrectionChannels
std::vector< unsigned > completeCorrectionChannels()
Fill all non-existing Correction Channels with emtpy subsets This is necessary to terminate the IOV o...
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArConditionsContainer::TVectorIterator
TVector::const_iterator TVectorIterator
Definition: LArConditionsContainer.h:314
LArConditionsContainer::get
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
LArConditionsContainer::merge
bool merge(const LArConditionsContainer< T > &other)
LArConditionsContainer::iov_size
iov_size_type iov_size() const
number of IOVs - from MultChanCollection
LArConditionsContainer::conditionsPerGroup
unsigned int conditionsPerGroup(unsigned int group) const
Statistics: number of conditions per group.
LArConditionsContainer::CorrectionVectors
std::vector< CorrectionVector > CorrectionVectors
Definition: LArConditionsContainer.h:320
LArConditionsContainer::chan_end
chan_const_iterator chan_end() const
LArConditionsContainer::ChannelVectorIterator
ChannelVector::const_iterator ChannelVectorIterator
Definition: LArConditionsContainer.h:76
CondMultChanCollection::chan_size_type
ChanVec::size_type chan_size_type
Definition: CondMultChanCollection.h:60
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LArConditionsContainerBase
This is a non-template implementation base class for LArConditionsContainer.
Definition: LArConditionsContainerBase.h:40
LArConditionsContainer::ConditionsMapIterator
ConditionsMap::iterator ConditionsMapIterator
Definition: LArConditionsContainer.h:87
LArConditionsContainerDB
LArConditionsContainerDB template class Author: Walter Lampl Initial Version: April,...
Definition: LArConditionsContainerDB.h:48
LArConditionsContainer::m_dummyCorrIt
ConstCorrectionIt m_dummyCorrIt
Dummy iterator (returned if requested for invalid gain)
Definition: LArConditionsContainer.h:291
CondMultChanCollection::iov_const_iterator
IOVVec::const_iterator iov_const_iterator
Definition: CondMultChanCollection.h:61
LArConditionsContainer::TVector
std::vector< ConstPointer > TVector
Definition: LArConditionsContainer.h:313
LArConditionsSubset::ConstReference
Traits::ConstReference ConstReference
Definition: LArConditionsSubset.h:136
LArConditionsContainer::totalNumberOfCorrections
unsigned int totalNumberOfCorrections() const
Statistics: total number of corrections.
LArConditionsContainer::chan_size_type
MultChanCollection::chan_size_type chan_size_type
Definition: LArConditionsContainer.h:97
LArConditionsContainer::chan_size
chan_size_type chan_size() const
number of channels - from MultChanCollection
CondMultChanCollection::iov_size_type
IOVVec::size_type iov_size_type
Definition: CondMultChanCollection.h:63
LArConditionsSubset
template class for use for I/O of conditions data
Definition: LArConditionsSubset.h:122
LArConditionsContainer::m_cached
GainMap m_cached
Map indexed by gain providing pointers into the data in the CondMultChanCollection.
Definition: LArConditionsContainer.h:286
LArConditionsContainer::nGroups
unsigned int nGroups() const
Number of groups - minimum is 2 (1 correction group, 1 FEB ID group)
HWIdentifier.h
LArConditionsSubset.h
This file defines the template class used for I/O of conditions data.
IdentifierHash.h
LArConditionsSubset::CorrectionPair
std::pair< ChannelId, T > CorrectionPair
Definition: LArConditionsSubset.h:143
LArConditionsContainer::get
Reference get(const HWIdentifier id, unsigned int gain=0)
non-const get data with online identifier
LArConditionsContainer::m_correctionsUndo
CorrectionVectors m_correctionsUndo
Definition: LArConditionsContainer.h:326
LArConditionsContainer::size_type
Subset::size_type size_type
Definition: LArConditionsContainer.h:77
LArConditionsContainer::undoCorrBegin
ConstCorrectionIt undoCorrBegin(unsigned int gain) const
get iterator over the Undo-Vector for a certain gain
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
LArConditionsContainer::Subset
LArConditionsSubset< T > Subset
Definition: LArConditionsContainer.h:72
LArConditionsContainer::SubsetDV
DataVector< Subset > SubsetDV
Definition: LArConditionsContainer.h:321
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
y
#define y
CondMultChanCollection.h
This file defines the template class used to register the tokens of T* in a COOL multchannel folder.
LArConditionsContainer::initialize
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
LArConditionsContainer::GainMap
std::map< unsigned int, ConditionsMap > GainMap
Definition: LArConditionsContainer.h:88
LArConditionsContainer::GainMapIterator
GainMap::iterator GainMapIterator
Definition: LArConditionsContainer.h:91
LArConditionsContainer::ConstReference
Subset::ConstReference ConstReference
Definition: LArConditionsContainer.h:80
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArConditionsContainer::CorrectionPair
Subset::CorrectionPair CorrectionPair
Definition: LArConditionsContainer.h:317
LArConditionsContainer::conditionsPerChannel
unsigned int conditionsPerChannel(unsigned int coolChannel) const
Statistics: number of conditions per COOL channel.
LArConditionsContainer::begin
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
LArConditionsContainer::Pointer
Subset::Pointer Pointer
Definition: LArConditionsContainer.h:81
LArConditionsContainer::removeConditionsChannel
void removeConditionsChannel(unsigned int coolChannel)
Remove the conditions for a specific cool channel - e.g.
LArConditionsSubset::size_type
CorrectionVec::size_type size_type
Definition: LArConditionsSubset.h:147
LArConditionsSubset::Reference
Traits::Reference Reference
Definition: LArConditionsSubset.h:135
LArConditionsContainer::sortSubsets
void sortSubsets()
Sort subsets by channel number.
LArConditionsSubset::Pointer
Traits::Pointer Pointer
Definition: LArConditionsSubset.h:137
LArConditionsContainer::~LArConditionsContainer
virtual ~LArConditionsContainer()
destructor
LArConditionsContainer::Reference
Subset::Reference Reference
Definition: LArConditionsContainer.h:79
LArConditionsContainer::GainPair
std::pair< unsigned int, ConditionsMap > GainPair
Definition: LArConditionsContainer.h:89
LArConditionsContainer::chan_const_iterator
MultChanCollection::chan_const_iterator chan_const_iterator
Definition: LArConditionsContainer.h:95
LArConditionsContainer::const_iterator
SubsetDV::const_iterator const_iterator
Definition: LArConditionsContainer.h:322
LArConditionsContainer::groupNumber
unsigned int groupNumber(unsigned int coolChannel) const
Return the group number of a COOL channel (0 - correction group, 1-N for FEB ID groups)
LArConditionsContainer::end
ConditionsMapIterator end(unsigned int gain)
LArConditionsContainer::FebPairReference
Subset::FebPairReference FebPairReference
Definition: LArConditionsContainer.h:75
LArConditionsContainer::groupingTypeToString
std::string groupingTypeToString() const
Type of grouping - defined in LArConditionContainerBase.h.
LArConditionsContainer::SubsetSort
Definition: LArConditionsContainer.h:302
LArConditionsContainer::begin
ConditionsMapIterator begin(unsigned int gain, const HWIdentifier &febId)
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
LArConditionsSubsetTraits
Traits class giving the types to use for the objects contained within the subset.
Definition: LArConditionsSubset.h:65
LArConditionsContainer::correctionsApplied
bool correctionsApplied() const
Have corrections been applied?
LArConditionsContainer::m_emptyCorrectionVec
CorrectionVector m_emptyCorrectionVec
Definition: LArConditionsContainer.h:328