CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParticleDeposit.h
Go to the documentation of this file.
1 #ifndef PARTICLEDEPOSIT_HH_
2 #define PARTICLEDEPOSIT_HH_
3 
4 #include <vector>
5 
8 
9 
10 #include <iostream>
11 
19 namespace pftools {
20 
22 public:
23 
24  ParticleDeposit(double truthEnergy = -1.0, double eta = 0, double phi = 0);
25  virtual ~ParticleDeposit();
26 
27  virtual void addRecDeposition(const Deposition& rec);
28  virtual void addTruthDeposition(const Deposition& truth);
29 
30  virtual const std::vector<Deposition>& getRecDepositions() const;
31  virtual std::vector<Deposition> getTruthDepositions() const;
32 
33  /*
34  * Returns the overall MC particle energy.
35  */
36  virtual double getTruthEnergy() const {
37  return myTruthEnergy;
38  }
39 
40  /*
41  * Returns the detected energy from this detector element, including calibration.
42  */
43  virtual double getRecEnergy(const DetectorElementPtr de) const;
44 
45  virtual double getRecEnergy() const;
46 
47  virtual void setRecEnergy(const DetectorElementPtr de, double energy);
48 
49  virtual double getEnergyResolution() const;
50 
51  /*
52  * Returns the raw MC energy input into this detector element.
53  */
54  virtual double getTruthEnergy(const DetectorElementPtr de) const;
55 
56  virtual unsigned getId() const {
57  return myId;
58  }
59 
60  inline double getEta() const {
61  return myEta;
62  }
63 
64  virtual double getPhi() const {
65  return myPhi;
66  }
67 
68  void setTruthEnergy(const double truth) {
69  myTruthEnergy = truth;
70  }
71 
72  void setPhi(const double phi) {
73  myPhi = phi;
74  }
75 
76  void setEta(const double eta) {
77  myEta = eta;
78  }
79 
80  double getTargetFunctionContrib() const;
81 
82  friend std::ostream& operator<<(std::ostream& s, const ParticleDeposit& p);
83 
84 private:
85  static unsigned count;
86  //ParticleDeposit(const ParticleDeposit& pd);
87  std::vector<Deposition> myRecDepositions;
88  std::vector<Deposition> myTruthDepositions;
89  unsigned myId;
90 
91  double myTruthEnergy;
92  double myEta;
93  double myPhi;
94 
95  /*
96  * For general ROOT dictionary building happiness!
97  */
98  std::vector<ParticleDeposit*> pdps_;
99  // std::vector<ParticleDeposit> pds_;
100 };
101 
102 
103 typedef boost::shared_ptr<ParticleDeposit> ParticleDepositPtr;
104 
105 }
106 
107 #endif /*PARTICLEDEPOSIT_HH_*/
virtual const std::vector< Deposition > & getRecDepositions() const
virtual double getEnergyResolution() const
std::vector< ParticleDeposit * > pdps_
T eta() const
void setPhi(const double phi)
void setEta(const double eta)
virtual void setRecEnergy(const DetectorElementPtr de, double energy)
double getTargetFunctionContrib() const
boost::shared_ptr< ParticleDeposit > ParticleDepositPtr
virtual unsigned getId() const
virtual double getRecEnergy() const
boost::shared_ptr< DetectorElement > DetectorElementPtr
virtual void addRecDeposition(const Deposition &rec)
virtual double getTruthEnergy() const
This class holds an arbitrary energy deposition, specified in terms of angular position, energy, depth (optional) and detector element type.
Definition: Deposition.h:20
std::vector< Deposition > myTruthDepositions
std::vector< Deposition > myRecDepositions
virtual double getPhi() const
virtual void addTruthDeposition(const Deposition &truth)
friend std::ostream & operator<<(std::ostream &s, const ParticleDeposit &p)
ParticleDeposit(double truthEnergy=-1.0, double eta=0, double phi=0)
void setTruthEnergy(const double truth)
virtual std::vector< Deposition > getTruthDepositions() const
Definition: DDAxes.h:10