CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PassiveHit.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_PassiveHit_H
2 #define SimDataFormats_PassiveHit_H
3 
4 #include <string>
5 #include <vector>
6 
7 // Persistent Hit in passive material
8 
9 class PassiveHit {
10 public:
12  unsigned int id,
13  float e = 0,
14  float etot = 0,
15  float t = 0,
16  int it = 0,
17  int ip = 0,
18  float stepl = 0,
19  float xp = 0,
20  float yp = 0,
21  float zp = 0)
22  : vname_(vname),
23  id_(id),
24  energy_(e),
25  etotal_(etot),
26  time_(t),
27  it_(it),
28  ip_(ip),
29  stepl_(stepl),
30  xp_(xp),
31  yp_(yp),
32  zp_(zp) {}
34  : vname_(""), id_(0), energy_(0), etotal_(0), time_(0), it_(0), ip_(0), stepl_(0), xp_(0), yp_(0), zp_(0) {}
35 
36  //Names
37  static const char *name() { return "PassiveHit"; }
38 
39  const char *getName() const { return name(); }
40 
41  //Energy deposit of the Hit
42  double energy() const { return energy_; }
43  void setEnergy(double e) { energy_ = e; }
44  double energyTotal() const { return etotal_; }
45  void setEnergyTotal(double e) { etotal_ = e; }
46 
47  //Time of the deposit
48  double time() const { return time_; }
49  void setTime(float t) { time_ = t; }
50 
51  //Geant track number
52  int trackId() const { return it_; }
53  void setTrackId(int it) { it_ = it; }
54 
55  //DetId where the Hit is recorded
56  void setID(std::string vname, unsigned int id) {
57  vname_ = vname;
58  id_ = id;
59  }
60  std::string vname() const { return vname_; }
61  unsigned int id() const { return id_; }
62 
63  //PDGId of the track causing the Hit
64  int pdgId() const { return ip_; }
65  void setPDGId(int ip) { ip_ = ip; }
66 
67  //Step length for the current Hit
68  float stepLength() const { return stepl_; }
69  void setStepLength(float stepl) { stepl_ = stepl; }
70 
71  //Position of the Hit
72  float x() const { return xp_; }
73  void setX(float xp) { xp_ = xp; }
74  float y() const { return yp_; }
75  void setY(float yp) { yp_ = yp; }
76  float z() const { return zp_; }
77  void setZ(float zp) { zp_ = zp; }
78 
79  //Comparisons
80  bool operator<(const PassiveHit &d) const { return energy_ < d.energy_; }
81 
82  //Same Hit (by value)
83  bool operator==(const PassiveHit &d) const { return (energy_ == d.energy_ && id_ == d.id_ && vname_ == d.vname_); }
84 
85 protected:
87  unsigned int id_;
88  float energy_;
89  float etotal_;
90  float time_;
91  int it_;
92  int ip_;
93  float stepl_;
94  float xp_;
95  float yp_;
96  float zp_;
97 };
98 
99 namespace edm {
100  typedef std::vector<PassiveHit> PassiveHitContainer;
101 } // namespace edm
102 
103 #include <iosfwd>
104 std::ostream &operator<<(std::ostream &, const PassiveHit &);
105 
106 #endif // _SimDataFormats_SimCaloHit_PassiveHit_h_
float stepl_
Definition: PassiveHit.h:93
void setID(std::string vname, unsigned int id)
Definition: PassiveHit.h:56
float stepLength() const
Definition: PassiveHit.h:68
bool operator<(const PassiveHit &d) const
Definition: PassiveHit.h:80
double energy() const
Definition: PassiveHit.h:42
double time() const
Definition: PassiveHit.h:48
void setPDGId(int ip)
Definition: PassiveHit.h:65
float etotal_
Definition: PassiveHit.h:89
float xp_
Definition: PassiveHit.h:94
void setStepLength(float stepl)
Definition: PassiveHit.h:69
void setX(float xp)
Definition: PassiveHit.h:73
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
unsigned int id() const
Definition: PassiveHit.h:61
std::string vname() const
Definition: PassiveHit.h:60
float z() const
Definition: PassiveHit.h:76
float yp_
Definition: PassiveHit.h:95
tuple d
Definition: ztail.py:151
const char * getName() const
Definition: PassiveHit.h:39
static const char * name()
Definition: PassiveHit.h:37
float x() const
Definition: PassiveHit.h:72
void setTime(float t)
Definition: PassiveHit.h:49
float zp_
Definition: PassiveHit.h:96
std::string vname_
Definition: PassiveHit.h:86
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:100
void setEnergyTotal(double e)
Definition: PassiveHit.h:45
float y() const
Definition: PassiveHit.h:74
bool operator==(const PassiveHit &d) const
Definition: PassiveHit.h:83
PassiveHit(std::string vname, unsigned int id, float e=0, float etot=0, float t=0, int it=0, int ip=0, float stepl=0, float xp=0, float yp=0, float zp=0)
Definition: PassiveHit.h:11
float energy_
Definition: PassiveHit.h:88
void setZ(float zp)
Definition: PassiveHit.h:77
float time_
Definition: PassiveHit.h:90
unsigned int id_
Definition: PassiveHit.h:87
double energyTotal() const
Definition: PassiveHit.h:44
int trackId() const
Definition: PassiveHit.h:52
void setEnergy(double e)
Definition: PassiveHit.h:43
void setTrackId(int it)
Definition: PassiveHit.h:53
int pdgId() const
Definition: PassiveHit.h:64
void setY(float yp)
Definition: PassiveHit.h:75