DCMSimulator.h
Go to the documentation of this file.
1 /*
2  * File: DCMSimulator.h
3  * Author: denis
4  *
5  * Created on January 31, 2012, 5:15 PM
6  */
7 
8 #ifndef _DCMSIMULATOR_H
9 #define _DCMSIMULATOR_H
10 #include "DAQDataFormats/RawMilliSlice.h"
11 #include "DAQChannelMap/DAQChannelMapConstants.h"
12 
13 #include <vector>
14 #include <boost/shared_ptr.hpp>
15 
16 // forward declarations
17 namespace daqdataformats{
18  class FEBSimulator;
19  class RawMicroSlice;
20 
21 }
22 
23 namespace mcdatadaq {
24 
25  /// Shared pointer
26  typedef boost::shared_ptr<daqdataformats::RawMicroSlice> RawMicroSlice_shrptr;
27 
28  class DCMSimulator {
29  public:
30  /// Constructor
32  /// Destructor
33  ~DCMSimulator();
34 
35  /// Generate NanoSlice with a given pixel, TimeStamp and PulseHeight
36  bool generateNanoSlice(const daqchannelmap::dchan, const uint32_t time_stamp, const uint32_t pulse_height);
37  bool generateNanoSlice(const daqchannelmap::dchan, const uint32_t time_stamp, const std::vector<uint32_t>& data);
38 
39  /// Write all MicroSlices into the output file
40  bool writeMicroSlices();
41  /// Write MilliSlice into the output file
42  bool writeMilliSlices();
43 
44  /// Fill MilliSlices out
45  daqdataformats::RawMilliSlice* fillMilliSlice();
46 
47  /// Advance to next event. Advancing MilliSlice. Clearing MicroSlice vector.
48  bool nextEvent();
49 
50 
51  private:
52  /// Get the instance of the FEB Simulator for a given link ID on this DCM
53  daqdataformats::FEBSimulator* getFEBSimulator(const daqchannelmap::feb_t);
54  /// Fill MicroSlice with a given NanoSlice
55  bool fillMicroSlice(const uint32_t microslice_number, daqdataformats::RawNanoSlice*);
56  /// Create a MicroSlice and put it in the vector
57  daqdataformats::RawMicroSlice* createMicroSlice(const uint32_t microslice_number);
58 
59  private:
60  uint32_t fDiblockNumber; ///< Diblock number
61  uint32_t fDCMNumber; ///< DCM number in the diblock
62 
63  std::vector<daqdataformats::FEBSimulator*> fFrontEndBoards; ///< All 64 FEBs on the DCM
64 
65  std::vector<RawMicroSlice_shrptr > fMicroSlice; ///< Vector of all Microslices in the event
66  daqdataformats::RawMilliSlice fMilliSlice; ///< There is going to be 1 Millislice per event
67 
68  /// Output file with hte microslices from this DCM
71 
72  };// end of class DCMSimulator
73 }// end of namespace mcdatadaq
74 #endif /* _DCMSIMULATOR_H */
75 
boost::shared_ptr< daqdataformats::RawMicroSlice > RawMicroSlice_shrptr
Shared pointer.
Definition: DCMSimulator.h:26
const XML_Char const XML_Char * data
Definition: expat.h:268
uint32_t fDiblockNumber
Diblock number.
Definition: DCMSimulator.h:60
Something conflicts with RandomNumberGenerator. Keep DAQSimulator.h include below Art Framework inclu...
uint32_t feb_t
Type for DCM link port. Counts from 0.
FILE * fOutputMicroslicesFile
Output file with hte microslices from this DCM.
Definition: DCMSimulator.h:69
uint32_t dcm_id_t
Type for DCM number, counts from 1.
Class to hold the MicroSlice data.
Definition: RawMicroSlice.h:48
std::vector< daqdataformats::FEBSimulator * > fFrontEndBoards
All 64 FEBs on the DCM.
Definition: DCMSimulator.h:63
uint32_t diblock_t
Type for diblocks and blocks.
uint32_t fDCMNumber
DCM number in the diblock.
Definition: DCMSimulator.h:61
Class to hold the data from the FEBs in correct formats.
std::vector< RawMicroSlice_shrptr > fMicroSlice
Vector of all Microslices in the event.
Definition: DCMSimulator.h:65
uint32_t dchan
< DAQ Channel Map Package
daqdataformats::RawMilliSlice fMilliSlice
There is going to be 1 Millislice per event.
Definition: DCMSimulator.h:66