|
ATLAS Offline Software
|
Go to the documentation of this file.
13 MsgStream &
log)
const
23 unsigned int waveIndex = 0;
24 unsigned int chIndex = 0;
26 unsigned int ifebWithData = 0;
29 for (
unsigned int i = 0;
i < nfebids; ++
i, ++subsetIt){
32 unsigned int febid = subsetIt->first;
35 bool hasSparseData =
false;
36 unsigned int chansSet = 0;
37 unsigned int chansOffset = 0;
49 for (
unsigned int j = 0; j < nChannelsPerFeb; ++j){
50 bool copyChannel =
true;
52 if (!(chansSet & (1 << (j - chansOffset)))) {
58 if (j%32 == 31 && j < nChannelsPerFeb-2) {
69 unsigned int f =persObj->
m_flag[chIndex];
70 int dac =(persObj->
m_DAC[chIndex])&0xFFFF;
71 int pulsed =(persObj->
m_DAC[chIndex])>>16;
73 std::vector<double>
val;
74 std::vector<double>
err;
100 for (
unsigned int i = 0;
i < ncorrs; ++
i){
102 if (chIndex >= persObj->
m_dt.size()) {
104 <<
"LArCaliWaveSubsetCnv_p1::persToTrans - CaliWave index too large: WaveIndex/sizeInFile "
105 << chIndex <<
" " << persObj->
m_dt.size() <<
" "
114 double time = persObj->
m_dt[chIndex];
115 unsigned int f = persObj->
m_flag[chIndex];
116 int dac = (persObj->
m_DAC[chIndex])&0xFFFF;
117 int pulsed =(persObj->
m_DAC[chIndex])>>16;
119 std::vector<double>
val;
120 std::vector<double>
err;
121 std::vector<int> tri;
124 log << MSG::ERROR <<
"Persistent LArCaliWave object is inconsistent. i=" <<
i <<
" WaveIndes="
158 unsigned int nsubsetsNotEmpty = 0;
159 unsigned int nchans = 0;
164 std::vector<unsigned int> febsWithSparseData;
166 const auto subsetEnd = transObj->
subsetEnd();
168 subsetIt != subsetEnd;
171 unsigned int nfebChans = subsetIt->second.size();
174 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
175 log << MSG::ERROR <<
"LArCaliWaveSubsetCnv_p1::transToPers - found incorrect number of channels per feb: " << nfebChans<<
endmsg;
179 if (nfebChans) ++nsubsetsNotEmpty;
181 bool isSparse =
false;
182 for (
unsigned int j = 0; j < nfebChans; ++j) {
185 if (!isSparse && CWV.size() == 0) {
187 febsWithSparseData.push_back(subsetIt->first);
208 if (febsWithSparseData.size())
211 persObj->
m_dt.reserve(nchans);
215 persObj->
m_flag.reserve(nchans);
220 subsetIt != subsetEnd;
223 unsigned int nfebChans = subsetIt->second.size();
225 if (nfebChans == 0)
continue;
227 unsigned int febid = subsetIt->first;
231 if (counterSparse < (
int)febsWithSparseData.size() && febid == febsWithSparseData[counterSparse]){
237 unsigned int chansSet = 0;
238 unsigned int chansOffset = 0;
239 for (
unsigned int j = 0; j < nfebChans; ++j){
241 bool saveAmplitudes=
true;
244 if (subsetIt->second[j].size() > 0) {
246 assert (j >= chansOffset && (j - chansOffset) <= 31);
247 chansSet |= (1 << (j - chansOffset));
252 saveAmplitudes =
false;
257 if (j == (chansOffset + 31)) {
265 if (saveAmplitudes) {
267 const std::vector<double>&
w=CWV[0].getWave();
268 const std::vector<double>&
e=CWV[0].getErrors();
269 const std::vector<int>&
t=CWV[0].getTriggers();
270 persObj->
m_dt.push_back(CWV[0].getDt());
272 persObj->
m_DAC.push_back(CWV[0].getDAC() | (CWV[0].getIsPulsedInt()<<16));
273 for (
unsigned int k = 0;
k<
w.size(); ++
k){
293 if (CWV.empty())
continue;
296 const std::vector<double>&
w=CWV[0].getWave();
297 const std::vector<double>&
e=CWV[0].getErrors();
298 const std::vector<int>&
t=CWV[0].getTriggers();
299 persObj->
m_dt.push_back(CWV[0].getDt());
301 persObj->
m_DAC.push_back(CWV[0].getDAC() | (CWV[0].getIsPulsedInt()<<16));
303 for (
unsigned int k = 0;
k<
w.size(); ++
k){
void setGroupingType(unsigned int type)
set the type of grouping - defined in LArConditionsContainerBase.h
std::vector< unsigned int > m_corrChannels
std::vector< unsigned int > m_febsWithSparseData
virtual void persToTrans(const LArCWPersType *persObj, LArCWTransType *transObj, MsgStream &log) const override
unsigned channelVectorSize() const
unsigned int subsetSize() const
ConstCorrectionVecIt correctionVecEnd() const
std::vector< int > m_vTriggers
LArConditionsSubset_p1 m_subset
std::vector< float > m_vAmplitudes
std::vector< float > m_dt
std::vector< unsigned int > m_febIds
void initialize(const std::vector< FebId > &ids, unsigned int gain)
Initialize with set of FEB ids.
std::vector< CorrectionPair > CorrectionVec
virtual void transToPers(const LArCWTransType *transObj, LArCWPersType *persObj, MsgStream &log) const override
unsigned int m_groupingType
unsigned int channel() const
Access to the COOL channel number.
std::vector< float > m_vErrors
void setChannel(unsigned int channel)
set the COOL channel number
std::vector< unsigned > m_flag
template class for use for I/O of conditions data
persistent class container of LArCaliWave data.
This file defines the template class used for I/O of conditions data.
unsigned int gain() const
Access to gain.
size_type correctionVecSize() const
Size of channel set.
const std::vector< bool > & getFlag(const TrigPassFlags *flags, const T *obj, const CONTAINER *container, const size_t position)
Returns the flag at index position.
def time(flags, cells_name, *args, **kw)
ConstSubsetIt subsetBegin() const
Iterators over subset.
ConstSubsetIt subsetEnd() const
ConstCorrectionVecIt correctionVecBegin() const
Iterators over channel set.
void insertCorrections(CorrectionVec &&corrs)
Insert a group of corrections.
unsigned int groupingType() const
Type of grouping - defined in LArConditionsContainerBase.h.