CMS 3D CMS Logo

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_
PassiveHit::pdgId
int pdgId() const
Definition: PassiveHit.h:64
PassiveHit::time_
float time_
Definition: PassiveHit.h:90
PassiveHit::zp_
float zp_
Definition: PassiveHit.h:96
PassiveHit::vname
std::string vname() const
Definition: PassiveHit.h:60
PassiveHit::operator==
bool operator==(const PassiveHit &d) const
Definition: PassiveHit.h:83
PassiveHit::setEnergyTotal
void setEnergyTotal(double e)
Definition: PassiveHit.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
PassiveHit::energy
double energy() const
Definition: PassiveHit.h:42
PassiveHit::yp_
float yp_
Definition: PassiveHit.h:95
PassiveHit::PassiveHit
PassiveHit()
Definition: PassiveHit.h:33
PassiveHit::ip_
int ip_
Definition: PassiveHit.h:92
PassiveHit::setID
void setID(std::string vname, unsigned int id)
Definition: PassiveHit.h:56
PassiveHit::setEnergy
void setEnergy(double e)
Definition: PassiveHit.h:43
PassiveHit::id_
unsigned int id_
Definition: PassiveHit.h:87
PassiveHit::setTime
void setTime(float t)
Definition: PassiveHit.h:49
PassiveHit::energy_
float energy_
Definition: PassiveHit.h:88
operator<<
std::ostream & operator<<(std::ostream &, const PassiveHit &)
Definition: PassiveHit.cc:4
PassiveHit::xp_
float xp_
Definition: PassiveHit.h:94
PassiveHit::setStepLength
void setStepLength(float stepl)
Definition: PassiveHit.h:69
PassiveHit::stepl_
float stepl_
Definition: PassiveHit.h:93
PassiveHit::setTrackId
void setTrackId(int it)
Definition: PassiveHit.h:53
PassiveHit
Definition: PassiveHit.h:9
PassiveHit::etotal_
float etotal_
Definition: PassiveHit.h:89
PassiveHit::stepLength
float stepLength() const
Definition: PassiveHit.h:68
PassiveHit::y
float y() const
Definition: PassiveHit.h:74
PassiveHit::getName
const char * getName() const
Definition: PassiveHit.h:39
PassiveHit::setZ
void setZ(float zp)
Definition: PassiveHit.h:77
PassiveHit::setX
void setX(float xp)
Definition: PassiveHit.h:73
edm::PassiveHitContainer
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:100
PassiveHit::it_
int it_
Definition: PassiveHit.h:91
PassiveHit::id
unsigned int id() const
Definition: PassiveHit.h:61
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PassiveHit::setPDGId
void setPDGId(int ip)
Definition: PassiveHit.h:65
PassiveHit::setY
void setY(float yp)
Definition: PassiveHit.h:75
PassiveHit::vname_
std::string vname_
Definition: PassiveHit.h:86
PassiveHit::name
static const char * name()
Definition: PassiveHit.h:37
PassiveHit::energyTotal
double energyTotal() const
Definition: PassiveHit.h:44
PassiveHit::z
float z() const
Definition: PassiveHit.h:76
PassiveHit::PassiveHit
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
ztail.d
d
Definition: ztail.py:151
PassiveHit::trackId
int trackId() const
Definition: PassiveHit.h:52
PassiveHit::operator<
bool operator<(const PassiveHit &d) const
Definition: PassiveHit.h:80
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
PassiveHit::time
double time() const
Definition: PassiveHit.h:48
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PassiveHit::x
float x() const
Definition: PassiveHit.h:72