ATLAS Offline Software
Loading...
Searching...
No Matches
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
19
20#ifndef LARRAWCONDITIONS_LARCONDITIONSCONTAINER_H
21#define LARRAWCONDITIONS_LARCONDITIONSCONTAINER_H
51
52// LAr classes
59
60
61template<class T>
64 public CondMultChanCollection<LArConditionsSubset<T> >
65{
66
67public:
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;
91 typedef typename GainMap::iterator GainMapIterator;
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
184 StatusCode applyCorrections();
185
187 StatusCode undoCorrections();
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 ;
238 ConditionsMapIterator begin(unsigned int gain);
239
242 const std::vector<FebId>& febIds) const ;
243 ConditionsMapIterator begin(unsigned int gain,
244 const std::vector<FebId>& febIds);
245
248 const HWIdentifier& febId) const ;
249 ConditionsMapIterator begin(unsigned int gain,
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
273 virtual StatusCode initialize();
274
275 //Merge in data from another conditions container of the same type
277
278
279protected:
280
283
287
288
289private:
292
295 unsigned int gain,
296 ConditionsMap& conditionsMap);
299
300
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
This file defines the template class used to register the tokens of T* in a COOL multchannel folder.
This file contain an implementation base class for LArConditionsContainer.
This file defines the template class used for I/O of conditions data.
#define y
#define x
ChanVec::const_iterator chan_const_iterator
Derived DataVector<T>.
Definition DataVector.h:795
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
LArConditionsContainerBase()
Default constructor.
LArConditionsContainerDB template class Author: Walter Lampl Initial Version: April,...
iteratorT< ConditionsMapIterator, ChannelIt, Pointer, Reference > iterator
iteratorT< ConstConditionsMapIterator, ConstChannelIt, ConstPointer, ConstReference > const_iterator
bool operator()(const LArConditionsSubset< T > *x, const LArConditionsSubset< T > *y)
MultChanCollection::iov_size_type iov_size_type
bool merge(const LArConditionsContainer< T > &other)
void removeConditions()
Remove conditions leaving the corrections - may be needed to only write out the corrections when both...
StatusCode insertCorrection(HWIdentifier id, const T &cond, unsigned int gain, bool corrChannel=true)
access to corrections -
bool correctionsApplied() const
Have corrections been applied?
void setPdata(const HWIdentifier id, const T &payload, unsigned int gain=0)
put payload in persistent data
unsigned int coolChannel(const HWIdentifier id, unsigned int gain=0) const
Return the COOL channel number for a given online id and gain.
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< LArAutoCorr > Subset
ConditionsMap::const_iterator ConstConditionsMapIterator
iov_const_iterator iov_begin() const
Access to IOVs via iterators - from MultChanCollection.
Subset::ConstCorrectionVecIt ConstCorrectionVecIt
unsigned int nGroups() const
Number of groups - minimum is 2 (1 correction group, 1 FEB ID group)
std::pair< unsigned int, ConditionsMap > GainPair
Reference get(const HWIdentifier id, unsigned int gain=0)
non-const get data with online identifier
StatusCode applyCorrections()
apply correction set
StatusCode undoCorrections()
undo corrections that have been already applied
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
void removeConditionsChannel(unsigned int coolChannel)
Remove the conditions for a specific cool channel - e.g.
virtual ~LArConditionsContainer()
destructor
chan_const_iterator chan_begin() const
Access to Channel numbers via iterators - from MultChanCollection.
iov_const_iterator iov_end() const
ConstCorrectionIt undoCorrBegin(unsigned int gain) const
get iterator over the Undo-Vector for a certain gain
CondMultChanCollection< Subset > MultChanCollection
ConstCorrectionIt undoCorrEnd(unsigned int gain) const
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
unsigned int conditionsPerGain(unsigned int gain) const
Statistics: number of conditions per gain.
ConditionsMapIterator begin(unsigned int gain, const std::vector< FebId > &febIds)
unsigned int conditionsPerChannel(unsigned int coolChannel) const
Statistics: number of conditions per COOL channel.
std::map< unsigned int, ConditionsMap > GainMap
unsigned int groupNumber(unsigned int coolChannel) const
Return the group number of a COOL channel (0 - correction group, 1-N for FEB ID groups)
std::vector< CorrectionVector > CorrectionVectors
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
chan_size_type chan_size() const
number of channels - from MultChanCollection
std::map< unsigned int, TVector > TVectorMap
ConditionsMapIterator begin(unsigned int gain, const HWIdentifier &febId)
ConstReference empty() const
Access to standard empty value.
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
void sortSubsets()
Sort subsets by channel number.
unsigned int conditionsPerGroup(unsigned int group) const
Statistics: number of conditions per group.
iov_size_type iov_size() const
number of IOVs - from MultChanCollection
Subset::ConstCorrectionVecIt ConstCorrectionIt
LArConditionsSubset< LArAutoCorr >::Traits Traits
MultChanCollection::chan_const_iterator chan_const_iterator
StatusCode updateConditionsMap(FebId id, unsigned int gain, ConditionsMap &conditionsMap)
Update the ConditionsMap for a new FEB ID.
MultChanCollection::iov_const_iterator iov_const_iterator
LArConditionsContainer()
default constructor
unsigned int totalNumberOfCorrections() const
Statistics: total number of corrections.
std::string groupingTypeToString() const
Type of grouping - defined in LArConditionContainerBase.h.
ConstConditionsMapIterator begin(unsigned int gain, const HWIdentifier &febId) const
get iterator for all channels for a gain, restricted to one Feb
unsigned int totalNumberOfConditions() const
Statistics: total number of conditions.
LArConditionsContainerDB< LArAutoCorr > ConditionsMap
chan_const_iterator chan_end() const
LArConditionsContainer(GroupingType type)
constructor defining grouping type
MultChanCollection::chan_size_type chan_size_type
ConditionsMapIterator begin(unsigned int gain)
unsigned int minGain() const
Mininum gain value.
unsigned int nGains() const
Number of gain values.
unsigned int groupingType() const
Type of grouping - defined in LArConditionContainerBase.h.
ChannelVector::const_iterator ChannelVectorIterator
ConditionsMapIterator end(unsigned int gain)
std::vector< unsigned > completeCorrectionChannels()
Fill all non-existing Correction Channels with emtpy subsets This is necessary to terminate the IOV o...
template class for use for I/O of conditions data
CorrectionVec::const_iterator ConstCorrectionVecIt
std::pair< ChannelId, T > CorrectionPair
Traits::ConstReference ConstReference
Traits::FebPairReference FebPairReference
LArConditionsSubsetTraits< T > Traits
Public typedefs for FEB id and channel vector - Subset.
std::vector< CorrectionPair > CorrectionVec
Traits::ConstPointer ConstPointer
Traits::Reference Reference
Traits::ChannelVector ChannelVector
CorrectionVec::size_type size_type