ATLAS Offline Software
LArMphysOverMcalSubsetCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 void
9  LArMpMcTransType* transObj,
10  MsgStream & /*log*/) const
11 {
12  transObj->initialize (persObj->m_subset.m_febIds, persObj->m_subset.m_gain);
13 
14  unsigned int nfebids = persObj->m_subset.m_febIds.size();
15  unsigned index =0;
16  const unsigned int nChannelsPerFeb = persObj->m_subset.subsetSize();
17  auto subsetIt = transObj->subsetBegin();
18  for (unsigned int i = 0; i < nfebids; ++i, ++subsetIt){
19  // Loop over channels in feb
20  for (unsigned int j = 0; j < nChannelsPerFeb; ++j){
21  subsetIt->second[j].m_data=persObj->m_values[index];
22  ++index;
23  }
24  }
25 
26  unsigned int ncorrs = persObj->m_subset.m_corrChannels.size();
28  corrs.resize(ncorrs);
29 
30  // Loop over corrections
31  for (unsigned int i = 0; i < ncorrs; ++i){
32  corrs[i].first = persObj->m_subset.m_corrChannels[i];
33  corrs[i].second.m_data=persObj->m_values[index];
34  ++index;
35  }
36  transObj->insertCorrections (std::move (corrs));
37 
38  // Copy the rest
39  transObj->setChannel (persObj->m_subset.m_channel);
40  transObj->setGroupingType (persObj->m_subset.m_groupingType);
41 
42  return;
43 }
44 
45 
46 void
49  MsgStream &log) const
50 {
51  log << MSG::ERROR << "LArMphysOverMcalSubsetCnv_p1::transToPers is obsolete" << endmsg;
52  return;
53 }
54 
LArConditionsSubset::setGroupingType
void setGroupingType(unsigned int type)
set the type of grouping - defined in LArConditionsContainerBase.h
Definition: LArConditionsSubset.h:575
LArConditionsSubset_p1::m_channel
unsigned int m_channel
Definition: LArConditionsSubset_p1.h:79
LArConditionsSubset_p1::m_corrChannels
std::vector< unsigned int > m_corrChannels
Definition: LArConditionsSubset_p1.h:76
LArMphysOverMcalSubsetCnv_p1::transToPers
virtual void transToPers(const LArMpMcTransType *transObj, LArMpMcPersType *persObj, MsgStream &log) const override
Definition: LArMphysOverMcalSubsetCnv_p1.cxx:47
index
Definition: index.py:1
LArMphysOverMcalSubset_p1::m_values
std::vector< float > m_values
Definition: LArMphysOverMcalSubset_p1.h:35
LArConditionsSubset_p1::subsetSize
unsigned int subsetSize() const
Definition: LArConditionsSubset_p1.h:82
LArConditionsSubset_p1::m_gain
unsigned int m_gain
Definition: LArConditionsSubset_p1.h:78
LArConditionsSubset_p1::m_febIds
std::vector< unsigned int > m_febIds
Definition: LArConditionsSubset_p1.h:75
LArConditionsSubset::initialize
void initialize(const std::vector< FebId > &ids, unsigned int gain)
Initialize with set of FEB ids.
Definition: LArConditionsSubset.h:529
LArConditionsSubset::CorrectionVec
std::vector< CorrectionPair > CorrectionVec
Definition: LArConditionsSubset.h:144
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArConditionsSubset_p1::m_groupingType
unsigned int m_groupingType
Definition: LArConditionsSubset_p1.h:80
LArMphysOverMcalSubsetCnv_p1::persToTrans
virtual void persToTrans(const LArMpMcPersType *persObj, LArMpMcTransType *transObj, MsgStream &log) const override
Definition: LArMphysOverMcalSubsetCnv_p1.cxx:8
LArConditionsSubset::setChannel
void setChannel(unsigned int channel)
set the COOL channel number
Definition: LArConditionsSubset.h:567
LArConditionsSubset
template class for use for I/O of conditions data
Definition: LArConditionsSubset.h:122
LArMphysOverMcalSubset_p1
persistent class container of LArConditionsSubset for LArMphysOverMcal data.
Definition: LArMphysOverMcalSubset_p1.h:30
DeMoScan.index
string index
Definition: DeMoScan.py:362
LArMphysOverMcalSubsetCnv_p1.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArConditionsSubset::subsetBegin
ConstSubsetIt subsetBegin() const
Iterators over subset.
Definition: LArConditionsSubset.h:412
LArConditionsSubset::insertCorrections
void insertCorrections(CorrectionVec &&corrs)
Insert a group of corrections.
Definition: LArConditionsSubset.h:593
LArMphysOverMcalSubset_p1::m_subset
LArConditionsSubset_p1 m_subset
Definition: LArMphysOverMcalSubset_p1.h:34