#include <ParticleDeposit.h>
Public Member Functions | |
virtual void | addRecDeposition (Deposition rec) |
virtual void | addTruthDeposition (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< Deposition > | getTruthDepositions () const |
virtual double | getTruthEnergy (const DetectorElementPtr de) const |
virtual double | getTruthEnergy () 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< Deposition > | myRecDepositions |
std::vector< Deposition > | myTruthDepositions |
double | myTruthEnergy |
std::vector< ParticleDeposit * > | pdps_ |
Static Private Attributes | |
static unsigned | count = 0 |
Friends | |
std::ostream & | operator<< (std::ostream &s, const ParticleDeposit &p) |
Definition at line 21 of file ParticleDeposit.h.
ParticleDeposit::ParticleDeposit | ( | double | truthEnergy = -1.0 , |
double | eta = 0 , |
||
double | phi = 0 |
||
) |
ParticleDeposit::~ParticleDeposit | ( | ) | [virtual] |
Definition at line 15 of file ParticleDeposit.cc.
{ }
void ParticleDeposit::addRecDeposition | ( | Deposition | rec | ) | [virtual] |
Definition at line 18 of file ParticleDeposit.cc.
References myRecDepositions.
{ myRecDepositions.push_back(rec); }
void ParticleDeposit::addTruthDeposition | ( | Deposition | truth | ) | [virtual] |
Definition at line 22 of file ParticleDeposit.cc.
References myTruthDepositions.
{ myTruthDepositions.push_back(truth); }
double ParticleDeposit::getEnergyResolution | ( | ) | const [virtual] |
Definition at line 91 of file ParticleDeposit.cc.
References getRecEnergy(), myTruthEnergy, and mathSSE::sqrt().
{ //assert(!(getRecEnergy() / myTruthEnergy < 0.0)); return fabs((getRecEnergy() - myTruthEnergy) / sqrt(myTruthEnergy)); }
double pftools::ParticleDeposit::getEta | ( | ) | const [inline] |
virtual unsigned pftools::ParticleDeposit::getId | ( | ) | const [inline, virtual] |
virtual double pftools::ParticleDeposit::getPhi | ( | ) | const [inline, virtual] |
const std::vector< Deposition > & ParticleDeposit::getRecDepositions | ( | ) | const [virtual] |
Definition at line 30 of file ParticleDeposit.cc.
References myRecDepositions.
{ return myRecDepositions; }
double ParticleDeposit::getRecEnergy | ( | const DetectorElementPtr | de | ) | const [virtual] |
Definition at line 34 of file ParticleDeposit.cc.
References relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), pftools::Deposition::getEta(), pftools::Deposition::getPhi(), and myRecDepositions.
{ double energy(0); for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit != myRecDepositions.end(); ++cit) { Deposition d = *cit; if (d.getDetectorElement()->getType() == de->getType()) { energy += de->getCalib(d.getEta(), d.getPhi()) * d.getEnergy(); } } return energy; }
double ParticleDeposit::getRecEnergy | ( | ) | const [virtual] |
Definition at line 74 of file ParticleDeposit.cc.
References relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), pftools::Deposition::getEta(), pftools::Deposition::getPhi(), and myRecDepositions.
Referenced by getEnergyResolution(), and getTargetFunctionContrib().
{ double energy(0); for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit != myRecDepositions.end(); ++cit) { Deposition d = *cit; // if (d.getDetectorElement()->getType() == OFFSET && d.getDetectorElement()->getCalib() == 1.0) { // //don't add a tiny amount! // } else { energy += d.getDetectorElement()->getCalib(d.getEta(), d.getPhi()) * d.getEnergy(); // } } //assert(!(energy < 0)); return energy; }
double ParticleDeposit::getTargetFunctionContrib | ( | ) | const |
Definition at line 96 of file ParticleDeposit.cc.
References getRecEnergy(), myTruthEnergy, and funct::pow().
{ //assert(!(getRecEnergy() / myTruthEnergy < 0.0)); return pow((getRecEnergy() - myTruthEnergy), 2); }
std::vector< Deposition > ParticleDeposit::getTruthDepositions | ( | ) | const [virtual] |
Definition at line 26 of file ParticleDeposit.cc.
References myTruthDepositions.
{ return myTruthDepositions; }
double ParticleDeposit::getTruthEnergy | ( | const DetectorElementPtr | de | ) | const [virtual] |
Definition at line 60 of file ParticleDeposit.cc.
References relval_parameters_module::energy, pftools::Deposition::getDetectorElement(), pftools::Deposition::getEnergy(), and myTruthDepositions.
{ double energy(0); for (std::vector<Deposition>::const_iterator cit = myTruthDepositions.begin(); cit!= myTruthDepositions.end(); ++cit) { Deposition d = *cit; if (d.getDetectorElement() == de) { energy += d.getEnergy(); } } assert(!(energy > 0)); return energy; }
virtual double pftools::ParticleDeposit::getTruthEnergy | ( | ) | const [inline, virtual] |
Definition at line 36 of file ParticleDeposit.h.
References myTruthEnergy.
{ return myTruthEnergy; }
void pftools::ParticleDeposit::setEta | ( | const double | eta | ) | [inline] |
void pftools::ParticleDeposit::setPhi | ( | const double | phi | ) | [inline] |
void ParticleDeposit::setRecEnergy | ( | const DetectorElementPtr | de, |
double | energy | ||
) | [virtual] |
Definition at line 48 of file ParticleDeposit.cc.
References pftools::Deposition::getDetectorElement(), myRecDepositions, and pftools::Deposition::setEnergy().
{ for (std::vector<Deposition>::const_iterator cit = myRecDepositions.begin(); cit != myRecDepositions.end(); ++cit) { Deposition d = *cit; if (d.getDetectorElement()->getType() == de->getType()) { d.setEnergy(energy); } } }
void pftools::ParticleDeposit::setTruthEnergy | ( | const double | truth | ) | [inline] |
Definition at line 68 of file ParticleDeposit.h.
References myTruthEnergy.
{ myTruthEnergy = truth; }
std::ostream& operator<< | ( | std::ostream & | s, |
const ParticleDeposit & | p | ||
) | [friend] |
unsigned ParticleDeposit::count = 0 [static, private] |
Definition at line 85 of file ParticleDeposit.h.
Referenced by ParticleDeposit().
double pftools::ParticleDeposit::myEta [private] |
Definition at line 92 of file ParticleDeposit.h.
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.
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] |
Definition at line 91 of file ParticleDeposit.h.
Referenced by getEnergyResolution(), getTargetFunctionContrib(), getTruthEnergy(), and setTruthEnergy().
std::vector<ParticleDeposit*> pftools::ParticleDeposit::pdps_ [private] |
Definition at line 98 of file ParticleDeposit.h.