CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes | Friends
pftools::ParticleDeposit Class Reference

#include <ParticleDeposit.h>

Public Member Functions

virtual void addRecDeposition (const Deposition &rec)
 
virtual void addTruthDeposition (const Deposition &truth)
 
virtual double getEnergyResolution () const
 
double getEta () const
 
virtual unsigned getId () const
 
virtual double getPhi () const
 
virtual const std::vector
< Deposition > & 
getRecDepositions () const
 
virtual double getRecEnergy (const DetectorElementPtr de) const
 
virtual double getRecEnergy () const
 
double getTargetFunctionContrib () const
 
virtual std::vector< DepositiongetTruthDepositions () const
 
virtual double getTruthEnergy () const
 
virtual double getTruthEnergy (const DetectorElementPtr de) const
 
 ParticleDeposit (double truthEnergy=-1.0, double eta=0, double phi=0)
 
void setEta (const double eta)
 
void setPhi (const double phi)
 
virtual void setRecEnergy (const DetectorElementPtr de, double energy)
 
void setTruthEnergy (const double truth)
 
virtual ~ParticleDeposit ()
 

Private Attributes

double myEta
 
unsigned myId
 
double myPhi
 
std::vector< DepositionmyRecDepositions
 
std::vector< DepositionmyTruthDepositions
 
double myTruthEnergy
 
std::vector< ParticleDeposit * > pdps_
 

Static Private Attributes

static unsigned count = 0
 

Friends

std::ostream & operator<< (std::ostream &s, const ParticleDeposit &p)
 

Detailed Description

Definition at line 21 of file ParticleDeposit.h.

Constructor & Destructor Documentation

ParticleDeposit::ParticleDeposit ( double  truthEnergy = -1.0,
double  eta = 0,
double  phi = 0 
)

Definition at line 10 of file ParticleDeposit.cc.

References count.

10  :
11  myId(count), myTruthEnergy(truthEnergy), myEta(eta), myPhi(phi) {
12  ++count;
13 }
T eta() const
Definition: DDAxes.h:10
ParticleDeposit::~ParticleDeposit ( )
virtual

Definition at line 15 of file ParticleDeposit.cc.

15  {
16 }

Member Function Documentation

void ParticleDeposit::addRecDeposition ( const Deposition rec)
virtual

Definition at line 18 of file ParticleDeposit.cc.

References myRecDepositions.

18  {
19  myRecDepositions.push_back(rec);
20 }
std::vector< Deposition > myRecDepositions
void ParticleDeposit::addTruthDeposition ( const Deposition truth)
virtual

Definition at line 22 of file ParticleDeposit.cc.

References myTruthDepositions.

22  {
23  myTruthDepositions.push_back(truth);
24 }
std::vector< Deposition > myTruthDepositions
double ParticleDeposit::getEnergyResolution ( ) const
virtual

Definition at line 91 of file ParticleDeposit.cc.

References getRecEnergy(), myTruthEnergy, and mathSSE::sqrt().

91  {
92  //assert(!(getRecEnergy() / myTruthEnergy < 0.0));
93  return fabs((getRecEnergy() - myTruthEnergy) / sqrt(myTruthEnergy));
94 }
T sqrt(T t)
Definition: SSEVec.h:48
virtual double getRecEnergy() const
double pftools::ParticleDeposit::getEta ( ) const
inline

Definition at line 60 of file ParticleDeposit.h.

References myEta.

60  {
61  return myEta;
62  }
virtual unsigned pftools::ParticleDeposit::getId ( ) const
inlinevirtual

Definition at line 56 of file ParticleDeposit.h.

References myId.

56  {
57  return myId;
58  }
virtual double pftools::ParticleDeposit::getPhi ( ) const
inlinevirtual

Definition at line 64 of file ParticleDeposit.h.

References myPhi.

64  {
65  return myPhi;
66  }
const std::vector< Deposition > & ParticleDeposit::getRecDepositions ( ) const
virtual

Definition at line 30 of file ParticleDeposit.cc.

References myRecDepositions.

30  {
31  return myRecDepositions;
32 }
std::vector< Deposition > myRecDepositions
double ParticleDeposit::getRecEnergy ( const DetectorElementPtr  de) const
virtual

Definition at line 34 of file ParticleDeposit.cc.

References ztail::d, relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), pftools::Deposition::getEta(), pftools::Deposition::getPhi(), and myRecDepositions.

34  {
35  double energy(0);
36  for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit
37  != myRecDepositions.end(); ++cit) {
38  Deposition d = *cit;
39 
40  if (d.getDetectorElement()->getType() == de->getType()) {
41  energy += de->getCalib(d.getEta(), d.getPhi()) * d.getEnergy();
42  }
43 
44  }
45  return energy;
46 }
DetectorElementPtr getDetectorElement() const
Definition: Deposition.h:43
double getEnergy() const
Definition: Deposition.h:38
tuple d
Definition: ztail.py:151
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 > myRecDepositions
double getPhi() const
Definition: Deposition.h:33
double getEta() const
Definition: Deposition.h:28
double ParticleDeposit::getRecEnergy ( ) const
virtual

Definition at line 74 of file ParticleDeposit.cc.

References ztail::d, relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), pftools::Deposition::getEta(), pftools::Deposition::getPhi(), and myRecDepositions.

Referenced by getEnergyResolution(), and getTargetFunctionContrib().

74  {
75  double energy(0);
76  for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit
77  != myRecDepositions.end(); ++cit) {
78  Deposition d = *cit;
79 // if (d.getDetectorElement()->getType() == OFFSET && d.getDetectorElement()->getCalib() == 1.0) {
80 // //don't add a tiny amount!
81 // } else {
82  energy += d.getDetectorElement()->getCalib(d.getEta(), d.getPhi()) * d.getEnergy();
83 // }
84  }
85 
86  //assert(!(energy < 0));
87  return energy;
88 
89 }
DetectorElementPtr getDetectorElement() const
Definition: Deposition.h:43
double getEnergy() const
Definition: Deposition.h:38
tuple d
Definition: ztail.py:151
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 > myRecDepositions
double getPhi() const
Definition: Deposition.h:33
double getEta() const
Definition: Deposition.h:28
double ParticleDeposit::getTargetFunctionContrib ( ) const

Definition at line 96 of file ParticleDeposit.cc.

References getRecEnergy(), myTruthEnergy, and funct::pow().

96  {
97  //assert(!(getRecEnergy() / myTruthEnergy < 0.0));
98  return pow((getRecEnergy() - myTruthEnergy), 2);
99 }
virtual double getRecEnergy() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
std::vector< Deposition > ParticleDeposit::getTruthDepositions ( ) const
virtual

Definition at line 26 of file ParticleDeposit.cc.

References myTruthDepositions.

26  {
27  return myTruthDepositions;
28 }
std::vector< Deposition > myTruthDepositions
virtual double pftools::ParticleDeposit::getTruthEnergy ( ) const
inlinevirtual

Definition at line 36 of file ParticleDeposit.h.

References myTruthEnergy.

36  {
37  return myTruthEnergy;
38  }
double ParticleDeposit::getTruthEnergy ( const DetectorElementPtr  de) const
virtual

Definition at line 60 of file ParticleDeposit.cc.

References assert(), ztail::d, relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), and myTruthDepositions.

60  {
61  double energy(0);
62  for (std::vector<Deposition>::const_iterator
63  cit = myTruthDepositions.begin(); cit!= myTruthDepositions.end(); ++cit) {
64  Deposition d = *cit;
65  if (d.getDetectorElement() == de) {
66  energy += d.getEnergy();
67  }
68  }
69  assert(!(energy > 0));
70  return energy;
71 
72 }
DetectorElementPtr getDetectorElement() const
Definition: Deposition.h:43
assert(m_qm.get())
double getEnergy() const
Definition: Deposition.h:38
tuple d
Definition: ztail.py:151
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
void pftools::ParticleDeposit::setEta ( const double  eta)
inline

Definition at line 76 of file ParticleDeposit.h.

References eta(), and myEta.

76  {
77  myEta = eta;
78  }
T eta() const
void pftools::ParticleDeposit::setPhi ( const double  phi)
inline

Definition at line 72 of file ParticleDeposit.h.

References myPhi, and phi.

72  {
73  myPhi = phi;
74  }
Definition: DDAxes.h:10
void ParticleDeposit::setRecEnergy ( const DetectorElementPtr  de,
double  energy 
)
virtual

Definition at line 48 of file ParticleDeposit.cc.

References ztail::d, pftools::Deposition::getDetectorElement(), myRecDepositions, and pftools::Deposition::setEnergy().

48  {
49  for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit
50  != myRecDepositions.end(); ++cit) {
51  Deposition d = *cit;
52 
53  if (d.getDetectorElement()->getType() == de->getType()) {
54  d.setEnergy(energy);
55  }
56 
57  }
58 }
DetectorElementPtr getDetectorElement() const
Definition: Deposition.h:43
tuple d
Definition: ztail.py:151
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 > myRecDepositions
void setEnergy(double energy)
Definition: Deposition.h:23
void pftools::ParticleDeposit::setTruthEnergy ( const double  truth)
inline

Definition at line 68 of file ParticleDeposit.h.

References myTruthEnergy.

68  {
69  myTruthEnergy = truth;
70  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const ParticleDeposit p 
)
friend

Member Data Documentation

unsigned ParticleDeposit::count = 0
staticprivate

Definition at line 85 of file ParticleDeposit.h.

Referenced by ParticleDeposit().

double pftools::ParticleDeposit::myEta
private

Definition at line 92 of file ParticleDeposit.h.

Referenced by getEta(), and setEta().

unsigned pftools::ParticleDeposit::myId
private

Definition at line 89 of file ParticleDeposit.h.

Referenced by getId().

double pftools::ParticleDeposit::myPhi
private

Definition at line 93 of file ParticleDeposit.h.

Referenced by getPhi(), and setPhi().

std::vector<Deposition> pftools::ParticleDeposit::myRecDepositions
private

Definition at line 87 of file ParticleDeposit.h.

Referenced by addRecDeposition(), getRecDepositions(), getRecEnergy(), and setRecEnergy().

std::vector<Deposition> pftools::ParticleDeposit::myTruthDepositions
private

Definition at line 88 of file ParticleDeposit.h.

Referenced by addTruthDeposition(), getTruthDepositions(), and getTruthEnergy().

double pftools::ParticleDeposit::myTruthEnergy
private
std::vector<ParticleDeposit*> pftools::ParticleDeposit::pdps_
private

Definition at line 98 of file ParticleDeposit.h.