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

#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

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

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

◆ 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 34 of file LArRodBlockPhysicsV6.cxx.

36 m_onlineHelper(nullptr)
37{
38 m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
44 m_OffTimeCut=0; //FIXME: Nowhere set to a sensible value ???
46 // retrieve onlineHelper
47 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
48 if (!detStore) {
49 std::cout << "Unable to locate DetectorStore" << std::endl;
50 std::abort();
51 }
52 StatusCode sc = detStore->retrieve(m_onlineHelper, "LArOnlineID");
53 if (sc.isFailure()) {
54 std::cout << "Could not get LArOnlineID helper !" << std::endl;
55 std::abort();
56 }
57}
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 61 of file LArRodBlockPhysicsV6.h.

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

◆ canIncludeRawData()

bool LArRodBlockPhysicsV6::canIncludeRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 176 of file LArRodBlockPhysicsV6.h.

176{ return true;}

◆ canSetCalibration()

virtual bool LArRodBlockPhysicsV6::canSetCalibration ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 173 of file LArRodBlockPhysicsV6.h.

173{return false;}

◆ canSetEnergy()

bool LArRodBlockPhysicsV6::canSetEnergy ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 174 of file LArRodBlockPhysicsV6.h.

174{ 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 175 of file LArRodBlockPhysicsV6.h.

175{ 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 867 of file LArRodBlockPhysicsV6.cxx.

868{
869 FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
870 FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
871 FEBMAPTYPE::const_iterator feb_it;
872 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
873 if (feb_it!=feb_it_b) //Not first Feb
875
876 //Add feb data to rod data block
877 m_pRODblock->insert (m_pRODblock->end(),
878 feb_it->second.begin(), feb_it->second.end());
879 } //end for feb_it
880
881 m_mFebBlocks.clear();
882 return;
883}
std::vector< uint32_t > * m_pRODblock

◆ dumpFragment()

void LArRodBlockStructure::dumpFragment ( )
virtualinherited

Definition at line 173 of file LArRodBlockStructure.cxx.

174{
175 std::cout << "Error: Function dumpFragment() not implemented in this instance of LArRodBlockStructure!\n";
176 return;
177}

◆ FebToRodChannel()

int LArRodBlockPhysicsV6::FebToRodChannel ( int ch) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 331 of file LArRodBlockPhysicsV6.h.

332{
333return ( (ch&0x7) << 4) | ( (ch&0x38) >>2 ) | ((ch&0x40)>>6);
334
335}

◆ finalizeFEB()

void LArRodBlockPhysicsV6::finalizeFEB ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 735 of file LArRodBlockPhysicsV6.cxx.

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

417{// chan = (0,127)
418 // int a = chan/32;
419 // int r = chan%32;
420 int a = chan>>5;
421 int r = chan&0x1f;
422 // a = (0,3), r = ( 0, 31 )
423 return (*(p+a)>>r) & 0x1;
424}
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 534 of file LArRodBlockPhysicsV6.cxx.

535{
536 if(!m_RawDataPointer) return 0;
537 int index=5;
539 return x;
540}
#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 542 of file LArRodBlockPhysicsV6.cxx.

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

◆ getCtrl3()

uint16_t LArRodBlockPhysicsV6::getCtrl3 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 550 of file LArRodBlockPhysicsV6.cxx.

551{
552 if(!m_RawDataPointer) return 0;
553 int index=7;
555 return x;
556}

◆ getDAC()

uint16_t LArRodBlockStructure::getDAC ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 451 of file LArRodBlockStructure.h.

452{
453 std::cout << "Error: Function getDAC not implemented in this instance of LArRodBlockStructure!\n";
454 return 0;
455}

◆ getDelay()

uint16_t LArRodBlockStructure::getDelay ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 457 of file LArRodBlockStructure.h.

458{
459 std::cout << "Error: Function getDelay not implemented in this instance of LArRodBlockStructure!\n";
460 return 0;
461}

◆ getDspCodeVersion()

uint32_t LArRodBlockStructure::getDspCodeVersion ( ) const
virtualinherited

Definition at line 256 of file LArRodBlockStructure.cxx.

257{
258 int i=getNumberOfWords()-2;
259 return m_FebBlock[i];
260}
uint32_t getNumberOfWords() const

◆ getDspEventCounter()

int32_t LArRodBlockStructure::getDspEventCounter ( ) const
virtualinherited

Definition at line 262 of file LArRodBlockStructure.cxx.

263{
264 int i=getNumberOfWords()-1;
265 return m_FebBlock[i];
266}

◆ getEx()

int32_t LArRodBlockPhysicsV6::getEx ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 269 of file LArRodBlockPhysicsV6.h.

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

◆ getEy()

int32_t LArRodBlockPhysicsV6::getEy ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 275 of file LArRodBlockPhysicsV6.h.

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

◆ getEz()

int32_t LArRodBlockPhysicsV6::getEz ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 281 of file LArRodBlockPhysicsV6.h.

282{
283 if(m_SumPointer) return (m_SumPointer[2]>>9);
284 return 0;
285}

◆ getFebConfig()

uint16_t LArRodBlockPhysicsV6::getFebConfig ( ) const
inline

Definition at line 179 of file LArRodBlockPhysicsV6.h.

180{
181 return getHeader16(FebConfig);
182}
uint16_t getHeader16(const unsigned n) const

◆ getFEBID()

uint32_t LArRodBlockStructure::getFEBID ( ) const
inlineinherited

Definition at line 292 of file LArRodBlockStructure.h.

293{return getHeader32(FEBID);}
uint32_t getHeader32(const unsigned n) const

◆ getFEBSN()

uint32_t LArRodBlockStructure::getFEBSN ( ) const
inlineinherited

Definition at line 295 of file LArRodBlockStructure.h.

296{return getHeader32(FEBSN);}

◆ getFirstSampleIndex()

uint16_t LArRodBlockPhysicsV6::getFirstSampleIndex ( ) const
inline

Definition at line 184 of file LArRodBlockPhysicsV6.h.

185{
187}

◆ getHeader16()

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

Definition at line 340 of file LArRodBlockStructure.h.

341{
342 if (n&0x1) //n is a odd number
343 return m_FebBlock[n>>1] & 0xffff; //1,3,5... are fetched from lower bits
344 else //n is a even number
345 return m_FebBlock[n>>1] >> 16; //0,2,4... are fetched from higher bits
346}

◆ getHeader32()

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

Definition at line 348 of file LArRodBlockStructure.h.

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

◆ getNbSweetCells1()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells1 ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 461 of file LArRodBlockPhysicsV6.cxx.

462{
463 if(!m_RaddPointer) return 0;
464 return m_RaddPointer[1]>>8;
465}
const uint16_t * m_RaddPointer

◆ getNbSweetCells1FromMask()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells1FromMask ( ) const
private

Definition at line 473 of file LArRodBlockPhysicsV6.cxx.

474{
475 if(!m_MaskTimeQualityPointer) return 0;
476 int n=0;
477 for(int i=0;i<4;i++)
478 for(int j=0;j<32;j++)
479 if((m_MaskTimeQualityPointer[i] >> j) &0x1) n++;
480 return n;
481}
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 467 of file LArRodBlockPhysicsV6.cxx.

468{
469 if(!m_RaddPointer) return 0;
470 return m_RaddPointer[1] & 0xff;
471}

◆ getNbSweetCells2FromMask()

uint16_t LArRodBlockPhysicsV6::getNbSweetCells2FromMask ( ) const
private

Definition at line 483 of file LArRodBlockPhysicsV6.cxx.

484{
485 if(!m_MaskDigitsPointer) return 0;
486 int n=0;
487 for(int i=0;i<4;i++)
488 for(int j=0;j<32;j++)
489 if((m_MaskDigitsPointer[i] >> j) &0x1) n++;
490 return n;
491}
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 92 of file LArRodBlockStructure.cxx.

93{
94 std::cout << "Error: Function getNextAccumulatedCalibDigit not implemented in this instance of LArRodBlockStructure!\n";
95 return 0;
96}

◆ 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 98 of file LArRodBlockStructure.cxx.

99{
100 std::cout << "Error: Function getNextAccumulatedDigit not implemented in this instance of LArRodBlockStructure!\n";
101 return 0;
102}

◆ getNextDigits()

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

Definition at line 339 of file LArRodBlockPhysicsV6.cxx.

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

◆ 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 189 of file LArRodBlockPhysicsV6.h.

190{
191 #ifdef LARBSDBGOUTPUT
192 MsgStream logstr(Athena::getMessageSvc(), BlockType());
193 #endif
194
195 LARBSDBG("in LArRodBlockPhysicsV6::getNextEnergy.");
196 LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
197 if (m_EnergyIndex>=m_channelsPerFEB) // Already beyond maximal number of channels
198 return 0;
199 if (!m_EnergyPointer) // No data block present
200 return 0;
201
202 unsigned rodChannelNumber=m_EnergyIndex; // Index of Channel in ROD-Block
203 channelNumber=((rodChannelNumber&0xe)<<2) + ((rodChannelNumber&0x1)<<6) + (rodChannelNumber>>4); //channel number of the FEB
204
205 // get information available for all cells
206 // Energy on a 16 bit word and decode ranges
207 uint16_t encodedEnergy; // 16 bits Encoded Energy word
208 int32_t aux;
209 uint16_t range; // 2 bits range
211
212 LARBSDBG("-------->>>> in LArRodBlockPhysicsV6::getNextEnergy : decode energy.....");
213 // decode energy
214 if(m_EnergyIndex & 0x1) encodedEnergy = m_EnergyPointer[m_EnergyIndex-1]; // Big/Little Endien stuff
215 else encodedEnergy = m_EnergyPointer[m_EnergyIndex+1]; // Big/Little Endien stuff
216
217 aux = (int32_t) (encodedEnergy&0x1fff);
218 range = (encodedEnergy & 0xc000) >> 14;
219 if(aux==0 && range>0) aux=0x2000;
220 sign = encodedEnergy & 0x2000;
221 aux <<= 3*range;
222 if(sign) aux = -aux;
223 energy = aux;
224
225 // gain in 2 bits of a 32 bits word
226 if(m_GainPointer) {
227 gain = (uint32_t) ((m_GainPointer[m_EnergyIndex>>4] >> ((m_EnergyIndex&0xf)<<1)) & 0x3);
229 } else gain=0xffffffff;
230
231 // Get Time and Quality if the information is present according to summary block
232 uint32_t hasTQ;
234 hasTQ = (uint32_t) ((m_MaskTimeQualityPointer[m_EnergyIndex>>5] >> (m_EnergyIndex&0x1f)) &0x1);
235 else
236 hasTQ = 0;
238 if (m_TimeQualityPointer && hasTQ) // Data has Time and Quality information
239 {
240 //Time is in 10 ps in ByteStream, hence the factor 10 to convert to ps
241 time = 10*(reinterpret_cast<const int16_t *>(m_TimeQualityPointer))[m_TimeQualityIndex++];
243
244#ifdef LARBSDBGOUTPUT
245 logstr << MYLEVEL <<"This cell has time and Quality information "<<endmsg;
246#endif
247 }
248 else // Data has no Time and Quality information
249 {
250 time=0;
251 quality=-1;
252 }
253
254
255#ifdef LARBSDBGOUTPUT
256 logstr << MYLEVEL <<"Range = "<<range<<endmsg;
257 logstr << MYLEVEL <<"Sign = "<<sign<<endmsg;
258 logstr << MYLEVEL <<" Encoded Energy ="<< MSG::hex << encodedEnergy << MSG::dec << " E=" << energy
259 << " t=" << time
260 << " Q=" << quality
261 << " G=" << gain
262 << " channel Number=" << channelNumber
263 << endmsg;
264#endif
265
266 return 1;
267}
#define LARBSDBG(text)
This class provides decoding/encoding from/to ROD format.
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 233 of file LArRodBlockPhysicsV6.cxx.

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

475{
476 std::cout << "Error: Function getNStep not implemented in this instance of LArRodBlockStructure!\n";
477 return 0;
478}

◆ getNTrigger()

uint16_t LArRodBlockStructure::getNTrigger ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 463 of file LArRodBlockStructure.h.

464{
465 std::cout << "Error: Function getNTrigger not implemented in this instance of LArRodBlockStructure!\n";
466 return 0;
467}

◆ getNumberOfGains()

uint32_t LArRodBlockPhysicsV6::getNumberOfGains ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 498 of file LArRodBlockPhysicsV6.cxx.

499{
500 return getHeader16(NGains);
501}

◆ getNumberOfSamples()

uint32_t LArRodBlockPhysicsV6::getNumberOfSamples ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 493 of file LArRodBlockPhysicsV6.cxx.

494{
495 return getHeader16(NSamples);
496}

◆ getNumberOfWords()

uint32_t LArRodBlockStructure::getNumberOfWords ( ) const
inlineinherited

Definition at line 411 of file LArRodBlockStructure.h.

412{
413 return getHeader32(NWTot);
414}

◆ getPulsed()

bool LArRodBlockStructure::getPulsed ( unsigned channelNumber) const
inlinevirtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 445 of file LArRodBlockStructure.h.

446{
447 std::cout << "Error: Function getPulsed not implemented in this instance of LArRodBlockStructure!\n";
448 return 0;
449}

◆ getRadd()

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

Reimplemented from LArRodBlockStructure.

Definition at line 518 of file LArRodBlockPhysicsV6.cxx.

519{
520 if(!m_RawDataPointer) {
521 if(!m_RaddPointer) return 0;
522 if(sample%2) sample+=2;
523 return m_RaddPointer[sample];
524 }
525 int index;
526 if(sample==0) index=6;
527 else if(sample & 0x1) index=7+sample-1;
528 else index=7+sample+1;
530 if(adc>=8) return x>>8;
531 return x&0xff;
532}

◆ getRawDataSize()

uint16_t LArRodBlockPhysicsV6::getRawDataSize ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 513 of file LArRodBlockPhysicsV6.cxx.

514{
516}

◆ getResults1Size()

uint16_t LArRodBlockPhysicsV6::getResults1Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 503 of file LArRodBlockPhysicsV6.cxx.

504{
505 return getHeader16(ResultsDim1);
506}

◆ getResults2Size()

uint16_t LArRodBlockPhysicsV6::getResults2Size ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 508 of file LArRodBlockPhysicsV6.cxx.

509{
510 return getHeader16(ResultsDim2);
511}

◆ getStatus()

uint32_t LArRodBlockPhysicsV6::getStatus ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 558 of file LArRodBlockPhysicsV6.cxx.

559{
560 if(getNumberOfWords()<EventStatus/2) return 0;
562 return x;
563}

◆ getStepIndex()

uint16_t LArRodBlockStructure::getStepIndex ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, and LArRodBlockCalibrationV3.

Definition at line 469 of file LArRodBlockStructure.h.

470{
471 std::cout << "Error: Function getStepIndex not implemented in this instance of LArRodBlockStructure!\n";
472 return 0;
473}

◆ getSumE()

int32_t LArRodBlockPhysicsV6::getSumE ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 286 of file LArRodBlockPhysicsV6.h.

287{
288 if(m_SumPointer) return (m_SumPointer[3]>>9);
289 return 0;
290}

◆ getTDCPhase()

uint8_t LArRodBlockStructure::getTDCPhase ( ) const
virtualinherited

Reimplemented in LArRodBlockAccumulatedV3, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, LArRodBlockCalibrationV3, and LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 147 of file LArRodBlockStructure.cxx.

148{
149 std::cout << "Error: Function getTDCPhase not implemented in this instance of LArRodBlockStructure!\n";
150 return 0;
151}

◆ getVectorHeader16()

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

Definition at line 351 of file LArRodBlockStructure.h.

352{ if (n&0x1) //n is a odd number
353 return (std::as_const(*m_vFragment).at(n>>1) & 0xffff);
354 else //n is a even number
355 return (std::as_const(*m_vFragment).at(n>>1) >> 16);
356}

◆ getVectorHeader32()

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

Definition at line 358 of file LArRodBlockStructure.h.

359{
360 return (*m_vFragment)[n>>1];
361}

◆ getVROBEx()

int32_t LArRodBlockPhysicsV6::getVROBEx ( ) 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[1]>>9);
307 return 0;
308}
const uint32_t * m_virtualROBPointerLocal

◆ getVROBEy()

int32_t LArRodBlockPhysicsV6::getVROBEy ( ) 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[2]>>9);
314 return 0;
315}

◆ getVROBEz()

int32_t LArRodBlockPhysicsV6::getVROBEz ( ) 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[3]>>9);
321 return 0;
322}

◆ getVROBFebId()

uint32_t LArRodBlockPhysicsV6::getVROBFebId ( )
inlinevirtual

◆ getVROBSumE()

int32_t LArRodBlockPhysicsV6::getVROBSumE ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 324 of file LArRodBlockPhysicsV6.h.

325{
326 const int32_t* p = reinterpret_cast<const int32_t*>(m_virtualROBPointerLocal);
327 if(p) return (p[4]>>9);
328 return 0;
329}

◆ 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 83 of file LArRodBlockPhysicsV6.h.

83{return 0;} ;

◆ hasControlWords()

virtual uint32_t LArRodBlockPhysicsV6::hasControlWords ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 86 of file LArRodBlockPhysicsV6.h.

86{return getHeader16(RawDataBlkOff);} ;

◆ hasPhysicsBlock()

virtual uint32_t LArRodBlockPhysicsV6::hasPhysicsBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 84 of file LArRodBlockPhysicsV6.h.

84{return getHeader16(ResultsOff1);} ;

◆ hasRawDataBlock()

virtual uint32_t LArRodBlockPhysicsV6::hasRawDataBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 85 of file LArRodBlockPhysicsV6.h.

◆ initializeFEB()

void LArRodBlockPhysicsV6::initializeFEB ( const uint32_t id)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 591 of file LArRodBlockPhysicsV6.cxx.

592{
594 if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
595 {
596 m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
597 setHeader32(FEBID,id); //Set Feb ID
598 // At least 10 (head) + 16 (gain/sumblks) + 64 (energies)
599 m_vFragment->reserve(90);
600 }
601
602 m_SumBlkBlockE1.resize(4);
603 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE1[i]=0x0;
604 m_SumBlkBlockE2.resize(4);
605 for(unsigned int i=0;i<4;i++) m_SumBlkBlockE2[i]=0x0;
606 m_GainBlock.resize(8);
607 for(unsigned int i=0;i<8;i++) m_GainBlock[i]=0x0;
608 m_TimeQualityBlock.resize(8);
609 for(unsigned int i=0;i<8;i++) m_TimeQualityBlock[i]=0x0;
610 m_EnergyBlockEncode.resize(128);
611 for(unsigned int i=0;i<128;i++) m_EnergyBlockEncode[i]=0x0;
612 m_DigitsEncode.clear();
613
615
616}

◆ initializeFragment()

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

Reimplemented from LArRodBlockStructure.

Definition at line 566 of file LArRodBlockPhysicsV6.cxx.

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

◆ LE_getHeader16()

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

Definition at line 388 of file LArRodBlockStructure.h.

389{
390 return (reinterpret_cast<const uint16_t*>(m_FebBlock))[n];
391}

◆ LE_getVectorHeader16()

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

Definition at line 393 of file LArRodBlockStructure.h.

394{
395 const uint32_t* data32 = std::as_const(*m_vFragment).data();
396 const uint16_t* data16 = reinterpret_cast<const uint16_t*> (data32);
397 return data16[n];
398}

◆ LE_setHeader16()

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

Definition at line 400 of file LArRodBlockStructure.h.

401{
402#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
403 if ((unsigned)n>=m_vFragment->size()*2) {
404 std::cout << "LArRodBlockStructure::LE_setHeader16 Error: WRITE BEYOND ARRAY BONDARY!" << std::endl;
405 std::abort();
406 }
407#endif
408 reinterpret_cast<uint16_t*>(m_vFragment->data())[n] = w;
409}

◆ 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 std::cout << "Error while decoding LArByteStream: Found FEB block of size " << BlockSize << " in a ROD block of size " << LeftSize << std::endl;
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 161 of file LArRodBlockStructure.cxx.

162{
163 int end = getNumberOfWords()-3;
164 int start = 1;
165 uint32_t sum = 0;
167 for(int i=start;i<end;i++) {
168 sum += m_FebBlock[i];
169 }
170 return sum & 0x7fffffff;
171}

◆ OfflineToRawGain()

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

Definition at line 337 of file LArRodBlockStructure.h.

338{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 153 of file LArRodBlockStructure.cxx.

154{
155 int offset = getNumberOfWords()-1;
156 if(offset>=m_FebBlockSize) return 0;
157 if(offset<0) return 0;
158 return m_FebBlock[offset];
159}

◆ operator()()

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

Definition at line 887 of file LArRodBlockPhysicsV6.cxx.

889{
890 HWIdentifier id1 = ch1->channelID();
891 HWIdentifier id2 = ch2->channelID();
892
893 HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
894 HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
895
896 if(febId1 == febId2 ){
897 int cId1 = m_onlineHelper->channel(id1);
898 int cId2 = m_onlineHelper->channel(id2);
899 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
900 }
901
902 return febId1 < febId2 ;
903}
virtual int FebToRodChannel(int ch) const

◆ RawToOfflineGain()

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

Definition at line 334 of file LArRodBlockStructure.h.

335{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 427 of file LArRodBlockStructure.h.

428{
429 // chan = (0,127)
430 // int a = chan/32;
431 // int r = chan%32;
432 int a = chan>>5;
433 int r = chan&0x1f;
434 // a = (0,3), r = ( 0, 31 )
435 *(p+a) |= (1<<r) ;
436 return;
437}

◆ setDAC()

void LArRodBlockStructure::setDAC ( const uint16_t DACValue)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 55 of file LArRodBlockStructure.cxx.

56{
57 std::cout << "Error: Function setDAC not implemented in this instance of LArRodBlockStructure!\n";
58 return;
59}

◆ setDelay()

void LArRodBlockStructure::setDelay ( const uint16_t DelayValue)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 61 of file LArRodBlockStructure.cxx.

62{
63 std::cout << "Error: Function setDelay not implemented in this instance of LArRodBlockStructure!\n";
64 return;
65}

◆ setE()

void LArRodBlockPhysicsV6::setE ( unsigned int index,
double E )
inlineprivate

Definition at line 337 of file LArRodBlockPhysicsV6.h.

337 {
338
339 union {
340 int32_t i;
341 uint16_t us[2];
342 } conv;
343 conv.i = static_cast<int32_t>(E);
344 // Write as multiplication, not as left shift, since left-shifting
345 // a negative number is undefined in C++.
346 // Compiles to the same code on x86_64.
347 conv.i *= (1<<9);
348 if ( m_TimeQualityBlock.size()>=8 ){
351 }
352}

◆ 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 118 of file LArRodBlockStructure.cxx.

119{
120 std::cout << "Error: Function setEtQ not implemented in this instance of LArRodBlockStructure!\n";
121 return;
122}

◆ setEx()

void LArRodBlockPhysicsV6::setEx ( double Ex)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 355 of file LArRodBlockPhysicsV6.h.

355 {
356 setE (0, Ex);
357}
void setE(unsigned int index, double E)

◆ setEy()

void LArRodBlockPhysicsV6::setEy ( double Ey)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 360 of file LArRodBlockPhysicsV6.h.

360 {
361 setE (2, Ey);
362}

◆ setEz()

void LArRodBlockPhysicsV6::setEz ( double Ez)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 365 of file LArRodBlockPhysicsV6.h.

365 {
366 setE (4, Ez);
367}

◆ 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 std::cout << "Error while decoding LArByteStream: Got Rod block size 0" << std::endl;
258 return false;
259 }
260
261 BlockSize = getNumberOfWords();
262 if (BlockSize>n) {
263 std::cout << "Error while decoding LArByteStream: Found FEB block of size " << BlockSize << " in a ROD block of size " << n << std::endl;
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.

276 {
281 if ( n<2 ) { std::cout << "Error" << std::endl; return 0;}
282 m_virtualROBJump = ((*p)>>16)>>1; // Divide by two (two FEBs-1ROB)
283 m_ROB_to_decode = ( (*p) & 0xFFFF )<<1; // Multiply by two
284 if ( (n - m_virtualROBJump*m_ROB_to_decode-1) ){
285 std::cout << "Error AGAIN" << std::endl;
286 return 0;
287 }
289 return m_ROB_to_decode;
290}

◆ setGain()

virtual int LArRodBlockPhysicsV6::setGain ( const int )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 100 of file LArRodBlockPhysicsV6.h.

100{ return 1; };

◆ setHeader16()

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

Definition at line 363 of file LArRodBlockStructure.h.

364{
365#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
366 if ((unsigned)n>=m_vFragment->size()*2) {
367 std::cout << "Error WRITE BEYOND ARRAY BONDARY!" << std::endl;
368 std::abort();
369 }
370#endif
371 if (n&0x1) // n is a odd number
372 m_vFragment->at(n>>1)=((m_vFragment->at(n>>1) & 0xffff0000) | w);
373 else
374 m_vFragment->at(n>>1)=((m_vFragment->at(n>>1) & 0xffff) | (w << 16));
375}

◆ setHeader32()

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

Definition at line 377 of file LArRodBlockStructure.h.

378{
379#ifdef LARBYTESTREAMRODBLOCK_CHCKBOUNDARIES
380 if ((unsigned)n>=m_vFragment->size()*2) {
381 std::cout << "Error WRITE BEYOND ARRAY BONDARY!" << std::endl;
382 std::abort();
383 }
384#endif
385 m_vFragment->at(n>>1) = w;
386}

◆ 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 618 of file LArRodBlockPhysicsV6.cxx.

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

◆ 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 681 of file LArRodBlockPhysicsV6.cxx.

682{
683 if (m_EnergyIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
684 {
685 return;
686 }
687
688 // Energy
689 int endianindex;
690 if (m_EnergyIndex & 0x1) endianindex = m_EnergyIndex-1;
691 else endianindex = m_EnergyIndex+1;
692 m_EnergyBlockEncode[endianindex] = energy;
693
694 // Find correct position
695
696 // update summary block
697 // Gain is composed of two bits per cell
698 uint16_t gain_idx=m_EnergyIndex>>4;
699 uint16_t gain_bit=(m_EnergyIndex&0xf)*2;
701 m_GainBlock[gain_idx] |= (gain1 << gain_bit);
702
703 // write Time and Chi2 for cells above HighEnergyCellCut threshold
704
705 if (quality!=-32767) // Do write Time and Chi2 information
706 {
707 // count the number of hot cells
709 // count the number of cells offtime
710 if (abs(time)>m_OffTimeCut) m_numberHotCellOffTime++;
711 uint16_t mask_idx=m_EnergyIndex>>5;
712 uint16_t mask_bit=(m_EnergyIndex&0x1f);
713 m_SumBlkBlockE1[mask_idx] |= (0x1 << mask_bit);
714
715 m_TimeQualityBlock.push_back(*((uint16_t*)&time));
716 m_TimeQualityBlock.push_back(*((uint16_t*)&quality));
717 }
718 m_EnergyIndex++; //Use m_EIndex to count the channels put in the Energy block
719
720}
uint32_t OfflineToRawGain(const uint32_t gain) const

◆ setNTrigger()

void LArRodBlockStructure::setNTrigger ( const uint16_t NTrigger)
virtualinherited

Definition at line 73 of file LArRodBlockStructure.cxx.

74{
75 std::cout << "Error: Function setNTrigger not implemented in this instance of LArRodBlockStructure!\n";
76 return;
77}

◆ setNumberOfGains()

void LArRodBlockStructure::setNumberOfGains ( const uint8_t n)
virtualinherited

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

Definition at line 136 of file LArRodBlockStructure.cxx.

137{
138 std::cout << "Error: Function setNumberOfGains not implemented in this instance of LArRodBlockStructure!\n";
139 return;
140}

◆ setNumberOfSamples()

void LArRodBlockStructure::setNumberOfSamples ( const uint8_t n)
virtualinherited

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

Definition at line 130 of file LArRodBlockStructure.cxx.

131{
132 std::cout << "Error: Function setNumberOfSamples not implemented in this instance of LArRodBlockStructure!\n";
133 return;
134}

◆ setPointers()

bool LArRodBlockPhysicsV6::setPointers ( )
privatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 80 of file LArRodBlockPhysicsV6.cxx.

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

68{
69 std::cout << "Error: Function setPulsed not implemented in this instance of LArRodBlockStructure!\n";
70 return;
71}

◆ setRawData()

void LArRodBlockPhysicsV6::setRawData ( const int chIdx,
const std::vector< short > & samples,
const uint32_t  )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 722 of file LArRodBlockPhysicsV6.cxx.

722 {
723
724 // First of all, set the bits
725 int cchIdx = FebToRodChannel(chIdx);
726 uint16_t mask_idx=cchIdx>>5;
727 uint16_t mask_bit=(cchIdx&0x1f);
728 m_SumBlkBlockE2[mask_idx] |= (0x1 << mask_bit);
729 for(std::vector<short>::const_iterator i=samples.begin();i!=samples.end();++i){
730 m_DigitsEncode.push_back((*i)<<2);
731 }
732
733}

◆ setRawDataFixed()

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

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 124 of file LArRodBlockStructure.cxx.

125{
126 std::cout << "Error: Function setRawDataFixed not implemented in this instance of LArRodBlockStructure!\n";
127 return;
128}

◆ setRequiredNSamples()

void LArRodBlockPhysicsV6::setRequiredNSamples ( unsigned short ns)
inline

Definition at line 115 of file LArRodBlockPhysicsV6.h.

◆ setSumE()

void LArRodBlockPhysicsV6::setSumE ( double SumE)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 369 of file LArRodBlockPhysicsV6.h.

369 {
370 setE (6, SumE);
371}

◆ setTDCPhase()

void LArRodBlockStructure::setTDCPhase ( const uint8_t n)
virtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 142 of file LArRodBlockStructure.cxx.

143{
144 std::cout << "Error: Function setTDCPhase not implemented in this instance of LArRodBlockStructure!\n";
145 return;
146}

◆ sortDataVector() [1/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 90 of file LArRodBlockStructure.cxx.

238{return;}

◆ sortDataVector() [2/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 91 of file LArRodBlockStructure.cxx.

241{return;}

◆ sortDataVector() [3/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 89 of file LArRodBlockStructure.cxx.

235{return;}

◆ sortDataVector() [4/5]

void LArRodBlockPhysicsV6::sortDataVector ( std::vector< const LArDigit * > & vDigit)
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 121 of file LArRodBlockPhysicsV6.h.

122 {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.

229{return;}

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 145 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsEncode

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

Definition at line 140 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsIndex

int LArRodBlockPhysicsV6::m_DigitsIndex = 0
private

Definition at line 144 of file LArRodBlockPhysicsV6.h.

◆ m_DigitsPointer

const uint16_t* LArRodBlockPhysicsV6::m_DigitsPointer = nullptr
private

Definition at line 154 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyBlockEncode

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

Definition at line 139 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyIndex

int LArRodBlockPhysicsV6::m_EnergyIndex = 0
private

Definition at line 142 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyPointer

const uint16_t* LArRodBlockPhysicsV6::m_EnergyPointer = nullptr
private

Definition at line 151 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyThreshold1

uint16_t LArRodBlockPhysicsV6::m_EnergyThreshold1
private

Definition at line 162 of file LArRodBlockPhysicsV6.h.

◆ m_EnergyThreshold2

uint16_t LArRodBlockPhysicsV6::m_EnergyThreshold2
private

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

◆ m_fixedGain

int LArRodBlockPhysicsV6::m_fixedGain
private

Definition at line 158 of file LArRodBlockPhysicsV6.h.

◆ m_GainBlock

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

Definition at line 135 of file LArRodBlockPhysicsV6.h.

◆ m_GainPointer

const uint32_t* LArRodBlockPhysicsV6::m_GainPointer = nullptr
private

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

◆ m_MaskTimeQualityPointer

const uint32_t* LArRodBlockPhysicsV6::m_MaskTimeQualityPointer = nullptr
private

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

◆ m_numberHotCellOffTime

uint16_t LArRodBlockPhysicsV6::m_numberHotCellOffTime
private

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

◆ m_onlineHelper

const LArOnlineID* LArRodBlockPhysicsV6::m_onlineHelper
private

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

◆ m_RawDataBlock

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

Definition at line 138 of file LArRodBlockPhysicsV6.h.

◆ m_RawDataIndex

int LArRodBlockPhysicsV6::m_RawDataIndex = 0
private

Definition at line 146 of file LArRodBlockPhysicsV6.h.

◆ m_RawDataPointer

const uint16_t* LArRodBlockPhysicsV6::m_RawDataPointer = nullptr
private

Definition at line 155 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 166 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 133 of file LArRodBlockPhysicsV6.h.

◆ m_SumBlkBlockE2

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

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

◆ m_TimeQualityBlock

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

Definition at line 137 of file LArRodBlockPhysicsV6.h.

◆ m_TimeQualityIndex

int LArRodBlockPhysicsV6::m_TimeQualityIndex = 0
private

Definition at line 143 of file LArRodBlockPhysicsV6.h.

◆ m_TimeQualityPointer

const uint16_t* LArRodBlockPhysicsV6::m_TimeQualityPointer = nullptr
private

Definition at line 153 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: