Public Member Functions | Private Attributes | List of all members
daqdataformats::DCMSimulator Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/DAQDataFormats/cxx/include/DCMSimulator.h"

Public Member Functions

 DCMSimulator ()
 
 ~DCMSimulator ()
 
 DCMSimulator (uint32_t diblock_number, uint32_t dcm_number)
 
 DCMSimulator (uint32_t FEBMask)
 
 DCMSimulator (uint32_t FEBMask, float probability)
 
bool init ()
 
bool initFEB (int FEBnumber)
 
bool initFEBList ()
 
void setFEBMask (uint32_t FEBMask)
 
void setHitProbability (float probability)
 
RawMicroSlicegenerateMicroSlice ()
 
void printMicroSlice ()
 

Private Attributes

uint32_t dcmID
 
uint32_t diblockID
 
uint32_t clock
 
uint32_t febMask
 
FEBSimulator FrontEndBoards [64]
 
FEBSimulatorActiveFEBList [64]
 
float hit_probability
 
uint32_t databuffer [DCM_DATA_BUFFER_SIZE]
 
uint32_t * nextWord
 
RawMicroSlice LastMicroSlice
 

Detailed Description

Definition at line 11 of file DCMSimulator.h.

Constructor & Destructor Documentation

DCMSimulator::DCMSimulator ( )

Definition at line 12 of file DCMSimulator.cpp.

References init().

12  {
13  this->init();
14 }
DCMSimulator::~DCMSimulator ( )

Definition at line 23 of file DCMSimulator.cpp.

23  {
24 
25 }
DCMSimulator::DCMSimulator ( uint32_t  diblock_number,
uint32_t  dcm_number 
)

Definition at line 16 of file DCMSimulator.cpp.

References dcmID, diblockID, and init().

16  {
17  this->init();
18  this->dcmID = dcm_number;
19  this->diblockID = diblock_number;
20 }
DCMSimulator::DCMSimulator ( uint32_t  FEBMask)

Definition at line 27 of file DCMSimulator.cpp.

References daqdataformats::DEFAULT_HIT_PROBABILITY, setFEBMask(), and setHitProbability().

27  {
28  this->setFEBMask(FEBMask);
29  this->setHitProbability(DEFAULT_HIT_PROBABILITY); // Default hit probability
30 }
void setHitProbability(float probability)
const float DEFAULT_HIT_PROBABILITY
Definition: FEBSimulator.h:10
void setFEBMask(uint32_t FEBMask)
DCMSimulator::DCMSimulator ( uint32_t  FEBMask,
float  probability 
)

Definition at line 32 of file DCMSimulator.cpp.

References setFEBMask(), and setHitProbability().

32  {
33  this->setFEBMask(FEBMask);
34  this->setHitProbability(probability); // Default hit probability
35 }
void setHitProbability(float probability)
void setFEBMask(uint32_t FEBMask)

Member Function Documentation

RawMicroSlice * DCMSimulator::generateMicroSlice ( )

Definition at line 91 of file DCMSimulator.cpp.

References daqdataformats::NanoSliceHeader::DataPresent, daqdataformats::NanoSliceHeader::DebugMode, daqdataformats::NanoSliceHeader::FEBLinkID, daqdataformats::NanoSliceHeader::FEBStatus, daqdataformats::NanoSliceHeader::FrameSequenceNumber, daqdataformats::RawTimingMarker::generate(), LastMicroSlice, daqdataformats::NanoSliceHeader::LinkStatus, daqdataformats::NanoSliceHeader::PixelAddress, central_limit::rand, and randReal.

91  {
92  // We need to generate a microslice
93  // from scratch. We do this in stages
94 
95  // First generate the header
96  RawMicroSliceHeader microHeader;
97  //microHeader.setDataPresent(true);
98 
99  // Note: The header is generated with a zero byte count
100  // so we need to set that later when we know the size of the block
101 
102  // Now generate the time marker;
103  RawTimingMarker tMarker;
104  tMarker.generate();
105 
106 
107 
108  return &LastMicroSlice;
109 }
Class to hold the timing markers used in the construction of Microslices in the DCMs.
void generate()
! Set the time-stamp as a single 64-bit value
bool DCMSimulator::init ( )

Definition at line 37 of file DCMSimulator.cpp.

References ActiveFEBList, clock, databuffer, DCM_DATA_BUFFER_SIZE, dcmID, daqdataformats::DEFAULT_HIT_PROBABILITY, diblockID, febMask, MECModelEnuComparisons::i, nextWord, and setHitProbability().

Referenced by demo.App::__init__(), testem0.App::__init__(), Lesson1.App::__init__(), ExN03.App::__init__(), and DCMSimulator().

37  {
38  this->dcmID=0; // Unassigned
39  this->diblockID=0; // Unassigned
40  this->clock=0; // Reset the clock to zero time
41  this->febMask=0x0; // All FEBs are off by default
42  this->setHitProbability(DEFAULT_HIT_PROBABILITY); // Default hit probability
43 
44  // Clear the databuffer
45  int i=0;
46  while(i < DCM_DATA_BUFFER_SIZE){
47  this->databuffer[i]=0x0;
48  ++i;
49  }
50 
51  this->nextWord = &(databuffer[0]);
52 
53  i=0;
54  while(i < 64){
55  ActiveFEBList[i]=NULL;
56  ++i;
57  }
58 
59  return true;
60 }
void setHitProbability(float probability)
const float DEFAULT_HIT_PROBABILITY
Definition: FEBSimulator.h:10
#define DCM_DATA_BUFFER_SIZE
Definition: DCMSimulator.h:9
FEBSimulator * ActiveFEBList[64]
Definition: DCMSimulator.h:41
uint32_t databuffer[DCM_DATA_BUFFER_SIZE]
Definition: DCMSimulator.h:45
bool DCMSimulator::initFEB ( int  FEBnumber)

Definition at line 63 of file DCMSimulator.cpp.

63  {
64  return true;
65 }
bool DCMSimulator::initFEBList ( )

Definition at line 67 of file DCMSimulator.cpp.

References ActiveFEBList, febMask, FrontEndBoards, MECModelEnuComparisons::i, calib::j, and x1.

67  {
68  // We look at the FEB Mask and make a list of the pointers to the
69  // active FEBs for subsequent readouts
70 
71  int j=0;
72  for(int i=0;i<64;++i){
73  if(febMask & (0x1 << i)){
75  ++j;
76  } // endif febMask
77  } // endfor i
78 
79  return true;
80 }
Float_t x1[n_points_granero]
Definition: compare.C:5
FEBSimulator FrontEndBoards[64]
Definition: DCMSimulator.h:40
const double j
Definition: BetheBloch.cxx:29
FEBSimulator * ActiveFEBList[64]
Definition: DCMSimulator.h:41
void DCMSimulator::printMicroSlice ( )

Definition at line 243 of file DCMSimulator.cpp.

References daqdataformats::NanoSliceHeader::FEBLinkID, daqdataformats::NanoSliceHeader::FEBStatus, daqdataformats::NanoSliceHeader::FrameSequenceNumber, submit_syst::header, daqdataformats::NanoSliceHeader::PixelAddress, and printf().

243  {
244 
245 #ifdef ASDF
246  uint32_t rawheader;
248 
249  printf("Header: 0x%08x \t Time: 0x%08x\t PulseHeight: 0x%08x\t",LastNanoSlice.GetNanoSliceHeader(), LastNanoSlice.GetTimeStamp(), LastNanoSlice.GetPulseHeight());
250 
251  rawheader = LastNanoSlice.GetNanoSliceHeader();
252 
253  LastNanoSlice.UnPackNanoSliceHeader(rawheader, &header);
254 
255  printf("Frame: %d\tPixel: %d\tStatus: %d\tLink: %d\n",header.FrameSequenceNumber, header.PixelAddress, header.FEBStatus, header.FEBLinkID);
256 
257 #endif
258 }
Data structure for holding all the nanoslice data of interest.
printf("%d Experimental points found\n", nlines)
void DCMSimulator::setFEBMask ( uint32_t  FEBMask)

Definition at line 82 of file DCMSimulator.cpp.

References febMask.

Referenced by DCMSimulator().

82  {
83  febMask = FEBMask; // Set the front end board mask
84 }
void DCMSimulator::setHitProbability ( float  probability)

Definition at line 86 of file DCMSimulator.cpp.

References hit_probability.

Referenced by DCMSimulator(), and init().

86  {
87  hit_probability = probability; // Set the prob of generating a single hit
88 }

Member Data Documentation

FEBSimulator* daqdataformats::DCMSimulator::ActiveFEBList[64]
private

Definition at line 41 of file DCMSimulator.h.

Referenced by init(), and initFEBList().

uint32_t daqdataformats::DCMSimulator::clock
private

Definition at line 36 of file DCMSimulator.h.

Referenced by init().

uint32_t daqdataformats::DCMSimulator::databuffer[DCM_DATA_BUFFER_SIZE]
private

Definition at line 45 of file DCMSimulator.h.

Referenced by init().

uint32_t daqdataformats::DCMSimulator::dcmID
private

Definition at line 34 of file DCMSimulator.h.

Referenced by DCMSimulator(), and init().

uint32_t daqdataformats::DCMSimulator::diblockID
private

Definition at line 35 of file DCMSimulator.h.

Referenced by DCMSimulator(), and init().

uint32_t daqdataformats::DCMSimulator::febMask
private

Definition at line 38 of file DCMSimulator.h.

Referenced by init(), initFEBList(), and setFEBMask().

FEBSimulator daqdataformats::DCMSimulator::FrontEndBoards[64]
private

Definition at line 40 of file DCMSimulator.h.

Referenced by initFEBList().

float daqdataformats::DCMSimulator::hit_probability
private

Definition at line 43 of file DCMSimulator.h.

Referenced by setHitProbability().

RawMicroSlice daqdataformats::DCMSimulator::LastMicroSlice
private

Definition at line 48 of file DCMSimulator.h.

Referenced by generateMicroSlice().

uint32_t* daqdataformats::DCMSimulator::nextWord
private

Definition at line 46 of file DCMSimulator.h.

Referenced by init().


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