 |
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;
54 if (!(chansSet & (1 << (j - chansOffset)))) {
60 if (j%32 == 31 && j < nChannelsPerFeb-2) {
71 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
73 for (
unsigned int nD=0;nD<nDAC;nD++){
80 std::vector<double>
val,
err;
105 corrs.resize(ncorrs);
108 for (
unsigned int i = 0;
i < ncorrs; ++
i){
109 if (cwvIndex >= persObj->
m_vDAC.size()) {
111 <<
"LArCaliWaveSubsetCnv_p2::persToTrans - CaliWave index too large: cwvIndex/sizeInFile "
112 << cwvIndex <<
" " << persObj->
m_vDAC.size() <<
" " <<
endmsg;
121 unsigned int nDAC=persObj->
m_vDAC[cwvIndex];
123 for (
unsigned int nD=0;nD<nDAC;nD++){
126 <<
"LArCaliWaveSubsetCnv_p2::persToTrans - CaliWave index too large: WaveIndex/sizeInFile "
136 std::vector<double>
val,
err;
137 std::vector<int> tri;
141 log << MSG::ERROR <<
"Persistent LArCaliWave object is inconsistent. i=" <<
i <<
" WaveIndes="
181 unsigned int nsubsetsNotEmpty = 0;
182 unsigned int nchans = 0;
186 std::vector<unsigned int> febsWithSparseData;
188 const auto subsetEnd = transObj->
subsetEnd();
190 subsetIt != subsetEnd;
193 unsigned int nfebChans = subsetIt->second.size();
195 if (nfebChans != 0 && nfebChans != nChannelsPerFeb) {
196 log << MSG::ERROR <<
"LArCaliWaveSubsetCnv_p2::transToPers - found incorrect number of channels per feb: " << nfebChans<<
endmsg;
200 if (nfebChans) ++nsubsetsNotEmpty;
202 bool isSparse =
false;
203 for (
unsigned int j = 0; j < nfebChans; ++j) {
207 if (!isSparse && CWV.size() == 0) {
209 febsWithSparseData.push_back(subsetIt->first);
232 if (febsWithSparseData.size())
235 persObj->
m_dt.reserve(nchans);
239 persObj->
m_flag.reserve(nchans);
243 subsetIt != subsetEnd;
246 unsigned int nfebChans = subsetIt->second.size();
248 if (nfebChans == 0)
continue;
250 unsigned int febid = subsetIt->first;
254 if (counterSparse < (
int)febsWithSparseData.size() && febid == febsWithSparseData[counterSparse]){
260 unsigned int chansSet = 0;
261 unsigned int chansOffset = 0;
262 for (
unsigned int j = 0; j < nfebChans; ++j){
264 bool saveAmplitudes=
true;
267 if (subsetIt->second[j].size() > 0) {
269 assert (j >= chansOffset && (j - chansOffset) <= 31);
271 chansSet |= (1 << (j - chansOffset));
276 saveAmplitudes =
false;
281 if (j == (chansOffset + 31) || j == nfebChans-1 ) {
289 if (saveAmplitudes) {
291 int dacValues=CWV.size();
292 persObj->
m_vDAC.push_back(dacValues);
294 for(
int dv=0;
dv<dacValues;
dv++){
295 persObj->
m_dt.push_back(CWV[
dv].getDt());
297 persObj->
m_DAC.push_back(CWV[
dv].getDAC() | (CWV[
dv].getIsPulsedInt()<<16));
298 const std::vector<double>&
w=CWV[
dv].getWave();
299 const std::vector<double>&
e=CWV[
dv].getErrors();
300 const std::vector<int>&
t=CWV[
dv].getTriggers();
301 for (
unsigned int k = 0;
k<
w.size(); ++
k){
323 int dacValues=CWV.size();
324 persObj->
m_vDAC.push_back(dacValues);
327 for(
int dv=0;
dv<dacValues;
dv++){
328 persObj->
m_dt.push_back(CWV[
dv].getDt());
330 persObj->
m_DAC.push_back(CWV[
dv].getDAC() | (CWV[
dv].getIsPulsedInt()<<16));
331 const std::vector<double>&
w=CWV[
dv].getWave();
332 const std::vector<double>&
e=CWV[
dv].getErrors();
333 const std::vector<int>&
t=CWV[
dv].getTriggers();
335 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
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
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