StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StETofDigiMaker.h
1 /***************************************************************************
2  *
3  * $Id: StETofDigiMaker.h,v 1.4 2021/05/10 10:45:13 weidenkaff Exp $
4  *
5  * Author: Florian Seck, April 2018
6  ***************************************************************************
7  *
8  * Description: StETofDigiMaker - class to fill the StEvent from DAQ reader:
9  * unpack raw data & save StETofHeader & StETofDigis in StETofCollection
10  *
11  ***************************************************************************
12  *
13  * $Log: StETofDigiMaker.h,v $
14  * Revision 1.4 2021/05/10 10:45:13 weidenkaff
15  * Added unpacking of status pattern to be written to Event header. PW.StETofDigiMaker.cxx
16  *
17  * Revision 1.3 2019/02/19 20:32:05 fseck
18  * update for unpacking year 2019+ daq files
19  *
20  * Revision 1.2 2018/07/27 13:58:08 fseck
21  * small change to compile also in 64bit mode
22  *
23  * Revision 1.1 2018/07/25 14:39:40 jeromel
24  * Peer reviewed Raghav+Jerome - code from Florian Seck
25  *
26  *
27  ***************************************************************************/
28 #ifndef STETOFDIGIMAKER_H
29 #define STETOFDIGIMAKER_H
30 
31 #include <stdint.h>
32 #include <string>
33 #include <vector>
34 #include "StRTSBaseMaker.h"
35 
36 class StEvent;
37 class StETofCollection;
38 class StETofDigi;
39 class StETofHardwareMap;
40 
41 namespace gdpb { class FullMessage; };
42 namespace gdpbv100 { class FullMessage; };
43 
45 public:
47  StETofDigiMaker( const char* name = "etofDigi" );
48 
49  ~StETofDigiMaker();
50 
51 
52  Int_t Init();
53  Int_t InitRun( Int_t );
54  Int_t FinishRun( Int_t );
55  Int_t Finish();
56  Int_t Make();
57 
59 
60  void setDebug( const bool debug );
61 
62  void checkEvent();
63 
64 
65  // methods for processing the data in 2019+
66  void processEvent( uint64_t* messageBuffer, size_t nFullMessagesToRead );
67 
68  void convertTriggerMessages( vector< gdpbv100::FullMessage >& triggerMessages,
69  map< unsigned int, uint64_t >& gdpbTs,
70  map< unsigned int, uint64_t >& starTs );
71 
72  void fillETofHeader( uint64_t* messageBuff, vector< gdpbv100::FullMessage >& triggerMessages );
73  void fillETofDigi( gdpbv100::FullMessage& mess );
74 
75  void setFileNameElectronicsMap( const char* fileName );
76 
77  // methods for processing the data in 2018
78  void processEvent2018( uint64_t* messageBuffer, size_t nFullMessagesToRead );
79 
80  void convertTriggerMessages( vector< gdpb::FullMessage >& triggerMessages,
81  map< unsigned int, uint64_t >& gdpbTs,
82  map< unsigned int, uint64_t >& starTs );
83 
84  void fillETofHeader( uint64_t* messageBuff, vector< gdpb::FullMessage >& triggerMessages );
85  void fillETofDigi( gdpb::FullMessage& mess );
86 
87 
88 private:
89  StEvent* mEvent;
90  StETofCollection* mETofCollection;
91  Int_t mRunYear;
92 
93  vector < Bool_t > mMissMatchFlagVec;
94  StETofHardwareMap* mHwMap; // electronic channel to hardware/geometry map
95  std::string mFileNameElectronicsMap; // name of parameter file for electronics-to-hardware map
96  std::map< Int_t, Bool_t > mGet4ActiveMap; // map of get4Id that are actually mapped to existing channels.
97 
98  Bool_t mDebug;
99 
100  virtual const Char_t *GetCVS() const { static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs; }
101 
102  ClassDef( StETofDigiMaker, 1 )
103 };
104 
105 inline void StETofDigiMaker::setDebug( const bool debug ) { mDebug = debug; }
106 
107 #endif // STETOFDIGIMAKER_H
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
void processEvent(uint64_t *messageBuffer, size_t nFullMessagesToRead)
void convertTriggerMessages(vector< gdpbv100::FullMessage > &triggerMessages, map< unsigned int, uint64_t > &gdpbTs, map< unsigned int, uint64_t > &starTs)
StETofDigiMaker(const char *name="etofDigi")
Default constructor.
StETofCollection * getETofCollection()
void processEvent2018(uint64_t *messageBuffer, size_t nFullMessagesToRead)