|
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;
49 if (!(chansSet & (1 << (j - chansOffset)))) {
52 if (j%32 == 31 && j < nChannelsPerFeb-2) {
62 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
64 for (
unsigned int nD=0;nD<nDAC;nD++){
66 unsigned int f =persObj->
m_flag[chIndex];
71 std::vector<double>
val,
err;
98 for (
unsigned int i = 0;
i < ncorrs; ++
i){
99 if (cwvIndex >= persObj->
m_vDAC.size()) {
101 <<
"LArCaliWaveSubsetCnv_p3::persToTrans - CaliWave index too large: cwvIndex/sizeInFile "
102 << cwvIndex <<
" " << persObj->
m_vDAC.size() <<
" " <<
endmsg;
111 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
113 for (
unsigned int nD=0;nD<nDAC;nD++){
114 if (chIndex >= persObj->
m_dt.size()) {
116 <<
"LArCaliWaveSubsetCnv_p3::persToTrans - CaliWave index too large: WaveIndex/sizeInFile "
117 << chIndex <<
" " << persObj->
m_dt.size() <<
" " <<
endmsg;
121 double time = persObj->
m_dt[chIndex];
122 unsigned int f = persObj->
m_flag[chIndex];
126 std::vector<double>
val,
err;
127 std::vector<int> tri;
131 log << MSG::ERROR <<
"Persistent LArCaliWave object is inconsistent. i=" <<
i <<
" WaveIndes="
171 unsigned int nsubsetsNotEmpty = 0;
172 unsigned int nchans = 0;
176 std::vector<unsigned int> febsWithSparseData;
178 const auto subsetEnd = transObj->
subsetEnd();
180 subsetIt != subsetEnd;
183 unsigned int nfebChans = subsetIt->second.size();
185 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
186 log << MSG::ERROR <<
"LArCaliWaveSubsetCnv_p3::transToPers - found incorrect number of channels per feb: " << nfebChans<<
endmsg;
190 if (nfebChans) ++nsubsetsNotEmpty;
192 bool isSparse =
false;
193 for (
unsigned int j = 0; j < nfebChans; ++j) {
197 if (!isSparse && CWV.size() == 0) {
199 febsWithSparseData.push_back(subsetIt->first);
216 if (febsWithSparseData.size())
219 persObj->
m_dt.reserve(nchans);
223 persObj->
m_flag.reserve(nchans);
227 subsetIt != subsetEnd;
230 unsigned int nfebChans = subsetIt->second.size();
232 if (nfebChans == 0)
continue;
234 unsigned int febid = subsetIt->first;
238 if (counterSparse < (
int)febsWithSparseData.size() && febid == febsWithSparseData[counterSparse]){
244 unsigned int chansSet = 0;
245 unsigned int chansOffset = 0;
246 for (
unsigned int j = 0; j < nfebChans; ++j){
248 bool saveAmplitudes=
true;
251 if (subsetIt->second[j].size() > 0) {
253 assert (j >= chansOffset && (j - chansOffset) <= 31);
254 chansSet |= (1 << (j - chansOffset));
258 saveAmplitudes =
false;
262 if (j == (chansOffset + 31) || j == nfebChans-1 ) {
269 if (saveAmplitudes) {
271 int dacValues=CWV.size();
272 persObj->
m_vDAC.push_back(dacValues);
274 for(
int dv=0;
dv<dacValues;
dv++){
275 persObj->
m_dt.push_back(CWV[
dv].getDt());
277 persObj->
m_DAC.push_back(CWV[
dv].getDAC());
278 persObj->
m_isPulsed.push_back(CWV[
dv].getIsPulsedInt());
279 const std::vector<double>&
w=CWV[
dv].getWave();
280 const std::vector<double>&
e=CWV[
dv].getErrors();
281 const std::vector<int>&
t=CWV[
dv].getTriggers();
282 for (
unsigned int k = 0;
k<
w.size(); ++
k){
303 int dacValues=CWV.size();
304 persObj->
m_vDAC.push_back(dacValues);
307 for(
int dv=0;
dv<dacValues;
dv++){
308 persObj->
m_dt.push_back(CWV[
dv].getDt());
310 persObj->
m_DAC.push_back(CWV[
dv].getDAC());
311 persObj->
m_isPulsed.push_back(CWV[
dv].getIsPulsedInt());
312 const std::vector<double>&
w=CWV[
dv].getWave();
313 const std::vector<double>&
e=CWV[
dv].getErrors();
314 const std::vector<int>&
t=CWV[
dv].getTriggers();
316 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
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.