CMS 3D CMS Logo

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() noexcept(false) {
37  }
38 
39  /*
40  * Here we use the virtual constructor idea to allow for plug-and-play Calibrators
41  * See http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.8
42  */
43  virtual Calibrator* clone() const = 0;
44  virtual Calibrator* create() const = 0;
45 
46  int hasParticles() const {
47  return myParticleDeposits.size();
48  }
49 
50  std::vector<ParticleDepositPtr> getParticles() {
51  return myParticleDeposits;
52  }
53 
54 
55 
56 protected:
57  virtual std::map<DetectorElementPtr, double>
59 
60  std::vector<DetectorElementPtr> myDetectorElements;
61  std::vector<ParticleDepositPtr> myParticleDeposits;
62 };
63 
64 typedef boost::shared_ptr<Calibrator> CalibratorPtr;
65 
66 }
67 
68 #endif /*CALIBRATOR_HH_*/
std::vector< ParticleDepositPtr > myParticleDeposits
Definition: Calibrator.h:61
std::vector< ParticleDepositPtr > getParticles()
Definition: Calibrator.h:50
#define noexcept
boost::shared_ptr< ParticleDeposit > ParticleDepositPtr
virtual Calibrator * create() const =0
int hasParticles() const
Definition: Calibrator.h:46
void addParticleDeposit(ParticleDepositPtr pd)
Definition: Calibrator.cc:17
boost::shared_ptr< Calibrator > CalibratorPtr
Definition: Calibrator.h:64
boost::shared_ptr< DetectorElement > DetectorElementPtr
Abstract base class for Particle Flow calibration algorithms.
Definition: Calibrator.h:21
General option file parser.
Definition: Calibratable.h:15
std::vector< DetectorElementPtr > myDetectorElements
Definition: Calibrator.h:60
virtual std::map< DetectorElementPtr, double > getCalibrationCoefficientsCore() noexcept(false)
Definition: Calibrator.cc:21
virtual Calibrator * clone() const =0
virtual ~Calibrator()
Definition: Calibrator.cc:10
std::map< DetectorElementPtr, double > getCalibrationCoefficients() noexcept(false)
Definition: Calibrator.h:35
void addDetectorElement(DetectorElementPtr const de)
Definition: Calibrator.cc:13