Jpp
Hit.hh
Go to the documentation of this file.
1 #ifndef HIT_HH_INCLUDED
2 #define HIT_HH_INCLUDED
3 
4 #include "TString.h"
5 #include "Vec.hh"
6 
7 struct Hit
8 {
9  int id;
10 
11  // straight from the data
12  int dom_id; ///< module identifier from the data (unique in the detector).
13  unsigned int channel_id; ///< PMT channel id {0,1, .., 31} local to moduke
14  unsigned int tdc; ///< hit tdc (=time in ns)
15  unsigned int tot; ///< tot value as stored in raw data (int for pyroot)
16  int trig; ///< non-zero if the hit is a trigger hit.
17 
18  int pmt_id; ///< global PMT identifier as found in evt files
19 
20  // values after calibration
21  double t; ///< hit time (from calibration or MC truth)
22  double a; ///< hit amplitude (in p.e.)
23  Vec pos; ///< hit position
24  Vec dir; ///< hit direction; i.e. direction of the PMT
25 
26  double pure_t; ///< photon time before pmt simultion (MC only)
27  double pure_a; ///< amptitude before pmt simution (MC only)
28  int type; ///< particle type or parametrisation used for hit (mc only)
29  int origin; ///< track id of the track that created this hit
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), pure_t(0), pure_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 ) 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,104) // reserve <100 for antcc class of the same name
69 };
70 
71 #endif
Hit
Definition: Hit.hh:7
Hit::pure_t
double pure_t
photon time before pmt simultion (MC only)
Definition: Hit.hh:26
Hit::tdc
unsigned int tdc
hit tdc (=time in ns)
Definition: Hit.hh:14
Hit::origin
int origin
track id of the track that created this hit
Definition: Hit.hh:29
Hit::pmt_id
int pmt_id
global PMT identifier as found in evt files
Definition: Hit.hh:18
Hit::read
void read(const Hit &h)
Read hit (useful in python).
Definition: Hit.hh:46
Vec.hh
Hit::a
double a
hit amplitude (in p.e.)
Definition: Hit.hh:22
Hit::t
double t
hit time (from calibration or MC truth)
Definition: Hit.hh:21
Hit::write
void write(Hit &h) const
Write hit (useful in python).
Definition: Hit.hh:53
Hit::tot
unsigned int tot
tot value as stored in raw data (int for pyroot)
Definition: Hit.hh:15
Hit::id
int id
Definition: Hit.hh:9
Hit::dom_id
int dom_id
module identifier from the data (unique in the detector).
Definition: Hit.hh:12
Hit::dir
Vec dir
hit direction; i.e. direction of the PMT
Definition: Hit.hh:24
Hit::pure_a
double pure_a
amptitude before pmt simution (MC only)
Definition: Hit.hh:27
Hit::trig
int trig
non-zero if the hit is a trigger hit.
Definition: Hit.hh:16
Hit::Hit
Hit()
Default constructor.
Definition: Hit.hh:36
ClassDefNV
#define ClassDefNV(name, version)
Definition: JRoot.hh:33
Hit::pattern_flags
unsigned pattern_flags
some number that you can use to flag the hit
Definition: Hit.hh:31
Hit::print
void print(std::ostream &out) const
Print hit.
Definition: Hit.hh:60
Vec
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
Hit::pos
Vec pos
hit position
Definition: Hit.hh:23
Hit::channel_id
unsigned int channel_id
PMT channel id {0,1, .., 31} local to moduke.
Definition: Hit.hh:13
Hit::type
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:28
Vec::print
void print(std::ostream &out=std::cout) const
Print vector.
Definition: Vec.hh:166