Berkeley Nuclear Data Software
GenesisEventStructures.h
Go to the documentation of this file.
1 
2 #ifndef GENESIS_DATA_STRUCTURES
3 #define GENESIS_DATA_STRUCTURES
4 
5 //project includes
7 #include "MDPP16DataStructures.h"
8 #include "MesyDAQPostProcessing.h" //needed for static rf filter function
9 #include "NSDPhysicsEvents.h"
10 #include "GENESISConfig.h"
11 //ROOT includes
12 #include "TH1.h"
13 //c++includes
14 #include <cstdint>
15 #include <vector>
16 #include <utility>
17 #include <deque>
18 using std::vector;
19 #include <map>
20 using std::map;
21 using std::pair;
22 
25 {
26  public:
27  GenesisEvent();
28 
29  // /// add leaf/BGO hit to clover event
30  // void addMDPPCloverEvent(unsigned int a_ADC, unsigned int a_TDC, unsigned int a_chNum,
31  // unsigned int a_endWord, unsigned int a_extTimeStamp, GenConfig* a_detConfig);
32 
33  // /// add scintillator hit m_scintEvents
34  // void addMDPPScintEvent(unsigned int a_total, unsigned int a_TDC, unsigned int a_peak, unsigned int a_chNum,
35  // unsigned int a_endWord, unsigned int a_extTimeStamp, GenConfig* a_detConfig);
36 
38  void addMDPPCloverEvent(unsigned int a_ADC,
39  unsigned int a_TDC,
40  unsigned int a_chNum,
41  unsigned int a_endWord,
42  unsigned int a_extTimeStamp,
43  int a_cloverID,
44  bool a_isBGO
45  );
46 
48  void addMDPPScintEvent(unsigned int a_total,
49  unsigned int a_TDC,
50  unsigned int a_peak,
51  unsigned int a_chNum,
52  unsigned int a_endWord,
53  unsigned int a_extTimeStamp,
54  int a_modID,
55  vector<uint16_t> a_triggers
56  );
59 void addMDPP16Evs(MDPP16Event* a_start,
60  int a_num,
61  ExperimentConfig& a_config,
62  time_t fileStartSinceEpoch,
63  bool a_saveBGOSingles=false,
64  int a_rfTrigIDs=1
65  );
66 
67  void addMDPPCloverEvent(MDPPCloverEvent* a_cloverEvent);
68  void addMDPPScintEvent(MDPPScintEvent* a_scintEvent);
69  void addMDPPCloverEvent(MDPPCloverEvent& a_cloverEvent);
70  void addMDPPScintEvent(MDPPScintEvent& a_scintEvent);
71  void addMDPPHPGeEvent(MDPPHPGeEvent& a_event);
73  void addBGOData(MDPPCloverEvent* a_cloverEvent, int a_cloverID);
74  void addBGOData(MDPPCloverEvent& a_cloverEvent, int a_cloverID);
75  void addRFTimes(int a_moduleID, vector<uint16_t>& a_RFTimes);
79  bool setCoarseTime(unsigned int a_endWord, unsigned int a_extTimeStamp);
80 
81  void setWallClockTime(uint32_t a_t);
82 
83 
85  MDPPCloverEvent getCloverEvent(int a_cloverID) const;
87  map<int , MDPPCloverEvent> getCloverEvents() const;
89  vector<MDPPScintEvent> getScintEvent() const;
91  MDPPHPGeEvent getHPGeEvent(int a_detID) const;
93  MDPPInorgScintEvent getInorgScintEvent(int a_detID) const;
96  unsigned int getCoarseTime() const;
98  double getMinTime() const;
100  vector<int> getMinTimeChannel() const;
102  int getNHits() const;
105  std::vector<DetType> getDetTypes() const;
108  std::map<DetType,int> getDetsMultiplicity() const;
109  vector<unsigned int> getLeafChannelList() const;
110  vector<unsigned int> getScintChannelList() const;
111  vector<int> getInorgScintIDList() const;
113  bool hasBGO(int modID) const;
114  vector<int> getCloverIDList() const;
116  vector<int> getCloverIDListLeaf() const;
117  vector<int> getHPGeIDList() const;
118  uint32_t getWallClockTime() const;
119 
120  //functions below here modify the class in some way that is not just
121  //adding data
122 
126  void reduceStoredRFs(int a_moduleID, bool a_isClover=0);
127 
129  void sortEvents();
130 
131 
133  bool isCoin();
134 
136  void reset();
137 
139  bool isEmpty();
140 
142  std::ostream& print(std::ostream& a_stream = std::cout);
143  private:
144  //private for making sure build is currently independent of old RF methods
145  vector<uint16_t> getRFTimes(int a_moduleID) const;
146  bool m_hasGoodRF;
148  unsigned int m_coarseTime;
149 
150  uint32_t m_wallClockTime;
152  map<int , MDPPCloverEvent> m_cloverEvents;
153  vector<MDPPScintEvent> m_scintEvents;
154  vector<MDPPHPGeEvent> m_HPGeEvents;
155  vector<MDPPInorgScintEvent> m_inorgScintEvents;
156 
157  //stores the trigger array for rf times for a given module
158  map<int, vector<uint16_t>> m_RFTimes;
159 
160 
161 };
165 {
166 public:
169 
173  void defineClass(const GenesisEvent* a_ev,
174  const GenesisConfig& a_conf,
175  int a_detOption=0
176  );
177 
178 
179 
180 
181  //this function takes unpacked data from a GenesisEvent and
182  //builds out the relevant information for calibrated clover event
183  //and adds it to the class
184  void addCloverEvent(int a_clovID,
185  const GenesisEvent* a_ev,
186  const GenesisConfig& a_conf
187  );
188  void addOrgScintEvent(const GenesisEvent* a_hit,
189  const GenesisConfig& a_conf
190  );
191 
192 };
193 
194 
195 
196 
197 #endif
Definition: ConfigClasses.h:431
Definition: GenesisEventStructures.h:165
GenesisCalibratedEvent()
default constructor puts the class into an empty but working state
Definition: GenesisEventStructures.cpp:891
void defineClass(const GenesisEvent *a_ev, const GenesisConfig &a_conf, int a_detOption=0)
Definition: GenesisEventStructures.cpp:900
void addCloverEvent(int a_clovID, const GenesisEvent *a_ev, const GenesisConfig &a_conf)
Definition: GenesisEventStructures.cpp:1260
void addOrgScintEvent(const GenesisEvent *a_hit, const GenesisConfig &a_conf)
Definition: GenesisEventStructures.cpp:1340
Definition: GENESISConfig.h:15
main Genesis Event Class
Definition: GenesisEventStructures.h:25
vector< unsigned int > getScintChannelList() const
Definition: GenesisEventStructures.cpp:504
void reduceStoredRFs(int a_moduleID, bool a_isClover=0)
Definition: GenesisEventStructures.cpp:592
void addRFTimes(int a_moduleID, vector< uint16_t > &a_RFTimes)
Definition: GenesisEventStructures.cpp:329
std::vector< DetType > getDetTypes() const
Definition: GenesisEventStructures.cpp:459
void addMDPPInorgScintEvent(MDPPInorgScintEvent &a_event)
Definition: GenesisEventStructures.cpp:313
bool isEmpty()
checks if any of the detector data structures have been populated
Definition: GenesisEventStructures.cpp:772
uint32_t getWallClockTime() const
Definition: GenesisEventStructures.cpp:586
vector< int > getInorgScintIDList() const
Definition: GenesisEventStructures.cpp:513
MDPPCloverEvent getCloverEvent(int a_cloverID) const
getter for a clover event from a_cloverID
Definition: GenesisEventStructures.cpp:363
vector< int > getCloverIDList() const
Definition: GenesisEventStructures.cpp:525
vector< int > getMinTimeChannel() const
returns channel that had the minimum time
Definition: GenesisEventStructures.cpp:427
MDPPHPGeEvent getHPGeEvent(int a_detID) const
getter for HPGe event using detector ID
Definition: GenesisEventStructures.cpp:382
unsigned int getCoarseTime() const
Definition: GenesisEventStructures.cpp:408
void reset()
resets m_cloverEvents and m_scintEvents
Definition: GenesisEventStructures.cpp:760
void addBGOData(MDPPCloverEvent *a_cloverEvent, int a_cloverID)
Definition: GenesisEventStructures.cpp:317
GenesisEvent()
Definition: GenesisEventStructures.cpp:30
bool setCoarseTime(unsigned int a_endWord, unsigned int a_extTimeStamp)
Definition: GenesisEventStructures.cpp:333
vector< int > getCloverIDListLeaf() const
what does this actually do?!!!!!!!!!!!!
Definition: GenesisEventStructures.cpp:537
void addMDPPCloverEvent(unsigned int a_ADC, unsigned int a_TDC, unsigned int a_chNum, unsigned int a_endWord, unsigned int a_extTimeStamp, int a_cloverID, bool a_isBGO)
add leaf/BGO hit to clover event
Definition: GenesisEventStructures.cpp:40
void addMDPP16Evs(MDPP16Event *a_start, int a_num, ExperimentConfig &a_config, time_t fileStartSinceEpoch, bool a_saveBGOSingles=false, int a_rfTrigIDs=1)
Definition: GenesisEventStructures.cpp:107
std::map< DetType, int > getDetsMultiplicity() const
Definition: GenesisEventStructures.cpp:482
vector< int > getHPGeIDList() const
Definition: GenesisEventStructures.cpp:547
MDPPInorgScintEvent getInorgScintEvent(int a_detID) const
getter for InorgScint event using detector ID
Definition: GenesisEventStructures.cpp:395
bool isCoin()
simple check for presence of scintillator + leaf signals
Definition: GenesisEventStructures.cpp:746
vector< unsigned int > getLeafChannelList() const
Definition: GenesisEventStructures.cpp:491
void addMDPPHPGeEvent(MDPPHPGeEvent &a_event)
Definition: GenesisEventStructures.cpp:309
vector< MDPPScintEvent > getScintEvent() const
getter for all scintillator events
Definition: GenesisEventStructures.cpp:378
std::ostream & print(std::ostream &a_stream=std::cout)
print out the Genesis Event
Definition: GenesisEventStructures.cpp:801
void setWallClockTime(uint32_t a_t)
Definition: GenesisEventStructures.cpp:356
double getMinTime() const
returns minimum global time in event - should be the triggering events
Definition: GenesisEventStructures.cpp:412
map< int, MDPPCloverEvent > getCloverEvents() const
getter for All clover events
Definition: GenesisEventStructures.cpp:374
bool hasBGO(int modID) const
IS THIS REALLY A MOD ID?
Definition: GenesisEventStructures.cpp:559
void sortEvents()
TDC-sorts scintillator, and clover (leaf/BGO independtly)
Definition: GenesisEventStructures.cpp:713
void addMDPPScintEvent(unsigned int a_total, unsigned int a_TDC, unsigned int a_peak, unsigned int a_chNum, unsigned int a_endWord, unsigned int a_extTimeStamp, int a_modID, vector< uint16_t > a_triggers)
add scintillator hit m_scintEvents
Definition: GenesisEventStructures.cpp:84
int getNHits() const
returns the total number of individual detectos that fired
Definition: GenesisEventStructures.cpp:451
Definition: MDPP16DataStructures.h:32
Definition: DetectorDataStructures.h:74
Definition: DetectorDataStructures.h:222
Definition: DetectorDataStructures.h:232
Definition: DetectorDataStructures.h:189
Definition: NSDPhysicsEvents.h:132