16#ifndef LARRAWCONDITIONS_LARCONDITIONSSUBSET_H
17#define LARRAWCONDITIONS_LARCONDITIONSSUBSET_H
76 typedef typename std::pair<FebId, ChannelVector>
FebPair;
82 static const T dum {};
94 template <
class OTHERIT,
class COPIER>
103template <
class OTHERIT,
class COPIER>
109 to.reserve (std::distance (otherBeg, otherEnd));
110 for (; otherBeg != otherEnd; ++otherBeg) {
112 for (
size_t i = 0; i < otherBeg->second.size(); i++) {
113 copier (otherBeg->second[i], v[i]);
115 to.emplace_back (otherBeg->first, std::move (v));
162 template <
class U,
class COPIER>
251 return (
x.first <
y.first);
255 typedef typename std::map<FebId, unsigned int>
SubsetMap;
280 for (
unsigned int i = 0; i <
m_subset.size(); ++i) {
325 for (
unsigned int i = 0; i < ids.size(); ++i) {
338template <
class U,
class COPIER>
349 size_t corrsz = other.correctionVecSize();
350 auto otherCorr = other.correctionVecBegin();
352 for (
size_t i = 0; i < corrsz; i++) {
378 typename SubsetMap::const_iterator it =
m_subsetMap.find(febID);
380 unsigned int index = (*it).second;
398 typename SubsetMap::const_iterator it =
m_subsetMap.find(febID);
400 unsigned int index = (*it).second;
517 unsigned int tot = 0;
518 for (
unsigned int i = 0; i <
m_subset.size(); ++i) {
538 for (
unsigned int i = 0; i < ids.size(); ++i) {
This file contain an implementation base class for LArConditionsContainer.
Traits class giving the types to use for the objects contained within the subset.
std::vector< FebPair > SubsetVector
std::vector< T > ChannelVector
std::pair< FebId, ChannelVector > FebPair
const std::vector< T > ConstChannelVector
FebPair & FebPairReference
ChannelVector * ChannelVectorPointer
static void copySubset(OTHERIT otherBeg, OTHERIT otherEnd, SubsetVector &to, COPIER copier)
Helper used by LArConditionsSubset::assign.
bool operator()(const CorrectionPair &x, const CorrectionPair &y)
CorrectionVec::const_iterator ConstCorrectionVecIt
std::pair< ChannelId, LArAutoCorrP1 > CorrectionPair
Traits::ConstReference ConstReference
size_type subsetSize() const
Size of subset.
void initialize(const std::vector< FebId > &ids, unsigned int gain)
Initialize with set of FEB ids.
ConstSubsetIt subsetEnd() const
void shrink_to_fit()
Reallocate to match size actually used.
unsigned channelVectorSize() const
unsigned int nConditions() const
Number of conditions objects in this subset.
ConstCorrectionVecIt correctionVecBegin() const
Iterators over channel set.
unsigned int groupingType() const
Type of grouping - defined in LArConditionsContainerBase.h.
Traits::SubsetVector SubsetVector
CorrectionVec m_correctionVec
SubsetVector::iterator SubsetIt
void fillMap()
Fill map from vector.
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
LArConditionsSubset(unsigned int gain)
Constructor for corrections - only need gain.
ConstCorrectionVecIt correctionVecEnd() const
SubsetVector::const_iterator ConstSubsetIt
void setGroupingType(unsigned int type)
set the type of grouping - defined in LArConditionsContainerBase.h
Traits::FebPairReference FebPairReference
unsigned int m_groupingType
ConstSubsetIt subsetBegin() const
Iterators over subset.
unsigned int gain() const
CorrectionVec::iterator CorrectionVecIt
LArConditionsSubsetTraits< LArAutoCorrP1 > Traits
size_type correctionVecSize() const
Size of channel set.
std::vector< CorrectionPair > CorrectionVec
Traits::ConstPointer ConstPointer
Traits::Reference Reference
std::map< FebId, unsigned int > SubsetMap
SubsetIt findChannelVector(FebId febId)
Access to a channel vector of a given FEB.
void insertCorrection(ChannelId id, const T &cond)
Insert a new channel id / T pair correction.
Traits::ChannelVector ChannelVector
void setGain(unsigned int gain)
set gain
LArConditionsSubset(const std::vector< FebId > &ids, unsigned int gain)
Constructor with initializing set of FEB ids.
unsigned int channel() const
Access to the COOL channel number.
ConstCorrectionVecIt findConditionsObj(ChannelId id) const
Access to a conditions object for a given channel id - searches channel set ONLY.
void insertCorrections(CorrectionVec &&corrs)
Insert a group of corrections.
void setChannel(unsigned int channel)
set the COOL channel number
ConstSubsetIt findChannelVector(FebId febId) const
Access to a channel vector of a given FEB.
Traits::ConstChannelVector ConstChannelVector
LArConditionsSubset()
Default constructor.
CorrectionVec::size_type size_type
virtual ~LArConditionsSubset()
destructor
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.