NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
DDASRootEvent.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Aaron Chester
12  Jeromy Tompkins
13  FRIB
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
23 #ifndef DDASROOTEVENT_H
24 #define DDASROOTEVENT_H
25 
26 #include <TObject.h>
27 #include <vector>
28 
29 class DDASRootHit;
30 
58 class DDASRootEvent : public TObject
59 {
60 private:
61  std::vector<DDASRootHit*> m_data;
62 
63 public:
65  DDASRootEvent();
68 
73  DDASRootEvent(const DDASRootEvent& obj);
84  std::vector<DDASRootHit*>& GetData() { return m_data;}
89  UInt_t GetNHits() const { return m_data.size(); }
94  void AddChannelData(DDASRootHit* channel);
99  Double_t GetFirstTime() const;
104  Double_t GetLastTime() const;
106  Double_t GetTimeWidth() const;
108  void Reset();
109 
110  // Tell ROOT we're implementing the class:
111 
113 };
114 
117 #endif
Encapsulates a built DDAS event with added capabilities for writing to ROOT files.
Definition: DDASRootEvent.h:59
DDASRootEvent & operator=(const DDASRootEvent &obj)
Assignment operator.
Definition: DDASRootEvent.cpp:54
Double_t GetLastTime() const
Get timestamp of last channel datum.
Definition: DDASRootEvent.cpp:112
void AddChannelData(DDASRootHit *channel)
Append channel data to event.
Definition: DDASRootEvent.cpp:85
~DDASRootEvent()
Destructor.
Definition: DDASRootEvent.cpp:74
std::vector< DDASRootHit * > & GetData()
Access internal, extensible array of channel data.
Definition: DDASRootEvent.h:84
Double_t GetTimeWidth() const
Get time difference between first and last channel data.
Definition: DDASRootEvent.cpp:127
Double_t GetFirstTime() const
Get timestamp of first channel datum.
Definition: DDASRootEvent.cpp:96
void Reset()
Clear data vector and reset the event.
Definition: DDASRootEvent.cpp:137
DDASRootEvent()
Default constructor.
Definition: DDASRootEvent.cpp:28
UInt_t GetNHits() const
Return the number of hits in this event.
Definition: DDASRootEvent.h:89
ClassDef(DDASRootEvent, 1)
Encapsulation of a generic DDAS hit with added capabilities for writing to ROOT files.
Definition: DDASRootHit.h:75