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

This class provides decoding/encoding from/to ROD format. More...

#include <LArRodBlockPhysicsV6.h>

Inheritance diagram for LArRodBlockPhysicsV6:
Collaboration diagram for LArRodBlockPhysicsV6:

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

 LArRodBlockPhysicsV6 (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 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 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)
virtual void setSumE (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 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 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 int 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

This class provides decoding/encoding from/to ROD format.

Authors
Denis Oliveira Damazio
Version
0-0-1 , March 28th, 2011

Modified, new format for ATLAS (to include SumE)

Definition at line 25 of file LArRodBlockPhysicsV6.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 29 of file LArRodBlockPhysicsV6.h.

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

◆ 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

◆ LArRodBlockPhysicsV6()

LArRodBlockPhysicsV6::LArRodBlockPhysicsV6 ( IMessageSvc * msgSvc)

Definition at line 28 of file LArRodBlockPhysicsV6.cxx.

30 m_onlineHelper(nullptr)
31{
32 m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
38 m_OffTimeCut=0; //FIXME: Nowhere set to a sensible value ???
40 // retrieve onlineHelper
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(m_onlineHelper, "LArOnlineID");
47 if (sc.isFailure()) {
48 m_logstr << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
49 std::abort();
50 }
51}
#define endmsg
static Double_t sc
static std::string BlockType()
const LArOnlineID * m_onlineHelper
unsigned short m_requiredNSamples
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 LArRodBlockPhysicsV6::BlockType ( )
inlinestatic

Definition at line 56 of file LArRodBlockPhysicsV6.h.

56{ return std::string("RodBlockPhysicsV6");}

◆ canIncludeRawData()

bool LArRodBlockPhysicsV6::canIncludeRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 171 of file LArRodBlockPhysicsV6.h.

171{ return true;}

◆ canSetCalibration()

virtual bool LArRodBlockPhysicsV6::canSetCalibration ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 168 of file LArRodBlockPhysicsV6.h.

168{return false;}

◆ canSetEnergy()

bool LArRodBlockPhysicsV6::canSetEnergy ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 169 of file LArRodBlockPhysicsV6.h.

169{ return true;}

◆ canSetNTrigger()

virtual bool LArRodBlockStructure::canSetNTrigger ( )
inlinevirtualinherited

Definition at line 99 of file LArRodBlockStructure.h.

99{return false;}

◆ canSetRawData()

bool LArRodBlockPhysicsV6::canSetRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 170 of file LArRodBlockPhysicsV6.h.

170{ 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 LArRodBlockPhysicsV6::concatinateFEBs ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 853 of file LArRodBlockPhysicsV6.cxx.

854{
855 FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
856 FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
857 FEBMAPTYPE::const_iterator feb_it;
858 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
859 if (feb_it!=feb_it_b) //Not first Feb
861
862 //Add feb data to rod data block
863 m_pRODblock->insert (m_pRODblock->end(),
864 feb_it->second.begin(), feb_it->second.end());
865 } //end for feb_it
866
867 m_mFebBlocks.clear();
868}
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 LArRodBlockPhysicsV6::FebToRodChannel ( int ch) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 324 of file LArRodBlockPhysicsV6.h.

325{
326 return ( (ch&0x7) << 4) | ( (ch&0x38) >>2 ) | ((ch&0x40)>>6);
327}

◆ finalizeFEB()

void LArRodBlockPhysicsV6::finalizeFEB ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 722 of file LArRodBlockPhysicsV6.cxx.

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

Reimplemented from LArRodBlockStructure.

Definition at line 526 of file LArRodBlockPhysicsV6.cxx.

527{
528 if(!m_RawDataPointer) return 0;
529 int index=5;
531 return x;
532}
#define x
const uint16_t * m_RawDataPointer
str index
Definition DeMoScan.py:362

◆ getCtrl2()

uint16_t LArRodBlockPhysicsV6::getCtrl2 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 534 of file LArRodBlockPhysicsV6.cxx.

535{
536 if(!m_RawDataPointer) return 0;
537 int index=4;
539 return x;
540}

◆ getCtrl3()

uint16_t LArRodBlockPhysicsV6::getCtrl3 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 542 of file LArRodBlockPhysicsV6.cxx.

543{
544 if(!m_RawDataPointer) return 0;
545 int index=7;
547 return x;
548}

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

Reimplemented from LArRodBlockStructure.

Definition at line 262 of file LArRodBlockPhysicsV6.h.

263{
264 if(m_SumPointer) return (m_SumPointer[0]>>9);
265 return 0;
266}

◆ getEy()

int32_t LArRodBlockPhysicsV6::getEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 268 of file LArRodBlockPhysicsV6.h.

269{
270 if(m_SumPointer) return (m_SumPointer[1]>>9);
271 return 0;
272}

◆ getEz()

int32_t LArRodBlockPhysicsV6::getEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 274 of file LArRodBlockPhysicsV6.h.

275{
276 if(m_SumPointer) return (m_SumPointer[2]>>9);
277 return 0;
278}

◆ getFebConfig()

uint16_t LArRodBlockPhysicsV6::getFebConfig ( ) const
inline

Definition at line 174 of file LArRodBlockPhysicsV6.h.

175{
176 return getHeader16(FebConfig);
177}
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 LArRodBlockPhysicsV6::getFirstSampleIndex ( ) const
inline

Definition at line 179 of file LArRodBlockPhysicsV6.h.

180{
182}

◆ 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 LArRodBlockPhysicsV6::getNbSweetCells1 ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 453 of file LArRodBlockPhysicsV6.cxx.

454{
455 if(!m_RaddPointer) return 0;
456 return m_RaddPointer[1]>>8;
457}
const uint16_t * m_RaddPointer

◆ getNbSweetCells1FromMask()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells1FromMask ( ) const
private

Definition at line 465 of file LArRodBlockPhysicsV6.cxx.

466{
467 if(!m_MaskTimeQualityPointer) return 0;
468 int n=0;
469 for(int i=0;i<4;i++)
470 for(int j=0;j<32;j++)
471 if((m_MaskTimeQualityPointer[i] >> j) &0x1) n++;
472 return n;
473}
const uint32_t * m_MaskTimeQualityPointer
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ getNbSweetCells2()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells2 ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 459 of file LArRodBlockPhysicsV6.cxx.

460{
461 if(!m_RaddPointer) return 0;
462 return m_RaddPointer[1] & 0xff;
463}

◆ getNbSweetCells2FromMask()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells2FromMask ( ) const
private

Definition at line 475 of file LArRodBlockPhysicsV6.cxx.

476{
477 if(!m_MaskDigitsPointer) return 0;
478 int n=0;
479 for(int i=0;i<4;i++)
480 for(int j=0;j<32;j++)
481 if((m_MaskDigitsPointer[i] >> j) &0x1) n++;
482 return n;
483}
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 LArRodBlockPhysicsV6::getNextDigits ( int & channelNumber,
std::vector< short > & samples,
uint32_t & gain )

Definition at line 332 of file LArRodBlockPhysicsV6.cxx.

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

◆ getNextEnergy()

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

Reimplemented from LArRodBlockStructure.

Definition at line 184 of file LArRodBlockPhysicsV6.h.

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

◆ getNextRawData()

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

Reimplemented from LArRodBlockStructure.

Definition at line 227 of file LArRodBlockPhysicsV6.cxx.

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

Reimplemented from LArRodBlockStructure.

Definition at line 490 of file LArRodBlockPhysicsV6.cxx.

491{
492 return getHeader16(NGains);
493}

◆ getNumberOfSamples()

uint32_t LArRodBlockPhysicsV6::getNumberOfSamples ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 485 of file LArRodBlockPhysicsV6.cxx.

486{
487 return getHeader16(NSamples);
488}

◆ 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 LArRodBlockPhysicsV6::getRadd ( uint32_t adc,
uint32_t sample ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 510 of file LArRodBlockPhysicsV6.cxx.

511{
512 if(!m_RawDataPointer) {
513 if(!m_RaddPointer) return 0;
514 if(sample%2) sample+=2;
515 return m_RaddPointer[sample];
516 }
517 int index;
518 if(sample==0) index=6;
519 else if(sample & 0x1) index=7+sample-1;
520 else index=7+sample+1;
522 if(adc>=8) return x>>8;
523 return x&0xff;
524}

◆ getRawDataSize()

uint16_t LArRodBlockPhysicsV6::getRawDataSize ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 505 of file LArRodBlockPhysicsV6.cxx.

506{
508}

◆ getResults1Size()

uint16_t LArRodBlockPhysicsV6::getResults1Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 495 of file LArRodBlockPhysicsV6.cxx.

496{
497 return getHeader16(ResultsDim1);
498}

◆ getResults2Size()

uint16_t LArRodBlockPhysicsV6::getResults2Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 500 of file LArRodBlockPhysicsV6.cxx.

501{
502 return getHeader16(ResultsDim2);
503}

◆ getStatus()

uint32_t LArRodBlockPhysicsV6::getStatus ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 550 of file LArRodBlockPhysicsV6.cxx.

551{
552 if(getNumberOfWords()<EventStatus/2) return 0;
554 return x;
555}

◆ 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 LArRodBlockPhysicsV6::getSumE ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 279 of file LArRodBlockPhysicsV6.h.

280{
281 if(m_SumPointer) return (m_SumPointer[3]>>9);
282 return 0;
283}

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

Reimplemented from LArRodBlockStructure.

Definition at line 296 of file LArRodBlockPhysicsV6.h.

297{
298 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
299 if(p) return (p[1]>>9);
300 return 0;
301}
const uint32_t * m_virtualROBPointerLocal

◆ getVROBEy()

int32_t LArRodBlockPhysicsV6::getVROBEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 303 of file LArRodBlockPhysicsV6.h.

304{
305 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
306 if(p) return (p[2]>>9);
307 return 0;
308}

◆ getVROBEz()

int32_t LArRodBlockPhysicsV6::getVROBEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 310 of file LArRodBlockPhysicsV6.h.

311{
312 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
313 if(p) return (p[3]>>9);
314 return 0;
315}

◆ getVROBFebId()

uint32_t LArRodBlockPhysicsV6::getVROBFebId ( )
inlinevirtual

◆ getVROBSumE()

int32_t LArRodBlockPhysicsV6::getVROBSumE ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 317 of file LArRodBlockPhysicsV6.h.

318{
319 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
320 if(p) return (p[4]>>9);
321 return 0;
322}

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

Reimplemented from LArRodBlockStructure.

Definition at line 78 of file LArRodBlockPhysicsV6.h.

78{return 0;} ;

◆ hasControlWords()

virtual uint32_t LArRodBlockPhysicsV6::hasControlWords ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 81 of file LArRodBlockPhysicsV6.h.

81{return getHeader16(RawDataBlkOff);} ;

◆ hasPhysicsBlock()

virtual uint32_t LArRodBlockPhysicsV6::hasPhysicsBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 79 of file LArRodBlockPhysicsV6.h.

79{return getHeader16(ResultsOff1);} ;

◆ hasRawDataBlock()

virtual uint32_t LArRodBlockPhysicsV6::hasRawDataBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 80 of file LArRodBlockPhysicsV6.h.

◆ initializeFEB()

void LArRodBlockPhysicsV6::initializeFEB ( const uint32_t id)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 581 of file LArRodBlockPhysicsV6.cxx.

582{
584 if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
585 {
586 m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
587 setHeader32(FEBID,id); //Set Feb ID
588 // At least 10 (head) + 16 (gain/sumblks) + 64 (energies)
589 m_vFragment->reserve(90);
590 }
591
592 m_SumBlkBlockE1.resize(4);
593 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE1[i]=0x0;
594 m_SumBlkBlockE2.resize(4);
595 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE2[i]=0x0;
596 m_GainBlock.resize(8);
597 for(unsigned int i=0;i<8;i++) m_GainBlock[i]=0x0;
598 m_TimeQualityBlock.resize(8);
599 for(unsigned int i=0;i<8;i++) m_TimeQualityBlock[i]=0x0;
600 m_EnergyBlockEncode.resize(128);
601 for(unsigned int i=0;i<128;i++) m_EnergyBlockEncode[i]=0x0;
602 m_DigitsEncode.clear();
603
605}

◆ initializeFragment()

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

Reimplemented from LArRodBlockStructure.

Definition at line 558 of file LArRodBlockPhysicsV6.cxx.

558 {
559 m_pRODblock=&fragment; //remember pointer to fragment
560 if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
561 unsigned int sizeRead=0;
562 //Store existing data in the FEB-Map
563 while (sizeRead<fragment.size()) {
564 std::vector<uint32_t>::iterator FebIter;
565 FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
566 m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
567 uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
568 uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
569 if (FebIter+currFebSize>fragment.end()) {
570 fragment.clear(); //Clear existing vector
571 return;
572 }
573 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
574 sizeRead+=currFebSize+m_MiddleHeaderSize; //6 is the middle header size
575 } // end while
576 }
577 fragment.clear(); //Clear existing vector
578}

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

Definition at line 872 of file LArRodBlockPhysicsV6.cxx.

874{
875 HWIdentifier id1 = ch1->channelID();
876 HWIdentifier id2 = ch2->channelID();
877
878 HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
879 HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
880
881 if(febId1 == febId2 ){
882 int cId1 = m_onlineHelper->channel(id1);
883 int cId2 = m_onlineHelper->channel(id2);
884 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
885 }
886
887 return febId1 < febId2 ;
888}
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 LArRodBlockPhysicsV6::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 LArRodBlockPhysicsV6::setE ( unsigned int index,
double E )
inlineprivate

Definition at line 331 of file LArRodBlockPhysicsV6.h.

332{
333 constexpr std::int32_t energyScale = 1 << 9;
334 if (m_TimeQualityBlock.size() < index + 2) {
335 return;
336 }
337 const auto scaled = static_cast<std::int32_t>(E) * energyScale;
338 const auto bits = static_cast<std::uint32_t>(scaled);
339 m_TimeQualityBlock[index] = static_cast<std::uint16_t>(bits);
340 m_TimeQualityBlock[index + 1] = static_cast<std::uint16_t>(bits >> 16);
341
342}

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

Reimplemented from LArRodBlockStructure.

Definition at line 345 of file LArRodBlockPhysicsV6.h.

345 {
346 setE (0, Ex);
347}
void setE(unsigned int index, double E)

◆ setEy()

void LArRodBlockPhysicsV6::setEy ( double Ey)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 350 of file LArRodBlockPhysicsV6.h.

350 {
351 setE (2, Ey);
352}

◆ setEz()

void LArRodBlockPhysicsV6::setEz ( double Ez)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 355 of file LArRodBlockPhysicsV6.h.

355 {
356 setE (4, Ez);
357}

◆ 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 LArRodBlockPhysicsV6::setGain ( const int )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 95 of file LArRodBlockPhysicsV6.h.

95{ 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 LArRodBlockPhysicsV6::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 607 of file LArRodBlockPhysicsV6.cxx.

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

◆ setNextEnergy() [2/2]

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

Definition at line 668 of file LArRodBlockPhysicsV6.cxx.

669{
670 if (m_EnergyIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
671 {
672 return;
673 }
674
675 // Energy
676 int endianindex;
677 if (m_EnergyIndex & 0x1) endianindex = m_EnergyIndex-1;
678 else endianindex = m_EnergyIndex+1;
679
680 m_EnergyBlockEncode[endianindex] = energy;
681
682 // Find correct position
683
684 // update summary block
685 // Gain is composed of two bits per cell
686 uint16_t gain_idx=m_EnergyIndex>>4;
687 uint16_t gain_bit=(m_EnergyIndex&0xf)*2;
689 m_GainBlock[gain_idx] |= (gain1 << gain_bit);
690
691 // write Time and Chi2 for cells above HighEnergyCellCut threshold
692
693 if (quality!=-32767) // Do write Time and Chi2 information
694 {
695 // count the number of hot cells
697 // count the number of cells offtime
698 if (abs(time)>m_OffTimeCut) m_numberHotCellOffTime++;
699 uint16_t mask_idx=m_EnergyIndex>>5;
700 uint16_t mask_bit=(m_EnergyIndex&0x1f);
701 m_SumBlkBlockE1[mask_idx] |= (0x1 << mask_bit);
702
703 m_TimeQualityBlock.push_back(*((uint16_t*)&time));
704 m_TimeQualityBlock.push_back(*((uint16_t*)&quality));
705 }
706 m_EnergyIndex++; //Use m_EIndex to count the channels put in the Energy block
707
708}
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 LArRodBlockPhysicsV6::setPointers ( )
privatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 74 of file LArRodBlockPhysicsV6.cxx.

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

Reimplemented from LArRodBlockStructure.

Definition at line 710 of file LArRodBlockPhysicsV6.cxx.

710 {
711
712 // First of all, set the bits
713 int cchIdx = FebToRodChannel(chIdx);
714 uint16_t mask_idx=cchIdx>>5;
715 uint16_t mask_bit=(cchIdx&0x1f);
716 m_SumBlkBlockE2[mask_idx] |= (0x1 << mask_bit);
717 for(std::vector<short>::const_iterator i=samples.begin();i!=samples.end();++i){
718 m_DigitsEncode.push_back((*i)<<2);
719 }
720}

◆ 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 LArRodBlockPhysicsV6::setRequiredNSamples ( unsigned short ns)
inline

Definition at line 110 of file LArRodBlockPhysicsV6.h.

◆ setSumE()

void LArRodBlockPhysicsV6::setSumE ( double SumE)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 359 of file LArRodBlockPhysicsV6.h.

359 {
360 setE (6, SumE);
361}

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

Reimplemented from LArRodBlockStructure.

Definition at line 116 of file LArRodBlockPhysicsV6.h.

117 {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 LArRodBlockPhysicsV6::m_DigitsChannel = 0
private

Definition at line 140 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsEncode

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

Definition at line 135 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsIndex

int LArRodBlockPhysicsV6::m_DigitsIndex = 0
private

Definition at line 139 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsPointer

const uint16_t* LArRodBlockPhysicsV6::m_DigitsPointer = nullptr
private

Definition at line 149 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyBlockEncode

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

Definition at line 134 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyIndex

int LArRodBlockPhysicsV6::m_EnergyIndex = 0
private

Definition at line 137 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyPointer

const uint16_t* LArRodBlockPhysicsV6::m_EnergyPointer = nullptr
private

Definition at line 146 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyThreshold1

uint16_t LArRodBlockPhysicsV6::m_EnergyThreshold1
private

Definition at line 157 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyThreshold2

uint16_t LArRodBlockPhysicsV6::m_EnergyThreshold2
private

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

Definition at line 131 of file LArRodBlockPhysicsV6.h.

◆ m_fixedGain

int LArRodBlockPhysicsV6::m_fixedGain
private

Definition at line 153 of file LArRodBlockPhysicsV6.h.

◆ m_GainBlock

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

Definition at line 130 of file LArRodBlockPhysicsV6.h.

◆ m_GainPointer

const uint32_t* LArRodBlockPhysicsV6::m_GainPointer = nullptr
private

Definition at line 142 of file LArRodBlockPhysicsV6.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* LArRodBlockPhysicsV6::m_MaskDigitsPointer = nullptr
private

Definition at line 144 of file LArRodBlockPhysicsV6.h.

◆ m_MaskTimeQualityPointer

const uint32_t* LArRodBlockPhysicsV6::m_MaskTimeQualityPointer = nullptr
private

Definition at line 143 of file LArRodBlockPhysicsV6.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 LArRodBlockPhysicsV6::m_numberHotCell = 0U
private

Definition at line 154 of file LArRodBlockPhysicsV6.h.

◆ m_numberHotCellOffTime

uint16_t LArRodBlockPhysicsV6::m_numberHotCellOffTime
private

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

Definition at line 159 of file LArRodBlockPhysicsV6.h.

◆ m_onlineHelper

const LArOnlineID* LArRodBlockPhysicsV6::m_onlineHelper
private

Definition at line 162 of file LArRodBlockPhysicsV6.h.

◆ m_pRODblock

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

Definition at line 226 of file LArRodBlockStructure.h.

◆ m_RaddPointer

const uint16_t* LArRodBlockPhysicsV6::m_RaddPointer = nullptr
private

Definition at line 145 of file LArRodBlockPhysicsV6.h.

◆ m_RawDataBlock

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

Definition at line 133 of file LArRodBlockPhysicsV6.h.

◆ m_RawDataIndex

int LArRodBlockPhysicsV6::m_RawDataIndex = 0
private

Definition at line 141 of file LArRodBlockPhysicsV6.h.

◆ m_RawDataPointer

const uint16_t* LArRodBlockPhysicsV6::m_RawDataPointer = nullptr
private

Definition at line 150 of file LArRodBlockPhysicsV6.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 LArRodBlockPhysicsV6::m_requiredNSamples
private

Definition at line 161 of file LArRodBlockPhysicsV6.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> LArRodBlockPhysicsV6::m_SumBlkBlockE1
private

Definition at line 128 of file LArRodBlockPhysicsV6.h.

◆ m_SumBlkBlockE2

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

Definition at line 129 of file LArRodBlockPhysicsV6.h.

◆ m_SumE

int32_t LArRodBlockStructure::m_SumE
protectedinherited

Definition at line 206 of file LArRodBlockStructure.h.

◆ m_SumPointer

const int32_t* LArRodBlockPhysicsV6::m_SumPointer = nullptr
private

Definition at line 147 of file LArRodBlockPhysicsV6.h.

◆ m_TimeQualityBlock

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

Definition at line 132 of file LArRodBlockPhysicsV6.h.

◆ m_TimeQualityIndex

int LArRodBlockPhysicsV6::m_TimeQualityIndex = 0
private

Definition at line 138 of file LArRodBlockPhysicsV6.h.

◆ m_TimeQualityPointer

const uint16_t* LArRodBlockPhysicsV6::m_TimeQualityPointer = nullptr
private

Definition at line 148 of file LArRodBlockPhysicsV6.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: