Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
6 #include "Vec.hh"
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, .., 31} 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  int 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 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  double pure_t; ///< photon time before pmt simultion (MC only)
29  double pure_a; ///< amptitude before pmt simution (MC only)
30  int type; ///< particle type or parametrisation used for hit (mc only)
31  int origin; ///< track id of the track that created this hit
32 
33  unsigned pattern_flags; ///< some number that you can use to flag the hit
34 
35  /**
36  * Default constructor.
37  */
38  Hit(): id(0), dom_id(0), channel_id(0), tdc(0), tot(0), trig(0), pmt_id(0),
39  t(0), a(0), pure_t(0), pure_a(0), type(0), origin(0), pattern_flags(0) {}
40  //virtual ~Hit() {}
41 
42 
43  /**
44  * Read hit (useful in python).
45  *
46  * \param h hit
47  */
48  void read(const Hit& h) { *this = h;}
49 
50  /**
51  * Write hit (useful in python).
52  *
53  * \param h hit
54  */
55  void write(Hit& h) const { h = *this;}
56 
57  /**
58  * Print hit.
59  *
60  * \param out output stream
61  */
62  void print( std::ostream& out = std::cout ) const
63  {
64  out << "Hit: id=" << id << " dom="<<dom_id << " channel="<<channel_id;
65  out << " pmt="<<pmt_id << " t=" << t << " tot="<<tot;
66  out << " pos="; pos.print(out);
67  out << " dir="; dir.print(out);
68  }
69 
70  ClassDefNV(Hit,105) // reserve <100 for antcc class of the same name
71 };
72 
73 #endif
Vec pos
hit position
Definition: Hit.hh:25
#define ClassDefNV(name, version)
Definition: JRoot.hh:33
Definition: JRoot.hh:19
int pmt_id
global PMT identifier as found in evt files
Definition: Hit.hh:20
unsigned int tdc
hit tdc (=time in ns)
Definition: Hit.hh:16
int origin
track id of the track that created this hit
Definition: Hit.hh:31
Hit()
Default constructor.
Definition: Hit.hh:38
void print(std::ostream &out=std::cout) const
Print hit.
Definition: Hit.hh:62
double pure_t
photon time before pmt simultion (MC only)
Definition: Hit.hh:28
double a
hit amplitude (in p.e.)
Definition: Hit.hh:24
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
void read(const Hit &h)
Read hit (useful in python).
Definition: Hit.hh:48
double pure_a
amptitude before pmt simution (MC only)
Definition: Hit.hh:29
int id
Definition: Hit.hh:11
Vec dir
hit direction; i.e. direction of the PMT
Definition: Hit.hh:26
unsigned pattern_flags
some number that you can use to flag the hit
Definition: Hit.hh:33
int trig
non-zero if the hit is a trigger hit.
Definition: Hit.hh:18
Definition: Hit.hh:8
double t
hit time (from calibration or MC truth)
Definition: Hit.hh:23
int dom_id
module identifier from the data (unique in the detector).
Definition: Hit.hh:14
unsigned int tot
tot value as stored in raw data (int for pyroot)
Definition: Hit.hh:17
void print(std::ostream &out=std::cout) const
Print vector.
Definition: Vec.hh:166
unsigned int channel_id
PMT channel id {0,1, .., 31} local to moduke.
Definition: Hit.hh:15
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:30
void write(Hit &h) const
Write hit (useful in python).
Definition: Hit.hh:55