|
ATLAS Offline Software
|
Go to the documentation of this file.
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>
103 template <
class OTHERIT,
class COPIER>
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>
200 unsigned int gain()
const;
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) {
281 m_subsetMap[m_subset[
i].first] =
i;
325 for (
unsigned int i = 0;
i <
ids.size(); ++
i) {
338 template <
class U,
class COPIER>
343 m_gain =
other.gain();
344 m_channel =
other.channel();
345 m_groupingType =
other.groupingType();
347 Traits::copySubset (
other.subsetBegin(),
other.subsetEnd(), m_subset, copier);
349 size_t corrsz =
other.correctionVecSize();
350 auto otherCorr =
other.correctionVecBegin();
351 m_correctionVec.resize (corrsz);
352 for (
size_t i = 0;
i < corrsz;
i++) {
353 m_correctionVec[
i].first = otherCorr[
i].first;
378 typename SubsetMap::const_iterator
it = m_subsetMap.find(febID);
379 if (
it != m_subsetMap.end()) {
380 unsigned int index = (*it).second;
381 if (
index < m_subset.size()) {
384 m_subset[
index].second.resize(channelVectorSize());
386 return (m_subset.begin() +
index);
389 return (m_subset.end());
398 typename SubsetMap::const_iterator
it = m_subsetMap.find(febID);
399 if (
it != m_subsetMap.end()) {
400 unsigned int index = (*it).second;
401 if (
index < m_subset.size()) {
402 return (m_subset.begin() +
index);
405 return (m_subset.end());
414 return (m_subset.begin());
422 return (m_subset.end());
430 return (m_subset.begin());
438 return (m_subset.end());
446 return (m_subset.size());
454 m_correctionVec.end(),
457 if ( m_correctionVec.end() !=
result &&
id !=
result->first ) {
458 result = m_correctionVec.end();
467 return (m_correctionVec.begin());
474 return (m_correctionVec.end());
483 return (m_correctionVec.size());
509 return (m_groupingType);
517 unsigned int tot = 0;
518 for (
unsigned int i = 0;
i < m_subset.size(); ++
i) {
519 tot += m_subset[
i].second.size();
531 m_correctionVec.clear();
534 m_subset.resize(
ids.size());
538 for (
unsigned int i = 0;
i <
ids.size(); ++
i) {
539 m_subset[
i].first =
ids[
i];
540 m_subset[
i].second.resize(channelVectorSize());
552 m_subset.shrink_to_fit();
577 m_groupingType =
type;
586 std::sort(m_correctionVec.begin(), m_correctionVec.end(),
PairSort());
595 if (m_correctionVec.empty()) {
596 m_correctionVec = std::move (corrs);
599 m_correctionVec.insert (m_correctionVec.end(), corrs.begin(), corrs.end());
600 std::sort(m_correctionVec.begin(), m_correctionVec.end(),
PairSort());
616 #endif // LARRAWCONDITIONS_LARCONDITIONSSUBSET_H
JetConstituentVector::iterator iterator
void setGroupingType(unsigned int type)
set the type of grouping - defined in LArConditionsContainerBase.h
std::vector< T > ChannelVector
CorrectionVec::iterator CorrectionVecIt
std::map< FebId, unsigned int > SubsetMap
Traits::FebPairReference FebPairReference
unsigned int nConditions() const
Number of conditions objects in this subset.
Traits::SubsetVector SubsetVector
LArConditionsSubset()
Default constructor.
ChannelVector * ChannelVectorPointer
This file contain an implementation base class for LArConditionsContainer.
unsigned channelVectorSize() const
CorrectionVec::const_iterator ConstCorrectionVecIt
FebPair & FebPairReference
void shrink_to_fit()
Reallocate to match size actually used.
void fillMap()
Fill map from vector.
ConstCorrectionVecIt correctionVecEnd() const
SubsetVector::const_iterator ConstSubsetIt
CorrectionVec m_correctionVec
LArConditionsSubsetTraits< T > Traits
Public typedefs for FEB id and channel vector - Subset.
T Payload
Public typedefs for channel id and T vector - CorrectionSet.
std::vector< FebPair > SubsetVector
Traits::ConstPointer ConstPointer
Traits::ChannelVector ChannelVector
void initialize(const std::vector< FebId > &ids, unsigned int gain)
Initialize with set of FEB ids.
std::vector< CorrectionPair > CorrectionVec
SubsetVector::iterator SubsetIt
unsigned int channel() const
Access to the COOL channel number.
const std::vector< T > ConstChannelVector
void setChannel(unsigned int channel)
set the COOL channel number
void setGain(unsigned int gain)
set gain
virtual ~LArConditionsSubset()
destructor
std::pair< FebId, ChannelVector > FebPair
Traits::ConstReference ConstReference
template class for use for I/O of conditions data
std::pair< ChannelId, T > CorrectionPair
size_type subsetSize() const
Size of subset.
ConstSubsetIt findChannelVector(FebId febId) const
Access to a channel vector of a given FEB.
Traits::ConstChannelVector ConstChannelVector
unsigned int m_groupingType
void insertCorrection(ChannelId id, const T &cond)
Insert a new channel id / T pair correction.
unsigned int gain() const
Access to gain.
size_type correctionVecSize() const
Size of channel set.
CorrectionVec::size_type size_type
bool operator()(const CorrectionPair &x, const CorrectionPair &y)
Traits::Reference Reference
static void copySubset(OTHERIT otherBeg, OTHERIT otherEnd, SubsetVector &to, COPIER copier)
Helper used by LArConditionsSubset::assign.
ConstSubsetIt subsetBegin() const
Iterators over subset.
ConstSubsetIt subsetEnd() const
ConstCorrectionVecIt findConditionsObj(ChannelId id) const
Access to a conditions object for a given channel id - searches channel set ONLY.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
ConstCorrectionVecIt correctionVecBegin() const
Iterators over channel set.
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
void insertCorrections(CorrectionVec &&corrs)
Insert a group of corrections.
Traits class giving the types to use for the objects contained within the subset.
unsigned int groupingType() const
Type of grouping - defined in LArConditionsContainerBase.h.