Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DTACHit.h
Go to the documentation of this file.
1 /*
2  * DTACHit.h
3  *
4  * Created on: Mar 24, 2017
5  * Author: Hovanes Egiyan
6  */
7 
8 #ifndef LIBRARIES_TAC_DTACHIT_H_
9 #define LIBRARIES_TAC_DTACHIT_H_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 using namespace jana;
14 
15 class DTACHit: public jana::JObject {
16 protected:
17  double E = 0;
18  double T = 0;
19 
20  double integral = 0;
21  double pulsePeak = 0;
22  double timeTDC = 0;
23  double timeFADC = 0;
24  double npeFADC = 0;
25  bool fadcPresent = false;
26  bool tdcPresent = false;
27 
28 
29 public:
30  JOBJECT_PUBLIC(DTACHit)
31 
32  DTACHit() {
33  }
34  DTACHit( const DTACHit& hit ) : jana::JObject(hit), E(hit.E), T(hit.T), integral(hit.integral),
35  pulsePeak(hit.pulsePeak), timeTDC(hit.timeTDC), timeFADC(hit.timeFADC), npeFADC(hit.npeFADC),
36  fadcPresent(hit.fadcPresent), tdcPresent(hit.tdcPresent) {
37  }
38  virtual ~DTACHit() {
39  }
40 
41  DTACHit& operator=( const DTACHit& hit ) {
42  if( this == &hit ) return *this;
43  *(dynamic_cast<jana::JObject*>(this)) = *dynamic_cast<const jana::JObject*>(&hit);
44  T=hit.T;
45  E=hit.E;
46  integral=hit.integral;
47  pulsePeak=hit.pulsePeak;
48  timeTDC=hit.timeTDC;
49  timeFADC=hit.timeFADC;
50  npeFADC = hit.npeFADC;
51  fadcPresent = hit.fadcPresent;
52  tdcPresent = hit.tdcPresent;
53 
54  return *this;
55  }
56 
57  virtual void toStrings(vector<pair<string, string> > &items) const override {
58  AddString(items, "E(MeV)", "%2.3f", E );
59  AddString(items, "t(ns)", "%2.3f", T);
60  AddString(items, "time_tdc(ns)", "%f", timeTDC);
61  AddString(items, "time_fadc(ns)", "%f", timeFADC);
62  AddString(items, "integral", "%f", integral);
63  AddString(items, "pulse_peak", "%f", pulsePeak);
64  AddString(items, "npe_fadc", "%f", npeFADC);
65  AddString(items, "has_fADC", "%d", (int) fadcPresent);
66  AddString(items, "has_TDC", "%d", (int) tdcPresent);
67  }
68 
69  double getE() const {
70  return E;
71  }
72 
73  void setE(double e = 0) {
74  E = e;
75  }
76 
77  double getIntegral() const {
78  return integral;
79  }
80 
81  void setIntegral(double integral = 0) {
82  this->integral = integral;
83  }
84 
85  double getNpeFADC() const {
86  return npeFADC;
87  }
88 
89  void setNpeFADC(double npeFadc = 0) {
90  npeFADC = npeFadc;
91  }
92 
93  double getPulsePeak() const {
94  return pulsePeak;
95  }
96 
97  void setPulsePeak(double pulsePeak = 0) {
98  this->pulsePeak = pulsePeak;
99  }
100 
101  double getT() const {
102  return T;
103  }
104 
105  void setT(double t = 0) {
106  T = t;
107  }
108 
109  double getTimeFADC() const {
110  return timeFADC;
111  }
112 
113  void setTimeFADC(double timeFadc = 0) {
114  timeFADC = timeFadc;
115  }
116 
117  double getTimeTDC() const {
118  return timeTDC;
119  }
120 
121  void setTimeTDC(double timeTdc = 0) {
122  timeTDC = timeTdc;
123  }
124 
125  bool isFADCPresent() const {
126  return fadcPresent;
127  }
128 
129  void setFADCPresent(bool fadcPresent = false) {
130  this->fadcPresent = fadcPresent;
131  }
132 
133  bool isTDCPresent() const {
134  return tdcPresent;
135  }
136 
137  void setTDCPresent(bool tdcPresent = false) {
138  this->tdcPresent = tdcPresent;
139  }
140 };
141 
142 #endif /* LIBRARIES_TAC_DTACHIT_H_ */
void setE(double e=0)
Definition: DTACHit.h:73
double E
Definition: DTACHit.h:17
void setTimeTDC(double timeTdc=0)
Definition: DTACHit.h:121
double getPulsePeak() const
Definition: DTACHit.h:93
bool isTDCPresent() const
Definition: DTACHit.h:133
bool fadcPresent
Definition: DTACHit.h:25
DTACHit(const DTACHit &hit)
Definition: DTACHit.h:34
double getE() const
Definition: DTACHit.h:69
double integral
Definition: DTACHit.h:20
double npeFADC
Definition: DTACHit.h:24
void setTimeFADC(double timeFadc=0)
Definition: DTACHit.h:113
void setNpeFADC(double npeFadc=0)
Definition: DTACHit.h:89
TEllipse * e
double T
Definition: DTACHit.h:18
virtual void toStrings(vector< pair< string, string > > &items) const override
Definition: DTACHit.h:57
double getT() const
Definition: DTACHit.h:101
void setFADCPresent(bool fadcPresent=false)
Definition: DTACHit.h:129
virtual ~DTACHit()
Definition: DTACHit.h:38
bool tdcPresent
Definition: DTACHit.h:26
double getIntegral() const
Definition: DTACHit.h:77
void setPulsePeak(double pulsePeak=0)
Definition: DTACHit.h:97
bool isFADCPresent() const
Definition: DTACHit.h:125
double getTimeTDC() const
Definition: DTACHit.h:117
void setTDCPresent(bool tdcPresent=false)
Definition: DTACHit.h:137
double pulsePeak
Definition: DTACHit.h:21
void setIntegral(double integral=0)
Definition: DTACHit.h:81
double timeTDC
Definition: DTACHit.h:22
void setT(double t=0)
Definition: DTACHit.h:105
double timeFADC
Definition: DTACHit.h:23
double getNpeFADC() const
Definition: DTACHit.h:85
double getTimeFADC() const
Definition: DTACHit.h:109
DTACHit & operator=(const DTACHit &hit)
Definition: DTACHit.h:41