Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
RecoParticleFlow
PFClusterTools
interface
Calibrator.h
Go to the documentation of this file.
1
#ifndef CALIBRATOR_HH_
2
#define CALIBRATOR_HH_
3
4
#include "
RecoParticleFlow/PFClusterTools/interface/DetectorElement.h
"
5
#include "
RecoParticleFlow/PFClusterTools/interface/ParticleDeposit.h
"
6
#include "
RecoParticleFlow/PFClusterTools/interface/PFToolsException.h
"
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
27
void
addDetectorElement
(
DetectorElementPtr
const
de);
28
29
void
addParticleDeposit
(
ParticleDepositPtr
pd);
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
(
36
PFToolsException
&) {
37
return
getCalibrationCoefficientsCore
();
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>
59
getCalibrationCoefficientsCore
()
throw
(
PFToolsException
&);
60
61
std::vector<
DetectorElementPtr
>
myDetectorElements
;
62
std::vector<
ParticleDepositPtr
>
myParticleDeposits
;
63
};
64
65
typedef boost::shared_ptr<
Calibrator
>
CalibratorPtr
;
66
67
}
68
69
#endif
/*CALIBRATOR_HH_*/
pftools::Calibrator::getCalibrationCoefficients
std::map< DetectorElementPtr, double > getCalibrationCoefficients()
Definition:
Calibrator.h:35
pftools::Calibrator::myParticleDeposits
std::vector< ParticleDepositPtr > myParticleDeposits
Definition:
Calibrator.h:62
pftools::Calibrator::getParticles
std::vector< ParticleDepositPtr > getParticles()
Definition:
Calibrator.h:51
pftools::ParticleDepositPtr
boost::shared_ptr< ParticleDeposit > ParticleDepositPtr
Definition:
ParticleDeposit.h:103
DetectorElement.h
ParticleDeposit.h
pftools::Calibrator::create
virtual Calibrator * create() const =0
pftools::Calibrator::hasParticles
int hasParticles() const
Definition:
Calibrator.h:47
pftools::Calibrator::Calibrator
Calibrator()
Definition:
Calibrator.cc:6
pftools::Calibrator::addParticleDeposit
void addParticleDeposit(ParticleDepositPtr pd)
Definition:
Calibrator.cc:17
pftools::CalibratorPtr
boost::shared_ptr< Calibrator > CalibratorPtr
Definition:
Calibrator.h:65
pftools::DetectorElementPtr
boost::shared_ptr< DetectorElement > DetectorElementPtr
Definition:
DetectorElement.h:83
pftools::Calibrator
Abstract base class for Particle Flow calibration algorithms.
Definition:
Calibrator.h:21
pftools::Calibrator::clone
virtual Calibrator * clone() const =0
pftools::PFToolsException
General purpose exception class for use by classes in the pftools namespace.
Definition:
PFToolsException.h:14
pftools::Calibrator::myDetectorElements
std::vector< DetectorElementPtr > myDetectorElements
Definition:
Calibrator.h:61
PFToolsException.h
pftools::Calibrator::getCalibrationCoefficientsCore
virtual std::map< DetectorElementPtr, double > getCalibrationCoefficientsCore()
Definition:
Calibrator.cc:21
pftools::Calibrator::~Calibrator
virtual ~Calibrator()
Definition:
Calibrator.cc:10
pftools::Calibrator::addDetectorElement
void addDetectorElement(DetectorElementPtr const de)
Definition:
Calibrator.cc:13
CommPDSkim_cfg.throw
tuple throw
Definition:
CommPDSkim_cfg.py:101
Generated for CMSSW Reference Manual by
1.8.5