00001 #ifndef PARTICLEDEPOSIT_HH_ 00002 #define PARTICLEDEPOSIT_HH_ 00003 00004 #include <vector> 00005 00006 #include "RecoParticleFlow/PFClusterTools/interface/Deposition.h" 00007 #include "RecoParticleFlow/PFClusterTools/interface/DetectorElement.h" 00008 00009 00010 #include <iostream> 00011 00019 namespace pftools { 00020 00021 class ParticleDeposit { 00022 public: 00023 00024 ParticleDeposit(double truthEnergy = -1.0, double eta = 0, double phi = 0); 00025 virtual ~ParticleDeposit(); 00026 00027 virtual void addRecDeposition(const Deposition& rec); 00028 virtual void addTruthDeposition(const Deposition& truth); 00029 00030 virtual const std::vector<Deposition>& getRecDepositions() const; 00031 virtual std::vector<Deposition> getTruthDepositions() const; 00032 00033 /* 00034 * Returns the overall MC particle energy. 00035 */ 00036 virtual double getTruthEnergy() const { 00037 return myTruthEnergy; 00038 } 00039 00040 /* 00041 * Returns the detected energy from this detector element, including calibration. 00042 */ 00043 virtual double getRecEnergy(const DetectorElementPtr de) const; 00044 00045 virtual double getRecEnergy() const; 00046 00047 virtual void setRecEnergy(const DetectorElementPtr de, double energy); 00048 00049 virtual double getEnergyResolution() const; 00050 00051 /* 00052 * Returns the raw MC energy input into this detector element. 00053 */ 00054 virtual double getTruthEnergy(const DetectorElementPtr de) const; 00055 00056 virtual unsigned getId() const { 00057 return myId; 00058 } 00059 00060 inline double getEta() const { 00061 return myEta; 00062 } 00063 00064 virtual double getPhi() const { 00065 return myPhi; 00066 } 00067 00068 void setTruthEnergy(const double truth) { 00069 myTruthEnergy = truth; 00070 } 00071 00072 void setPhi(const double phi) { 00073 myPhi = phi; 00074 } 00075 00076 void setEta(const double eta) { 00077 myEta = eta; 00078 } 00079 00080 double getTargetFunctionContrib() const; 00081 00082 friend std::ostream& operator<<(std::ostream& s, const ParticleDeposit& p); 00083 00084 private: 00085 static unsigned count; 00086 //ParticleDeposit(const ParticleDeposit& pd); 00087 std::vector<Deposition> myRecDepositions; 00088 std::vector<Deposition> myTruthDepositions; 00089 unsigned myId; 00090 00091 double myTruthEnergy; 00092 double myEta; 00093 double myPhi; 00094 00095 /* 00096 * For general ROOT dictionary building happiness! 00097 */ 00098 std::vector<ParticleDeposit*> pdps_; 00099 // std::vector<ParticleDeposit> pds_; 00100 }; 00101 00102 00103 typedef boost::shared_ptr<ParticleDeposit> ParticleDepositPtr; 00104 00105 } 00106 00107 #endif /*PARTICLEDEPOSIT_HH_*/