 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 unsigned int cwvIndex=0, waveIndex=0,
chIndex = 0;
25 unsigned int ifebWithData = 0;
28 for (
unsigned int i = 0;
i < nfebids; ++
i, ++subsetIt){
29 unsigned int febid = subsetIt->first;
32 bool hasSparseData =
false;
33 unsigned int chansSet = 0;
34 unsigned int chansOffset = 0;
46 for (
unsigned int j = 0; j < nChannelsPerFeb; ++j){
47 bool copyChannel =
true;
51 if (!(chansSet & (1 << (j - chansOffset)))) {
54 if (j%32 == 31 && j < nChannelsPerFeb-2) {
64 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
66 for (
unsigned int nD=0;nD<nDAC;nD++){
73 std::vector<double>
val,
err;
100 for (
unsigned int i = 0;
i < ncorrs; ++
i){
101 if (cwvIndex >= persObj->
m_vDAC.size()) {
103 <<
"LArCaliWaveSubsetCnv_p3::persToTrans - CaliWave index too large: cwvIndex/sizeInFile "
104 << cwvIndex <<
" " << persObj->
m_vDAC.size() <<
" " <<
endmsg;
113 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
115 for (
unsigned int nD=0;nD<nDAC;nD++){
118 <<
"LArCaliWaveSubsetCnv_p3::persToTrans - CaliWave index too large: WaveIndex/sizeInFile "
128 std::vector<double>
val,
err;
129 std::vector<int> tri;
133 log << MSG::ERROR <<
"Persistent LArCaliWave object is inconsistent. i=" <<
i <<
" WaveIndes="
173 unsigned int nsubsetsNotEmpty = 0;
174 unsigned int nchans = 0;
178 std::vector<unsigned int> febsWithSparseData;
180 const auto subsetEnd = transObj->
subsetEnd();
182 subsetIt != subsetEnd;
185 unsigned int nfebChans = subsetIt->second.size();
187 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
188 log << MSG::ERROR <<
"LArCaliWaveSubsetCnv_p3::transToPers - found incorrect number of channels per feb: " << nfebChans<<
endmsg;
192 if (nfebChans) ++nsubsetsNotEmpty;
194 bool isSparse =
false;
195 for (
unsigned int j = 0; j < nfebChans; ++j) {
199 if (!isSparse && CWV.size() == 0) {
201 febsWithSparseData.push_back(subsetIt->first);
218 if (febsWithSparseData.size())
221 persObj->
m_dt.reserve(nchans);
225 persObj->
m_flag.reserve(nchans);
229 subsetIt != subsetEnd;
232 unsigned int nfebChans = subsetIt->second.size();
234 if (nfebChans == 0)
continue;
236 unsigned int febid = subsetIt->first;
240 if (counterSparse < (
int)febsWithSparseData.size() && febid == febsWithSparseData[counterSparse]){
246 unsigned int chansSet = 0;
247 unsigned int chansOffset = 0;
248 for (
unsigned int j = 0; j < nfebChans; ++j){
250 bool saveAmplitudes=
true;
253 if (subsetIt->second[j].size() > 0) {
255 assert (j >= chansOffset && (j - chansOffset) <= 31);
257 chansSet |= (1 << (j - chansOffset));
261 saveAmplitudes =
false;
265 if (j == (chansOffset + 31) || j == nfebChans-1 ) {
272 if (saveAmplitudes) {
274 int dacValues=CWV.size();
275 persObj->
m_vDAC.push_back(dacValues);
277 for(
int dv=0;
dv<dacValues;
dv++){
278 persObj->
m_dt.push_back(CWV[
dv].getDt());
280 persObj->
m_DAC.push_back(CWV[
dv].getDAC());
281 persObj->
m_isPulsed.push_back(CWV[
dv].getIsPulsedInt());
282 const std::vector<double>&
w=CWV[
dv].getWave();
283 const std::vector<double>&
e=CWV[
dv].getErrors();
284 const std::vector<int>&
t=CWV[
dv].getTriggers();
285 for (
unsigned int k = 0;
k<
w.size(); ++
k){
306 int dacValues=CWV.size();
307 persObj->
m_vDAC.push_back(dacValues);
310 for(
int dv=0;
dv<dacValues;
dv++){
311 persObj->
m_dt.push_back(CWV[
dv].getDt());
313 persObj->
m_DAC.push_back(CWV[
dv].getDAC());
314 persObj->
m_isPulsed.push_back(CWV[
dv].getIsPulsedInt());
315 const std::vector<double>&
w=CWV[
dv].getWave();
316 const std::vector<double>&
e=CWV[
dv].getErrors();
317 const std::vector<int>&
t=CWV[
dv].getTriggers();
319 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
std::vector< unsigned short > m_vDAC
std::vector< int > m_vTriggers
std::vector< float > m_dt
unsigned channelVectorSize() const
std::vector< int > m_isPulsed
unsigned int subsetSize() const
std::vector< float > m_vErrors
ConstCorrectionVecIt correctionVecEnd() const
virtual void transToPers(const LArCWTransType *transObj, LArCaliWaveSubset_p3 *persObj, MsgStream &log) const override
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
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
unsigned int m_groupingType
persistent class container of LArCaliWave data.
unsigned int channel() const
Access to the COOL channel number.
std::vector< float > m_vAmplitudes
void setChannel(unsigned int channel)
set the COOL channel number
virtual void persToTrans(const LArCaliWaveSubset_p3 *persObj, LArCWTransType *transObj, MsgStream &log) const override
template class for use for I/O of conditions data
This file defines the template class used for I/O of conditions data.
std::vector< unsigned > m_flag
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)
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.
LArConditionsSubset_p1 m_subset
unsigned int groupingType() const
Type of grouping - defined in LArConditionsContainerBase.h.