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 
11 public:
12 
13  PassiveHit(std::string vname, unsigned int id, float e=0, float etot=0,
14  float t=0, int it=0) : vname_(vname), id_(id), energy_(e),
15  etotal_(etot), time_(t), it_(it) {}
16  PassiveHit() : vname_(""), id_(0), energy_(0), etotal_(0), time_(0), it_(0) {}
17 
18  //Names
19  static const char *name() { return "PassiveHit"; }
20 
21  const char * getName() const { return name (); }
22 
23  //Energy deposit of the Hit
24  double energy() const { return energy_; }
25  void setEnergy(double e) { energy_ = e; }
26  double energyTotal() const { return etotal_; }
27  void setEnergyTotal(double e) { etotal_ = e; }
28 
29  //Time of the deposit
30  double time() const { return time_; }
31  void setTime(float t) { time_ = t;}
32 
33  //Geant track number
34  int trackId() const { return it_; }
35  void setTrackId(int it) { it_ = it; }
36 
37  //DetId where the Hit is recorded
38  void setID(std::string vname, unsigned int id) { vname_ = vname; id_ = id; }
39  std::string vname() const { return vname_; }
40  unsigned int id() const { return id_; }
41 
42  //Comparisons
43  bool operator<(const PassiveHit &d) const { return energy_ < d.energy_; }
44 
45  //Same Hit (by value)
46  bool operator==(const PassiveHit &d) const
47  { return (energy_ == d.energy_ && id_ == d.id_ && vname_ == d.vname_); }
48 
49 
50 protected:
52  unsigned int id_;
53  float energy_;
54  float etotal_;
55  float time_;
56  int it_;
57 };
58 
59 namespace edm {
60  typedef std::vector<PassiveHit> PassiveHitContainer;
61 } // edm
62 
63 #include<iosfwd>
64 std::ostream &operator<<(std::ostream &, const PassiveHit &);
65 
66 #endif // _SimDataFormats_SimCaloHit_PassiveHit_h_
void setID(std::string vname, unsigned int id)
Definition: PassiveHit.h:38
bool operator<(const PassiveHit &d) const
Definition: PassiveHit.h:43
double energy() const
Definition: PassiveHit.h:24
std::ostream & operator<<(std::ostream &, const PassiveHit &)
Definition: PassiveHit.cc:4
double time() const
Definition: PassiveHit.h:30
float etotal_
Definition: PassiveHit.h:54
unsigned int id() const
Definition: PassiveHit.h:40
std::string vname() const
Definition: PassiveHit.h:39
const char * getName() const
Definition: PassiveHit.h:21
static const char * name()
Definition: PassiveHit.h:19
void setTime(float t)
Definition: PassiveHit.h:31
std::string vname_
Definition: PassiveHit.h:51
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:60
void setEnergyTotal(double e)
Definition: PassiveHit.h:27
bool operator==(const PassiveHit &d) const
Definition: PassiveHit.h:46
float energy_
Definition: PassiveHit.h:53
float time_
Definition: PassiveHit.h:55
unsigned int id_
Definition: PassiveHit.h:52
HLT enums.
double energyTotal() const
Definition: PassiveHit.h:26
int trackId() const
Definition: PassiveHit.h:34
void setEnergy(double e)
Definition: PassiveHit.h:25
void setTrackId(int it)
Definition: PassiveHit.h:35
PassiveHit(std::string vname, unsigned int id, float e=0, float etot=0, float t=0, int it=0)
Definition: PassiveHit.h:13