ATLAS Offline Software
Loading...
Searching...
No Matches
LArRodBlockPhysicsV3 Class Reference

#include <LArRodBlockPhysicsV3.h>

Inheritance diagram for LArRodBlockPhysicsV3:
Collaboration diagram for LArRodBlockPhysicsV3:

Public Member Functions

 LArRodBlockPhysicsV3 (IMessageSvc *msgSvc)
std::string BlockType ()
virtual void initializeFragment (std::vector< uint32_t > &fragment)
virtual void initializeFEB (const uint32_t id)
virtual void setNumberOfSamples (const uint8_t n)
virtual void setNumberOfGains (const uint8_t n)
virtual void setNextEnergy (const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
virtual void setRawData (const int channel, const std::vector< short > &samples, const uint32_t gain)
virtual void setEx (double Ex)
virtual void setEy (double Ey)
virtual void setEz (double Ez)
virtual void finalizeFEB ()
virtual void concatinateFEBs ()
virtual void sortDataVector (std::vector< const LArRawChannel * > &)
virtual void sortDataVector (std::vector< const LArDigit * > &)
virtual bool canSetEnergy ()
virtual bool canSetRawData ()
template<class RAWDATA>
bool operator() (const RAWDATA *ch1, const RAWDATA *ch2) const
virtual void setEThreshold (uint16_t thres)
virtual void setOffTimeCut (uint16_t TimeCut)
virtual int setGain (const int)
virtual bool setPointers ()
virtual int getNextEnergy (int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
virtual int getNextRawData (int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual uint32_t getNumberOfSamples () const
virtual uint32_t getNumberOfGains () const
virtual uint32_t getRadd (uint32_t adc, uint32_t sample) const
virtual uint16_t getCtrl1 (uint32_t adc) const
virtual uint16_t getCtrl2 (uint32_t adc) const
virtual uint16_t getCtrl3 (uint32_t adc) const
virtual uint32_t getStatus () const
virtual uint16_t getNumberOfHotCells () const
virtual uint16_t getNumberOfHotCellsInTime () const
virtual uint16_t getHotCellThreshold () const
virtual uint16_t getOfftimeThreshold () const
virtual int32_t getEx () const
virtual int32_t getEy () const
virtual int32_t getEz () const
virtual uint16_t getHottestCellIndex ()
virtual uint32_t getHottestCellEnergy () const
virtual uint32_t hasPhysicsBlock () const
virtual uint32_t hasRawDataBlock () const
virtual uint32_t hasControlWordBlock () const
virtual void sortDataVector (std::vector< const LArCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedDigit * > &)
virtual void setTDCPhase (const uint8_t n)
virtual void setRawDataFixed (const int channel, const std::vector< short > &samples, const uint32_t gain)
virtual void setEtQ (const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
virtual void setDAC (const uint16_t DACValue)
virtual void setDelay (const uint16_t DelayValue)
virtual void setPulsed (const unsigned channelNumber)
virtual void setNTrigger (const uint16_t NTrigger)
virtual void setSumE (double)
virtual bool canSetRawDataFixed ()
virtual bool canSetCalibration ()
virtual bool canSetNTrigger ()
virtual bool canIncludeRawData ()
bool setFragment (const uint32_t *p, uint32_t n)
bool nextFEB ()
uint32_t getNumberOfWords () const
uint32_t getFEBID () const
uint32_t getFEBSN () const
virtual int32_t getSumE () const
virtual uint32_t getVROBFebId ()
virtual int32_t getVROBEx () const
virtual int32_t getVROBEy () const
virtual int32_t getVROBEz () const
virtual int32_t getVROBSumE () const
virtual uint32_t hasCalibBlock () const
virtual uint32_t hasAccumBlock () const
virtual uint32_t hasControlWords () const
virtual int getNextAccumulatedCalibDigit (int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &Samples2Sum, uint32_t &nStepTriggers, uint32_t &gain)
virtual int getNextAccumulatedDigit (int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
virtual bool getPulsed (unsigned channelNumber) const
virtual uint16_t getDAC () const
virtual uint16_t getDelay () const
virtual uint16_t getNTrigger () const
virtual uint16_t getStepIndex () const
virtual uint16_t getNStep () const
virtual uint8_t getTDCPhase () const
virtual uint16_t getResults1Size () const
virtual uint16_t getResults2Size () const
virtual uint16_t getRawDataSize () const
virtual uint16_t getNbSweetCells1 () const
virtual uint16_t getNbSweetCells2 () const
virtual uint32_t getDspCodeVersion () const
virtual int32_t getDspEventCounter () const
virtual uint32_t onlineCheckSum () const
virtual uint32_t offlineCheckSum () const
virtual int setFragmentVirtualROB (const uint32_t *p, uint32_t n)
virtual void dumpFragment ()
void setFirstSample (const int rearrangeFirstSample)
uint32_t RawToOfflineGain (const uint32_t gain) const
uint32_t OfflineToRawGain (const uint32_t gain) const
bool report_error (void) const

Protected Types

enum  {
  NWTot , NWTot_h , FEBID , FEBID_h ,
  FEB_SN , FEB_SN_h , NGainNSamples , SumBlkOffset ,
  CounterBlkOffset , EBlkOffset , GainBlkOffset , FebInfoBlkOffset ,
  TimeQualityBlkOffset , RawDataBlkOffset , Status2 , Status1 ,
  BCID , EventID , endtag
}
enum  {
  NWTot , NWTot_h , FEBID , FEBID_h ,
  FEBSN , FEBSN_h , endtag
}
typedef std::map< uint32_t, std::vector< uint32_t > > FEBMAPTYPE

Protected Member Functions

void setHeader16 (const unsigned n, const uint16_t w)
void setHeader32 (const unsigned n, const uint32_t w)
uint16_t getVectorHeader16 (const unsigned n) const
uint32_t getVectorHeader32 (const unsigned n) const
uint16_t getHeader16 (const unsigned n) const
uint32_t getHeader32 (const unsigned n) const
uint16_t LE_getHeader16 (const unsigned n) const
void LE_setHeader16 (const unsigned n, const uint16_t w)
uint16_t LE_getVectorHeader16 (const unsigned n) const
void setBit (uint32_t *const p, const unsigned chan)
int getBit (const uint32_t *const p, const unsigned chan) const

Protected Attributes

int32_t m_Ex
int32_t m_Ey
int32_t m_Ez
int32_t m_SumE
uint32_t m_numberOfEx
uint32_t m_numberOfEy
uint32_t m_numberOfEz
uint32_t m_numberOfSumE
unsigned short m_iHeadBlockSize
int m_channelsPerFEB
const uint32_t * m_FebBlock
const uint32_t * m_RodBlock
int32_t m_FebBlockSize
int32_t m_RodBlockSize
std::vector< uint32_t > * m_vFragment
std::vector< uint32_t > * m_pRODblock
FEBMAPTYPE m_mFebBlocks
int32_t m_MiddleHeaderSize
unsigned int m_rearrangeFirstSample
bool m_error_next_feb
uint32_t m_virtualROBJump
int32_t m_ROB_to_decode
const uint32_t * m_virtualROBPointer
const uint32_t * m_virtualROBPointerLocal
MsgStream m_logstr

Static Protected Attributes

static const uint32_t m_RawToOfflineGainMap [4] ={0, 2, 1,0}
static const uint32_t m_OfflineToRawGainMap [3] ={3,2,1}

Private Member Functions

void clearBlocks ()
virtual void resetPointers ()
int FebToRodChannel (int ch) const
void setNextEnergy (const uint16_t energy, const int16_t time, const int16_t quality, const uint32_t gain)

Private Attributes

std::vector< uint32_t > m_SumBlkBlock
std::vector< uint32_t > m_CounterBlkBlock
std::vector< uint32_t > m_EnergyBlock
std::vector< uint32_t > m_GainBlock
std::vector< uint32_t > m_FebInfoBlock
std::vector< uint32_t > m_TimeQualityBlock
std::vector< uint32_t > m_RawDataBlock
int m_RawDataCounter = 0
int m_RawDataIndex = 0
int m_CounterIndex = 0
int m_EnergyIndex = 0
int m_FebInfoIndex = 0
int m_GainIndex = 0
int m_TimeQualityIndex = 0
int m_SumBlkIndex = 0
const uint32_t * m_SumBlkPtr
const uint16_t * m_CounterPtr
const uint16_t * m_EnergyPtr
const int16_t * m_TimeQualityPtr
const uint32_t * m_GainPtr
const int16_t * m_FebInfoDataPtr
const int16_t * m_RawDataPtr
const uint32_t * m_RawDataFlagsPtr
int m_NSumBlkWords
int m_NCounterBlkWords
int m_NEnergyBlkWords
int m_NGainBlkWords
int m_NFebInfoBlkWords
int m_NFlaggingWords
uint16_t m_numberHotCell = 0U
uint16_t m_numberHotCellOffTime = 0U
uint16_t m_EnergyThreshold
int16_t m_OffTimeCut
uint16_t m_HottestCellIndex
uint32_t m_HottestCellEnergy
const LArOnlineIDm_onlineHelper

Static Private Attributes

static const uint32_t m_DummyBitMap [4] ={0,0,0,0}

Detailed Description

Definition at line 48 of file LArRodBlockPhysicsV3.h.

Member Typedef Documentation

◆ FEBMAPTYPE

typedef std::map<uint32_t, std::vector<uint32_t> > LArRodBlockStructure::FEBMAPTYPE
protectedinherited

Definition at line 227 of file LArRodBlockStructure.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
NWTot 
NWTot_h 
FEBID 
FEBID_h 
FEBSN 
FEBSN_h 
endtag 

Definition at line 50 of file LArRodBlockStructure.h.

50 {
51 NWTot, // Number of words in DSP block
52 NWTot_h,
53 FEBID, // FEB ID
54 FEBID_h,
55 FEBSN, // FEB Serial Number
56 FEBSN_h,
57 endtag // This tag needs to be an odd number, see *) for constructor
58 };

◆ anonymous enum

anonymous enum
protected
Enumerator
NWTot 
NWTot_h 
FEBID 
FEBID_h 
FEB_SN 
FEB_SN_h 
NGainNSamples 
SumBlkOffset 
CounterBlkOffset 
EBlkOffset 
GainBlkOffset 
FebInfoBlkOffset 
TimeQualityBlkOffset 
RawDataBlkOffset 
Status2 
Status1 
BCID 
EventID 
endtag 

Definition at line 56 of file LArRodBlockPhysicsV3.h.

56 {
57 NWTot,
58 NWTot_h,
59 FEBID,
60 FEBID_h,
61 FEB_SN,
63 NGainNSamples, // number of samples sent by the FEB and used at the raw data level in the dsp to apply Optimal Filtering
64 SumBlkOffset, // summary block offset (fixed length)
65 CounterBlkOffset, // counter block offset (fixed length)
66 EBlkOffset, // Energy block offset (fixed length)
67 GainBlkOffset, // Gain block offset (fixed length)
68 FebInfoBlkOffset, // Technical FEB information usefull for offline correction
69 TimeQualityBlkOffset, // Time and quality variable length block
70 RawDataBlkOffset, // Raw data block offset
71 Status2, // This element and the ones below this are not used by the converter
72 Status1,
73 BCID,
74 EventID,
75 // endtag1, // remove if the number of words is even
76 endtag
77 };

Constructor & Destructor Documentation

◆ LArRodBlockPhysicsV3()

LArRodBlockPhysicsV3::LArRodBlockPhysicsV3 ( IMessageSvc * msgSvc)

Definition at line 36 of file LArRodBlockPhysicsV3.cxx.

38{
39 // retrieve onlineHelper
40 const LArOnlineID* online_id;
41 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
42 if (!detStore) {
43 m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg;
44 std::abort();
45 }
46 StatusCode sc = detStore->retrieve(online_id, "LArOnlineID");
47 if (sc.isFailure()) {
48 m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
49 std::abort();
50 }
51 else {
52 m_onlineHelper=online_id;
53 m_logstr << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
54 }
55
56 m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
57 m_NSumBlkWords=4; // BL : words of 32 bits here
60 m_NEnergyBlkWords=128*16/32;
61 m_NGainBlkWords=128*2/32;
62
63 // Move this to properties of the algorithm but set default values.
64 m_EnergyThreshold = 100; // MeV
65 m_OffTimeCut = 30; // ns
66
68
70 m_vFragment=NULL;
71 m_FebBlock=NULL;
72 m_pRODblock=NULL;
73
74 m_Ex=0;
75 m_Ey=0;
76 m_Ez=0;
77 m_HottestCellIndex=255; // 255 is unphysical since cells index are between 0 and 127 per FEB.
79
80 m_CounterPtr=NULL;
81 m_EnergyPtr=NULL;
83 m_GainPtr=NULL;
85 m_RawDataPtr=NULL;
86 m_SumBlkPtr=NULL;
88}
#define endmsg
static Double_t sc
const int16_t * m_TimeQualityPtr
const LArOnlineID * m_onlineHelper
const uint16_t * m_CounterPtr
const int16_t * m_FebInfoDataPtr
const uint32_t * m_RawDataFlagsPtr
std::vector< uint32_t > * m_pRODblock
LArRodBlockStructure(IMessageSvc *msgSvc, const std::string &blockType)
std::vector< uint32_t > * m_vFragment
::StatusCode StatusCode
StatusCode definition for legacy code.

Member Function Documentation

◆ BlockType()

std::string LArRodBlockPhysicsV3::BlockType ( )
inline

Definition at line 80 of file LArRodBlockPhysicsV3.h.

80{ return std::string("RodBlockPhysicsV3");}

◆ canIncludeRawData()

virtual bool LArRodBlockStructure::canIncludeRawData ( )
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 100 of file LArRodBlockStructure.h.

100{return false;}

◆ canSetCalibration()

virtual bool LArRodBlockStructure::canSetCalibration ( )
inlinevirtualinherited

◆ canSetEnergy()

virtual bool LArRodBlockPhysicsV3::canSetEnergy ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 100 of file LArRodBlockPhysicsV3.h.

100{ return true;}

◆ canSetNTrigger()

virtual bool LArRodBlockStructure::canSetNTrigger ( )
inlinevirtualinherited

Definition at line 99 of file LArRodBlockStructure.h.

99{return false;}

◆ canSetRawData()

virtual bool LArRodBlockPhysicsV3::canSetRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 101 of file LArRodBlockPhysicsV3.h.

101{return true;}

◆ canSetRawDataFixed()

virtual bool LArRodBlockStructure::canSetRawDataFixed ( )
inlinevirtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 97 of file LArRodBlockStructure.h.

97{return false;}

◆ clearBlocks()

void LArRodBlockPhysicsV3::clearBlocks ( )
private

Definition at line 91 of file LArRodBlockPhysicsV3.cxx.

92{
93 m_SumBlkBlock.clear();
94 m_CounterBlkBlock.clear();
95 m_EnergyBlock.clear();
96 m_GainBlock.clear();
97 m_TimeQualityBlock.clear();
98 m_RawDataBlock.clear();
99 m_FebInfoBlock.clear();
100}
std::vector< uint32_t > m_EnergyBlock
std::vector< uint32_t > m_RawDataBlock
std::vector< uint32_t > m_CounterBlkBlock
std::vector< uint32_t > m_SumBlkBlock
std::vector< uint32_t > m_TimeQualityBlock
std::vector< uint32_t > m_GainBlock
std::vector< uint32_t > m_FebInfoBlock

◆ concatinateFEBs()

void LArRodBlockPhysicsV3::concatinateFEBs ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 632 of file LArRodBlockPhysicsV3.cxx.

633{
634 FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
635 FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
636 FEBMAPTYPE::const_iterator feb_it;
637 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
638 if (feb_it!=feb_it_b) //Not first Feb
640
641 //Add feb data to rod data block
642 m_pRODblock->insert (m_pRODblock->end(),
643 feb_it->second.begin(), feb_it->second.end());
644 } //end for feb_it
645
646 m_mFebBlocks.clear();
647}

◆ dumpFragment()

void LArRodBlockStructure::dumpFragment ( )
virtualinherited

Definition at line 159 of file LArRodBlockStructure.cxx.

160{
161 m_logstr << MSG::ERROR << "Error: Function dumpFragment() not implemented in this instance of LArRodBlockStructure!" << endmsg;
162}

◆ FebToRodChannel()

int LArRodBlockPhysicsV3::FebToRodChannel ( int ch) const
inlineprivatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 201 of file LArRodBlockPhysicsV3.h.

203{return (ch>>3) + ((ch&0x7)<<4);
204}

◆ finalizeFEB()

void LArRodBlockPhysicsV3::finalizeFEB ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 481 of file LArRodBlockPhysicsV3.cxx.

482{
483 //Complete non-complete Energy block
485 setNextEnergy((uint16_t)0,(int16_t)32767,(int32_t)-32767,(uint32_t)0);//E=0,t=32767,q=-32767,G=0
486
487 uint16_t n;
488 uint16_t BlockOffset;
489
490 // Summary block....
491 n = m_SumBlkBlock.size();
493 //Check if Summary Block exists and is not yet part of the fragment
494 LARBSDBG("Checking for Summary Block n=" << n << "BlockOffset=" << BlockOffset);
495 if (n && !BlockOffset)
496 {
499 m_logstr << MSG::DEBUG << "In finalizeFEB-------------------->>>>> " << "Checking for Summary Block : length= " << n << " BlockOffset=" << BlockOffset << endmsg;
500 for (unsigned i=0;i<n;i++)
501 m_vFragment->push_back(m_SumBlkBlock[i]);
502 }
503
504 // Counter block....
505
506 // fill info from counters
507 ShortLong twoValues{};
508 twoValues.s[0]=(uint16_t)m_numberHotCell;
509 twoValues.s[1]=(uint16_t)m_numberHotCellOffTime;
510 m_CounterBlkBlock.push_back(twoValues.l);
511
512 twoValues.s[0]=(uint16_t)m_EnergyThreshold;
513 twoValues.s[1]=(uint16_t)m_OffTimeCut;
514 m_CounterBlkBlock.push_back(twoValues.l);
515
516 // Write the Energy threshold used to determine which cell is a hot cell in the first
517 // 32 bit word of the counters
518 // Write the Energy Ex of the ROD block in a 32 bits word
519 // Write the Energy Ey of the ROD block in a 32 bits word
520 // Ex and Ey have to be 32 bits words as they are sums of multiple 16 bits words
521
522 uint32_t* aux = (uint32_t*)&m_Ex;
523 m_CounterBlkBlock.push_back(*aux);
524 aux = (uint32_t*)&m_Ey;
525 m_CounterBlkBlock.push_back(*aux);
526
527 // write the hottest cell index for that FEB and its energy in MeV
528
529 twoValues.s[0]=(uint16_t)((m_HottestCellIndex<<9)|((uint16_t)((m_HottestCellEnergy>>16))&0x01FF));
530 twoValues.s[1]=(uint16_t)m_HottestCellEnergy;
531 m_CounterBlkBlock.push_back(twoValues.l);
532
533 aux = (uint32_t*)&m_Ez;
534 m_CounterBlkBlock.push_back(*aux);
535
536 n = m_CounterBlkBlock.size();
538 //Check if Counter Block exists and is not yet part of the fragment
539 LARBSDBG("Checking for Counter Block n=" << n << "BlockOffset=" << BlockOffset);
540 if (n && !BlockOffset)
541 {
544 m_logstr << MSG::INFO << "In finalizeFEB-------------------->>>>> " << "Checking for Counter Block : length= " << n << " BlockOffset=" << BlockOffset << endmsg;
545 for (unsigned i=0;i<n;i++)
546 m_vFragment->push_back(m_CounterBlkBlock[i]);
547 }
548
549 // Energy block...
550 n = m_EnergyBlock.size();
551 BlockOffset=LE_getVectorHeader16(EBlkOffset);
552 LARBSDBG("Checking Energy Block n=" << n << "BlockOffset=" << BlockOffset);
553 //Check if Energy-Block exists and is not yet part of the fragment
554 if (n && !BlockOffset)
555 {
557 BlockOffset=LE_getVectorHeader16(EBlkOffset);
558 m_logstr << MSG::DEBUG << "In finalyseFEB-------------------->>>>> " << "Checking for Energy Block : length= " << n << " BlockOffset=" << BlockOffset << endmsg;
559 for(unsigned int i=0;i<n;i++)
560 m_vFragment->push_back(m_EnergyBlock[i]);
561 }
562
563 // Gain block...
564 n = m_GainBlock.size();
566 LARBSDBG("Checking Gain Block n=" << n << "BlockOffset=" << BlockOffset);
567 //Check if Gain-Block exists and is not yet part of the fragment
568 if (n && !BlockOffset)
569 {
572 for(unsigned int i=0;i<n;i++)
573 m_vFragment->push_back(m_GainBlock[i]);
574 }
575
576 // FeBInfo Block... // offline encoder just put dummy info there
577 for (int nword=0; nword<m_NFebInfoBlkWords ; nword++)
578 m_FebInfoBlock.push_back(0L);
579
580 n = m_FebInfoBlock.size();
582 LARBSDBG("Checking FebInfo Block n=" << n << "BlockOffset=" << BlockOffset);
583 //Check if Gain-Block exists and is not yet part of the fragment
584 if (n && !BlockOffset)
585 {
588 for(unsigned int i=0;i<n;i++)
589 m_vFragment->push_back(m_FebInfoBlock[i]);
590 }
591
592 // Time and Quality block
593 n = m_TimeQualityBlock.size();
595 LARBSDBG("Checking Time and Quality Block n=" << n << "BlockOffset=" << BlockOffset);
596 //Check if Time and Quality Block exists and is not yet part of the fragment
597 if (n && !BlockOffset)
598 {
601 m_logstr << MSG::DEBUG << "In finalizeFEB-------------------->>>>> " << "Checking for Time and Quality Block : length= " << n << " BlockOffset=" << BlockOffset << endmsg;
602 for(unsigned int i=0;i<n;i++)
603 m_vFragment->push_back(m_TimeQualityBlock[i]);
604 }
605
606 // Raw data
607 LARBSDBG("Checking Raw Data Block");
608 n = m_RawDataBlock.size();
610 LARBSDBG("Checking Raw Data Block. n=" << n << "BlockOffset=" << BlockOffset);
611 //Check if Raw Data block exists and is not yet part of the fragment
612 if ((n>m_NFlaggingWords) && (!BlockOffset))
613 {
615 for(unsigned int i=0;i<n;i++)
616 m_vFragment->push_back(m_RawDataBlock[i]);
617 }
619
620 m_logstr << MYLEVEL << "***********************************************************************"<< endmsg;
621 m_logstr << MYLEVEL << "m_HottestCellIndex : "<< m_HottestCellIndex << endmsg;
622 m_logstr << MYLEVEL << "m_HottestCellEnergy : "<< m_HottestCellEnergy << endmsg;
623 m_logstr << MYLEVEL << "***********************************************************************"<< endmsg;
624 m_logstr << MYLEVEL << "m_Ex : "<< m_Ex << endmsg;
625 m_logstr << MYLEVEL << "m_Ey : "<< m_Ey << endmsg;
626 m_logstr << MYLEVEL << "***********************************************************************"<< endmsg;
627
628 clearBlocks();
629}
#define LARBSDBG(text)
This class provides decoding/encoding from/to ROD format.
#define MYLEVEL
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
void setHeader32(const unsigned n, const uint32_t w)
uint16_t LE_getVectorHeader16(const unsigned n) const
void LE_setHeader16(const unsigned n, const uint16_t w)
setWord1 uint16_t
setEventNumber uint32_t

◆ getBit()

int LArRodBlockStructure::getBit ( const uint32_t *const p,
const unsigned chan ) const
inlineprotectedinherited

Definition at line 422 of file LArRodBlockStructure.h.

423{// chan = (0,127)
424 // int a = chan/32;
425 // int r = chan%32;
426 int a = chan>>5;
427 int r = chan&0x1f;
428 // a = (0,3), r = ( 0, 31 )
429 return (*(p+a)>>r) & 0x1;
430}
static Double_t a
int r
Definition globals.cxx:22

◆ getCtrl1()

uint16_t LArRodBlockPhysicsV3::getCtrl1 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 755 of file LArRodBlockPhysicsV3.cxx.

756{
759 x=x>>16;
760 uint16_t ctrl=x;
761 return ctrl;
762}
#define x
uint16_t LE_getHeader16(const unsigned n) const
str index
Definition DeMoScan.py:362

◆ getCtrl2()

uint16_t LArRodBlockPhysicsV3::getCtrl2 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 764 of file LArRodBlockPhysicsV3.cxx.

765{
768 x=x&0xffff;
769 uint16_t ctrl=x;
770 return ctrl;
771}

◆ getCtrl3()

uint16_t LArRodBlockPhysicsV3::getCtrl3 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 773 of file LArRodBlockPhysicsV3.cxx.

774{
777 x=x>>16;
778 uint16_t ctrl=x;
779 return ctrl;
780}

◆ getDAC()

uint16_t LArRodBlockStructure::getDAC ( ) const
inlinevirtualinherited

◆ getDelay()

uint16_t LArRodBlockStructure::getDelay ( ) const
inlinevirtualinherited

◆ getDspCodeVersion()

uint32_t LArRodBlockStructure::getDspCodeVersion ( ) const
virtualinherited

Definition at line 234 of file LArRodBlockStructure.cxx.

235{
236 int i=getNumberOfWords()-2;
237 return m_FebBlock[i];
238}
uint32_t getNumberOfWords() const

◆ getDspEventCounter()

int32_t LArRodBlockStructure::getDspEventCounter ( ) const
virtualinherited

Definition at line 240 of file LArRodBlockStructure.cxx.

241{
242 int i=getNumberOfWords()-1;
243 return m_FebBlock[i];
244}

◆ getEx()

int32_t LArRodBlockPhysicsV3::getEx ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 303 of file LArRodBlockPhysicsV3.h.

304{
305 const uint32_t* copy32u = reinterpret_cast<const uint32_t*>(m_CounterPtr+4);
306 return *copy32u;
307}

◆ getEy()

int32_t LArRodBlockPhysicsV3::getEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 309 of file LArRodBlockPhysicsV3.h.

310{
311 const uint32_t* copy32u = reinterpret_cast<const uint32_t*>(m_CounterPtr+6);
312 return *copy32u;
313}

◆ getEz()

int32_t LArRodBlockPhysicsV3::getEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 315 of file LArRodBlockPhysicsV3.h.

316{
317 const uint32_t* aux = reinterpret_cast<const uint32_t*>(m_CounterPtr+10);
318 return *aux;
319}

◆ getFEBID()

uint32_t LArRodBlockStructure::getFEBID ( ) const
inlineinherited

Definition at line 293 of file LArRodBlockStructure.h.

294{
295 return getHeader32(FEBID);
296}
uint32_t getHeader32(const unsigned n) const

◆ getFEBSN()

uint32_t LArRodBlockStructure::getFEBSN ( ) const
inlineinherited

Definition at line 298 of file LArRodBlockStructure.h.

299{
300 return getHeader32(FEBSN);
301}

◆ getHeader16()

uint16_t LArRodBlockStructure::getHeader16 ( const unsigned n) const
inlineprotectedinherited

Definition at line 345 of file LArRodBlockStructure.h.

346{
347 if (n&0x1) //n is an odd number
348 return m_FebBlock[n>>1] & 0xffff; //1,3,5... are fetched from lower bits
349 else //n is a even number
350 return m_FebBlock[n>>1] >> 16; //0,2,4... are fetched from higher bits
351}

◆ getHeader32()

uint32_t LArRodBlockStructure::getHeader32 ( const unsigned n) const
inlineprotectedinherited

Definition at line 353 of file LArRodBlockStructure.h.

354{return m_FebBlock[n>>1];}

◆ getHotCellThreshold()

uint16_t LArRodBlockPhysicsV3::getHotCellThreshold ( ) const
inlinevirtual

Definition at line 294 of file LArRodBlockPhysicsV3.h.

295{
296 return (uint16_t) (*(m_CounterPtr+2));
297}

◆ getHottestCellEnergy()

uint32_t LArRodBlockPhysicsV3::getHottestCellEnergy ( ) const
inlinevirtual

Definition at line 326 of file LArRodBlockPhysicsV3.h.

327{
328
329 uint32_t aux;
330 aux = * reinterpret_cast<const uint32_t *>(m_CounterPtr+8);
331 return (aux&0x01FFFFFF);
332}

◆ getHottestCellIndex()

uint16_t LArRodBlockPhysicsV3::getHottestCellIndex ( )
inlinevirtual

Definition at line 321 of file LArRodBlockPhysicsV3.h.

322{
323 return ((uint16_t) (*(m_CounterPtr+8)>>9));
324}

◆ getNbSweetCells1()

uint16_t LArRodBlockStructure::getNbSweetCells1 ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 231 of file LArRodBlockStructure.cxx.

231{ return 0; }

◆ getNbSweetCells2()

uint16_t LArRodBlockStructure::getNbSweetCells2 ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 232 of file LArRodBlockStructure.cxx.

232{ return 0; }

◆ getNextAccumulatedCalibDigit()

int LArRodBlockStructure::getNextAccumulatedCalibDigit ( int & channelNumber,
std::vector< uint64_t > & SamplesSum,
std::vector< uint64_t > & Samples2Sum,
uint32_t & nStepTriggers,
uint32_t & gain )
virtualinherited

Reimplemented in LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 86 of file LArRodBlockStructure.cxx.

87{
88 m_logstr << MSG::ERROR << "Error: Function getNextAccumulatedCalibDigit not implemented in this instance of LArRodBlockStructure!" << endmsg;
89 return 0;
90}

◆ getNextAccumulatedDigit()

int LArRodBlockStructure::getNextAccumulatedDigit ( int & channelNumber,
std::vector< uint64_t > & SamplesSum,
std::vector< uint64_t > & corr2Sum,
uint32_t & gain )
virtualinherited

Reimplemented in LArRodBlockAccumulatedV3.

Definition at line 92 of file LArRodBlockStructure.cxx.

93{
94 m_logstr << MSG::ERROR << "Error: Function getNextAccumulatedDigit not implemented in this instance of LArRodBlockStructure!" << endmsg;
95 return 0;
96}

◆ getNextEnergy()

int LArRodBlockPhysicsV3::getNextEnergy ( int & channelNumber,
int32_t & energy,
int32_t & time,
int32_t & quality,
uint32_t & gain )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 206 of file LArRodBlockPhysicsV3.h.

207{
208 LARBSDBG("in LArRodBlockPhysicsV3::getNextEnergy.");
209 LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
210 if (m_EnergyIndex>=m_channelsPerFEB) //Already beyond maximal number of channels
211 return 0;
212 if (!m_EnergyPtr) //No data block present
213 return 0;
214 uint16_t tQ; // TimeQuality word
215
216 unsigned rodChannelNumber=m_EnergyIndex; // Index of Channel in ROD-Block
217 channelNumber=(rodChannelNumber>>4) + ((rodChannelNumber&0xf)<<3); //channel number of the FEB
218
219 // get information available for all cells
220 // Energy on a 16 bit word and decode ranges
221
222 uint16_t encodedEnergy; // 16 bits Encoded Energy word
223 int32_t aux;
224 uint16_t range; // 2 bits range
225 int32_t sign=1;
226
227 LARBSDBG("-------->>>> in LArRodBlockPhysicsV3::getNextEnergy : decode energy.....");
228 // decode energy
229 encodedEnergy = m_EnergyPtr[m_EnergyIndex];
231
232 if (encodedEnergy&0x8000) sign=-1;
233 range = ((encodedEnergy)>>13)&0x0003; // range is encoded in bits 14 and 13
234
235 aux = (int32_t) (encodedEnergy&0x1FFF);
236 if (range==1) aux=(aux<<3)+4; // shift left by 3 bits and add 4 MeV
237 else if (range==2) aux=(aux<<6)+32; // shift left by 6 bits and add 32 MeV
238 else if (range==3) aux=(aux<<9)+256; // shift left by 9 bits and add 256 MeV
239 energy = sign*aux;
240
241 // gain in 2 bits of a 32 bits word
242
243 gain=(uint32_t)((m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
244
245 // Decode Time and Quality if the information is present according to summary block
246
247 if (getBit(m_SumBlkPtr,rodChannelNumber)) // Data has Time and Quality information
248 {
250
251#ifdef LARBSDBGOUTPUT
252 m_logstr <<MSG::DEBUG<<"This cell has time and Quality information "<<endmsg;
253#endif
254
255 // Decode Time, Quality
256 // Q in bits 0-3
257 // t in bits 4-15
258
259 quality = (int32_t) (tQ & 0x003f);
260 tQ = tQ>>4;
261 time = (tQ<<4) + 8; // unit is 16 ps
263 }
264 else // Data has no Time and Quality information
265 {
266 time=0;
267 quality=-1;
268 }
269
270
271#ifdef LARBSDBGOUTPUT
272 m_logstr <<MSG::DEBUG<<"Range = "<<range<<endmsg;
273 m_logstr <<MSG::DEBUG<<"Sign = "<<sign<<endmsg;
274 m_logstr << MSG::DEBUG<<" Encoded Energy ="<< encodedEnergy << " E=" << energy
275 << " t=" << time
276 << " Q=" << quality
277 << " G=" << gain
278 << " channel Number=" << channelNumber
279 << endmsg;
280#endif
281
282 return 1;
283}
int sign(int a)
int getBit(const uint32_t *const p, const unsigned chan) const
time(flags, cells_name, *args, **kw)

◆ getNextRawData()

int LArRodBlockPhysicsV3::getNextRawData ( int & channelNumber,
std::vector< short > & samples,
uint32_t & gain )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 649 of file LArRodBlockPhysicsV3.cxx.

650{
651 LARBSDBG("in LArRodBlockPhysicsV3::getNextRawData.");
652 LARBSDBG("m_RawDataCounter=" << m_RawDataCounter << " m_RawDataIndex="<< m_RawDataIndex);
653 LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
654 if(m_FebBlockSize<=m_iHeadBlockSize) return 0;
656
658 if (!flags)
659 return 0; //Block not existing
660 if (m_RawDataCounter>=m_channelsPerFEB) //Already beyond maximal number of channels
661 return 0;
662
663 LARBSDBG("Flags="<<flags);
664
665 while (!getBit(m_RawDataFlagsPtr,m_RawDataCounter)) //Look for next filled channel
666 {
668 LARBSDBG("RawDataCounter ist now " << m_RawDataCounter);
669 if (m_RawDataCounter>=m_channelsPerFEB) //No more channel available
670 return 0;
671 }
672 LARBSDBG("Found filled channel at positon " << m_RawDataCounter);
673 //Found next filled channel
674 channelNumber=m_RawDataCounter;
675 unsigned int nsamples = LE_getHeader16(NGainNSamples) & 0x00FF;
676 LARBSDBG("This run has " << nsamples << " samples");
678 LARBSDBG( "index="<<index);
680 LARBSDBG("In getnextRawData(). index= " << index);
681 gain=3-((m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
682 if(gain>=CaloGain::LARNGAIN) return 0;
683 for(unsigned int i=0;i<nsamples;i++) {
684 uint16_t x;
685 if((index+i)%2==0)
687 else
689 samples.push_back((short) (x & 0xfff));
690 }
692
693 if (m_rearrangeFirstSample && m_rearrangeFirstSample<samples.size()) //FIXME: Very ugly hack! See explanation in LArRodDecoder.h file
694 {//Change e.g. 3 0 1 2 4 to 0 1 2 3 4
695 short movedSample=samples[0];
696 for (unsigned i=1;i<=m_rearrangeFirstSample;i++)
697 samples[i-1]=samples[i];
698 samples[m_rearrangeFirstSample]=movedSample;
699 }
700
701 return 1;
702}
@ LARNGAIN
Definition CaloGain.h:19

◆ getNStep()

uint16_t LArRodBlockStructure::getNStep ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, and LArRodBlockCalibrationV3.

Definition at line 475 of file LArRodBlockStructure.h.

476{
477 return 0;
478}

◆ getNTrigger()

uint16_t LArRodBlockStructure::getNTrigger ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 466 of file LArRodBlockStructure.h.

467{
468 return 0;
469}

◆ getNumberOfGains()

uint32_t LArRodBlockPhysicsV3::getNumberOfGains ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 742 of file LArRodBlockPhysicsV3.cxx.

743{
744 return LE_getHeader16(NGainNSamples)>>8;
745}

◆ getNumberOfHotCells()

uint16_t LArRodBlockPhysicsV3::getNumberOfHotCells ( ) const
inlinevirtual

Definition at line 285 of file LArRodBlockPhysicsV3.h.

286{
287 return (uint16_t) (*m_CounterPtr);
288}

◆ getNumberOfHotCellsInTime()

uint16_t LArRodBlockPhysicsV3::getNumberOfHotCellsInTime ( ) const
inlinevirtual

Definition at line 289 of file LArRodBlockPhysicsV3.h.

290{
291 return (uint16_t) *(m_CounterPtr+1);
292}

◆ getNumberOfSamples()

uint32_t LArRodBlockPhysicsV3::getNumberOfSamples ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 737 of file LArRodBlockPhysicsV3.cxx.

738{
739 return LE_getHeader16(NGainNSamples)&0xff;
740}

◆ getNumberOfWords()

uint32_t LArRodBlockStructure::getNumberOfWords ( ) const
inlineinherited

Definition at line 417 of file LArRodBlockStructure.h.

418{
419 return getHeader32(NWTot);
420}

◆ getOfftimeThreshold()

uint16_t LArRodBlockPhysicsV3::getOfftimeThreshold ( ) const
inlinevirtual

Definition at line 298 of file LArRodBlockPhysicsV3.h.

299{
300 return (uint16_t) (*(m_CounterPtr+3));
301}

◆ getPulsed()

bool LArRodBlockStructure::getPulsed ( unsigned channelNumber) const
inlinevirtualinherited

◆ getRadd()

uint32_t LArRodBlockPhysicsV3::getRadd ( uint32_t adc,
uint32_t sample ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 747 of file LArRodBlockPhysicsV3.cxx.

◆ getRawDataSize()

uint16_t LArRodBlockStructure::getRawDataSize ( ) const
virtualinherited

◆ getResults1Size()

uint16_t LArRodBlockStructure::getResults1Size ( ) const
virtualinherited

◆ getResults2Size()

uint16_t LArRodBlockStructure::getResults2Size ( ) const
virtualinherited

◆ getStatus()

uint32_t LArRodBlockPhysicsV3::getStatus ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 782 of file LArRodBlockPhysicsV3.cxx.

783{
784 if(getNumberOfWords()<Status2/2) return 0;
786 return x;
787}

◆ getStepIndex()

uint16_t LArRodBlockStructure::getStepIndex ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, and LArRodBlockCalibrationV3.

Definition at line 471 of file LArRodBlockStructure.h.

472{
473 return 0;
474}

◆ getSumE()

int32_t LArRodBlockStructure::getSumE ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 315 of file LArRodBlockStructure.h.

315 {
316 return 0;
317}

◆ getTDCPhase()

uint8_t LArRodBlockStructure::getTDCPhase ( ) const
virtualinherited

◆ getVectorHeader16()

uint16_t LArRodBlockStructure::getVectorHeader16 ( const unsigned n) const
inlineprotectedinherited

Definition at line 356 of file LArRodBlockStructure.h.

357{
358 if (n&0x1) //n is an odd number
359 return (std::as_const(*m_vFragment).at(n>>1) & 0xffff);
360 else //n is a even number
361 return (std::as_const(*m_vFragment).at(n>>1) >> 16);
362}

◆ getVectorHeader32()

uint32_t LArRodBlockStructure::getVectorHeader32 ( const unsigned n) const
inlineprotectedinherited

Definition at line 364 of file LArRodBlockStructure.h.

365{
366 return (*m_vFragment)[n>>1];
367}

◆ getVROBEx()

int32_t LArRodBlockStructure::getVROBEx ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 323 of file LArRodBlockStructure.h.

323 {
324 return 0;
325}

◆ getVROBEy()

int32_t LArRodBlockStructure::getVROBEy ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 327 of file LArRodBlockStructure.h.

327 {
328 return 0;
329}

◆ getVROBEz()

int32_t LArRodBlockStructure::getVROBEz ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 331 of file LArRodBlockStructure.h.

331 {
332 return 0;
333}

◆ getVROBFebId()

uint32_t LArRodBlockStructure::getVROBFebId ( )
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 319 of file LArRodBlockStructure.h.

319 {
320 return 0;
321}

◆ getVROBSumE()

int32_t LArRodBlockStructure::getVROBSumE ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 335 of file LArRodBlockStructure.h.

335 {
336 return 0;
337}

◆ hasAccumBlock()

virtual uint32_t LArRodBlockStructure::hasAccumBlock ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3.

Definition at line 121 of file LArRodBlockStructure.h.

121{return 0;} ;

◆ hasCalibBlock()

virtual uint32_t LArRodBlockStructure::hasCalibBlock ( ) const
inlinevirtualinherited

◆ hasControlWordBlock()

virtual uint32_t LArRodBlockPhysicsV3::hasControlWordBlock ( ) const
inlinevirtual

Definition at line 138 of file LArRodBlockPhysicsV3.h.

◆ hasControlWords()

virtual uint32_t LArRodBlockStructure::hasControlWords ( ) const
inlinevirtualinherited

◆ hasPhysicsBlock()

virtual uint32_t LArRodBlockPhysicsV3::hasPhysicsBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 136 of file LArRodBlockPhysicsV3.h.

136{return LE_getHeader16(EBlkOffset);} ;

◆ hasRawDataBlock()

virtual uint32_t LArRodBlockPhysicsV3::hasRawDataBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 137 of file LArRodBlockPhysicsV3.h.

◆ initializeFEB()

void LArRodBlockPhysicsV3::initializeFEB ( const uint32_t id)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 462 of file LArRodBlockPhysicsV3.cxx.

463{
465 if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
466 {
467 m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
468 setHeader32(FEBID,id); //Set Feb ID
469 }
470
471 m_SumBlkBlock.resize(0);
472 m_CounterBlkBlock.resize(0);
473 m_EnergyBlock.resize(0);
474 m_GainBlock.resize(0);
475 m_FebInfoBlock.resize(0);
476 m_RawDataBlock.resize(0);
477
479}

◆ initializeFragment()

void LArRodBlockPhysicsV3::initializeFragment ( std::vector< uint32_t > & fragment)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 435 of file LArRodBlockPhysicsV3.cxx.

436{
437 m_pRODblock=&fragment; //remember pointer to fragment
438 if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
439 unsigned int sizeRead=0;
440 //Store existing data in the FEB-Map
441 while (sizeRead<fragment.size()) {
442 std::vector<uint32_t>::iterator FebIter;
443 FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
444 m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
445 uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
446 uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
447 if (FebIter+currFebSize>fragment.end()) {
448 fragment.clear(); //Clear existing vector
449 m_logstr << MSG::ERROR << "Got inconsistent ROD-Fragment!" << endmsg;
450 return;
451 }
452 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
453 sizeRead+=currFebSize+m_MiddleHeaderSize; //6 is the middle header size
454 LARBSDBG("Found FEB-id " << currFEBid << " in existing ROD-Fragment");
455 } // end while
456 }
457 fragment.clear(); //Clear existing vector
458 return;
459}

◆ LE_getHeader16()

uint16_t LArRodBlockStructure::LE_getHeader16 ( const unsigned n) const
inlineprotectedinherited

Definition at line 394 of file LArRodBlockStructure.h.

395{
396 return (reinterpret_cast<const uint16_t*>(m_FebBlock))[n];
397}

◆ LE_getVectorHeader16()

uint16_t LArRodBlockStructure::LE_getVectorHeader16 ( const unsigned n) const
inlineprotectedinherited

Definition at line 399 of file LArRodBlockStructure.h.

400{
401 const uint32_t* data32 = std::as_const(*m_vFragment).data();
402 const uint16_t* data16 = reinterpret_cast<const uint16_t*> (data32);
403 return data16[n];
404}

◆ LE_setHeader16()

void LArRodBlockStructure::LE_setHeader16 ( const unsigned n,
const uint16_t w )
inlineprotectedinherited

Definition at line 406 of file LArRodBlockStructure.h.

407{
408#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
409 if ((unsigned)n>=m_vFragment->size()*2) {
410 m_logstr << MSG::ERROR << "LArRodBlockStructure::LE_setHeader16 Error: WRITE BEYOND ARRAY BOUNDARY!" << endmsg;
411 std::abort();
412 }
413#endif
414 reinterpret_cast<uint16_t*>(m_vFragment->data())[n] = w;
415}

◆ nextFEB()

bool LArRodBlockStructure::nextFEB ( )
inlineinherited

Definition at line 480 of file LArRodBlockStructure.h.

481{
483
484 const int32_t FebOffset = m_FebBlockSize+m_MiddleHeaderSize;
485 const int32_t LeftSize = m_RodBlockSize-FebOffset+m_RodBlock-m_FebBlock;
486 if ( LeftSize<=0 ) return false; //No next feb
487
488 m_FebBlock += FebOffset; //Jump to the next FEB fragment
489 const int32_t BlockSize = getNumberOfWords();
490 if (BlockSize>LeftSize) {
491 m_logstr << MSG::ERROR << "Error while decoding LArByteStream: Found FEB block of size " << BlockSize << " in a ROD block of size " << LeftSize << endmsg;
492 m_error_next_feb = true;
493 return false;
494 }
495
496 m_FebBlockSize=BlockSize;
497
498 setPointers();
499 return true;
500}

◆ offlineCheckSum()

uint32_t LArRodBlockStructure::offlineCheckSum ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV4.

Definition at line 147 of file LArRodBlockStructure.cxx.

◆ OfflineToRawGain()

uint32_t LArRodBlockStructure::OfflineToRawGain ( const uint32_t gain) const
inlineinherited

Definition at line 342 of file LArRodBlockStructure.h.

343{return m_OfflineToRawGainMap[gain];} //For efficency, don't check range
static const uint32_t m_OfflineToRawGainMap[3]

◆ onlineCheckSum()

uint32_t LArRodBlockStructure::onlineCheckSum ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV4.

Definition at line 139 of file LArRodBlockStructure.cxx.

140{
141 int offset = getNumberOfWords()-1;
142 if(offset>=m_FebBlockSize) return 0;
143 if(offset<0) return 0;
144 return m_FebBlock[offset];
145}

◆ operator()()

template<class RAWDATA>
bool LArRodBlockPhysicsV3::operator() ( const RAWDATA * ch1,
const RAWDATA * ch2 ) const

Definition at line 709 of file LArRodBlockPhysicsV3.cxx.

711{
712 HWIdentifier id1 = ch1->channelID();
713 HWIdentifier id2 = ch2->channelID();
714
715 HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
716 HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
717
718 if(febId1 == febId2 ){
719 int cId1 = m_onlineHelper->channel(id1);
720 int cId2 = m_onlineHelper->channel(id2);
721 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
722 }
723
724 return febId1 < febId2 ;
725}
int FebToRodChannel(int ch) const

◆ RawToOfflineGain()

uint32_t LArRodBlockStructure::RawToOfflineGain ( const uint32_t gain) const
inlineinherited

Definition at line 339 of file LArRodBlockStructure.h.

340{return m_RawToOfflineGainMap[gain];} //For efficency, don't check range
static const uint32_t m_RawToOfflineGainMap[4]

◆ report_error()

bool LArRodBlockStructure::report_error ( void ) const
inlineinherited

Definition at line 173 of file LArRodBlockStructure.h.

173{ return m_error_next_feb;}

◆ resetPointers()

void LArRodBlockPhysicsV3::resetPointers ( )
inlineprivatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 102 of file LArRodBlockPhysicsV3.cxx.

103{
108 m_GainIndex=0;
110 m_SumBlkIndex=0;
112
115 m_Ex=0;
116 m_Ey=0;
117 m_Ez=0;
118 m_HottestCellIndex=255; // 255 is unphysical since cells index are between 0 and 127 per FEB.
120}

◆ setBit()

void LArRodBlockStructure::setBit ( uint32_t *const p,
const unsigned chan )
inlineprotectedinherited

Definition at line 433 of file LArRodBlockStructure.h.

434{
435 // chan = (0,127)
436 // int a = chan/32;
437 // int r = chan%32;
438 int a = chan>>5;
439 int r = chan&0x1f;
440 // a = (0,3), r = ( 0, 31 )
441 *(p+a) |= (1<<r) ;
442 return;
443}

◆ setDAC()

void LArRodBlockStructure::setDAC ( const uint16_t DACValue)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 54 of file LArRodBlockStructure.cxx.

55{
56 m_logstr << MSG::ERROR << "Error: Function setDAC not implemented in this instance of LArRodBlockStructure!" << endmsg;
57}

◆ setDelay()

void LArRodBlockStructure::setDelay ( const uint16_t DelayValue)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 59 of file LArRodBlockStructure.cxx.

60{
61 m_logstr << MSG::ERROR << "Error: Function setDelay not implemented in this instance of LArRodBlockStructure!" << endmsg;
62}

◆ setEThreshold()

void LArRodBlockPhysicsV3::setEThreshold ( uint16_t thres)
virtual

Definition at line 790 of file LArRodBlockPhysicsV3.cxx.

791{
792 m_EnergyThreshold=thres;
793}

◆ setEtQ()

void LArRodBlockStructure::setEtQ ( const int channel,
const int32_t energy,
const int32_t time,
const int32_t quality,
const uint32_t gain )
virtualinherited

Definition at line 110 of file LArRodBlockStructure.cxx.

111{
112 m_logstr << MSG::ERROR << "Error: Function setEtQ not implemented in this instance of LArRodBlockStructure!" << endmsg;
113}

◆ setEx()

void LArRodBlockPhysicsV3::setEx ( double Ex)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 800 of file LArRodBlockPhysicsV3.cxx.

801{
802 m_Ex=(int32_t)Ex;
803 return;
804}

◆ setEy()

void LArRodBlockPhysicsV3::setEy ( double Ey)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 805 of file LArRodBlockPhysicsV3.cxx.

806{
807 m_Ey=(int32_t)Ey;
808 return;
809}

◆ setEz()

void LArRodBlockPhysicsV3::setEz ( double Ez)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 811 of file LArRodBlockPhysicsV3.cxx.

812{
813 m_Ez=(int32_t)Ez;
814 return;
815}

◆ setFirstSample()

void LArRodBlockStructure::setFirstSample ( const int rearrangeFirstSample)
inlineinherited

Definition at line 166 of file LArRodBlockStructure.h.

167 {m_rearrangeFirstSample=rearrangeFirstSample;}

◆ setFragment()

bool LArRodBlockStructure::setFragment ( const uint32_t * p,
uint32_t n )
inlineinherited

Definition at line 248 of file LArRodBlockStructure.h.

249{
251 m_FebBlock = p;
254 uint32_t BlockSize = 0;
255
256 if (n==0) {
257 m_logstr << MSG::ERROR << "Error while decoding LArByteStream: Got Rod block size 0" << endmsg;
258 return false;
259 }
260
261 BlockSize = getNumberOfWords();
262 if (BlockSize>n) {
263 m_logstr << MSG::ERROR << "Error while decoding LArByteStream: Found FEB block of size " << BlockSize << " in a ROD block of size " << n << endmsg;
264 return false;
265 }
266 m_FebBlockSize = BlockSize;
267
268 m_error_next_feb = false;
269
270 return setPointers();
271}

◆ setFragmentVirtualROB()

int LArRodBlockStructure::setFragmentVirtualROB ( const uint32_t * p,
uint32_t n )
inlinevirtualinherited

Definition at line 275 of file LArRodBlockStructure.h.

277{
282 if ( n<2 ) { m_logstr << MSG::ERROR << "Error" << endmsg; return 0;}
283 m_virtualROBJump = ((*p)>>16)>>1; // Divide by two (two FEBs-1ROB)
284 m_ROB_to_decode = ( (*p) & 0xFFFF )<<1; // Multiply by two
285 if ( (n - m_virtualROBJump*m_ROB_to_decode-1) ){
286 m_logstr << MSG::ERROR << "Error AGAIN" << endmsg;
287 return 0;
288 }
290 return m_ROB_to_decode;
291}
const uint32_t * m_virtualROBPointerLocal
const uint32_t * m_virtualROBPointer

◆ setGain()

virtual int LArRodBlockPhysicsV3::setGain ( const int )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 113 of file LArRodBlockPhysicsV3.h.

113{ return 1; };

◆ setHeader16()

void LArRodBlockStructure::setHeader16 ( const unsigned n,
const uint16_t w )
inlineprotectedinherited

Definition at line 369 of file LArRodBlockStructure.h.

370{
371#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
372 if ((unsigned)n>=m_vFragment->size()*2) {
373 m_logstr << MSG::ERROR << "Error WRITE BEYOND ARRAY BOUNDARY!" << endmsg;
374 std::abort();
375 }
376#endif
377 if (n&0x1) // n is an odd number
378 m_vFragment->at(n>>1)=((m_vFragment->at(n>>1) & 0xffff0000) | w);
379 else
380 m_vFragment->at(n>>1)=((m_vFragment->at(n>>1) & 0xffff) | (w << 16));
381}

◆ setHeader32()

void LArRodBlockStructure::setHeader32 ( const unsigned n,
const uint32_t w )
inlineprotectedinherited

Definition at line 383 of file LArRodBlockStructure.h.

384{
385#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
386 if ((unsigned)n>=m_vFragment->size()*2) {
387 m_logstr << MSG::ERROR << "Error WRITE BEYOND ARRAY BOUNDARY!" << endmsg
388 std::abort();
389 }
390#endif
391 m_vFragment->at(n>>1) = w;
392}

◆ setNextEnergy() [1/2]

void LArRodBlockPhysicsV3::setNextEnergy ( const int channel,
const int32_t energy,
const int32_t time,
const int32_t quality,
const uint32_t gain )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 230 of file LArRodBlockPhysicsV3.cxx.

232{
233 m_logstr << MYLEVEL << "setNextEnergy-------------------->>>>>********************** new format V3 ***********" << endmsg;
234 m_logstr << MYLEVEL << "Channel=" << channel << " energy =" << energy << endmsg;
235 int rcNb=FebToRodChannel(channel);
236 //rcNb ist supposed to equal or bigger than m_EIndex.
237 //In the latter case, we fill up the missing channels with zero
238 if (rcNb<m_EnergyIndex) {
239 m_logstr << MSG::ERROR << "LArRODBlockStructure Error: Internal error. Channels not ordered correctly. rcNb=" << rcNb
240 << " m_EnergyIndex=" << m_EnergyIndex << endmsg;
241 return;
242 }
243
244 //Fill up missing channels with zeros:
245 while (m_EnergyIndex<rcNb)
246 setNextEnergy((int16_t)0,(int16_t)32767,(int16_t)-32767,(uint32_t)0);
247
248 // update if needed the hottest cell info
249 if ((energy>0)&&(energy>(int)m_HottestCellEnergy))
250 {
251 m_HottestCellEnergy = abs(energy);
253 }
254
255 // transform 32 bits data into 16 bits data
256
257 uint16_t theenergy;
258 uint32_t abse,EncodedE;
259 int16_t thetime,thequality;
260 int32_t sign;
261
262 thetime = (int16_t) time >> 4;
263 thequality = (int16_t) quality;
264
265 sign=(energy>=0?1:-1); // get sign of energy
266 abse=(uint32_t)abs(energy);
267
268 EncodedE=abse; // range 0
269
270 if ((abse>8192)&&(abse<65536))
271 {
272 EncodedE=((abse>>3)|0x2000); // range 1 : drop last 3 bits and put range bits (bits 14 and 13 = 01)
273 }
274 else if ((abse>65535)&&(abse<524288))
275 {
276 EncodedE=((abse>>6)|0x4000); // range 2 : drop last 6 bits and put range bits (bits 14 and 13 = 10)
277 }
278 else if ((abse>524288))
279 {
280 EncodedE=((abse>>9)|0x6000); // range 3 : drop last 9 bits and put range bits (bits 14 and 13 = 11)
281 }
282
283 // treat sign now :
284
285 if (sign<0) EncodedE |= 0x8000;
286 theenergy = (uint16_t) EncodedE;
287
288 // Add data...
289
290 m_logstr << MYLEVEL << "setNextEnergy-------------------->>>>> Energy = "<< energy << " Encoded Energy =" << theenergy << endmsg;
291
292 if (abse> m_EnergyThreshold)
293 {
294 setNextEnergy(theenergy,thetime,thequality,gain);
295 }
296 else
297 {
298 setNextEnergy(theenergy,(int16_t)32767,(int16_t)-32767,gain);
299 }
300}
setScaleOne setStatusOne setSaturated int16_t

◆ setNextEnergy() [2/2]

void LArRodBlockPhysicsV3::setNextEnergy ( const uint16_t energy,
const int16_t time,
const int16_t quality,
const uint32_t gain )
private

Definition at line 303 of file LArRodBlockPhysicsV3.cxx.

304{
305 if (m_EnergyIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
306 {
307 m_logstr << MSG::ERROR << "LArRodBlockStructure Error: Attempt to write Energy for channel "
308 << m_EnergyIndex << " channels into a FEB!" <<endmsg;
309 return;
310 }
311 LARBSDBG("LArRodBlockStructure: Setting Energy for channel " << m_EnergyIndex << ". E=" << energy);
312
313 m_logstr << MYLEVEL << "In setNextEnergy-------------------->>>>> time = " << time << " quality=" << quality << endmsg;
314
315 // write for all cells energy and hardware gain
316
317 // Energy
318
319 m_EnergyIndex++; //Use m_EIndex to count the channels put in the Energy block
320
321 ShortLong twoValues{};
322 if (m_EnergyIndex%2) // m_EIndex-1 is even
323 {
324 twoValues.s[0]= energy;
325 twoValues.s[1]=0;
326 }
327 else
328 { //Even number: Merging with previous block
329 uint32_t oneValue=m_EnergyBlock[m_EnergyBlock.size()-1]; //Take last element of vector
330 m_EnergyBlock.pop_back();
331 uint16_t* valptr=reinterpret_cast<uint16_t*>(&oneValue);
332 twoValues.s[0]=valptr[0];
333 twoValues.s[1]=(uint16_t)energy;
334 }
335
336 LARBSDBG("Writing words: val0= " << twoValues.s[0] << " val1= " << twoValues.s[1]);
337 m_EnergyBlock.push_back(twoValues.l);
338 LARBSDBG("Writing Raw data to E block. E=" << energy);
339
340 // update summary block
341 // Summary block is one bit per cell
342
343 int mylocalBitwiseIndex = (int) (m_EnergyIndex-1)%32; // 1 bits in SB per channel
344 if (mylocalBitwiseIndex==0) // need for a new 32 bits word to store SM info of that cell
345 {
346 uint32_t SB;
347 SB = (quality==-32767?0x00000000:0x00000001);
348 m_SumBlkBlock.push_back(SB);
349 }
350 else
351 {
352 uint32_t SB=m_SumBlkBlock[m_GainBlock.size()-1]; //Take out last element of vector
353 m_SumBlkBlock.pop_back();
354 SB=(SB<<1)|(quality==-32767?0x00000000:0x00000001);
355 m_SumBlkBlock.push_back(SB);
356 }
357
358 // Hardware gain
359
360 mylocalBitwiseIndex = (m_EnergyIndex-1)%16; // 2 bits of gain per channel
361 if (mylocalBitwiseIndex==0) // need for a new 32 bits word to store the gain of that cell
362 {
363 m_GainBlock.push_back(gain&0x00000003);
364 }
365 else
366 {
367 uint32_t encodedgains=m_GainBlock[m_GainBlock.size()-1]; //Take out last element of vector
368 m_GainBlock.pop_back();
369 encodedgains=(encodedgains<<2)|(gain&0x00000003);
370 m_GainBlock.push_back(encodedgains);
371 }
372
373 // write Time and Chi2 for cells above HighEnergyCellCut threshold
374
375 if (quality!=-32767) // Do write Time and Chi2 information
376 {
377 // count the number of hot cells
379 // count the number of cells offtime
380 if (abs(time)>m_OffTimeCut) m_numberHotCellOffTime++;
381
382 mylocalBitwiseIndex = (m_numberHotCell-1)%2; // 16 bits per channel
383 ShortLong twoValues{};
384 if (mylocalBitwiseIndex==0) // need for a new 32 bits word to store the time quality of that cell
385 {
386 twoValues.s[0]=0;
387 twoValues.s[1]=0;
388 twoValues.s[0]=(int16_t)(time)|((quality>>10)&0x003F); // Quality on the first 6 bits and Time on the last 10 bits;
389 }
390 else
391 { //Even number: Merging with previous block
392 uint32_t oneValue=m_TimeQualityBlock[m_TimeQualityBlock.size()-1]; //Take last element of vector
393 m_TimeQualityBlock.pop_back();
394 int16_t* valptr=reinterpret_cast<int16_t*>(&oneValue);
395 twoValues.s[0]=valptr[0];
396 twoValues.s[1]=(int16_t)(time)|((quality>>12)&0x003F); // Quality on the first 4 bits and Time on the last 12 bits;
397 }
398 m_TimeQualityBlock.push_back(twoValues.l);
399 }
400}

◆ setNTrigger()

void LArRodBlockStructure::setNTrigger ( const uint16_t NTrigger)
virtualinherited

Definition at line 69 of file LArRodBlockStructure.cxx.

70{
71 m_logstr << MSG::ERROR << "Error: Function setNTrigger not implemented in this instance of LArRodBlockStructure!" << endmsg;
72}

◆ setNumberOfGains()

void LArRodBlockPhysicsV3::setNumberOfGains ( const uint8_t n)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 222 of file LArRodBlockPhysicsV3.cxx.

223{
225 LE_setHeader16(NGainNSamples,(oldword & 0x00FF) | (n<<8));
226}

◆ setNumberOfSamples()

void LArRodBlockPhysicsV3::setNumberOfSamples ( const uint8_t n)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 216 of file LArRodBlockPhysicsV3.cxx.

217{
219 LE_setHeader16(NGainNSamples,(oldword & 0xFF00) | n);
220}

◆ setOffTimeCut()

void LArRodBlockPhysicsV3::setOffTimeCut ( uint16_t TimeCut)
virtual

Definition at line 795 of file LArRodBlockPhysicsV3.cxx.

796{
797 m_OffTimeCut=TimeCut;
798}

◆ setPointers()

bool LArRodBlockPhysicsV3::setPointers ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 123 of file LArRodBlockPhysicsV3.cxx.

124{
125 //Set pointers to data blocks (pesuming, they exist)
127 {
129 m_SumBlkPtr=reinterpret_cast<const uint32_t*> (m_FebBlock+LE_getHeader16(SumBlkOffset));
130 else
131 m_SumBlkPtr=reinterpret_cast<const uint32_t*>(m_DummyBitMap);
132
135 else
136 m_CounterPtr=reinterpret_cast<const uint16_t*>(m_DummyBitMap);
137
139 m_EnergyPtr=reinterpret_cast<const uint16_t*>(m_FebBlock+LE_getHeader16(EBlkOffset));
140 else
141 m_EnergyPtr=reinterpret_cast<const uint16_t*>(m_DummyBitMap);
142
144 m_GainPtr=reinterpret_cast<const uint32_t*>(m_FebBlock+LE_getHeader16(GainBlkOffset));
145 else
146 m_GainPtr=reinterpret_cast<const uint32_t*>(m_DummyBitMap);
147
150 else
151 m_TimeQualityPtr=reinterpret_cast<const int16_t*>(m_DummyBitMap);
152
155 else
156 m_RawDataPtr=reinterpret_cast<const int16_t*>(m_DummyBitMap);
157
160 else
161 m_FebInfoDataPtr=reinterpret_cast<const int16_t*>(m_DummyBitMap);
162
163#ifdef LARBSDBGOUTPUT
164 m_logstr << MYLEVEL << "***********************************************************************"<< endmsg;
165 m_logstr << MYLEVEL << "Energy Pointed values :"<< endmsg;
166 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
167 m_logstr << MYLEVEL << "LE_getHeader16(SumBlkOffset) = "<< MSG::hex << LE_getHeader16(SumBlkOffset) << endmsg;
168 m_logstr << MYLEVEL << "LE_getHeader16(CounterBlkOffset) = "<< MSG::hex << LE_getHeader16(CounterBlkOffset) << endmsg;
169 m_logstr << MYLEVEL << "LE_getHeader16(GainBlkOffset) = "<< MSG::hex << LE_getHeader16(GainBlkOffset) << endmsg;
170 m_logstr << MYLEVEL << "LE_getHeader16(EBlkOffset) = "<< MSG::hex << LE_getHeader16(EBlkOffset) << endmsg;
171 m_logstr << MYLEVEL << "LE_getHeader16(FebInfoBlkOffset) = "<< MSG::hex << LE_getHeader16(FebInfoBlkOffset) << endmsg;
172 m_logstr << MYLEVEL << "LE_getHeader16(TimeQualityBlkOffset) = "<< MSG::hex << LE_getHeader16(TimeQualityBlkOffset) << endmsg;
173 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
174
175 m_logstr << MYLEVEL << "********************* SumBlck ************************************"<< endmsg;
176 for(int toto=0;toto<4;toto++)
177 m_logstr << MYLEVEL << "hexa = 0x" << MSG::hex << m_SumBlkPtr[toto] << endmsg;
178 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
179
180 m_logstr << MYLEVEL << "********************* CounterBlck ************************************"<< endmsg;
181 for(int toto=0;toto<10;toto++) m_logstr << MYLEVEL << "hexa = 0x" << MSG::hex << m_CounterPtr[toto] << endmsg;
182 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
183
184 m_logstr << MYLEVEL << "********************* FebInfoBlck ************************************"<< endmsg;
185 for(int toto=0;toto<4;toto++) m_logstr << MYLEVEL << "hexa = 0x" << MSG::hex << m_FebInfoDataPtr[toto] << endmsg;
186 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
187
188
189 m_logstr << MYLEVEL << "********************* Energies ************************************"<< endmsg;
190 for(int toto=0;toto<128;toto++)
191 m_logstr << MYLEVEL << "hexa = 0x" << MSG::hex << m_EnergyPtr[toto] << endmsg;
192 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
193
194 m_logstr << MYLEVEL << "********************* Time & Quality ************************************"<< endmsg;
195 for(int toto=0;toto<10;toto++)
196 m_logstr << MYLEVEL << "hexa = 0x" << MSG::hex << m_TimeQualityPtr[toto] << endmsg;
197 m_logstr << MYLEVEL << "************************************************************************"<< endmsg;
198#endif
199
200 }
201 else
202 {
203 m_SumBlkPtr=NULL;
204 m_CounterPtr=NULL;
205 m_EnergyPtr=NULL;
206 m_TimeQualityPtr=NULL;
207 m_GainPtr=NULL;
208 m_FebInfoDataPtr=NULL;
209 m_RawDataPtr=NULL;
211 }
212
213 return true;
214}
static const uint32_t m_DummyBitMap[4]

◆ setPulsed()

void LArRodBlockStructure::setPulsed ( const unsigned channelNumber)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 64 of file LArRodBlockStructure.cxx.

65{
66 m_logstr << MSG::ERROR << "Error: Function setPulsed not implemented in this instance of LArRodBlockStructure!" << endmsg;
67}

◆ setRawData()

void LArRodBlockPhysicsV3::setRawData ( const int channel,
const std::vector< short > & samples,
const uint32_t gain )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 402 of file LArRodBlockPhysicsV3.cxx.

402 {
403 //Convert Feb to Rod Channel Number:
404 int rcNb=FebToRodChannel(channel);
405 if (rcNb>=m_channelsPerFEB)
406 {
407 m_logstr << MSG::ERROR << "Attempt to write Energy for channel " << rcNb << " channels into a FEB!" << endmsg;
408 return;
409 }
410 unsigned int nsamples = LE_getVectorHeader16(NGainNSamples) & 0x00FF;
411 if(samples.size() != nsamples) {
412 m_logstr << MSG::ERROR << "Number of samples mismatch!\n";
413 m_logstr << " nsamples =" << nsamples;
414 m_logstr << " samples.size() =" << samples.size() << endmsg;
415 std::abort();
416 }
417
418 setBit(&m_RawDataBlock[0],rcNb);
419 //Samples have 12 bit and are shifted to the left by 2 bits.
420 // odd samples in high bits, even samples in low bits
421 if((nsamples/2)*2!=nsamples) { //odd number of samples - gain is alone
422 m_RawDataBlock.push_back((gain<<30) | samples[0]<<2);
423 for (unsigned int i=1;i<nsamples;i+=2)
424 m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
425 }
426 else { //even number of samples - gain is packed with sample 0
427 m_RawDataBlock.push_back((gain<<30) | (samples[1]<<18) | samples[0]<<2);
428 for (unsigned int i=2;i<nsamples;i+=2)
429 m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
430 }
431}
void setBit(uint32_t *const p, const unsigned chan)

◆ setRawDataFixed()

void LArRodBlockStructure::setRawDataFixed ( const int channel,
const std::vector< short > & samples,
const uint32_t gain )
virtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 115 of file LArRodBlockStructure.cxx.

116{
117 m_logstr << MSG::ERROR << "Error: Function setRawDataFixed not implemented in this instance of LArRodBlockStructure!" << endmsg;
118}

◆ setSumE()

void LArRodBlockStructure::setSumE ( double )
virtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 195 of file LArRodBlockStructure.cxx.

196{
197 // Do not set anything
198}

◆ setTDCPhase()

void LArRodBlockStructure::setTDCPhase ( const uint8_t n)
virtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 130 of file LArRodBlockStructure.cxx.

131{
132 m_logstr << MSG::ERROR << "Error: Function setTDCPhase not implemented in this instance of LArRodBlockStructure!" << endmsg;
133}

◆ sortDataVector() [1/5]

Reimplemented from LArRodBlockStructure.

Definition at line 90 of file LArRodBlockStructure.cxx.

216{}

◆ sortDataVector() [2/5]

void LArRodBlockStructure::sortDataVector ( std::vector< const LArAccumulatedDigit * > & )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 91 of file LArRodBlockStructure.cxx.

219{}

◆ sortDataVector() [3/5]

void LArRodBlockStructure::sortDataVector ( std::vector< const LArCalibDigit * > & )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 89 of file LArRodBlockStructure.cxx.

213{}

◆ sortDataVector() [4/5]

void LArRodBlockPhysicsV3::sortDataVector ( std::vector< const LArDigit * > & vDigit)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 732 of file LArRodBlockPhysicsV3.cxx.

733{
734 std::sort(vDigit.begin(),vDigit.end(),*this);
735}
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ sortDataVector() [5/5]

void LArRodBlockPhysicsV3::sortDataVector ( std::vector< const LArRawChannel * > & vRC)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 727 of file LArRodBlockPhysicsV3.cxx.

728{
729 std::sort(vRC.begin(),vRC.end(),*this);
730}

Member Data Documentation

◆ m_channelsPerFEB

int LArRodBlockStructure::m_channelsPerFEB
protectedinherited

Definition at line 219 of file LArRodBlockStructure.h.

◆ m_CounterBlkBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_CounterBlkBlock
private

Definition at line 152 of file LArRodBlockPhysicsV3.h.

◆ m_CounterIndex

int LArRodBlockPhysicsV3::m_CounterIndex = 0
private

Definition at line 163 of file LArRodBlockPhysicsV3.h.

◆ m_CounterPtr

const uint16_t* LArRodBlockPhysicsV3::m_CounterPtr
private

Definition at line 171 of file LArRodBlockPhysicsV3.h.

◆ m_DummyBitMap

const uint32_t LArRodBlockPhysicsV3::m_DummyBitMap ={0,0,0,0}
staticprivate

Definition at line 34 of file LArRodBlockPhysicsV3.h.

◆ m_EnergyBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_EnergyBlock
private

Definition at line 153 of file LArRodBlockPhysicsV3.h.

◆ m_EnergyIndex

int LArRodBlockPhysicsV3::m_EnergyIndex = 0
private

Definition at line 164 of file LArRodBlockPhysicsV3.h.

◆ m_EnergyPtr

const uint16_t* LArRodBlockPhysicsV3::m_EnergyPtr
private

Definition at line 172 of file LArRodBlockPhysicsV3.h.

◆ m_EnergyThreshold

uint16_t LArRodBlockPhysicsV3::m_EnergyThreshold
private

Definition at line 189 of file LArRodBlockPhysicsV3.h.

◆ m_error_next_feb

bool LArRodBlockStructure::m_error_next_feb
protectedinherited

Definition at line 237 of file LArRodBlockStructure.h.

◆ m_Ex

int32_t LArRodBlockStructure::m_Ex
protectedinherited

Definition at line 203 of file LArRodBlockStructure.h.

◆ m_Ey

int32_t LArRodBlockStructure::m_Ey
protectedinherited

Definition at line 204 of file LArRodBlockStructure.h.

◆ m_Ez

int32_t LArRodBlockStructure::m_Ez
protectedinherited

Definition at line 205 of file LArRodBlockStructure.h.

◆ m_FebBlock

const uint32_t* LArRodBlockStructure::m_FebBlock
protectedinherited

Definition at line 221 of file LArRodBlockStructure.h.

◆ m_FebBlockSize

int32_t LArRodBlockStructure::m_FebBlockSize
protectedinherited

Definition at line 223 of file LArRodBlockStructure.h.

◆ m_FebInfoBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_FebInfoBlock
private

Definition at line 155 of file LArRodBlockPhysicsV3.h.

◆ m_FebInfoDataPtr

const int16_t* LArRodBlockPhysicsV3::m_FebInfoDataPtr
private

Definition at line 175 of file LArRodBlockPhysicsV3.h.

◆ m_FebInfoIndex

int LArRodBlockPhysicsV3::m_FebInfoIndex = 0
private

Definition at line 165 of file LArRodBlockPhysicsV3.h.

◆ m_GainBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_GainBlock
private

Definition at line 154 of file LArRodBlockPhysicsV3.h.

◆ m_GainIndex

int LArRodBlockPhysicsV3::m_GainIndex = 0
private

Definition at line 166 of file LArRodBlockPhysicsV3.h.

◆ m_GainPtr

const uint32_t* LArRodBlockPhysicsV3::m_GainPtr
private

Definition at line 174 of file LArRodBlockPhysicsV3.h.

◆ m_HottestCellEnergy

uint32_t LArRodBlockPhysicsV3::m_HottestCellEnergy
private

Definition at line 192 of file LArRodBlockPhysicsV3.h.

◆ m_HottestCellIndex

uint16_t LArRodBlockPhysicsV3::m_HottestCellIndex
private

Definition at line 191 of file LArRodBlockPhysicsV3.h.

◆ m_iHeadBlockSize

unsigned short LArRodBlockStructure::m_iHeadBlockSize
protectedinherited

Definition at line 217 of file LArRodBlockStructure.h.

◆ m_logstr

MsgStream LArRodBlockStructure::m_logstr
protectedinherited

Definition at line 244 of file LArRodBlockStructure.h.

◆ m_mFebBlocks

FEBMAPTYPE LArRodBlockStructure::m_mFebBlocks
protectedinherited

Definition at line 228 of file LArRodBlockStructure.h.

◆ m_MiddleHeaderSize

int32_t LArRodBlockStructure::m_MiddleHeaderSize
protectedinherited

Definition at line 233 of file LArRodBlockStructure.h.

◆ m_NCounterBlkWords

int LArRodBlockPhysicsV3::m_NCounterBlkWords
private

Definition at line 180 of file LArRodBlockPhysicsV3.h.

◆ m_NEnergyBlkWords

int LArRodBlockPhysicsV3::m_NEnergyBlkWords
private

Definition at line 181 of file LArRodBlockPhysicsV3.h.

◆ m_NFebInfoBlkWords

int LArRodBlockPhysicsV3::m_NFebInfoBlkWords
private

Definition at line 183 of file LArRodBlockPhysicsV3.h.

◆ m_NFlaggingWords

int LArRodBlockPhysicsV3::m_NFlaggingWords
private

Definition at line 185 of file LArRodBlockPhysicsV3.h.

◆ m_NGainBlkWords

int LArRodBlockPhysicsV3::m_NGainBlkWords
private

Definition at line 182 of file LArRodBlockPhysicsV3.h.

◆ m_NSumBlkWords

int LArRodBlockPhysicsV3::m_NSumBlkWords
private

Definition at line 179 of file LArRodBlockPhysicsV3.h.

◆ m_numberHotCell

uint16_t LArRodBlockPhysicsV3::m_numberHotCell = 0U
private

Definition at line 187 of file LArRodBlockPhysicsV3.h.

◆ m_numberHotCellOffTime

uint16_t LArRodBlockPhysicsV3::m_numberHotCellOffTime = 0U
private

Definition at line 188 of file LArRodBlockPhysicsV3.h.

◆ m_numberOfEx

uint32_t LArRodBlockStructure::m_numberOfEx
protectedinherited

Definition at line 210 of file LArRodBlockStructure.h.

◆ m_numberOfEy

uint32_t LArRodBlockStructure::m_numberOfEy
protectedinherited

Definition at line 211 of file LArRodBlockStructure.h.

◆ m_numberOfEz

uint32_t LArRodBlockStructure::m_numberOfEz
protectedinherited

Definition at line 212 of file LArRodBlockStructure.h.

◆ m_numberOfSumE

uint32_t LArRodBlockStructure::m_numberOfSumE
protectedinherited

Definition at line 213 of file LArRodBlockStructure.h.

◆ m_OfflineToRawGainMap

const uint32_t LArRodBlockStructure::m_OfflineToRawGainMap ={3,2,1}
staticprotectedinherited

Definition at line 17 of file LArRodBlockStructure.h.

◆ m_OffTimeCut

int16_t LArRodBlockPhysicsV3::m_OffTimeCut
private

Definition at line 190 of file LArRodBlockPhysicsV3.h.

◆ m_onlineHelper

const LArOnlineID* LArRodBlockPhysicsV3::m_onlineHelper
private

Definition at line 194 of file LArRodBlockPhysicsV3.h.

◆ m_pRODblock

std::vector<uint32_t>* LArRodBlockStructure::m_pRODblock
protectedinherited

Definition at line 226 of file LArRodBlockStructure.h.

◆ m_RawDataBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_RawDataBlock
private

Definition at line 157 of file LArRodBlockPhysicsV3.h.

◆ m_RawDataCounter

int LArRodBlockPhysicsV3::m_RawDataCounter = 0
private

Definition at line 161 of file LArRodBlockPhysicsV3.h.

◆ m_RawDataFlagsPtr

const uint32_t* LArRodBlockPhysicsV3::m_RawDataFlagsPtr
private

Definition at line 177 of file LArRodBlockPhysicsV3.h.

◆ m_RawDataIndex

int LArRodBlockPhysicsV3::m_RawDataIndex = 0
private

Definition at line 162 of file LArRodBlockPhysicsV3.h.

◆ m_RawDataPtr

const int16_t* LArRodBlockPhysicsV3::m_RawDataPtr
private

Definition at line 176 of file LArRodBlockPhysicsV3.h.

◆ m_RawToOfflineGainMap

const uint32_t LArRodBlockStructure::m_RawToOfflineGainMap ={0, 2, 1,0}
staticprotectedinherited

Definition at line 16 of file LArRodBlockStructure.h.

◆ m_rearrangeFirstSample

unsigned int LArRodBlockStructure::m_rearrangeFirstSample
protectedinherited

Definition at line 235 of file LArRodBlockStructure.h.

◆ m_ROB_to_decode

int32_t LArRodBlockStructure::m_ROB_to_decode
protectedinherited

Definition at line 240 of file LArRodBlockStructure.h.

◆ m_RodBlock

const uint32_t* LArRodBlockStructure::m_RodBlock
protectedinherited

Definition at line 222 of file LArRodBlockStructure.h.

◆ m_RodBlockSize

int32_t LArRodBlockStructure::m_RodBlockSize
protectedinherited

Definition at line 224 of file LArRodBlockStructure.h.

◆ m_SumBlkBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_SumBlkBlock
private

Definition at line 151 of file LArRodBlockPhysicsV3.h.

◆ m_SumBlkIndex

int LArRodBlockPhysicsV3::m_SumBlkIndex = 0
private

Definition at line 168 of file LArRodBlockPhysicsV3.h.

◆ m_SumBlkPtr

const uint32_t* LArRodBlockPhysicsV3::m_SumBlkPtr
private

Definition at line 170 of file LArRodBlockPhysicsV3.h.

◆ m_SumE

int32_t LArRodBlockStructure::m_SumE
protectedinherited

Definition at line 206 of file LArRodBlockStructure.h.

◆ m_TimeQualityBlock

std::vector<uint32_t> LArRodBlockPhysicsV3::m_TimeQualityBlock
private

Definition at line 156 of file LArRodBlockPhysicsV3.h.

◆ m_TimeQualityIndex

int LArRodBlockPhysicsV3::m_TimeQualityIndex = 0
private

Definition at line 167 of file LArRodBlockPhysicsV3.h.

◆ m_TimeQualityPtr

const int16_t* LArRodBlockPhysicsV3::m_TimeQualityPtr
private

Definition at line 173 of file LArRodBlockPhysicsV3.h.

◆ m_vFragment

std::vector<uint32_t>* LArRodBlockStructure::m_vFragment
protectedinherited

Definition at line 225 of file LArRodBlockStructure.h.

◆ m_virtualROBJump

uint32_t LArRodBlockStructure::m_virtualROBJump
protectedinherited

Definition at line 239 of file LArRodBlockStructure.h.

◆ m_virtualROBPointer

const uint32_t* LArRodBlockStructure::m_virtualROBPointer
protectedinherited

Definition at line 241 of file LArRodBlockStructure.h.

◆ m_virtualROBPointerLocal

const uint32_t* LArRodBlockStructure::m_virtualROBPointerLocal
protectedinherited

Definition at line 242 of file LArRodBlockStructure.h.


The documentation for this class was generated from the following files: