test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Calibrator.h
Go to the documentation of this file.
1 #ifndef CALIBRATOR_HH_
2 #define CALIBRATOR_HH_
3 
7 
8 #include <map>
9 #include <vector>
10 #include <boost/shared_ptr.hpp>
11 
12 namespace pftools {
13 
21 class Calibrator {
22 public:
23 
24  Calibrator();
25  virtual ~Calibrator();
26 
28 
30 
31  /*
32  * Returns the calibration coefficient for each detector element, using data
33  * from all particle depositions stored within.
34  */
35  std::map<DetectorElementPtr, double> getCalibrationCoefficients() throw(
38  }
39 
40  /*
41  * Here we use the virtual constructor idea to allow for plug-and-play Calibrators
42  * See http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.8
43  */
44  virtual Calibrator* clone() const = 0;
45  virtual Calibrator* create() const = 0;
46 
47  int hasParticles() const {
48  return myParticleDeposits.size();
49  }
50 
51  std::vector<ParticleDepositPtr> getParticles() {
52  return myParticleDeposits;
53  }
54 
55 
56 
57 protected:
58  virtual std::map<DetectorElementPtr, double>
60 
63 };
64 
65 typedef boost::shared_ptr<Calibrator> CalibratorPtr;
66 
67 }
68 
69 #endif /*CALIBRATOR_HH_*/
std::map< DetectorElementPtr, double > getCalibrationCoefficients()
Definition: Calibrator.h:35
std::vector< ParticleDepositPtr > myParticleDeposits
Definition: Calibrator.h:62
std::vector< ParticleDepositPtr > getParticles()
Definition: Calibrator.h:51
boost::shared_ptr< ParticleDeposit > ParticleDepositPtr
virtual Calibrator * create() const =0
int hasParticles() const
Definition: Calibrator.h:47
void addParticleDeposit(ParticleDepositPtr pd)
Definition: Calibrator.cc:17
boost::shared_ptr< Calibrator > CalibratorPtr
Definition: Calibrator.h:65
boost::shared_ptr< DetectorElement > DetectorElementPtr
Abstract base class for Particle Flow calibration algorithms.
Definition: Calibrator.h:21
virtual Calibrator * clone() const =0
General purpose exception class for use by classes in the pftools namespace.
std::vector< DetectorElementPtr > myDetectorElements
Definition: Calibrator.h:61
virtual std::map< DetectorElementPtr, double > getCalibrationCoefficientsCore()
Definition: Calibrator.cc:21
virtual ~Calibrator()
Definition: Calibrator.cc:10
void addDetectorElement(DetectorElementPtr const de)
Definition: Calibrator.cc:13