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 private:
83  static unsigned count;
84  //ParticleDeposit(const ParticleDeposit& pd);
85  std::vector<Deposition> myRecDepositions;
86  std::vector<Deposition> myTruthDepositions;
87  unsigned myId;
88 
89  double myTruthEnergy;
90  double myEta;
91  double myPhi;
92 
93  /*
94  * For general ROOT dictionary building happiness!
95  */
96  std::vector<ParticleDeposit*> pdps_;
97  // std::vector<ParticleDeposit> pds_;
98 };
99 
100 
101 typedef boost::shared_ptr<ParticleDeposit> ParticleDepositPtr;
102 std::ostream& operator<<(std::ostream& s, const ParticleDeposit& p);
103 
104 }
105 
106 #endif /*PARTICLEDEPOSIT_HH_*/
virtual const std::vector< Deposition > & getRecDepositions() const
virtual double getEnergyResolution() const
std::vector< ParticleDeposit * > pdps_
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
Geom::Phi< T > phi() const
virtual void addTruthDeposition(const Deposition &truth)
ParticleDeposit(double truthEnergy=-1.0, double eta=0, double phi=0)
void setTruthEnergy(const double truth)
std::ostream & operator<<(std::ostream &s, const Calibratable &calib_)
Definition: Calibratable.cc:6
virtual std::vector< Deposition > getTruthDepositions() const