|
ATLAS Offline Software
|
Go to the documentation of this file.
26 unsigned int cwvIndex=0, waveIndex=0, chIndex = 0;
28 unsigned int ifebWithData = 0;
31 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 nDAC=persObj->
m_vDAC[cwvIndex];
71 for (
unsigned int nD=0;nD<nDAC;nD++){
73 unsigned int f =persObj->
m_flag[chIndex];
74 int dac =(persObj->
m_DAC[chIndex])&0xFFFF;
75 int pulsed =(persObj->
m_DAC[chIndex])>>16;
78 std::vector<double>
val,
err;
103 corrs.resize(ncorrs);
106 for (
unsigned int i = 0;
i < ncorrs; ++
i){
107 if (cwvIndex >= persObj->
m_vDAC.size()) {
109 <<
"LArCaliWaveSubsetCnv_p2::persToTrans - CaliWave index too large: cwvIndex/sizeInFile "
110 << cwvIndex <<
" " << persObj->
m_vDAC.size() <<
" " <<
endmsg;
119 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
121 for (
unsigned int nD=0;nD<nDAC;nD++){
122 if (chIndex >= persObj->
m_dt.size()) {
124 <<
"LArCaliWaveSubsetCnv_p2::persToTrans - CaliWave index too large: WaveIndex/sizeInFile "
125 << chIndex <<
" " << persObj->
m_dt.size() <<
" " <<
endmsg;
129 double time = persObj->
m_dt[chIndex];
130 unsigned int f = persObj->
m_flag[chIndex];
131 int dac =(persObj->
m_DAC[chIndex])&0xFFFF;
132 int pulsed =(persObj->
m_DAC[chIndex])>>16;
134 std::vector<double>
val,
err;
135 std::vector<int> tri;
139 log << MSG::ERROR <<
"Persistent LArCaliWave object is inconsistent. i=" <<
i <<
" WaveIndes="
179 unsigned int nsubsetsNotEmpty = 0;
180 unsigned int nchans = 0;
184 std::vector<unsigned int> febsWithSparseData;
186 const auto subsetEnd = transObj->
subsetEnd();
188 subsetIt != subsetEnd;
191 unsigned int nfebChans = subsetIt->second.size();
193 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
194 log << MSG::ERROR <<
"LArCaliWaveSubsetCnv_p2::transToPers - found incorrect number of channels per feb: " << nfebChans<<
endmsg;
198 if (nfebChans) ++nsubsetsNotEmpty;
200 bool isSparse =
false;
201 for (
unsigned int j = 0; j < nfebChans; ++j) {
205 if (!isSparse && CWV.size() == 0) {
207 febsWithSparseData.push_back(subsetIt->first);
230 if (febsWithSparseData.size())
233 persObj->
m_dt.reserve(nchans);
237 persObj->
m_flag.reserve(nchans);
241 subsetIt != subsetEnd;
244 unsigned int nfebChans = subsetIt->second.size();
246 if (nfebChans == 0)
continue;
248 unsigned int febid = subsetIt->first;
252 if (counterSparse < (
int)febsWithSparseData.size() && febid == febsWithSparseData[counterSparse]){
258 unsigned int chansSet = 0;
259 unsigned int chansOffset = 0;
260 for (
unsigned int j = 0; j < nfebChans; ++j){
262 bool saveAmplitudes=
true;
265 if (subsetIt->second[j].size() > 0) {
267 assert (j >= chansOffset && (j - chansOffset) <= 31);
268 chansSet |= (1 << (j - chansOffset));
273 saveAmplitudes =
false;
278 if (j == (chansOffset + 31) || j == nfebChans-1 ) {
286 if (saveAmplitudes) {
288 int dacValues=CWV.size();
289 persObj->
m_vDAC.push_back(dacValues);
291 for(
int dv=0;
dv<dacValues;
dv++){
292 persObj->
m_dt.push_back(CWV[
dv].getDt());
294 persObj->
m_DAC.push_back(CWV[
dv].getDAC() | (CWV[
dv].getIsPulsedInt()<<16));
295 const std::vector<double>&
w=CWV[
dv].getWave();
296 const std::vector<double>&
e=CWV[
dv].getErrors();
297 const std::vector<int>&
t=CWV[
dv].getTriggers();
298 for (
unsigned int k = 0;
k<
w.size(); ++
k){
320 int dacValues=CWV.size();
321 persObj->
m_vDAC.push_back(dacValues);
324 for(
int dv=0;
dv<dacValues;
dv++){
325 persObj->
m_dt.push_back(CWV[
dv].getDt());
327 persObj->
m_DAC.push_back(CWV[
dv].getDAC() | (CWV[
dv].getIsPulsedInt()<<16));
328 const std::vector<double>&
w=CWV[
dv].getWave();
329 const std::vector<double>&
e=CWV[
dv].getErrors();
330 const std::vector<int>&
t=CWV[
dv].getTriggers();
332 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< int > m_vTriggers
virtual void transToPers(const LArCWTransType *transObj, LArCaliWaveSubset_p2 *persObj, MsgStream &log) const override
std::vector< unsigned int > m_corrChannels
std::vector< float > m_vErrors
std::vector< unsigned int > m_febsWithSparseData
std::vector< float > m_dt
unsigned channelVectorSize() const
unsigned int subsetSize() const
virtual void persToTrans(const LArCaliWaveSubset_p2 *persObj, LArCWTransType *transObj, MsgStream &log) const override
ConstCorrectionVecIt correctionVecEnd() const
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
std::vector< float > m_vAmplitudes
std::vector< unsigned short > m_vDAC
unsigned int m_groupingType
unsigned int channel() const
Access to the COOL channel number.
std::vector< unsigned > m_flag
void setChannel(unsigned int channel)
set the COOL channel number
template class for use for I/O of conditions data
This file defines the template class used for I/O of conditions data.
size_type subsetSize() const
Size of subset.
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)
persistent class container of LArCaliWave data.
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.
LArConditionsSubset_p1 m_subset