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

#include <LArRodBlockPhysicsV5.h>

Inheritance diagram for LArRodBlockPhysicsV5:
Collaboration diagram for LArRodBlockPhysicsV5:

Public Types

enum  {
  NWTot , NWTot_h , FEBID , FEBID_h ,
  FEB_SN , FEB_SN_h , ResultsOff1 , ResultsDim1 ,
  ResultsOff2 , ResultsDim2 , RawDataBlkOff , RawDataBlkDim ,
  EventStatus , EventStatus_h , NGains , NSamples ,
  FirstSampleIndex , FebConfig , InFPGAFormat , InFPGAFormat_h ,
  endtag
}

Public Member Functions

 LArRodBlockPhysicsV5 (IMessageSvc *msgSvc)
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)
int getNextDigits (int &channelNumber, std::vector< short > &samples, uint32_t &gain)
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 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 uint32_t hasCalibBlock () const
virtual uint32_t hasPhysicsBlock () const
virtual uint32_t hasRawDataBlock () const
virtual uint32_t hasControlWords () const
virtual int FebToRodChannel (int ch) const
virtual int32_t getEx () const
virtual int32_t getEy () const
virtual int32_t getEz () const
virtual uint32_t getVROBFebId ()
virtual int32_t getVROBEx () const
virtual int32_t getVROBEy () const
virtual int32_t getVROBEz () const
virtual int setGain (const int)
void initializeFragment (std::vector< uint32_t > &fragment)
void initializeFEB (const uint32_t id)
void setNextEnergy (const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
void setRawData (const int, const std::vector< short > &, const uint32_t)
void finalizeFEB ()
void concatinateFEBs ()
virtual void setEx (double)
virtual void setEy (double)
virtual void setEz (double)
void setRequiredNSamples (unsigned short ns)
template<class RAWDATA>
bool operator() (const RAWDATA *ch1, const RAWDATA *ch2) const
void sortDataVector (std::vector< const LArDigit * > &vDigit)
uint16_t getFebConfig () const
uint16_t getFirstSampleIndex () const
virtual bool canSetCalibration ()
bool canSetEnergy ()
bool canSetRawData ()
bool canIncludeRawData ()
virtual void sortDataVector (std::vector< const LArRawChannel * > &)
virtual void sortDataVector (std::vector< const LArCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedDigit * > &)
virtual void setNumberOfSamples (const uint8_t n)
virtual void setNumberOfGains (const uint8_t n)
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 canSetNTrigger ()
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 int32_t getVROBSumE () const
virtual uint32_t hasAccumBlock () 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 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

Static Public Member Functions

static std::string BlockType ()

Protected Types

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 setE (unsigned index, double E)
virtual void resetPointers ()
virtual bool setPointers ()
void setNextEnergy (const uint16_t energy, const int16_t time, const int16_t quality, const uint32_t gain)
uint16_t getNbSweetCells1FromMask () const
uint16_t getNbSweetCells2FromMask () const

Private Attributes

std::vector< uint32_t > m_SumBlkBlockE1
std::vector< uint32_t > m_SumBlkBlockE2
std::vector< uint32_t > m_GainBlock
std::vector< uint32_t > m_FebInfoBlock
std::vector< uint16_t > m_TimeQualityBlock
std::vector< uint32_t > m_RawDataBlock
std::vector< uint16_t > m_EnergyBlockEncode
std::vector< uint16_t > m_DigitsEncode
int m_EnergyIndex = 0
int m_TimeQualityIndex = 0
int m_DigitsIndex = 0
int m_DigitsChannel = 0
int m_RawDataIndex = 0
const uint32_t * m_GainPointer = nullptr
const uint32_t * m_MaskTimeQualityPointer = nullptr
const uint32_t * m_MaskDigitsPointer = nullptr
const uint16_t * m_RaddPointer = nullptr
const uint16_t * m_EnergyPointer = nullptr
const int32_t * m_SumPointer = nullptr
const uint16_t * m_TimeQualityPointer = nullptr
const uint16_t * m_DigitsPointer = nullptr
const uint16_t * m_RawDataPointer = nullptr
int m_fixedGain
uint16_t m_numberHotCell = 0U
uint16_t m_numberHotCellOffTime
uint16_t m_EnergyThreshold1
uint16_t m_EnergyThreshold2
int16_t m_OffTimeCut
unsigned short m_requiredNSamples
const LArOnlineIDm_onlineHelper

Detailed Description

Definition at line 26 of file LArRodBlockPhysicsV5.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
Enumerator
NWTot 
NWTot_h 
FEBID 
FEBID_h 
FEB_SN 
FEB_SN_h 
ResultsOff1 
ResultsDim1 
ResultsOff2 
ResultsDim2 
RawDataBlkOff 
RawDataBlkDim 
EventStatus 
EventStatus_h 
NGains 
NSamples 
FirstSampleIndex 
FebConfig 
InFPGAFormat 
InFPGAFormat_h 
endtag 

Definition at line 30 of file LArRodBlockPhysicsV5.h.

30 {
31 NWTot, // First words: DSP event header
32 NWTot_h,
33 FEBID,
34 FEBID_h,
35 FEB_SN, // FEB serial number
36 FEB_SN_h, // FEB serial number
37 ResultsOff1, // Size of results (Physics averages in DSP)
38 ResultsDim1, // Offset to results
39 ResultsOff2, // Size of times (in physics)
40 ResultsDim2, // Offset to times (in physics)
42 RawDataBlkDim, // Raw FEB event offset
43 EventStatus, // Bits describing the event
45 NGains,
46 NSamples,
49 InFPGAFormat, // added 08.09.2005 - wrong 28.09.2005?
51 endtag //This tag needs to be an odd number, see *) for constructor
52 };

◆ 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 };

Constructor & Destructor Documentation

◆ LArRodBlockPhysicsV5()

LArRodBlockPhysicsV5::LArRodBlockPhysicsV5 ( IMessageSvc * msgSvc)

Definition at line 23 of file LArRodBlockPhysicsV5.cxx.

25 m_onlineHelper(nullptr)
26{
27 m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
33 m_OffTimeCut=0; //FIXME: Nowhere set to a sensible value ???
35 // retrieve onlineHelper
36 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
37 if (!detStore) {
38 m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg;
39 std::abort();
40 }
41 StatusCode sc = detStore->retrieve(m_onlineHelper, "LArOnlineID");
42 if (sc.isFailure()) {
43 m_logstr << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
44 std::abort();
45 }
46}
#define endmsg
static Double_t sc
const LArOnlineID * m_onlineHelper
unsigned short m_requiredNSamples
static std::string BlockType()
LArRodBlockStructure(IMessageSvc *msgSvc, const std::string &blockType)
@ LARNGAIN
Definition CaloGain.h:19
::StatusCode StatusCode
StatusCode definition for legacy code.

Member Function Documentation

◆ BlockType()

std::string LArRodBlockPhysicsV5::BlockType ( )
inlinestatic

Definition at line 57 of file LArRodBlockPhysicsV5.h.

57{ return std::string("RodBlockPhysicsV5");}

◆ canIncludeRawData()

bool LArRodBlockPhysicsV5::canIncludeRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 169 of file LArRodBlockPhysicsV5.h.

169{ return true;}

◆ canSetCalibration()

virtual bool LArRodBlockPhysicsV5::canSetCalibration ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 166 of file LArRodBlockPhysicsV5.h.

166{return false;}

◆ canSetEnergy()

bool LArRodBlockPhysicsV5::canSetEnergy ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 167 of file LArRodBlockPhysicsV5.h.

167{ return true;}

◆ canSetNTrigger()

virtual bool LArRodBlockStructure::canSetNTrigger ( )
inlinevirtualinherited

Definition at line 99 of file LArRodBlockStructure.h.

99{return false;}

◆ canSetRawData()

bool LArRodBlockPhysicsV5::canSetRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 168 of file LArRodBlockPhysicsV5.h.

168{ return false;}

◆ canSetRawDataFixed()

virtual bool LArRodBlockStructure::canSetRawDataFixed ( )
inlinevirtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 97 of file LArRodBlockStructure.h.

97{return false;}

◆ concatinateFEBs()

void LArRodBlockPhysicsV5::concatinateFEBs ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 831 of file LArRodBlockPhysicsV5.cxx.

832{
833 FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
834 FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
835 FEBMAPTYPE::const_iterator feb_it;
836 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
837 if (feb_it!=feb_it_b) //Not first Feb
839
840 //Add feb data to rod data block
841 m_pRODblock->insert (m_pRODblock->end(),
842 feb_it->second.begin(), feb_it->second.end());
843 } //end for feb_it
844
845 m_mFebBlocks.clear();
846}
std::vector< uint32_t > * m_pRODblock

◆ 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 LArRodBlockPhysicsV5::FebToRodChannel ( int ch) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 308 of file LArRodBlockPhysicsV5.h.

309{
310 return ( (ch&0x7) << 4) | ( (ch&0x38) >>2 ) | ((ch&0x40)>>6);
311}

◆ finalizeFEB()

void LArRodBlockPhysicsV5::finalizeFEB ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 705 of file LArRodBlockPhysicsV5.cxx.

706{
707 //Complete non-complete Energy block
709 setNextEnergy((uint16_t)0,(int16_t)32767,(int32_t)-32767,(uint32_t)0);//E=0,t=32767,q=-32767,G=0
710
711 uint16_t n;
713 // checkSum value
714 uint32_t sum=0;
715
716 // Will Hardcode here for the moment FIXME. Minimal 1 sample
718 setHeader16(NSamples,nsamples);
719 // These will never be used form MC. Nice to put in here thought
720 setHeader16(FEB_SN,0xfefe);
721 setHeader16(FEB_SN_h,0xdede);
724
725 // Gain block...
726 n = m_GainBlock.size();
727 //Check if Gain-Block exists and is not yet part of the fragment
728 if (n)
729 {
730 for(unsigned int i=0;i<n;i++){
731 m_vFragment->push_back(m_GainBlock[i]);
732 sum+=m_GainBlock[i];
733 }
734 }
735
736 // Cells above energy threshold E1
737 n = m_SumBlkBlockE1.size();
738 //Check if Summary Block exists and is not yet part of the fragment
739 if (n)
740 {
741 for (unsigned i=0;i<n;i++){
742 m_vFragment->push_back(m_SumBlkBlockE1[i]);
744 }
745 }
746
747 // Cells above energy threshold E2 (not included so far)
748 n = m_SumBlkBlockE2.size();
749 //Check if Summary Block exists and is not yet part of the fragment
750 if (n)
751 {
752 for (unsigned i=0;i<n;i++){
753 m_vFragment->push_back(m_SumBlkBlockE2[i]);
755 }
756 }
757
758 // fill info from counters
759 // for moment just include 1 fake words (32 bits) to put radd
760 uint32_t radd_nANC=0x0;
761 // Second threshold missing (FIXME)
762 radd_nANC = ((m_numberHotCell<<8))+(m_DigitsEncode.size()/nsamples);
763 radd_nANC = (radd_nANC<<16);
764 m_vFragment->push_back(radd_nANC);
765 sum+=radd_nANC;
766 // Need to include radd nsamples-1
767 // No need to include in sum's for now
768 for( int i=0; i < (nsamples-1)/2; i++)
769 m_vFragment->push_back(0x0);
770
771 // Energy block...
772 n = 128 ; // Fixed size m_EnergyBlock.size();
773 // Block also include time, whenever necessary
774 int size_of_block=80+(nsamples+1)/2+(m_TimeQualityBlock.size())/2;
775 //Check if Energy-Block exists and is not yet part of the fragment
776 if (n)
777 {
779 setHeader16(ResultsDim1,size_of_block);
780 for(unsigned int i=0;i<n/2;i++) {
781 // WARNING which one should be >>16 2*i or 2*i+1? To be tested
782 uint32_t Encode = m_EnergyBlockEncode[2*i]+(m_EnergyBlockEncode[2*i+1]<<16);
783 m_vFragment->push_back(Encode);
784 sum+=Encode;
785 }
786 }
787
788 // Magic numbers (3 or 6) for Ex, Ey and Ez
789 n = m_TimeQualityBlock.size();
790 //Check if Time and Quality Block exists and is not yet part of the fragment
791 if (n){
792 unsigned int imax = n/2;
793 for (unsigned int i=0;i<imax;i++) {
794 const auto low = static_cast<std::uint32_t>(m_TimeQualityBlock[i * 2]);
795 const auto high = static_cast<std::uint32_t>(m_TimeQualityBlock[i * 2 + 1]);
796 const std::uint32_t to_push = low | (high << 16);
797 m_vFragment->push_back(to_push);
798 sum += to_push;
799 }
800 }
801 // Now include digits
802 n = m_DigitsEncode.size();
803 if ( n ) {
804 // First make sure it is not and odd number to store
805 if ( m_DigitsEncode.size() & 0x1 ) m_DigitsEncode.push_back(0x0);
806 unsigned int imax=m_DigitsEncode.size()/2;
807 for (unsigned int i=0;i<imax;i++) {
808 const auto low = static_cast<std::uint32_t>(m_DigitsEncode[i * 2 + 1]);
809 const auto high = static_cast<std::uint32_t>(m_DigitsEncode[i * 2]);
810 const std::uint32_t to_push = low | (high << 16);
811 m_vFragment->push_back(to_push);
812 sum += to_push;
813 }
815 setHeader16(ResultsOff2,18+size_of_block);
816 } // End of check for format
817
818 // Need to add header to check sum
819 for(size_t ii=0;ii<endtag/2;ii++){
820 sum+=((*m_vFragment)[ii]);
821 }
822 // Three final magic words
823 m_vFragment->push_back(0x0); // For the moment
824 m_vFragment->push_back(0x12345678); // For the moment
825 m_vFragment->push_back(sum& 0x7fffffff);
826
828}
int imax(int i, int j)
std::vector< uint16_t > m_EnergyBlockEncode
std::vector< uint32_t > m_SumBlkBlockE1
std::vector< uint32_t > m_SumBlkBlockE2
std::vector< uint32_t > m_GainBlock
void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
std::vector< uint16_t > m_DigitsEncode
std::vector< uint16_t > m_TimeQualityBlock
void setHeader32(const unsigned n, const uint32_t w)
void setHeader16(const unsigned n, const uint16_t w)
std::vector< uint32_t > * m_vFragment
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 LArRodBlockPhysicsV5::getCtrl1 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 510 of file LArRodBlockPhysicsV5.cxx.

511{
512 if(!m_RawDataPointer) return 0;
513 int index=5;
515 return x;
516}
#define x
const uint16_t * m_RawDataPointer
str index
Definition DeMoScan.py:362

◆ getCtrl2()

uint16_t LArRodBlockPhysicsV5::getCtrl2 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 518 of file LArRodBlockPhysicsV5.cxx.

519{
520 if(!m_RawDataPointer) return 0;
521 int index=4;
523 return x;
524}

◆ getCtrl3()

uint16_t LArRodBlockPhysicsV5::getCtrl3 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 526 of file LArRodBlockPhysicsV5.cxx.

527{
528 if(!m_RawDataPointer) return 0;
529 int index=7;
531 return x;
532}

◆ 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 LArRodBlockPhysicsV5::getEx ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 258 of file LArRodBlockPhysicsV5.h.

259{
260 if(m_SumPointer) return (m_SumPointer[0]>>9);
261 return 0;
262}

◆ getEy()

int32_t LArRodBlockPhysicsV5::getEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 264 of file LArRodBlockPhysicsV5.h.

265{
266 if(m_SumPointer) return (m_SumPointer[1]>>9);
267 return 0;
268}

◆ getEz()

int32_t LArRodBlockPhysicsV5::getEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 270 of file LArRodBlockPhysicsV5.h.

271{
272 if(m_SumPointer) return (m_SumPointer[2]>>9);
273 return 0;
274}

◆ getFebConfig()

uint16_t LArRodBlockPhysicsV5::getFebConfig ( ) const
inline

Definition at line 172 of file LArRodBlockPhysicsV5.h.

173{
174 return getHeader16(FebConfig);
175}
uint16_t getHeader16(const unsigned n) const

◆ 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}

◆ getFirstSampleIndex()

uint16_t LArRodBlockPhysicsV5::getFirstSampleIndex ( ) const
inline

Definition at line 177 of file LArRodBlockPhysicsV5.h.

178{
180}

◆ 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];}

◆ getNbSweetCells1()

uint16_t LArRodBlockPhysicsV5::getNbSweetCells1 ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 437 of file LArRodBlockPhysicsV5.cxx.

438{
439 if(!m_RaddPointer) return 0;
440 return m_RaddPointer[1]>>8;
441}
const uint16_t * m_RaddPointer

◆ getNbSweetCells1FromMask()

uint16_t LArRodBlockPhysicsV5::getNbSweetCells1FromMask ( ) const
private

Definition at line 449 of file LArRodBlockPhysicsV5.cxx.

450{
451 if(!m_MaskTimeQualityPointer) return 0;
452 int n=0;
453 for(int i=0;i<4;i++)
454 for(int j=0;j<32;j++)
455 if((m_MaskTimeQualityPointer[i] >> j) &0x1) n++;
456 return n;
457}
const uint32_t * m_MaskTimeQualityPointer
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ getNbSweetCells2()

uint16_t LArRodBlockPhysicsV5::getNbSweetCells2 ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 443 of file LArRodBlockPhysicsV5.cxx.

444{
445 if(!m_RaddPointer) return 0;
446 return m_RaddPointer[1] & 0xff;
447}

◆ getNbSweetCells2FromMask()

uint16_t LArRodBlockPhysicsV5::getNbSweetCells2FromMask ( ) const
private

Definition at line 459 of file LArRodBlockPhysicsV5.cxx.

460{
461 if(!m_MaskDigitsPointer) return 0;
462 int n=0;
463 for(int i=0;i<4;i++)
464 for(int j=0;j<32;j++)
465 if((m_MaskDigitsPointer[i] >> j) &0x1) n++;
466 return n;
467}
const uint32_t * m_MaskDigitsPointer

◆ 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}

◆ getNextDigits()

int LArRodBlockPhysicsV5::getNextDigits ( int & channelNumber,
std::vector< short > & samples,
uint32_t & gain )

Definition at line 323 of file LArRodBlockPhysicsV5.cxx.

324{
325#ifdef LARBSDBGOUTPUT
326 //Debug output
327 m_logstr << MSG::DEBUG << "Let s go in getNextDigits..." << endmsg;
328 m_logstr << MSG::DEBUG << "GetNextDigits for FEB 0x" << MSG::hex << (uint32_t)getHeader32(FEBID) << MSG::dec << endmsg;
329 m_logstr << MSG::DEBUG << "m_DigitsPointer=" << m_DigitsPointer << " m_DigitsIndex="<< m_DigitsIndex
330 << " m_DigitsChannel="<< m_DigitsChannel
331 << " m_channelsPerFEB=" << m_channelsPerFEB << endmsg;
332#endif
333
334 if (m_DigitsChannel>=m_channelsPerFEB) { //Already beyond maximal number of channels
335#ifdef LARBSDBGOUTPUT
336 m_logstr << MSG::DEBUG << "Maximum number of channels reached" << endmsg;
337#endif
338 return 0;
339 }
340 if (!m_DigitsPointer) { //Block does not exist
341#ifdef LARBSDBGOUTPUT
342 m_logstr << MSG::DEBUG << "No Digits Block in this FEB" << endmsg;
343#endif
344 return 0;
345 }
346 if (!m_MaskDigitsPointer) { //Block does not exist
347#ifdef LARBSDBGOUTPUT
348 m_logstr << MSG::DEBUG << "No Mask Digits Block in this FEB" << endmsg;
349#endif
350 return 0;
351 }
352
353 // Get Digits if the information is present according to summary block
354 uint32_t hasDigits;
355
356 hasDigits = (uint32_t) ((m_MaskDigitsPointer[m_DigitsChannel>>5] >> (m_DigitsChannel&0x1f)) &0x1);
357 // Increment channel number until digits are found
358 while(hasDigits==0) {
360 if (m_DigitsChannel>=m_channelsPerFEB) { //Already beyond maximal number of channels
361#ifdef LARBSDBGOUTPUT
362 m_logstr << MSG::DEBUG << "Maximum number of channels reached" << endmsg;
363#endif
364 return 0;
365 }
366 hasDigits = (uint32_t) ((m_MaskDigitsPointer[m_DigitsChannel>>5] >> (m_DigitsChannel&0x1f)) &0x1);
367 }
368
369 // Get next channel
370 unsigned rodChannelNumber=m_DigitsChannel; // Index of Channel in ROD-Block
371 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4); //channel number of the FEB
372 const unsigned int nsamples = getHeader16(NSamples) & 0xff;
373
374 // gain in 2 bits of a 32 bits word
375 if(m_GainPointer) {
376 gain = (uint32_t) ((m_GainPointer[m_DigitsChannel>>4] >> (m_DigitsChannel&0xf)*2) & 0x3);
378 } else gain=0xffffffff;
379
380#ifdef LARBSDBGOUTPUT
381 m_logstr << MSG::DEBUG << "This FEB has " << nsamples << " samples" << endmsg;
382#endif
383
384 if(nsamples==0) return 0;
385 int s_size = nsamples;
386 int index;
387 index = s_size*m_DigitsIndex;
388 if(m_DigitsIndex&0x1) {
389 samples.push_back(m_DigitsPointer[index-1]>>2);
390 samples.push_back(m_DigitsPointer[index+2]>>2);
391 samples.push_back(m_DigitsPointer[index+1]>>2);
392 samples.push_back(m_DigitsPointer[index+4]>>2);
393 samples.push_back(m_DigitsPointer[index+3]>>2);
394 if(nsamples==7) {
395 samples.push_back(m_DigitsPointer[index+6]>>2);
396 samples.push_back(m_DigitsPointer[index+5]>>2);
397 }
398 } else {
399 samples.push_back(m_DigitsPointer[index+1]>>2);
400 samples.push_back(m_DigitsPointer[index+0]>>2);
401 samples.push_back(m_DigitsPointer[index+3]>>2);
402 samples.push_back(m_DigitsPointer[index+2]>>2);
403 samples.push_back(m_DigitsPointer[index+5]>>2);
404 if(nsamples==7) {
405 samples.push_back(m_DigitsPointer[index+4]>>2);
406 samples.push_back(m_DigitsPointer[index+7]>>2);
407 }
408 }
409
410#ifdef LARBSDBGOUTPUT
411 m_logstr << MSG::DEBUG << " ===> ROD Channel = " << m_DigitsChannel << endmsg;
412 m_logstr << MSG::DEBUG << " ===> FEB Channel = " << channelNumber << endmsg;
413 m_logstr << MSG::DEBUG << " ===> Gain = " << gain << endmsg;
414 for(int i=0;i<nsamples;i++)
415 m_logstr << MSG::DEBUG << " ===> sample " << i << " = " << samples[i] << endmsg;
416#endif
419 unsigned rearrangeFirstSample=0;
421 rearrangeFirstSample=m_rearrangeFirstSample; //Overwrite by jobOptions
422 else
423 rearrangeFirstSample=getFirstSampleIndex();
424 if (rearrangeFirstSample && rearrangeFirstSample<samples.size()) //FIXME: Very ugly hack! See explanation in LArRodDecoder.h file
425 {//Change e.g. 3 0 1 2 4 to 0 1 2 3 4
426 short movedSample=samples[0];
427 for (unsigned i=1;i<=rearrangeFirstSample;i++)
428 samples[i-1]=samples[i];
429 samples[rearrangeFirstSample]=movedSample;
430 }
431#ifdef LARBSDBGOUTPUT
432 m_logstr << MSG::DEBUG << "GetNextDigits for FEB finished 0x" << MSG::hex << (uint32_t)getHeader32(FEBID) << MSG::dec << endmsg;
433#endif
434 return 1;
435}
const uint32_t * m_GainPointer
const uint16_t * m_DigitsPointer
uint16_t getFirstSampleIndex() const
uint32_t RawToOfflineGain(const uint32_t gain) const

◆ getNextEnergy()

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

Reimplemented from LArRodBlockStructure.

Definition at line 182 of file LArRodBlockPhysicsV5.h.

183{
184 m_logstr << MSG::DEBUG << "in LArRodBlockPhysicsV5::getNextEnergy." << endmsg;
185 m_logstr << MSG::DEBUG << "m_channelsPerFEB=" << m_channelsPerFEB << endmsg;
186 if (m_EnergyIndex>=m_channelsPerFEB) // Already beyond maximal number of channels
187 return 0;
188 if (!m_EnergyPointer) // No data block present
189 return 0;
190
191 unsigned rodChannelNumber=m_EnergyIndex; // Index of Channel in ROD-Block
192 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4); //channel number of the FEB
193
194 // get information available for all cells
195 // Energy on a 16 bit word and decode ranges
196 uint16_t encodedEnergy; // 16 bits Encoded Energy word
197 int32_t aux;
198 uint16_t range; // 2 bits range
200
201 m_logstr << MSG::DEBUG << "-------->>>> in LArRodBlockPhysicsV5::getNextEnergy : decode energy....." << "\n";
202 // decode energy
203 if(m_EnergyIndex & 0x1) encodedEnergy = m_EnergyPointer[m_EnergyIndex-1]; // Big/Little Endien stuff
204 else encodedEnergy = m_EnergyPointer[m_EnergyIndex+1]; // Big/Little Endien stuff
205
206 aux = (int32_t) (encodedEnergy&0x1fff);
207 range = (encodedEnergy & 0xc000) >> 14;
208 if(aux==0 && range>0) aux=0x2000;
209 sign = encodedEnergy & 0x2000;
210 aux <<= 3*range;
211 if(sign) aux = -aux;
212 energy = aux;
213
214 // gain in 2 bits of a 32 bits word
215 if(m_GainPointer) {
216 gain = (uint32_t) ((m_GainPointer[m_EnergyIndex>>4] >> ((m_EnergyIndex&0xf)<<1)) & 0x3);
218 } else gain=0xffffffff;
219
220 // Get Time and Quality if the information is present according to summary block
221 uint32_t hasTQ;
223 hasTQ = (uint32_t) ((m_MaskTimeQualityPointer[m_EnergyIndex>>5] >> (m_EnergyIndex&0x1f)) &0x1);
224 else
225 hasTQ = 0;
227 if (m_TimeQualityPointer && hasTQ) // Data has Time and Quality information
228 {
229 //Time is in 10 ps in ByteStream, hence the factor 10 to convert to ps
230 time = 10*(reinterpret_cast<const int16_t *>(m_TimeQualityPointer))[m_TimeQualityIndex++];
232
233#ifdef LARBSDBGOUTPUT
234 m_logstr << MSG::DEBUG <<"This cell has time and Quality information "<<endmsg;
235#endif
236 }
237 else // Data has no Time and Quality information
238 {
239 time=0;
240 quality=-1;
241 }
242
243
244#ifdef LARBSDBGOUTPUT
245 m_logstr << MSG::DEBUG <<"Range = "<<range<<endmsg;
246 m_logstr << MSG::DEBUG <<"Sign = "<<sign<<endmsg;
247 m_logstr << MSG::DEBUG <<" Encoded Energy ="<< MSG::hex << encodedEnergy << MSG::dec << " E=" << energy
248 << " t=" << time
249 << " Q=" << quality
250 << " G=" << gain
251 << " channel Number=" << channelNumber
252 << endmsg;
253#endif
254
255 return 1;
256}
int sign(int a)
const uint16_t * m_TimeQualityPointer
const uint16_t * m_EnergyPointer
time(flags, cells_name, *args, **kw)
setScaleOne setStatusOne setSaturated int16_t

◆ getNextRawData()

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

Reimplemented from LArRodBlockStructure.

Definition at line 218 of file LArRodBlockPhysicsV5.cxx.

219{
220#ifdef LARBSDBGOUTPUT
221 //Debug output
222 m_logstr << MSG::DEBUG << "Let s go in getNextRawData..." << endmsg;
223 m_logstr << MSG::DEBUG << "GetNextRawData for FEB 0x" << MSG::hex << (uint32_t)getHeader32(FEBID) << MSG::dec << endmsg;
224 m_logstr << MSG::DEBUG << "m_RawDataPointer=" << m_RawDataPointer << " m_RawDataIndex="<< m_RawDataIndex
225 << " m_channelsPerFEB=" << m_channelsPerFEB << endmsg;
226#endif
227
228 if (m_RawDataIndex>=m_channelsPerFEB) { //Already beyond maximal number of channels
229#ifdef LARBSDBGOUTPUT
230 m_logstr << MSG::DEBUG << "Maximum number of channels reached" << endmsg;
231#endif
232 return 0;
233 }
234 if (!m_RawDataPointer) { //Block does not exist
235 // Try to get samples and gain from getNextDigits
236 return getNextDigits(channelNumber,samples,gain);
237 }
238
239 // Get next channel
240 unsigned rodChannelNumber=m_RawDataIndex; // Index of Channel in ROD-Block
241 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4); //channel number of the FEB
242 uint32_t febgain;
243 const unsigned int nsamples = getHeader16(NSamples) & 0xff;
244 const unsigned int ngains = getHeader16(NGains);
245
246#ifdef LARBSDBGOUTPUT
247 m_logstr << MSG::DEBUG << "This FEB has " << nsamples << " samples" << endmsg;
248 m_logstr << MSG::DEBUG << "This FEB has " << ngains << " gains" << endmsg;
249#endif
250
251 if(ngains==0 || nsamples==0) return 0;
252 int s_size = nsamples+1;
253 int offset = (10+nsamples)&0xfffc;
254 int index;
255 index = s_size*m_RawDataIndex + offset;
256 uint16_t s[2];
257 if((nsamples+1)&0x7) {
258 s[0] = m_RawDataPointer[index++]>>2;
259 febgain = m_RawDataPointer[index++];
260 samples.push_back(s[0]);
261 for(unsigned int i=0;i<nsamples/2;i++) {
262 s[1] = m_RawDataPointer[index++]>>2;
263 s[0] = m_RawDataPointer[index++]>>2;
264 samples.push_back(s[0]);
265 samples.push_back(s[1]);
266 }
267 } // End of check for 5 samples
268 else {
269 if (!(m_RawDataIndex%2)) {
270 s[0] = m_RawDataPointer[index++]>>2;
271 febgain = m_RawDataPointer[index++];
272 samples.push_back(s[0]);
273 for(unsigned int i=0;i<nsamples/2;i++) {
274 s[1] = m_RawDataPointer[index++]>>2;
275 s[0] = m_RawDataPointer[index++]>>2;
276 samples.push_back(s[0]);
277 samples.push_back(s[1]);
278 }
279 } else {
280 for(unsigned int i=0;i<nsamples/2;i++) {
281 s[1] = m_RawDataPointer[index++]>>2;
282 s[0] = m_RawDataPointer[index++]>>2;
283 samples.push_back(s[0]);
284 samples.push_back(s[1]);
285 }
286 febgain = m_RawDataPointer[index++];
287 s[0] = m_RawDataPointer[index++]>>2;
288 samples.push_back(s[0]);
289 }
290 } // End of >5 check
291 gain=RawToOfflineGain(febgain);
292
293#ifdef LARBSDBGOUTPUT
294 m_logstr << MSG::DEBUG << " ===> ROD Channel = " << m_RawDataIndex << endmsg;
295 m_logstr << MSG::DEBUG << " ===> FEB Channel = " << channelNumber << endmsg;
296 m_logstr << MSG::DEBUG << " ===> Gain = " << gain << endmsg;
297 for(int i=0;i<nsamples;i++)
298 m_logstr << MSG::DEBUG << " ===> sample " << i << " = " << samples[i] << endmsg;
299 int n = m_RawDataIndex;
300 int32_t e,t,q;
301 uint32_t g;
303#endif
305 unsigned rearrangeFirstSample=0;
307 rearrangeFirstSample=m_rearrangeFirstSample; //Overwrite by jobOptions
308 else
309 rearrangeFirstSample=getFirstSampleIndex();
310 if (rearrangeFirstSample && rearrangeFirstSample<samples.size()) //FIXME: Very ugly hack! See explanation in LArRodDecoder.h file
311 {//Change e.g. 3 0 1 2 4 to 0 1 2 3 4
312 short movedSample=samples[0];
313 for (unsigned i=1;i<=rearrangeFirstSample;i++)
314 samples[i-1]=samples[i];
315 samples[rearrangeFirstSample]=movedSample;
316 }
317#ifdef LARBSDBGOUTPUT
318 m_logstr << MSG::DEBUG << "GetNextRawData for FEB finished 0x" << MSG::hex << (uint32_t)getHeader32(FEBID) << MSG::dec << endmsg;
319#endif
320 return 1;
321}
int getNextDigits(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)

◆ 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 LArRodBlockPhysicsV5::getNumberOfGains ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 474 of file LArRodBlockPhysicsV5.cxx.

475{
476 return getHeader16(NGains);
477}

◆ getNumberOfSamples()

uint32_t LArRodBlockPhysicsV5::getNumberOfSamples ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 469 of file LArRodBlockPhysicsV5.cxx.

470{
471 return getHeader16(NSamples);
472}

◆ getNumberOfWords()

uint32_t LArRodBlockStructure::getNumberOfWords ( ) const
inlineinherited

Definition at line 417 of file LArRodBlockStructure.h.

418{
419 return getHeader32(NWTot);
420}

◆ getPulsed()

bool LArRodBlockStructure::getPulsed ( unsigned channelNumber) const
inlinevirtualinherited

◆ getRadd()

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

Reimplemented from LArRodBlockStructure.

Definition at line 494 of file LArRodBlockPhysicsV5.cxx.

495{
496 if(!m_RawDataPointer) {
497 if(!m_RaddPointer) return 0;
498 if(sample%2) sample+=2;
499 return m_RaddPointer[sample];
500 }
501 int index;
502 if(sample==0) index=6;
503 else if(sample & 0x1) index=7+sample-1;
504 else index=7+sample+1;
506 if(adc>=8) return x>>8;
507 return x&0xff;
508}

◆ getRawDataSize()

uint16_t LArRodBlockPhysicsV5::getRawDataSize ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 489 of file LArRodBlockPhysicsV5.cxx.

490{
492}

◆ getResults1Size()

uint16_t LArRodBlockPhysicsV5::getResults1Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 479 of file LArRodBlockPhysicsV5.cxx.

480{
481 return getHeader16(ResultsDim1);
482}

◆ getResults2Size()

uint16_t LArRodBlockPhysicsV5::getResults2Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 484 of file LArRodBlockPhysicsV5.cxx.

485{
486 return getHeader16(ResultsDim2);
487}

◆ getStatus()

uint32_t LArRodBlockPhysicsV5::getStatus ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 534 of file LArRodBlockPhysicsV5.cxx.

535{
536 if(getNumberOfWords()<EventStatus/2) return 0;
538 return x;
539}

◆ 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 LArRodBlockPhysicsV5::getVROBEx ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 287 of file LArRodBlockPhysicsV5.h.

288{
289 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
290 if(p) return (p[1]>>9);
291 return 0;
292}
const uint32_t * m_virtualROBPointerLocal

◆ getVROBEy()

int32_t LArRodBlockPhysicsV5::getVROBEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 294 of file LArRodBlockPhysicsV5.h.

295{
296 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
297 if(p) return (p[2]>>9);
298 return 0;
299}

◆ getVROBEz()

int32_t LArRodBlockPhysicsV5::getVROBEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 301 of file LArRodBlockPhysicsV5.h.

302{
303 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
304 if(p) return (p[3]>>9);
305 return 0;
306}

◆ getVROBFebId()

uint32_t LArRodBlockPhysicsV5::getVROBFebId ( )
inlinevirtual

◆ 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 LArRodBlockPhysicsV5::hasCalibBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 79 of file LArRodBlockPhysicsV5.h.

79{return 0;} ;

◆ hasControlWords()

virtual uint32_t LArRodBlockPhysicsV5::hasControlWords ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 82 of file LArRodBlockPhysicsV5.h.

82{return getHeader16(RawDataBlkOff);} ;

◆ hasPhysicsBlock()

virtual uint32_t LArRodBlockPhysicsV5::hasPhysicsBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 80 of file LArRodBlockPhysicsV5.h.

80{return getHeader16(ResultsOff1);} ;

◆ hasRawDataBlock()

virtual uint32_t LArRodBlockPhysicsV5::hasRawDataBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 81 of file LArRodBlockPhysicsV5.h.

◆ initializeFEB()

void LArRodBlockPhysicsV5::initializeFEB ( const uint32_t id)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 565 of file LArRodBlockPhysicsV5.cxx.

566{
568 if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
569 {
570 m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
571 setHeader32(FEBID,id); //Set Feb ID
572 // At least 10 (head) + 16 (gain/sumblks) + 64 (energies)
573 m_vFragment->reserve(90);
574 }
575
576 m_SumBlkBlockE1.resize(4);
577 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE1[i]=0x0;
578 m_SumBlkBlockE2.resize(4);
579 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE2[i]=0x0;
580 m_GainBlock.resize(8);
581 for(unsigned int i=0;i<8;i++) m_GainBlock[i]=0x0;
582 m_TimeQualityBlock.resize(6);
583 for(unsigned int i=0;i<6;i++) m_TimeQualityBlock[i]=0x0;
584 m_EnergyBlockEncode.resize(128);
585 for(unsigned int i=0;i<128;i++) m_EnergyBlockEncode[i]=0x0;
586 m_DigitsEncode.clear();
587
589}

◆ initializeFragment()

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

Reimplemented from LArRodBlockStructure.

Definition at line 542 of file LArRodBlockPhysicsV5.cxx.

542 {
543 m_pRODblock=&fragment; //remember pointer to fragment
544 if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
545 unsigned int sizeRead=0;
546 //Store existing data in the FEB-Map
547 while (sizeRead<fragment.size()) {
548 std::vector<uint32_t>::iterator FebIter;
549 FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
550 m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
551 uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
552 uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
553 if (FebIter+currFebSize>fragment.end()) {
554 fragment.clear(); //Clear existing vector
555 return;
556 }
557 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
558 sizeRead+=currFebSize+m_MiddleHeaderSize; //6 is the middle header size
559 } // end while
560 }
561 fragment.clear(); //Clear existing vector
562}

◆ 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.

148{
149 int end = getNumberOfWords()-3;
150 int start = 1;
151 uint32_t sum = 0;
153 for(int i=start;i<end;i++) {
154 sum += m_FebBlock[i];
155 }
156 return sum & 0x7fffffff;
157}

◆ 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 LArRodBlockPhysicsV5::operator() ( const RAWDATA * ch1,
const RAWDATA * ch2 ) const

Definition at line 850 of file LArRodBlockPhysicsV5.cxx.

852{
853 HWIdentifier id1 = ch1->channelID();
854 HWIdentifier id2 = ch2->channelID();
855
856 HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
857 HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
858
859 if(febId1 == febId2 ){
860 int cId1 = m_onlineHelper->channel(id1);
861 int cId2 = m_onlineHelper->channel(id2);
862 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
863 }
864
865 return febId1 < febId2 ;
866}
virtual 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 LArRodBlockPhysicsV5::resetPointers ( )
privatevirtual

◆ 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}

◆ setE()

void LArRodBlockPhysicsV5::setE ( unsigned index,
double E )
inlineprivate

Definition at line 314 of file LArRodBlockPhysicsV5.h.

314 {
315 if (m_TimeQualityBlock.size() < index + 2) {
316 return;
317 }
318 const auto scaled = static_cast<std::int32_t>(E) * (1 << 9);
319 const auto bits = static_cast<std::uint32_t>(scaled);
320 m_TimeQualityBlock[index] = static_cast<std::uint16_t>(bits & 0xffffu);
321 m_TimeQualityBlock[index + 1] = static_cast<std::uint16_t>((bits >> 16) & 0xffffu);
322}

◆ 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 LArRodBlockPhysicsV5::setEx ( double Ex)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 324 of file LArRodBlockPhysicsV5.h.

324 {
325 setE (0, Ex);
326}
void setE(unsigned index, double E)

◆ setEy()

void LArRodBlockPhysicsV5::setEy ( double Ey)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 329 of file LArRodBlockPhysicsV5.h.

329 {
330 setE (2, Ey);
331}

◆ setEz()

void LArRodBlockPhysicsV5::setEz ( double Ez)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 334 of file LArRodBlockPhysicsV5.h.

334 {
335 setE (4, Ez);
336}

◆ 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}

◆ setGain()

virtual int LArRodBlockPhysicsV5::setGain ( const int )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 94 of file LArRodBlockPhysicsV5.h.

94{ 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 LArRodBlockPhysicsV5::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 591 of file LArRodBlockPhysicsV5.cxx.

593{
594 int rcNb=FebToRodChannel(channel);
595 //rcNb is supposed to be equal or bigger than m_EIndex.
596 //In the latter case, we fill up the missing channels with zero
597 if (rcNb<m_EnergyIndex) {
598 return;
599 }
600
601 //Fill up missing channels with zeros:
602 while (m_EnergyIndex<rcNb)
603 setNextEnergy((int16_t)0,(int16_t)32767,(int16_t)-32767,(uint32_t)0);
604
605 // transform 32 bits data into 16 bits data
606
607 uint16_t theenergy;
608 uint32_t abse,EncodedE;
609 int16_t thetime,thequality;
610 int32_t sign;
611
612 //Time is in 10 ps in ByteStream, hence the factor 10 to convert from ps
613 thetime = (int16_t) time/10;
614 thequality = (int16_t) quality;
615
616 sign=(energy>=0?1:-1); // get sign of energy
617 abse=(uint32_t)abs(energy);
618
619 EncodedE=abse; // range 0
620
621 if ((abse>8192)&&(abse<65536))
622 {
623 EncodedE=((abse>>3)|0x4000); // range 1 : drop last 3 bits and put range bits (bits 14 and 13 = 01)
624 }
625 else if ((abse>65535)&&(abse<524288))
626 {
627 EncodedE=((abse>>6)|0x8000); // range 2 : drop last 6 bits and put range bits (bits 14 and 13 = 10)
628 }
629 else if ((abse>524288))
630 {
631 EncodedE=((abse>>9)|0xc000); // range 3 : drop last 9 bits and put range bits (bits 14 and 13 = 11)
632 }
633
634 // treat sign now :
635
636 if (sign<0) EncodedE |= 0x2000;
637 theenergy = (uint16_t) EncodedE;
638
639 // Add data...
640
641 if (abse> m_EnergyThreshold1)
642 {
643 setNextEnergy(theenergy,thetime,thequality,gain);
644 }
645 else
646 {
647 setNextEnergy(theenergy,(int16_t)32767,(int16_t)-32767,gain);
648 }
649}

◆ setNextEnergy() [2/2]

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

Definition at line 652 of file LArRodBlockPhysicsV5.cxx.

653{
654 if (m_EnergyIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
655 {
656 return;
657 }
658
659 // Energy
660 int endianindex;
661 if (m_EnergyIndex & 0x1) endianindex = m_EnergyIndex-1;
662 else endianindex = m_EnergyIndex+1;
663 m_EnergyBlockEncode[endianindex] = energy;
664
665 // Find correct position
666
667 // update summary block
668 // Gain is composed of two bits per cell
669 uint16_t gain_idx=m_EnergyIndex>>4;
670 uint16_t gain_bit=(m_EnergyIndex&0xf)*2;
672 m_GainBlock[gain_idx] |= (gain1 << gain_bit);
673
674 // write Time and Chi2 for cells above HighEnergyCellCut threshold
675
676 if (quality!=-32767) // Do write Time and Chi2 information
677 {
678 // count the number of hot cells
680 // count the number of cells offtime
681 if (abs(time)>m_OffTimeCut) m_numberHotCellOffTime++;
682 uint16_t mask_idx=m_EnergyIndex>>5;
683 uint16_t mask_bit=(m_EnergyIndex&0x1f);
684 m_SumBlkBlockE1[mask_idx] |= (0x1 << mask_bit);
685
686 m_TimeQualityBlock.push_back(*((uint16_t*)&time));
687 m_TimeQualityBlock.push_back(*((uint16_t*)&quality));
688 }
689 m_EnergyIndex++; //Use m_EIndex to count the channels put in the Energy block
690
691}
uint32_t OfflineToRawGain(const uint32_t gain) const

◆ 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 LArRodBlockStructure::setNumberOfGains ( const uint8_t n)
virtualinherited

Reimplemented in LArRodBlockPhysicsV0, LArRodBlockPhysicsV1, LArRodBlockPhysicsV2, LArRodBlockPhysicsV3, and LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 125 of file LArRodBlockStructure.cxx.

126{
127 m_logstr << MSG::ERROR << "Error: Function setNumberOfGains not implemented in this instance of LArRodBlockStructure!" << endmsg;
128}

◆ setNumberOfSamples()

void LArRodBlockStructure::setNumberOfSamples ( const uint8_t n)
virtualinherited

Reimplemented in LArRodBlockPhysicsV0, LArRodBlockPhysicsV1, LArRodBlockPhysicsV2, LArRodBlockPhysicsV3, and LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 120 of file LArRodBlockStructure.cxx.

121{
122 m_logstr << MSG::ERROR << "Error: Function setNumberOfSamples not implemented in this instance of LArRodBlockStructure!" << endmsg;
123}

◆ setPointers()

bool LArRodBlockPhysicsV5::setPointers ( )
privatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 69 of file LArRodBlockPhysicsV5.cxx.

70{
72 {
73 int off = -8;
74 int ns = getHeader16(NSamples) & 0xff;
75 if (m_requiredNSamples > 0 && m_requiredNSamples != ns) return false;
76 int radd = (ns+1)/2;
77 int dim1 = getHeader16(ResultsDim1);
78 int off1 = getHeader16(ResultsOff1);
79 int off2 = getHeader16(ResultsOff2);
80 int dim2 = getHeader16(ResultsDim2);
81 int off3 = getHeader16(RawDataBlkOff);
82 int dim3 = getHeader16(RawDataBlkDim);
83
84 if (off1 && dim1+off1+off<m_FebBlockSize) {
85 off1 += off;
86 if (dim1>=8)
87 m_GainPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1);
88 if (dim1>=12)
89 m_MaskTimeQualityPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1+8);
90 if (dim1>=16)
91 m_MaskDigitsPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1+12);
92 if (dim1>=16+radd)
93 m_RaddPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off1+16);
94 if (dim1>=80+radd)
95 m_EnergyPointer=reinterpret_cast<const uint16_t*> (m_FebBlock+off1+16+radd);
96 if (dim1>=83+radd)
97 m_SumPointer=reinterpret_cast<const int32_t*>(m_FebBlock+off1+80+radd);
98 if (dim1>83+radd)
99 m_TimeQualityPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off1+83+radd);
100 off1 -= off;
101 }
102 if (off2 && dim2+off2+off<m_FebBlockSize) {
103 m_DigitsPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off2+off);
104 }
105 if (off3 && dim3+off3+off<m_FebBlockSize) {
106 m_RawDataPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off3+off);
107 }
108
109 // Check for offsets problems
110 uint32_t problem = 0;
111 int n1, n2;
112 int n1_tmp, n2_tmp;
113 int off1_tmp, dim1_tmp;
114 int off2_tmp, dim2_tmp;
115 int off3_tmp, dim3_tmp;
116 if(off1==0) {
117 n1 = n2 = 0;
118 n1_tmp = n2_tmp =0;
119 off1_tmp = dim1_tmp = 0;
120 off2_tmp = dim2_tmp = 0;
121 off3_tmp = dim3_tmp = 0;
122 }
123 else {
124 m_RaddPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+26);
125 m_MaskTimeQualityPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+18);
126 m_MaskDigitsPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+22);
127 n1 = getNbSweetCells1();
128 n2 = getNbSweetCells2();
129 n1_tmp = getNbSweetCells1FromMask();
130 n2_tmp = getNbSweetCells2FromMask();
131 off1_tmp = 10-off;
132 dim1_tmp = 83+(ns+1)/2+n1;
133 if ( m_requiredNSamples > 0 )
134 dim1_tmp = 83 +(m_requiredNSamples+1)/2+n1;
135 off2_tmp = off1_tmp+dim1_tmp;
136 dim2_tmp = (n2*ns+1)/2;
137 off3_tmp = off2_tmp+dim2_tmp;
138 dim3_tmp = getNumberOfWords()-3-off3_tmp-off;
139 if(dim2_tmp==0) off2_tmp = 0;
140 if(dim3_tmp==0) off3_tmp = 0;
141 }
142
143 if(off1 != off1_tmp) problem=1;
144 if(dim1 != dim1_tmp) problem=2;
145 if(off2 != off2_tmp) problem=3;
146 if(dim2 != dim2_tmp) problem=4;
147 if(off3 != off3_tmp) problem=5;
148 if(dim3 != dim3_tmp) problem=6;
149 if(n1 != n1_tmp) problem=7;
150 if(n2 != n2_tmp) problem=8;
151 if (m_requiredNSamples > 0 &&
152 getHeader32(NGains) != (uint32_t)0x10000 + m_requiredNSamples) problem=9;
153 if(problem) { // Try to recompute offsets
154 m_logstr << MSG::ERROR << "LArByteStreamProblem " << problem << endmsg;
155 m_logstr << MSG::ERROR << "NSamples = " << std::dec << ns << endmsg;
156 m_logstr << MSG::ERROR << "getHeader32(NGains) = " << std::hex << getHeader32(NGains) << endmsg;
157 m_logstr << MSG::ERROR << "NWTot: " << std::hex << getNumberOfWords() << " n1=" << n1 << " (" << n1_tmp << ") n2=" << n2 << " (" << n2_tmp << ")" << endmsg;
158 m_logstr << MSG::ERROR << "Found 1: " << off1 << " " << dim1 << endmsg;
159 m_logstr << MSG::ERROR << "Found 2: " << off2 << " " << dim2 << endmsg;
160 m_logstr << MSG::ERROR << "Found 3: " << off3 << " " << dim3 << std::dec << endmsg;
161
162 if(n1==n1_tmp && n2==n2_tmp) { // Check consistency of cells above threshold
163 off1 = off1_tmp;
164 dim1 = dim1_tmp;
165 off2 = off2_tmp;
166 dim2 = dim2_tmp;
167 off3 = off3_tmp;
168 dim3 = dim3_tmp;
169 m_logstr << MSG::ERROR << "Recomputed 1: " << std::hex << off1 << " " << dim1 << endmsg;
170 m_logstr << MSG::ERROR << "Recomputed 2: " << off2 << " " << dim2 << endmsg;
171 m_logstr << MSG::ERROR << "Recomputed 3: " << off3 << " " << dim3 << std::dec << endmsg;
172
173 if (off1 && dim1+off1+off<m_FebBlockSize) {
174 off1 += off;
175 if (dim1>=8)
176 m_GainPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1);
177 if (dim1>=12)
178 m_MaskTimeQualityPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1+8);
179 if (dim1>=16)
180 m_MaskDigitsPointer=reinterpret_cast<const uint32_t*>(m_FebBlock+off1+12);
181 if (dim1>=16+radd)
182 m_RaddPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off1+16);
183 if (dim1>=80+radd)
184 m_EnergyPointer=reinterpret_cast<const uint16_t*> (m_FebBlock+off1+16+radd);
185 if (dim1>=83+radd)
186 m_SumPointer=reinterpret_cast<const int32_t*>(m_FebBlock+off1+80+radd);
187 if (dim1>83+radd)
188 m_TimeQualityPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off1+83+radd);
189 }
190 if (off2 && dim2+off2+off<m_FebBlockSize) {
191 m_DigitsPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off2+off);
192 }
193 if (off3 && dim3+off3+off<m_FebBlockSize) {
194 m_RawDataPointer=reinterpret_cast<const uint16_t*>(m_FebBlock+off3+off);
195 }
196 }
197 }
198
199 problem=0;
200 // Recheck offsets
201 if(off1< off2 && off1 + dim1 > off2) problem = 1;
202 if(off1< off3 && off1 + dim1 > off3) problem = 2;
203 if(off2< off1 && off2 + dim2 > off1) problem = 3;
204 if(off2< off3 && off2 + dim2 > off3) problem = 4;
205 if(off3< off1 && off3 + dim3 > off1) problem = 5;
206 if(off3< off2 && off3 + dim3 > off2) problem = 6;
207
208 if(problem) {
210 m_logstr << MSG::ERROR << "LArByteStreamProblem " << problem << endmsg;
211 m_logstr << MSG::ERROR << "Unrecoverable problem" << endmsg;
212 }
213 }
214
215 return true;
216}
virtual uint16_t getNbSweetCells2() const
uint16_t getNbSweetCells1FromMask() const
uint16_t getNbSweetCells2FromMask() const
virtual uint16_t getNbSweetCells1() const

◆ 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 LArRodBlockPhysicsV5::setRawData ( const int chIdx,
const std::vector< short > & samples,
const uint32_t  )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 693 of file LArRodBlockPhysicsV5.cxx.

693 {
694
695 // First of all, set the bits
696 int cchIdx = FebToRodChannel(chIdx);
697 uint16_t mask_idx=cchIdx>>5;
698 uint16_t mask_bit=(cchIdx&0x1f);
699 m_SumBlkBlockE2[mask_idx] |= (0x1 << mask_bit);
700 for(std::vector<short>::const_iterator i=samples.begin();i!=samples.end();++i){
701 m_DigitsEncode.push_back((*i)<<2);
702 }
703}

◆ 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}

◆ setRequiredNSamples()

void LArRodBlockPhysicsV5::setRequiredNSamples ( unsigned short ns)
inline

Definition at line 108 of file LArRodBlockPhysicsV5.h.

◆ 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 LArRodBlockPhysicsV5::sortDataVector ( std::vector< const LArDigit * > & vDigit)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 114 of file LArRodBlockPhysicsV5.h.

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

◆ sortDataVector() [5/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 87 of file LArRodBlockStructure.cxx.

207{}

Member Data Documentation

◆ m_channelsPerFEB

int LArRodBlockStructure::m_channelsPerFEB
protectedinherited

Definition at line 219 of file LArRodBlockStructure.h.

◆ m_DigitsChannel

int LArRodBlockPhysicsV5::m_DigitsChannel = 0
private

Definition at line 138 of file LArRodBlockPhysicsV5.h.

◆ m_DigitsEncode

std::vector<uint16_t> LArRodBlockPhysicsV5::m_DigitsEncode
private

Definition at line 133 of file LArRodBlockPhysicsV5.h.

◆ m_DigitsIndex

int LArRodBlockPhysicsV5::m_DigitsIndex = 0
private

Definition at line 137 of file LArRodBlockPhysicsV5.h.

◆ m_DigitsPointer

const uint16_t* LArRodBlockPhysicsV5::m_DigitsPointer = nullptr
private

Definition at line 147 of file LArRodBlockPhysicsV5.h.

◆ m_EnergyBlockEncode

std::vector<uint16_t> LArRodBlockPhysicsV5::m_EnergyBlockEncode
private

Definition at line 132 of file LArRodBlockPhysicsV5.h.

◆ m_EnergyIndex

int LArRodBlockPhysicsV5::m_EnergyIndex = 0
private

Definition at line 135 of file LArRodBlockPhysicsV5.h.

◆ m_EnergyPointer

const uint16_t* LArRodBlockPhysicsV5::m_EnergyPointer = nullptr
private

Definition at line 144 of file LArRodBlockPhysicsV5.h.

◆ m_EnergyThreshold1

uint16_t LArRodBlockPhysicsV5::m_EnergyThreshold1
private

Definition at line 155 of file LArRodBlockPhysicsV5.h.

◆ m_EnergyThreshold2

uint16_t LArRodBlockPhysicsV5::m_EnergyThreshold2
private

Definition at line 156 of file LArRodBlockPhysicsV5.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> LArRodBlockPhysicsV5::m_FebInfoBlock
private

Definition at line 129 of file LArRodBlockPhysicsV5.h.

◆ m_fixedGain

int LArRodBlockPhysicsV5::m_fixedGain
private

Definition at line 151 of file LArRodBlockPhysicsV5.h.

◆ m_GainBlock

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

Definition at line 128 of file LArRodBlockPhysicsV5.h.

◆ m_GainPointer

const uint32_t* LArRodBlockPhysicsV5::m_GainPointer = nullptr
private

Definition at line 140 of file LArRodBlockPhysicsV5.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_MaskDigitsPointer

const uint32_t* LArRodBlockPhysicsV5::m_MaskDigitsPointer = nullptr
private

Definition at line 142 of file LArRodBlockPhysicsV5.h.

◆ m_MaskTimeQualityPointer

const uint32_t* LArRodBlockPhysicsV5::m_MaskTimeQualityPointer = nullptr
private

Definition at line 141 of file LArRodBlockPhysicsV5.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_numberHotCell

uint16_t LArRodBlockPhysicsV5::m_numberHotCell = 0U
private

Definition at line 152 of file LArRodBlockPhysicsV5.h.

◆ m_numberHotCellOffTime

uint16_t LArRodBlockPhysicsV5::m_numberHotCellOffTime
private

Definition at line 153 of file LArRodBlockPhysicsV5.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 LArRodBlockPhysicsV5::m_OffTimeCut
private

Definition at line 157 of file LArRodBlockPhysicsV5.h.

◆ m_onlineHelper

const LArOnlineID* LArRodBlockPhysicsV5::m_onlineHelper
private

Definition at line 160 of file LArRodBlockPhysicsV5.h.

◆ m_pRODblock

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

Definition at line 226 of file LArRodBlockStructure.h.

◆ m_RaddPointer

const uint16_t* LArRodBlockPhysicsV5::m_RaddPointer = nullptr
private

Definition at line 143 of file LArRodBlockPhysicsV5.h.

◆ m_RawDataBlock

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

Definition at line 131 of file LArRodBlockPhysicsV5.h.

◆ m_RawDataIndex

int LArRodBlockPhysicsV5::m_RawDataIndex = 0
private

Definition at line 139 of file LArRodBlockPhysicsV5.h.

◆ m_RawDataPointer

const uint16_t* LArRodBlockPhysicsV5::m_RawDataPointer = nullptr
private

Definition at line 148 of file LArRodBlockPhysicsV5.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_requiredNSamples

unsigned short LArRodBlockPhysicsV5::m_requiredNSamples
private

Definition at line 159 of file LArRodBlockPhysicsV5.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_SumBlkBlockE1

std::vector<uint32_t> LArRodBlockPhysicsV5::m_SumBlkBlockE1
private

Definition at line 126 of file LArRodBlockPhysicsV5.h.

◆ m_SumBlkBlockE2

std::vector<uint32_t> LArRodBlockPhysicsV5::m_SumBlkBlockE2
private

Definition at line 127 of file LArRodBlockPhysicsV5.h.

◆ m_SumE

int32_t LArRodBlockStructure::m_SumE
protectedinherited

Definition at line 206 of file LArRodBlockStructure.h.

◆ m_SumPointer

const int32_t* LArRodBlockPhysicsV5::m_SumPointer = nullptr
private

Definition at line 145 of file LArRodBlockPhysicsV5.h.

◆ m_TimeQualityBlock

std::vector<uint16_t> LArRodBlockPhysicsV5::m_TimeQualityBlock
private

Definition at line 130 of file LArRodBlockPhysicsV5.h.

◆ m_TimeQualityIndex

int LArRodBlockPhysicsV5::m_TimeQualityIndex = 0
private

Definition at line 136 of file LArRodBlockPhysicsV5.h.

◆ m_TimeQualityPointer

const uint16_t* LArRodBlockPhysicsV5::m_TimeQualityPointer = nullptr
private

Definition at line 146 of file LArRodBlockPhysicsV5.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: