|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/Bootstrap.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/IToolSvc.h"
23 #define LARBSDBG(text) m_logstr<<MSG::DEBUG<<text<<endmsg
25 #define LARBSDBG(text)
42 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
44 m_logstr << MSG::ERROR <<
"Unable to locate DetectorStore" <<
endmsg;
156 #ifdef LARBSDBGOUTPUT
157 m_logstr <<
MYLEVEL <<
"***********************************************************************"<<
endmsg;
159 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
166 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
168 m_logstr <<
MYLEVEL <<
"********************* SumBlck ************************************"<<
endmsg;
169 for(
int toto=0;toto<4;toto++)
171 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
173 m_logstr <<
MYLEVEL <<
"********************* CounterBlck ************************************"<<
endmsg;
175 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
177 m_logstr <<
MYLEVEL <<
"********************* FebInfoBlck ************************************"<<
endmsg;
179 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
182 m_logstr <<
MYLEVEL <<
"********************* Energies ************************************"<<
endmsg;
183 for(
int toto=0;toto<128;toto++)
185 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
187 m_logstr <<
MYLEVEL <<
"********************* Time & Quality ************************************"<<
endmsg;
188 for(
int toto=0;toto<10;toto++)
190 m_logstr <<
MYLEVEL <<
"************************************************************************"<<
endmsg;
224 m_logstr <<
MYLEVEL <<
"setNextEnergy-------------------->>>>>********************** new format V3 ***********" <<
endmsg;
230 m_logstr << MSG::ERROR <<
"LArRODBlockStructure Error: Internal error. Channels not ordered correctly. rcNb=" << rcNb
264 thequality = (
int16_t) quality;
271 if ((abse>8192)&&(abse<65536))
273 EncodedE=((abse>>3)|0x2000);
275 else if ((abse>65535)&&(abse<524288))
277 EncodedE=((abse>>6)|0x4000);
279 else if ((abse>524288))
281 EncodedE=((abse>>9)|0x6000);
286 if (
sign<0) EncodedE |= 0x8000;
310 {
m_logstr << MSG::ERROR <<
"LArRodBlockStructure Error: Attempt to write Energy for channel "
324 ShortLong twoValues{};
335 twoValues.s[0]=valptr[0];
341 LARBSDBG(
"Writing words: val0= " << twoValues.s[0] <<
" val1= " << twoValues.s[1]);
351 if (mylocalBitwiseIndex==0)
355 SB = (quality==-32767?0x00000000:0x00000001);
363 SB=(SB<<1)|(quality==-32767?0x00000000:0x00000001);
370 if (mylocalBitwiseIndex==0)
378 encodedgains=(encodedgains<<2)|(
gain&0x00000003);
395 ShortLong twoValues{};
396 if (mylocalBitwiseIndex==0)
400 twoValues.s[0]=(
int16_t)(
time)|((quality>>10)&0x003F);
407 twoValues.s[0]=valptr[0];
408 twoValues.s[1]=(
int16_t)(
time)|((quality>>12)&0x003F);
420 {
m_logstr << MSG::ERROR <<
"Attempt to write Energy for channel " << rcNb <<
" channels into a FEB!" <<
endmsg;
425 m_logstr << MSG::ERROR <<
"Number of samples mismatch!\n";
452 unsigned int sizeRead=0;
454 while (sizeRead<fragment.size()) {
456 FebIter=fragment.begin()+sizeRead;
461 if (FebIter+currFebSize>fragment.end()) {
463 m_logstr << MSG::ERROR <<
"Got inconsistent ROD-Fragment!" <<
endmsg;
466 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize);
468 LARBSDBG(
"Found FEB-id " << currFEBid <<
" in existing ROD-Fragment");
509 LARBSDBG(
"Checking for Summary Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
510 if (
n && !BlockOffset)
514 m_logstr <<
MSG::DEBUG <<
"In finalizeFEB-------------------->>>>> " <<
"Checking for Summary Block : length= " <<
n <<
" BlockOffset=" << BlockOffset <<
endmsg;
515 for (
unsigned i=0;
i<
n;
i++)
522 ShortLong twoValues{};
566 LARBSDBG(
"Checking for Counter Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
567 if (
n && !BlockOffset)
571 m_logstr << MSG::INFO <<
"In finalyseFEB-------------------->>>>> " <<
"Checking for Counter Block : length= " <<
n <<
" BlockOffset=" << BlockOffset <<
endmsg;
572 for (
unsigned i=0;
i<
n;
i++)
579 LARBSDBG(
"Checking Energy Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
581 if (
n && !BlockOffset)
585 m_logstr <<
MSG::DEBUG <<
"In finalyseFEB-------------------->>>>> " <<
"Checking for Energy Block : length= " <<
n <<
" BlockOffset=" << BlockOffset <<
endmsg;
587 for(
unsigned int i=0;
i<
n;
i++)
594 LARBSDBG(
"Checking Gain Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
596 if (
n && !BlockOffset)
601 for(
unsigned int i=0;
i<
n;
i++)
612 LARBSDBG(
"Checking FebInfo Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
614 if (
n && !BlockOffset)
619 for(
unsigned int i=0;
i<
n;
i++)
626 LARBSDBG(
"Checking Time and Quality Block n=" <<
n <<
"BlockOffset=" << BlockOffset);
628 if (
n && !BlockOffset)
632 m_logstr <<
MSG::DEBUG <<
"In finalyseFEB-------------------->>>>> " <<
"Checking for Time and Quality Block : length= " <<
n <<
" BlockOffset=" << BlockOffset <<
endmsg;
633 for(
unsigned int i=0;
i<
n;
i++)
638 LARBSDBG(
"Checking Raw Data Block");
641 LARBSDBG(
"Checking Raw Data Block. n=" <<
n <<
"BlockOffset=" << BlockOffset);
646 for(
unsigned int i=0;
i<
n;
i++)
662 m_logstr <<
MYLEVEL <<
"***********************************************************************"<<
endmsg;
665 m_logstr <<
MYLEVEL <<
"***********************************************************************"<<
endmsg;
668 m_logstr <<
MYLEVEL <<
"***********************************************************************"<<
endmsg;
679 FEBMAPTYPE::const_iterator feb_it_b=
m_mFebBlocks.begin();
681 FEBMAPTYPE::const_iterator feb_it;
682 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
683 if (feb_it!=feb_it_b)
700 feb_it->second.begin(), feb_it->second.end());
709 LARBSDBG(
"in LArRodBlockPhysicsV3::getNextRawData.");
739 gain=3-((
m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
747 samples.push_back((
short) (
x & 0xfff));
753 short movedSample=samples[0];
755 samples[
i-1]=samples[
i];
766 template<
class RAWDATA>
767 bool LArRodBlockPhysicsV3::operator ()
769 (
const RAWDATA* ch1,
const RAWDATA* ch2)
const
778 int cId1 = m_onlineHelper->channel(id1);
779 int cId2 = m_onlineHelper->channel(
id2);
780 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
787 {
std::sort(vRC.begin(),vRC.end(),*
this);}
790 {
std::sort(vDigit.begin(),vDigit.end(),*
this);
JetConstituentVector::iterator iterator
const LArOnlineID * m_onlineHelper
std::vector< uint32_t > * m_vFragment
const uint32_t * m_RawDataFlagsPtr
virtual void setEThreshold(uint16_t thres)
static const uint32_t m_DummyBitMap[4]
virtual void setEy(double Ey)
uint32_t getNumberOfWords() const
virtual void sortDataVector(std::vector< const LArRawChannel * > &)
virtual void setOffTimeCut(uint16_t TimeCut)
uint16_t LE_getVectorHeader16(const unsigned n) const
virtual void setNumberOfGains(const uint8_t n)
int FebToRodChannel(int ch) const
std::vector< uint32_t > m_TimeQualityBlock
const uint32_t * m_FebBlock
std::vector< uint32_t > m_RawDataBlock
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
virtual void initializeFragment(std::vector< uint32_t > &fragment)
setScaleOne setStatusOne setSaturated int16_t
std::vector< uint32_t > * m_pRODblock
IMessageSvc * getMessageSvc(bool quiet=false)
virtual uint32_t getNumberOfSamples() const
virtual void setNumberOfSamples(const uint8_t n)
virtual void concatinateFEBs()
virtual uint16_t getCtrl2(uint32_t adc) const
virtual void finalizeFEB()
unsigned short m_iHeadBlockSize
unsigned int m_rearrangeFirstSample
uint32_t getHeader32(const unsigned n) const
virtual void initializeFEB(const uint32_t id)
const uint16_t * m_CounterPtr
virtual void setEx(double Ex)
uint16_t m_numberHotCellOffTime
const int16_t * m_TimeQualityPtr
const uint32_t * m_GainPtr
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
Some weak symbol referencing magic...
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual uint32_t getStatus() const
std::vector< uint32_t > m_EnergyBlock
virtual uint16_t getCtrl3(uint32_t adc) const
std::vector< uint32_t > m_SumBlkBlock
std::vector< uint32_t > m_FebInfoBlock
virtual uint32_t getNumberOfGains() const
int getBit(const uint32_t *const p, const unsigned chan) const
void LE_setHeader16(const unsigned n, const uint16_t w)
virtual void resetPointers()
std::vector< uint32_t > m_GainBlock
std::vector< uint32_t > m_CounterBlkBlock
virtual void setEz(double Ez)
const uint32_t * m_SumBlkPtr
uint16_t m_EnergyThreshold
uint16_t LE_getHeader16(const unsigned n) const
int32_t m_MiddleHeaderSize
virtual bool setPointers()
def time(flags, cells_name, *args, **kw)
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
virtual void setRawData(const int channel, const std::vector< short > &samples, const uint32_t gain)
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual uint16_t getCtrl1(uint32_t adc) const
uint16_t m_HottestCellIndex
void setBit(uint32_t *const p, const unsigned chan)
uint32_t m_HottestCellEnergy
const int16_t * m_FebInfoDataPtr
const uint16_t * m_EnergyPtr
const int16_t * m_RawDataPtr
void setHeader32(const unsigned n, const uint32_t w)