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

#include <LArRodBlockPhysicsV2.h>

Inheritance diagram for LArRodBlockPhysicsV2:
Collaboration diagram for LArRodBlockPhysicsV2:

Public Member Functions

 LArRodBlockPhysicsV2 (IMessageSvc *msgSvc)
virtual void initializeFragment (std::vector< uint32_t > &fragment)
virtual void initializeFEB (const uint32_t id)
virtual void setNumberOfSamples (const uint8_t n)
virtual void setNumberOfGains (const uint8_t n)
virtual void setNextEnergy (const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
virtual void setRawData (const int channel, const std::vector< short > &samples, const uint32_t gain)
virtual void finalizeFEB ()
virtual void concatinateFEBs ()
virtual void sortDataVector (std::vector< const LArRawChannel * > &)
virtual void sortDataVector (std::vector< const LArDigit * > &)
virtual bool canSetEnergy ()
virtual bool canSetRawData ()
template<class RAWDATA>
bool operator() (const RAWDATA *ch1, const RAWDATA *ch2) const
virtual int setGain (const int)
virtual bool setPointers ()
virtual int getNextEnergy (int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
virtual int getNextRawData (int &channelNumber, std::vector< short > &samples, uint32_t &gain)
virtual uint32_t getNumberOfSamples () const
virtual uint32_t getNumberOfGains () const
virtual uint32_t getRadd (uint32_t adc, uint32_t sample) const
virtual uint16_t getCtrl1 (uint32_t adc) const
virtual uint16_t getCtrl2 (uint32_t adc) const
virtual uint16_t getCtrl3 (uint32_t adc) const
virtual uint32_t getStatus () const
virtual uint32_t hasPhysicsBlock () const
virtual uint32_t hasRawDataBlock () const
virtual void sortDataVector (std::vector< const LArCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedCalibDigit * > &)
virtual void sortDataVector (std::vector< const LArAccumulatedDigit * > &)
virtual void setTDCPhase (const uint8_t n)
virtual void setRawDataFixed (const int channel, const std::vector< short > &samples, const uint32_t gain)
virtual void setEtQ (const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
virtual void setDAC (const uint16_t DACValue)
virtual void setDelay (const uint16_t DelayValue)
virtual void setPulsed (const unsigned channelNumber)
virtual void setNTrigger (const uint16_t NTrigger)
virtual void setEx (double)
virtual void setEy (double)
virtual void setEz (double)
virtual void setSumE (double)
virtual bool canSetRawDataFixed ()
virtual bool canSetCalibration ()
virtual bool canSetNTrigger ()
virtual bool canIncludeRawData ()
bool setFragment (const uint32_t *p, uint32_t n)
bool nextFEB ()
uint32_t getNumberOfWords () const
uint32_t getFEBID () const
uint32_t getFEBSN () const
virtual int32_t 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 uint32_t hasCalibBlock () const
virtual uint32_t hasAccumBlock () const
virtual uint32_t hasControlWords () const
virtual int getNextAccumulatedCalibDigit (int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &Samples2Sum, uint32_t &nStepTriggers, uint32_t &gain)
virtual int getNextAccumulatedDigit (int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
virtual bool getPulsed (unsigned channelNumber) const
virtual uint16_t getDAC () const
virtual uint16_t getDelay () const
virtual uint16_t getNTrigger () const
virtual uint16_t getStepIndex () const
virtual uint16_t getNStep () const
virtual uint8_t getTDCPhase () const
virtual uint16_t getResults1Size () const
virtual uint16_t getResults2Size () const
virtual uint16_t getRawDataSize () const
virtual uint16_t getNbSweetCells1 () const
virtual uint16_t getNbSweetCells2 () const
virtual uint32_t getDspCodeVersion () const
virtual int32_t getDspEventCounter () const
virtual uint32_t onlineCheckSum () const
virtual uint32_t offlineCheckSum () const
virtual int setFragmentVirtualROB (const uint32_t *p, uint32_t n)
virtual void dumpFragment ()
void setFirstSample (const int rearrangeFirstSample)
uint32_t RawToOfflineGain (const uint32_t gain) const
uint32_t OfflineToRawGain (const uint32_t gain) const
bool report_error (void) const

Static Public Member Functions

static std::string BlockType ()

Protected Types

enum  {
  NWTot , NWTot_h , FEBID , FEBID_h ,
  FEB_SN , FEB_SN_h , HighEBlkOffset , LowEBlkOffset ,
  NGainNSamples , RawDataBlkOffset , Status2 , Status1 ,
  BCID , EventID , endtag
}
enum  {
  NWTot , NWTot_h , FEBID , FEBID_h ,
  FEBSN , FEBSN_h , endtag
}
typedef std::map< uint32_t, std::vector< uint32_t > > FEBMAPTYPE

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

Private Member Functions

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

Private Attributes

std::vector< uint32_t > m_LowEnergyBlock
std::vector< uint32_t > m_HighEnergyBlock
std::vector< uint32_t > m_RawDataBlock
int m_ECounter = 0
int m_RawDataCounter = 0
int m_LowEIndex = 0
int m_RawDataIndex = 0
int m_HighEIndex = 0
int m_EIndex = 0
const uint16_t * m_RawDataPtr
const uint32_t * m_RawDataFlagsPtr
const uint32_t * m_GainPtr
const int32_t * m_HighEPtr
const uint32_t * m_FlagPtr
const int16_t * m_LowEPtr
unsigned short m_NFlaggingWords
const LArOnlineIDm_onlineHelper

Static Private Attributes

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

Detailed Description

Definition at line 46 of file LArRodBlockPhysicsV2.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
protected
Enumerator
NWTot 
NWTot_h 
FEBID 
FEBID_h 
FEB_SN 
FEB_SN_h 
HighEBlkOffset 
LowEBlkOffset 
NGainNSamples 
RawDataBlkOffset 
Status2 
Status1 
BCID 
EventID 
endtag 

Definition at line 54 of file LArRodBlockPhysicsV2.h.

◆ 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

◆ LArRodBlockPhysicsV2()

LArRodBlockPhysicsV2::LArRodBlockPhysicsV2 ( IMessageSvc * msgSvc)

Definition at line 37 of file LArRodBlockPhysicsV2.cxx.

39{
40 // retrieve onlineHelper
41 const LArOnlineID* online_id;
42 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
43 if (!detStore) {
44 m_logstr << MSG::ERROR << "Unable to locate DetectorStore" << endmsg;
45 std::abort();
46 }
47 StatusCode sc = detStore->retrieve(online_id, "LArOnlineID");
48 if (sc.isFailure()) {
49 m_logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
50 std::abort();
51 }
52 else {
53 m_onlineHelper=online_id;
54 m_logstr << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
55 }
56
57 m_iHeadBlockSize=endtag/2; // The implicit cast rounds down to the right size
60 m_vFragment=NULL;
61 m_FebBlock=NULL;
62 m_pRODblock=NULL;
63 m_FlagPtr=NULL;
64 m_GainPtr=NULL;
65 m_HighEPtr=NULL;
66 m_LowEPtr=NULL;
68 m_RawDataPtr=NULL;
69}
#define endmsg
static Double_t sc
static std::string BlockType()
const uint16_t * m_RawDataPtr
const LArOnlineID * m_onlineHelper
const uint32_t * m_RawDataFlagsPtr
std::vector< uint32_t > * m_pRODblock
LArRodBlockStructure(IMessageSvc *msgSvc, const std::string &blockType)
std::vector< uint32_t > * m_vFragment
::StatusCode StatusCode
StatusCode definition for legacy code.

Member Function Documentation

◆ BlockType()

std::string LArRodBlockPhysicsV2::BlockType ( )
inlinestatic

Definition at line 73 of file LArRodBlockPhysicsV2.h.

73{ return std::string("RodBlockPhysicsV2");}

◆ canIncludeRawData()

virtual bool LArRodBlockStructure::canIncludeRawData ( )
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 100 of file LArRodBlockStructure.h.

100{return false;}

◆ canSetCalibration()

virtual bool LArRodBlockStructure::canSetCalibration ( )
inlinevirtualinherited

◆ canSetEnergy()

virtual bool LArRodBlockPhysicsV2::canSetEnergy ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 90 of file LArRodBlockPhysicsV2.h.

90{ return true;}

◆ canSetNTrigger()

virtual bool LArRodBlockStructure::canSetNTrigger ( )
inlinevirtualinherited

Definition at line 99 of file LArRodBlockStructure.h.

99{return false;}

◆ canSetRawData()

virtual bool LArRodBlockPhysicsV2::canSetRawData ( )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 91 of file LArRodBlockPhysicsV2.h.

91{return true;}

◆ canSetRawDataFixed()

virtual bool LArRodBlockStructure::canSetRawDataFixed ( )
inlinevirtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 97 of file LArRodBlockStructure.h.

97{return false;}

◆ clearBlocks()

void LArRodBlockPhysicsV2::clearBlocks ( )
private

Definition at line 72 of file LArRodBlockPhysicsV2.cxx.

73{
74 m_HighEnergyBlock.clear();
75 m_LowEnergyBlock.clear();
76 m_RawDataBlock.clear();
77}
std::vector< uint32_t > m_LowEnergyBlock
std::vector< uint32_t > m_HighEnergyBlock
std::vector< uint32_t > m_RawDataBlock

◆ concatinateFEBs()

void LArRodBlockPhysicsV2::concatinateFEBs ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 342 of file LArRodBlockPhysicsV2.cxx.

343{
344 FEBMAPTYPE::const_iterator feb_it_b=m_mFebBlocks.begin();
345 FEBMAPTYPE::const_iterator feb_it_e=m_mFebBlocks.end();
346 FEBMAPTYPE::const_iterator feb_it;
347 for (feb_it=feb_it_b;feb_it!=feb_it_e;++feb_it) {
348 if (feb_it!=feb_it_b) //Not first Feb
350
351 //Add feb data to rod data block
352 m_pRODblock->insert (m_pRODblock->end(),
353 feb_it->second.begin(), feb_it->second.end());
354 } //end for feb_it
355
356 m_mFebBlocks.clear();
357}

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

Reimplemented from LArRodBlockStructure.

Definition at line 145 of file LArRodBlockPhysicsV2.h.

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

◆ finalizeFEB()

void LArRodBlockPhysicsV2::finalizeFEB ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 288 of file LArRodBlockPhysicsV2.cxx.

289{
290 //Complete non-complete Energy block
292 setNextEnergy(0,0,-1,0);//E=0,t=0,q=-1,G=0
293 // Energies
294 unsigned int n;
295 uint16_t BlockOffset;
296 //Low energy block....
297 n = m_LowEnergyBlock.size();
299 //Check if Low Energy Block exists and is not yet part of the fragment
300 LARBSDBG("Checking Low Energy Block n=" << n << "BlockOffset=" << BlockOffset);
301 if (n>m_NFlaggingWords && !BlockOffset)
302 {
304 for (unsigned i=0;i<n;i++)
305 m_vFragment->push_back(m_LowEnergyBlock[i]);
306 }
307 //High energy block...
308 n = m_HighEnergyBlock.size();
310 LARBSDBG("Checking High Energy Block n=" << n << "BlockOffset=" << BlockOffset);
311 //Check if High Energy-Block exists and is not yet part of the fragment
312 if (n && !BlockOffset)
313 {
315 for(unsigned int i=0;i<n;i++)
316 m_vFragment->push_back(m_HighEnergyBlock[i]);
317 }
318
319 // Raw data
320 LARBSDBG("Checking Raw Data Block");
321 n = m_RawDataBlock.size();
323 LARBSDBG("Checking Raw Data Block. n=" << n << "BlockOffset=" << BlockOffset);
324 //Check if Raw Data block exists and is not yet part of the fragment
325 if (n>m_NFlaggingWords && !BlockOffset)
326 {
328 for(unsigned int i=0;i<n;i++)
329 m_vFragment->push_back(m_RawDataBlock[i]);
330 }
332 LARBSDBG("Offsets:" << std::endl
333 << "Raw Data: " << LE_getVectorHeader16(RawDataBlkOffset) << std::endl
334 <<"Low Energy: " << LE_getVectorHeader16(LowEBlkOffset)<< std::endl
335 << "High Energy: " << LE_getVectorHeader16(HighEBlkOffset)<< std::endl
336 << "Energy-index:" << m_EIndex << std::endl
337 << "Filled channels: " << m_ECounter << std::endl);
338 clearBlocks();
339}
#define LARBSDBG(text)
This class provides decoding/encoding from/to ROD format.
virtual void setNextEnergy(const int channel, const int32_t energy, const int32_t time, const int32_t quality, const uint32_t gain)
void setHeader32(const unsigned n, const uint32_t w)
uint16_t LE_getVectorHeader16(const unsigned n) const
void LE_setHeader16(const unsigned n, const uint16_t w)
setWord1 uint16_t

◆ 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 LArRodBlockPhysicsV2::getCtrl1 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 465 of file LArRodBlockPhysicsV2.cxx.

466{
469 x=x>>16;
470 uint16_t ctrl=x;
471 return ctrl;
472}
#define x
uint16_t LE_getHeader16(const unsigned n) const
str index
Definition DeMoScan.py:362
setEventNumber uint32_t

◆ getCtrl2()

uint16_t LArRodBlockPhysicsV2::getCtrl2 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 474 of file LArRodBlockPhysicsV2.cxx.

475{
478 x=x&0xffff;
479 uint16_t ctrl=x;
480 return ctrl;
481}

◆ getCtrl3()

uint16_t LArRodBlockPhysicsV2::getCtrl3 ( uint32_t adc) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 483 of file LArRodBlockPhysicsV2.cxx.

484{
487 x=x>>16;
488 uint16_t ctrl=x;
489 return ctrl;
490}

◆ 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 LArRodBlockStructure::getEx ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV4, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 303 of file LArRodBlockStructure.h.

303 {
304 return 0;
305}

◆ getEy()

int32_t LArRodBlockStructure::getEy ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV4, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 307 of file LArRodBlockStructure.h.

307 {
308 return 0;
309}

◆ getEz()

int32_t LArRodBlockStructure::getEz ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV4, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 311 of file LArRodBlockStructure.h.

311 {
312 return 0;
313}

◆ getFEBID()

uint32_t LArRodBlockStructure::getFEBID ( ) const
inlineinherited

Definition at line 293 of file LArRodBlockStructure.h.

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

◆ getFEBSN()

uint32_t LArRodBlockStructure::getFEBSN ( ) const
inlineinherited

Definition at line 298 of file LArRodBlockStructure.h.

299{
300 return getHeader32(FEBSN);
301}

◆ getHeader16()

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

Definition at line 345 of file LArRodBlockStructure.h.

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

◆ getHeader32()

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

Definition at line 353 of file LArRodBlockStructure.h.

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

◆ getNbSweetCells1()

uint16_t LArRodBlockStructure::getNbSweetCells1 ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 231 of file LArRodBlockStructure.cxx.

231{ return 0; }

◆ getNbSweetCells2()

uint16_t LArRodBlockStructure::getNbSweetCells2 ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 232 of file LArRodBlockStructure.cxx.

232{ return 0; }

◆ getNextAccumulatedCalibDigit()

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

Reimplemented in LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 86 of file LArRodBlockStructure.cxx.

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

◆ getNextAccumulatedDigit()

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

Reimplemented in LArRodBlockAccumulatedV3.

Definition at line 92 of file LArRodBlockStructure.cxx.

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

◆ getNextEnergy()

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

Reimplemented from LArRodBlockStructure.

Definition at line 149 of file LArRodBlockPhysicsV2.h.

150{
151 LARBSDBG("in LArRodBlockPhysicsV2::getEnergy.");
152 LARBSDBG("m_ECounter=" << m_ECounter << " m_RawDataIndex="<< m_EIndex);
153 LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
154 if (m_LowEIndex+m_HighEIndex>=m_channelsPerFEB) //Already beyond maximal number of channels
155 return 0;
156 if (!m_FlagPtr || !m_LowEPtr) //No data block present
157 return 0;
158 uint32_t gtQ;
159 int rodChannelNumber=m_LowEIndex+m_HighEIndex; //Index of Channel in ROD-Block
160 channelNumber=rodChannelNumber; // Arno claims he is using FEB numbering
161 //channelNumber=(rodChannelNumber>>4) + ((rodChannelNumber&0xf)<<3); //channel number of the FEB
162 if (getBit(m_FlagPtr,rodChannelNumber)) //Data in high energy block
164 gtQ=m_HighEPtr[m_HighEIndex*2+1];
165 // Q in bits 0-15
166 // t in bits 16-29
167 // gain in bits 30-31
168 quality = gtQ & 0xffff;
169 gtQ = gtQ >> 16;
170 //time = gtQ & 0x3fff;
171 time = gtQ & 0x7fff;
172 if (gtQ & 0x8000)
173 time*=-1;
174 gain=3-((m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
175 m_HighEIndex++;
176 LARBSDBG("Reading Raw data form High E block. E=" << energy << " Q=" << quality);
177 }
178 else //Data in low energy block
179 {
180 if (!m_LowEPtr)
181 return 0; //Block does not exist;
182 if(m_LowEIndex%2==0)
184 else
186
187 gain=3-((m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
188 time=0;
189 quality=-1;
190 m_LowEIndex++;
191 LARBSDBG("*** Reading Raw data form Low E block. E=" << energy);
192 }
193 return 1;
194}
int getBit(const uint32_t *const p, const unsigned chan) const
time(flags, cells_name, *args, **kw)

◆ getNextRawData()

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

Reimplemented from LArRodBlockStructure.

Definition at line 359 of file LArRodBlockPhysicsV2.cxx.

360{
361 LARBSDBG("in LArRodBlockPhysicsV2::getNextRawData.");
362 LARBSDBG("m_RawDataCounter=" << m_RawDataCounter << " m_RawDataIndex="<< m_RawDataIndex);
363 LARBSDBG("m_channelsPerFEB=" << m_channelsPerFEB);
364 if(m_FebBlockSize<=m_iHeadBlockSize) return 0;
366
368 if (!flags)
369 return 0; //Block not existing
370 if (m_RawDataCounter>=m_channelsPerFEB) //Already beyond maximal number of channels
371 return 0;
372
373 LARBSDBG("Flags="<<flags);
374
375 while (!getBit(m_RawDataFlagsPtr,m_RawDataCounter)) //Look for next filled channel
376 {
378 LARBSDBG("RawDataCounter ist now " << m_RawDataCounter);
379 if (m_RawDataCounter>=m_channelsPerFEB) //No more channel available
380 return 0;
381 }
382 LARBSDBG("Found filled channel at positon " << m_RawDataCounter);
383 //Found next filled channel
384 channelNumber=m_RawDataCounter;
385 //channelNumber=(m_RawDataCounter>>4) + ((m_RawDataCounter&0xf)<<3); //Convert ROD to FEB channel ordering
386 unsigned int nsamples = LE_getHeader16(NGainNSamples) & 0x00FF;
387 LARBSDBG("This run has " << nsamples << " samples");
389 LARBSDBG( "index="<<index);
391 LARBSDBG("In getnextRawData(). index= " << index);
392 gain=3-((m_GainPtr[channelNumber/16] >> (channelNumber%16)*2) & 0x3);
393 if(gain>=CaloGain::LARNGAIN) return 0;
394 for(unsigned int i=0;i<nsamples;i++) {
395 uint16_t x;
396 if((index+i)%2==0)
398 else
400 samples.push_back((short) (x & 0xfff));
401 }
403
404 if (m_rearrangeFirstSample && m_rearrangeFirstSample<samples.size()) //FIXME: Very ugly hack! See explanation in LArRodDecoder.h file
405 {//Change e.g. 3 0 1 2 4 to 0 1 2 3 4
406 short movedSample=samples[0];
407 for (unsigned i=1;i<=m_rearrangeFirstSample;i++)
408 samples[i-1]=samples[i];
409 samples[m_rearrangeFirstSample]=movedSample;
410 }
411
412 return 1;
413}
@ LARNGAIN
Definition CaloGain.h:19

◆ getNStep()

uint16_t LArRodBlockStructure::getNStep ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, and LArRodBlockCalibrationV3.

Definition at line 475 of file LArRodBlockStructure.h.

476{
477 return 0;
478}

◆ getNTrigger()

uint16_t LArRodBlockStructure::getNTrigger ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, LArRodBlockCalibrationV1, LArRodBlockCalibrationV2, and LArRodBlockCalibrationV3.

Definition at line 466 of file LArRodBlockStructure.h.

467{
468 return 0;
469}

◆ getNumberOfGains()

uint32_t LArRodBlockPhysicsV2::getNumberOfGains ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 452 of file LArRodBlockPhysicsV2.cxx.

453{
454 return LE_getHeader16(NGainNSamples)>>8;
455}

◆ getNumberOfSamples()

uint32_t LArRodBlockPhysicsV2::getNumberOfSamples ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 447 of file LArRodBlockPhysicsV2.cxx.

448{
449 return LE_getHeader16(NGainNSamples)&0xff;
450}

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

Reimplemented from LArRodBlockStructure.

Definition at line 457 of file LArRodBlockPhysicsV2.cxx.

◆ getRawDataSize()

uint16_t LArRodBlockStructure::getRawDataSize ( ) const
virtualinherited

◆ getResults1Size()

uint16_t LArRodBlockStructure::getResults1Size ( ) const
virtualinherited

◆ getResults2Size()

uint16_t LArRodBlockStructure::getResults2Size ( ) const
virtualinherited

◆ getStatus()

uint32_t LArRodBlockPhysicsV2::getStatus ( ) const
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 492 of file LArRodBlockPhysicsV2.cxx.

493{
495 return x;
496}

◆ getStepIndex()

uint16_t LArRodBlockStructure::getStepIndex ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3, and LArRodBlockCalibrationV3.

Definition at line 471 of file LArRodBlockStructure.h.

472{
473 return 0;
474}

◆ getSumE()

int32_t LArRodBlockStructure::getSumE ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 315 of file LArRodBlockStructure.h.

315 {
316 return 0;
317}

◆ getTDCPhase()

uint8_t LArRodBlockStructure::getTDCPhase ( ) const
virtualinherited

◆ getVectorHeader16()

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

Definition at line 356 of file LArRodBlockStructure.h.

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

◆ getVectorHeader32()

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

Definition at line 364 of file LArRodBlockStructure.h.

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

◆ getVROBEx()

int32_t LArRodBlockStructure::getVROBEx ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 323 of file LArRodBlockStructure.h.

323 {
324 return 0;
325}

◆ getVROBEy()

int32_t LArRodBlockStructure::getVROBEy ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 327 of file LArRodBlockStructure.h.

327 {
328 return 0;
329}

◆ getVROBEz()

int32_t LArRodBlockStructure::getVROBEz ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 331 of file LArRodBlockStructure.h.

331 {
332 return 0;
333}

◆ getVROBFebId()

uint32_t LArRodBlockStructure::getVROBFebId ( )
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 319 of file LArRodBlockStructure.h.

319 {
320 return 0;
321}

◆ getVROBSumE()

int32_t LArRodBlockStructure::getVROBSumE ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 335 of file LArRodBlockStructure.h.

335 {
336 return 0;
337}

◆ hasAccumBlock()

virtual uint32_t LArRodBlockStructure::hasAccumBlock ( ) const
inlinevirtualinherited

Reimplemented in LArRodBlockAccumulatedV3.

Definition at line 121 of file LArRodBlockStructure.h.

121{return 0;} ;

◆ hasCalibBlock()

virtual uint32_t LArRodBlockStructure::hasCalibBlock ( ) const
inlinevirtualinherited

◆ hasControlWords()

virtual uint32_t LArRodBlockStructure::hasControlWords ( ) const
inlinevirtualinherited

◆ hasPhysicsBlock()

virtual uint32_t LArRodBlockPhysicsV2::hasPhysicsBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 112 of file LArRodBlockPhysicsV2.h.

112{return LE_getHeader16(LowEBlkOffset);} ;

◆ hasRawDataBlock()

virtual uint32_t LArRodBlockPhysicsV2::hasRawDataBlock ( ) const
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 113 of file LArRodBlockPhysicsV2.h.

◆ initializeFEB()

void LArRodBlockPhysicsV2::initializeFEB ( const uint32_t id)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 274 of file LArRodBlockPhysicsV2.cxx.

275{
277 if (m_vFragment->size()<m_iHeadBlockSize) //Got empty or spoiled fragment
278 {
279 m_vFragment->resize(m_iHeadBlockSize,0); //Initialize FEB-Header
280 setHeader32(FEBID,id); //Set Feb ID
281 }
282
286}

◆ initializeFragment()

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

Reimplemented from LArRodBlockStructure.

Definition at line 247 of file LArRodBlockPhysicsV2.cxx.

248{
249 m_pRODblock=&fragment; //remember pointer to fragment
250 if (fragment.size()>m_iHeadBlockSize) { //Got filled fragment
251 unsigned int sizeRead=0;
252 //Store existing data in the FEB-Map
253 while (sizeRead<fragment.size()) {
254 std::vector<uint32_t>::iterator FebIter;
255 FebIter=fragment.begin()+sizeRead; //Store pointer to current Feb-Header
256 m_FebBlock=&(*FebIter); //Set m_FebBlock in order to use getHeader-functions.
257 uint32_t currFEBid=getHeader32(FEBID); //Get this FEB-ID
258 uint16_t currFebSize=getNumberOfWords(); //Size of this FEB-Block
259 if (FebIter+currFebSize>fragment.end()) {
260 fragment.clear(); //Clear existing vector
261 m_logstr << MSG::ERROR << "Got inconsistent ROD-Fragment!" << endmsg;
262 return;
263 }
264 m_mFebBlocks[currFEBid].assign(FebIter,FebIter+currFebSize); //Copy data from ROD-fragment into FEB-Block
265 sizeRead+=currFebSize+m_MiddleHeaderSize;//6 is the middle header size
266 LARBSDBG("Found FEB-id " << currFEBid << " in existing ROD-Fragment");
267 } // end while
268 }
269 fragment.clear(); //Clear existing vector
270 return;
271}

◆ LE_getHeader16()

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

Definition at line 394 of file LArRodBlockStructure.h.

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

◆ LE_getVectorHeader16()

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

Definition at line 399 of file LArRodBlockStructure.h.

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

◆ LE_setHeader16()

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

Definition at line 406 of file LArRodBlockStructure.h.

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

◆ nextFEB()

bool LArRodBlockStructure::nextFEB ( )
inlineinherited

Definition at line 480 of file LArRodBlockStructure.h.

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

◆ offlineCheckSum()

uint32_t LArRodBlockStructure::offlineCheckSum ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV4.

Definition at line 147 of file LArRodBlockStructure.cxx.

◆ OfflineToRawGain()

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

Definition at line 342 of file LArRodBlockStructure.h.

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

◆ onlineCheckSum()

uint32_t LArRodBlockStructure::onlineCheckSum ( ) const
virtualinherited

Reimplemented in LArRodBlockPhysicsV4.

Definition at line 139 of file LArRodBlockStructure.cxx.

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

◆ operator()()

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

Definition at line 418 of file LArRodBlockPhysicsV2.cxx.

420{
421 HWIdentifier id1 = ch1->channelID();
422 HWIdentifier id2 = ch2->channelID();
423
424 HWIdentifier febId1= m_onlineHelper->feb_Id(id1);
425 HWIdentifier febId2= m_onlineHelper->feb_Id(id2);
426
427 if(febId1 == febId2 ){
428 int cId1 = m_onlineHelper->channel(id1);
429 int cId2 = m_onlineHelper->channel(id2);
430 return FebToRodChannel(cId1) < FebToRodChannel(cId2);
431 }
432
433 return febId1 < febId2 ;
434}
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 LArRodBlockPhysicsV2::resetPointers ( )
inlineprivatevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 79 of file LArRodBlockPhysicsV2.cxx.

80{
81 m_ECounter=0;
86 m_EIndex=0;
87}

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

◆ 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 LArRodBlockStructure::setEx ( double )
virtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 180 of file LArRodBlockStructure.cxx.

181{
182 // Do not set anything
183}

◆ setEy()

void LArRodBlockStructure::setEy ( double )
virtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 185 of file LArRodBlockStructure.cxx.

186{
187 // Do not set anything
188}

◆ setEz()

void LArRodBlockStructure::setEz ( double )
virtualinherited

Reimplemented in LArRodBlockPhysicsV3, LArRodBlockPhysicsV5, and LArRodBlockPhysicsV6.

Definition at line 190 of file LArRodBlockStructure.cxx.

191{
192 // Do not set anything
193}

◆ setFirstSample()

void LArRodBlockStructure::setFirstSample ( const int rearrangeFirstSample)
inlineinherited

Definition at line 166 of file LArRodBlockStructure.h.

167 {m_rearrangeFirstSample=rearrangeFirstSample;}

◆ setFragment()

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

Definition at line 248 of file LArRodBlockStructure.h.

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

◆ setFragmentVirtualROB()

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

Definition at line 275 of file LArRodBlockStructure.h.

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

◆ setGain()

virtual int LArRodBlockPhysicsV2::setGain ( const int )
inlinevirtual

Reimplemented from LArRodBlockStructure.

Definition at line 100 of file LArRodBlockPhysicsV2.h.

100{ 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 LArRodBlockPhysicsV2::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 148 of file LArRodBlockPhysicsV2.cxx.

149 {
150 int rcNb=FebToRodChannel(channel);
151 //rcNb ist supposed to equal or bigger than m_EIndex.
152 //In the latter case, we fill up the missing channels with zero
153 if (rcNb<m_EIndex) {
154 m_logstr << MSG::ERROR << "LArRODBlockStructure Error: Internal error. Channels not ordered correctly. rcNb=" << rcNb
155 << " m_EIndex=" << m_EIndex << endmsg;
156 return;
157 }
158 //Fill up missing channels with zeros:
159 while (m_EIndex<rcNb)
160 setNextEnergy(0,0,-1,0);
161 //Add data...
162 setNextEnergy(energy,time,quality,gain);
163}

◆ setNextEnergy() [2/2]

void LArRodBlockPhysicsV2::setNextEnergy ( const int32_t energy,
const int32_t time,
const int32_t quality,
const uint32_t gain )
private

Definition at line 166 of file LArRodBlockPhysicsV2.cxx.

167{
168 if (m_EIndex>=m_channelsPerFEB) //Use m_EIndex to count total number of channels
169 {
170 m_logstr << MSG::ERROR << "LArRodBlockStructure Error: Attempt to write Energy for channel "
171 << m_EIndex << " channels into a FEB!" <<endmsg;
172 return;
173 }
174 LARBSDBG("LArRodBlockStructure: Setting Energy for channel " << m_EIndex << ". E=" << energy);
175 if (quality<0 && energy<0x7FFE && gain==0) { //Write into Low Energy block
176 m_LowEIndex++; //Use m_LowEIndex to count the channels in the Low Energy block
177 ShortLong twoValues{};
178 twoValues.s[0]=0;
179 twoValues.s[1]=0;
180 if (m_LowEIndex%2==1) { //This is an odd number, simply add data at the bottom of the block
181 twoValues.s[0]=(int16_t)energy;
182 }
183 else { //Even number: Merging with previous block
184 uint32_t oneValue=m_LowEnergyBlock[m_LowEnergyBlock.size()-1]; //Take last element of vector
185 m_LowEnergyBlock.pop_back();
186 int16_t* valptr=reinterpret_cast<int16_t*>(&oneValue);
187 twoValues.s[0]=valptr[0];
188 twoValues.s[1]=(int16_t)energy;
189 }
190 LARBSDBG("Writing words: val0= " << twoValues.s[0] << " val1= " << twoValues.s[1]);
191 m_LowEnergyBlock.push_back(twoValues.l);
192 LARBSDBG("Writing Raw data to Low E block. E=" << energy);
193 }
194 else //Write into High Energy block
195 {
197 m_HighEnergyBlock.push_back(energy);
198 uint32_t t_sign;
199 uint32_t abs_time;
200 if (time<0)
201 t_sign=1;
202 else
203 t_sign=0;
204 abs_time=abs(time);
205 if (abs_time>0x1fff)
206 abs_time=0x1fff;
207 uint32_t gtQ = (gain << 30) | (t_sign<<29) | ((abs_time & 0x1fff)<<16) | (0xffff & quality);
208 m_HighEnergyBlock.push_back(gtQ);
209 LARBSDBG("Writing Raw data to High E block. E=" << energy << " Q=" << quality);
210 }
211 m_EIndex++;
212}
void setBit(uint32_t *const p, const unsigned chan)
setScaleOne setStatusOne setSaturated int16_t

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

Reimplemented from LArRodBlockStructure.

Definition at line 141 of file LArRodBlockPhysicsV2.cxx.

142{
144 LE_setHeader16(NGainNSamples,(oldword & 0x00FF) | (n<<8));
145}

◆ setNumberOfSamples()

void LArRodBlockPhysicsV2::setNumberOfSamples ( const uint8_t n)
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 135 of file LArRodBlockPhysicsV2.cxx.

136{
138 LE_setHeader16(NGainNSamples,(oldword & 0xFF00) | n);
139}

◆ setPointers()

bool LArRodBlockPhysicsV2::setPointers ( )
virtual

Reimplemented from LArRodBlockStructure.

Definition at line 90 of file LArRodBlockPhysicsV2.cxx.

91{
92 //Set pointers to data blocks (pesuming, they exist)
94 {
96 {
99 m_GainPtr=reinterpret_cast<const uint32_t*>(m_RawDataFlagsPtr-2*m_NFlaggingWords);
100 }
101 else
102 {
104 m_RawDataPtr=reinterpret_cast<const uint16_t*>(m_RawDataFlagsPtr);
105 m_GainPtr=reinterpret_cast<const uint32_t*>(m_DummyBitMap);
106 }
108 {
110 m_LowEPtr=reinterpret_cast<const int16_t*>(m_FlagPtr+m_NFlaggingWords);
111 }
112 else
113 { //Bugfix, 9.8.2004, WL: Set pointer to dummy map to read FEB with only high energy block
115 m_LowEPtr=reinterpret_cast<const int16_t*>(m_FlagPtr);
116 }
118 m_HighEPtr=reinterpret_cast<const int32_t*>(m_FebBlock)+LE_getHeader16(HighEBlkOffset);
119 else
120 m_HighEPtr=NULL;
121 }
122 else
123 {
124 m_RawDataPtr=NULL;
126 m_GainPtr=NULL;
127 m_FlagPtr=NULL;
128 m_LowEPtr=NULL;
129 m_HighEPtr=NULL;
130 }
131 return true;
132}
static const uint32_t m_DummyBitMap[4]

◆ setPulsed()

void LArRodBlockStructure::setPulsed ( const unsigned channelNumber)
virtualinherited

Reimplemented in LArRodBlockCalibrationV0< DSPHEADER >.

Definition at line 64 of file LArRodBlockStructure.cxx.

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

◆ setRawData()

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

Reimplemented from LArRodBlockStructure.

Definition at line 215 of file LArRodBlockPhysicsV2.cxx.

215 {
216 //Convert Feb to Rod Channel Number:
217 int rcNb=FebToRodChannel(channel);
218 if (rcNb>=m_channelsPerFEB)
219 {m_logstr << MSG::ERROR << "Attempt to write Energy for channel " << rcNb << " channels into a FEB!" << endmsg;
220 return;
221 }
222 unsigned int nsamples = LE_getVectorHeader16(NGainNSamples) & 0x00FF;
223 if(samples.size() != nsamples) {
224 m_logstr << MSG::ERROR << "Number of samples mismatch!\n";
225 m_logstr << " nsamples =" << nsamples;
226 m_logstr << " samples.size() =" << samples.size() << endmsg;
227 std::abort();
228 }
229
230 setBit(&m_RawDataBlock[0],rcNb);
231 //Samples have 12 bit and are shifted to the left by 2 bits.
232 // odd samples in high bits, even samples in low bits
233 if((nsamples/2)*2!=nsamples) { //odd number of samples - gain is alone
234 m_RawDataBlock.push_back((gain<<30) | samples[0]<<2);
235 for (unsigned int i=1;i<nsamples;i+=2)
236 m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
237 }
238 else { //even number of samples - gain is packed with sample 0
239 m_RawDataBlock.push_back((gain<<30) | (samples[1]<<18) | samples[0]<<2);
240 for (unsigned int i=2;i<nsamples;i+=2)
241 m_RawDataBlock.push_back((samples[i+1]<<18) | samples[i]<<2);
242 }
243}

◆ setRawDataFixed()

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

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 115 of file LArRodBlockStructure.cxx.

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

◆ setSumE()

void LArRodBlockStructure::setSumE ( double )
virtualinherited

Reimplemented in LArRodBlockPhysicsV6.

Definition at line 195 of file LArRodBlockStructure.cxx.

196{
197 // Do not set anything
198}

◆ setTDCPhase()

void LArRodBlockStructure::setTDCPhase ( const uint8_t n)
virtualinherited

Reimplemented in LArRodBlockTransparentV0< DSPHEADER >.

Definition at line 130 of file LArRodBlockStructure.cxx.

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

◆ sortDataVector() [1/5]

Reimplemented from LArRodBlockStructure.

Definition at line 90 of file LArRodBlockStructure.cxx.

216{}

◆ sortDataVector() [2/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 91 of file LArRodBlockStructure.cxx.

219{}

◆ sortDataVector() [3/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 89 of file LArRodBlockStructure.cxx.

213{}

◆ sortDataVector() [4/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 442 of file LArRodBlockPhysicsV2.cxx.

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

◆ sortDataVector() [5/5]

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

Reimplemented from LArRodBlockStructure.

Definition at line 437 of file LArRodBlockPhysicsV2.cxx.

438{
439 std::sort(vRC.begin(),vRC.end(),*this);
440}

Member Data Documentation

◆ m_channelsPerFEB

int LArRodBlockStructure::m_channelsPerFEB
protectedinherited

Definition at line 219 of file LArRodBlockStructure.h.

◆ m_DummyBitMap

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

Definition at line 35 of file LArRodBlockPhysicsV2.h.

◆ m_ECounter

int LArRodBlockPhysicsV2::m_ECounter = 0
private

Definition at line 123 of file LArRodBlockPhysicsV2.h.

◆ m_EIndex

int LArRodBlockPhysicsV2::m_EIndex = 0
private

Definition at line 128 of file LArRodBlockPhysicsV2.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_FlagPtr

const uint32_t* LArRodBlockPhysicsV2::m_FlagPtr
private

Definition at line 133 of file LArRodBlockPhysicsV2.h.

◆ m_GainPtr

const uint32_t* LArRodBlockPhysicsV2::m_GainPtr
private

Definition at line 131 of file LArRodBlockPhysicsV2.h.

◆ m_HighEIndex

int LArRodBlockPhysicsV2::m_HighEIndex = 0
private

Definition at line 127 of file LArRodBlockPhysicsV2.h.

◆ m_HighEnergyBlock

std::vector<uint32_t> LArRodBlockPhysicsV2::m_HighEnergyBlock
private

Definition at line 120 of file LArRodBlockPhysicsV2.h.

◆ m_HighEPtr

const int32_t* LArRodBlockPhysicsV2::m_HighEPtr
private

Definition at line 132 of file LArRodBlockPhysicsV2.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_LowEIndex

int LArRodBlockPhysicsV2::m_LowEIndex = 0
private

Definition at line 125 of file LArRodBlockPhysicsV2.h.

◆ m_LowEnergyBlock

std::vector<uint32_t> LArRodBlockPhysicsV2::m_LowEnergyBlock
private

Definition at line 119 of file LArRodBlockPhysicsV2.h.

◆ m_LowEPtr

const int16_t* LArRodBlockPhysicsV2::m_LowEPtr
private

Definition at line 134 of file LArRodBlockPhysicsV2.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_NFlaggingWords

unsigned short LArRodBlockPhysicsV2::m_NFlaggingWords
private

Definition at line 136 of file LArRodBlockPhysicsV2.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_onlineHelper

const LArOnlineID* LArRodBlockPhysicsV2::m_onlineHelper
private

Definition at line 138 of file LArRodBlockPhysicsV2.h.

◆ m_pRODblock

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

Definition at line 226 of file LArRodBlockStructure.h.

◆ m_RawDataBlock

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

Definition at line 121 of file LArRodBlockPhysicsV2.h.

◆ m_RawDataCounter

int LArRodBlockPhysicsV2::m_RawDataCounter = 0
private

Definition at line 124 of file LArRodBlockPhysicsV2.h.

◆ m_RawDataFlagsPtr

const uint32_t* LArRodBlockPhysicsV2::m_RawDataFlagsPtr
private

Definition at line 130 of file LArRodBlockPhysicsV2.h.

◆ m_RawDataIndex

int LArRodBlockPhysicsV2::m_RawDataIndex = 0
private

Definition at line 126 of file LArRodBlockPhysicsV2.h.

◆ m_RawDataPtr

const uint16_t* LArRodBlockPhysicsV2::m_RawDataPtr
private

Definition at line 129 of file LArRodBlockPhysicsV2.h.

◆ m_RawToOfflineGainMap

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

Definition at line 16 of file LArRodBlockStructure.h.

◆ m_rearrangeFirstSample

unsigned int LArRodBlockStructure::m_rearrangeFirstSample
protectedinherited

Definition at line 235 of file LArRodBlockStructure.h.

◆ m_ROB_to_decode

int32_t LArRodBlockStructure::m_ROB_to_decode
protectedinherited

Definition at line 240 of file LArRodBlockStructure.h.

◆ m_RodBlock

const uint32_t* LArRodBlockStructure::m_RodBlock
protectedinherited

Definition at line 222 of file LArRodBlockStructure.h.

◆ m_RodBlockSize

int32_t LArRodBlockStructure::m_RodBlockSize
protectedinherited

Definition at line 224 of file LArRodBlockStructure.h.

◆ m_SumE

int32_t LArRodBlockStructure::m_SumE
protectedinherited

Definition at line 206 of file LArRodBlockStructure.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: