Jpp  19.1.0-rc.1
the software that should make you happy
Hit.hh
Go to the documentation of this file.
1 #ifndef HIT_HH_INCLUDED
2 #define HIT_HH_INCLUDED
3 
4 #include "TObject.h"
5 #include "TString.h"
7 
8 struct Hit :
9  public TObject
10 {
11  int id;
12 
13  // straight from the data
14  int dom_id; ///< module identifier from the data (unique in the detector).
15  unsigned int channel_id; ///< PMT channel id {0,1, .., 30} local to moduke
16  unsigned int tdc; ///< hit tdc (=time in ns)
17  unsigned int tot; ///< tot value as stored in raw data (int for pyroot)
18  ULong64_t trig; ///< non-zero if the hit is a trigger hit.
19 
20  int pmt_id; ///< global PMT identifier as found in evt files
21 
22  // values after calibration
23  double t; ///< hit time (from tdc+calibration or MC truth)
24  double a; ///< hit amplitude (in p.e.)
25  Vec pos; ///< hit position
26  Vec dir; ///< hit direction; i.e. direction of the PMT
27 
28  int type; ///< particle type or parametrisation used for hit (mc only)
29  int origin; ///< track id of the track that created this hit (mc only)
30 
31  unsigned pattern_flags; ///< some number that you can use to flag the hit
32 
33  /**
34  * Default constructor.
35  */
36  Hit(): id(0), dom_id(0), channel_id(0), tdc(0), tot(0), trig(0), pmt_id(0),
37  t(0), a(0), type(0), origin(0), pattern_flags(0) {}
38  //virtual ~Hit() {}
39 
40 
41  /**
42  * Read hit (useful in python).
43  *
44  * \param h hit
45  */
46  void read(const Hit& h) { *this = h;}
47 
48  /**
49  * Write hit (useful in python).
50  *
51  * \param h hit
52  */
53  void write(Hit& h) const { h = *this;}
54 
55  /**
56  * Print hit.
57  *
58  * \param out output stream
59  */
60  void print( std::ostream& out = std::cout ) const
61  {
62  out << "Hit: id=" << id << " dom=" << dom_id << " channel=" << channel_id;
63  out << " pmt=" << pmt_id << " t=" << t << " tot=" << tot;
64  out << " pos="; pos.print(out);
65  out << " dir="; dir.print(out);
66  }
67 
68  ClassDefNV(Hit, 106) // reserve <100 for antcc class of the same name
69 };
70 
71 #endif
#define ClassDefNV(name, version)
Definition: JRoot.hh:33
Definition: Hit.hh:10
int pmt_id
global PMT identifier as found in evt files
Definition: Hit.hh:20
int dom_id
module identifier from the data (unique in the detector).
Definition: Hit.hh:14
int origin
track id of the track that created this hit (mc only)
Definition: Hit.hh:29
Vec pos
hit position
Definition: Hit.hh:25
double a
hit amplitude (in p.e.)
Definition: Hit.hh:24
int id
Definition: Hit.hh:11
void print(std::ostream &out=std::cout) const
Print hit.
Definition: Hit.hh:60
Vec dir
hit direction; i.e. direction of the PMT
Definition: Hit.hh:26
ULong64_t trig
non-zero if the hit is a trigger hit.
Definition: Hit.hh:18
unsigned pattern_flags
some number that you can use to flag the hit
Definition: Hit.hh:31
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
void write(Hit &h) const
Write hit (useful in python).
Definition: Hit.hh:53
void read(const Hit &h)
Read hit (useful in python).
Definition: Hit.hh:46
Hit()
Default constructor.
Definition: Hit.hh:36
unsigned int tdc
hit tdc (=time in ns)
Definition: Hit.hh:16
unsigned int channel_id
PMT channel id {0,1, .., 30} local to moduke.
Definition: Hit.hh:15
unsigned int tot
tot value as stored in raw data (int for pyroot)
Definition: Hit.hh:17
double t
hit time (from tdc+calibration or MC truth)
Definition: Hit.hh:23
Definition: JRoot.hh:19
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:13
void print(std::ostream &out=std::cout) const
Print vector.
Definition: Vec.hh:166