test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoParticleFlow
PFClusterTools
interface
SpaceManager.h
Go to the documentation of this file.
1
#ifndef SPACEMANAGER_HH_
2
#define SPACEMANAGER_HH_
3
#include "
RecoParticleFlow/PFClusterTools/interface/SpaceVoxel.h
"
4
#include "
RecoParticleFlow/PFClusterTools/interface/Calibrator.h
"
5
#include "
RecoParticleFlow/PFClusterTools/interface/DetectorElement.h
"
6
#include "
RecoParticleFlow/PFClusterTools/interface/Region.h
"
7
#include <map>
8
#include <vector>
9
#include <boost/shared_ptr.hpp>
10
#include <iostream>
11
#include <TGraph.h>
12
#include <TF1.h>
13
#include <TF2.h>
14
#include <string>
15
namespace
pftools {
23
class
SpaceManager
{
24
public
:
25
SpaceManager
(
std::string
name
);
26
27
virtual
~SpaceManager
();
28
29
std::string
getName
() {
30
return
name_
;
31
}
32
33
34
/*
35
* Initialises the internal map of calibrators and space voxels according to the
36
* type of calibrator supplied and the specified eta, phi and energy segmentation.
37
*/
38
void
createCalibrators
(
const
Calibrator
& toClone,
const
double
etaSeg,
39
const
double
phiSeg,
const
double
energySeg);
40
41
/*
42
* As above but only for the specified ranges.
43
* (Compare with ROOT TH3F histogram constructor!)
44
*/
45
void
createCalibrators
(
const
Calibrator
& toClone,
const
unsigned
nEta
,
46
const
double
etaMin
,
const
double
etaMax
,
const
unsigned
nPhi
,
47
const
double
phiMin,
const
double
phiMax,
const
unsigned
nEnergy,
48
const
double
energyMin,
const
double
energyMax)
throw
(
PFToolsException
&);
49
50
void
createCalibrators
(
const
Calibrator
& toClone);
51
52
std::map<SpaceVoxelPtr, CalibratorPtr>*
getCalibrators
() {
53
std::map<SpaceVoxelPtr, CalibratorPtr>* ptr = &
myAddressBook
;
54
return
ptr;
55
}
56
57
/*
58
* Adds a calibrator for the specified volume element.
59
* Returns a pointer to it once it's been created, and returns a pointer to
60
* any exisitng calibrator should that SpaceVoxel already exist.
61
*/
62
CalibratorPtr
createCalibrator
(
const
Calibrator
& toClone,
SpaceVoxelPtr
s
);
63
64
/*
65
* Returns a pointer to the calibrator you need for the specified space point.
66
* Returns 0 if it's not found.
67
*/
68
CalibratorPtr
findCalibrator
(
const
double
eta
,
const
double
phi,
69
const
double
energy
= 0)
const
;
70
71
void
assignCalibration
(
const
CalibratorPtr
&
c
,
const
std::map<DetectorElementPtr, double>&
result
);
72
73
std::map<DetectorElementPtr, double>
getCalibration
(
CalibratorPtr
c
);
74
75
std::ostream&
printCalibrations
(std::ostream& stream);
76
77
TH1*
extractEvolution
(
DetectorElementPtr
det,
Region
region
, TF1&
f1
,
bool
useTruth =
true
);
78
79
void
addEvolution
(
const
DetectorElementPtr
& det,
Region
region
,
const
TF1&
f
) {
80
if
(region ==
BARREL_POS
)
81
barrelPosEvolutions_
[det] =
f
;
82
if
(region ==
ENDCAP_POS
)
83
endcapPosEvolutions_
[det] =
f
;
84
}
85
86
double
interpolateCoefficient
(
DetectorElementPtr
det,
double
energy
,
double
eta
,
double
phi);
87
88
double
evolveCoefficient
(
DetectorElementPtr
det,
double
energy
,
double
eta
,
double
phi);
89
90
int
getNCalibrations
() {
91
return
calibrationCoeffs_
.size();
92
}
93
void
clear
();
94
95
void
makeInverseAddressBook
();
96
97
void
setBarrelLimit
(
double
limit
) {
98
barrelLimit_
=
limit
;
99
}
100
101
private
:
102
103
std::string
name_
;
104
105
double
barrelLimit_
;
106
double
transitionLimit_
;
107
double
endcapLimit_
;
108
109
std::map<SpaceVoxelPtr, CalibratorPtr>
myAddressBook
;
110
std::map<CalibratorPtr, SpaceVoxelPtr>
inverseAddressBook_
;
111
std::map<CalibratorPtr, std::map<DetectorElementPtr, double> >
calibrationCoeffs_
;
112
std::vector<SpaceVoxelPtr>
myKnownSpaceVoxels
;
113
114
std::vector<SpaceVoxelPtr>
barrelPosRegion_
;
115
std::vector<SpaceVoxelPtr>
transitionPosRegion_
;
116
std::vector<SpaceVoxelPtr>
endcapPosRegion_
;
117
118
std::map<DetectorElementPtr, TF1>
barrelPosEvolutions_
;
119
std::map<DetectorElementPtr, TF1>
endcapPosEvolutions_
;
120
121
std::map<Region, std::vector<SpaceVoxelPtr> >
regionsToSVs_
;
122
123
124
};
125
126
typedef
boost::shared_ptr<SpaceManager>
SpaceManagerPtr
;
127
128
}
129
#endif
/*SPACEMANAGER_HH_*/
pftools::SpaceManager::barrelPosRegion_
std::vector< SpaceVoxelPtr > barrelPosRegion_
Definition:
SpaceManager.h:114
pftools::SpaceManager::clear
void clear()
Definition:
SpaceManager.cc:22
pftools::SpaceManager::~SpaceManager
virtual ~SpaceManager()
Definition:
SpaceManager.cc:18
pftools::SpaceManager::myKnownSpaceVoxels
std::vector< SpaceVoxelPtr > myKnownSpaceVoxels
Definition:
SpaceManager.h:112
pftools::BARREL_POS
Definition:
Region.h:8
pftools::SpaceManager::regionsToSVs_
std::map< Region, std::vector< SpaceVoxelPtr > > regionsToSVs_
Definition:
SpaceManager.h:121
Calibrator.h
pftools::SpaceManager::getNCalibrations
int getNCalibrations()
Definition:
SpaceManager.h:90
HLT_25ns10e33_v2_cff.nEta
tuple nEta
Definition:
HLT_25ns10e33_v2_cff.py:2904
pftools::SpaceManager::getCalibrators
std::map< SpaceVoxelPtr, CalibratorPtr > * getCalibrators()
Definition:
SpaceManager.h:52
MessageLogger_cff.limit
tuple limit
Definition:
MessageLogger_cff.py:11
pftools::SpaceManager::myAddressBook
std::map< SpaceVoxelPtr, CalibratorPtr > myAddressBook
Definition:
SpaceManager.h:109
pftools::SpaceManager
A tool to associate SpaceVoxels with Calibrator objects.
Definition:
SpaceManager.h:23
pftools::SpaceManager::barrelPosEvolutions_
std::map< DetectorElementPtr, TF1 > barrelPosEvolutions_
Definition:
SpaceManager.h:118
EnergyCorrector.c
tuple c
Definition:
EnergyCorrector.py:43
pftools::SpaceManager::evolveCoefficient
double evolveCoefficient(DetectorElementPtr det, double energy, double eta, double phi)
Definition:
SpaceManager.cc:320
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
mps_fire.result
tuple result
Definition:
mps_fire.py:84
pftools::SpaceManager::setBarrelLimit
void setBarrelLimit(double limit)
Definition:
SpaceManager.h:97
pftools::SpaceManager::transitionPosRegion_
std::vector< SpaceVoxelPtr > transitionPosRegion_
Definition:
SpaceManager.h:115
pftools::SpaceManagerPtr
boost::shared_ptr< SpaceManager > SpaceManagerPtr
Definition:
SpaceManager.h:126
pftools::SpaceManager::createCalibrator
CalibratorPtr createCalibrator(const Calibrator &toClone, SpaceVoxelPtr s)
Definition:
SpaceManager.cc:213
DetectorElement.h
pftools::SpaceManager::calibrationCoeffs_
std::map< CalibratorPtr, std::map< DetectorElementPtr, double > > calibrationCoeffs_
Definition:
SpaceManager.h:111
pftools::Region
Region
Definition:
Region.h:7
pftools::SpaceManager::transitionLimit_
double transitionLimit_
Definition:
SpaceManager.h:106
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
pftools::SpaceManager::makeInverseAddressBook
void makeInverseAddressBook()
Definition:
SpaceManager.cc:393
pftools::SpaceManager::createCalibrators
void createCalibrators(const Calibrator &toClone, const double etaSeg, const double phiSeg, const double energySeg)
Definition:
SpaceManager.cc:30
validate-o2o-wbm.f1
tuple f1
Definition:
validate-o2o-wbm.py:5
pftools::CalibratorPtr
boost::shared_ptr< Calibrator > CalibratorPtr
Definition:
Calibrator.h:65
pftools::DetectorElementPtr
boost::shared_ptr< DetectorElement > DetectorElementPtr
Definition:
DetectorElement.h:83
pftools::SpaceManager::getName
std::string getName()
Definition:
SpaceManager.h:29
eta
Definition:
HIMultiTrackSelector.h:42
pftools::Calibrator
Abstract base class for Particle Flow calibration algorithms.
Definition:
Calibrator.h:21
pftools::PFToolsException
General purpose exception class for use by classes in the pftools namespace.
Definition:
PFToolsException.h:14
pftools::SpaceManager::getCalibration
std::map< DetectorElementPtr, double > getCalibration(CalibratorPtr c)
Definition:
SpaceManager.cc:252
pftools::SpaceManager::extractEvolution
TH1 * extractEvolution(DetectorElementPtr det, Region region, TF1 &f1, bool useTruth=true)
Definition:
SpaceManager.cc:256
HLT_25ns10e33_v2_cff.region
tuple region
Definition:
HLT_25ns10e33_v2_cff.py:61599
pftools::SpaceManager::endcapPosRegion_
std::vector< SpaceVoxelPtr > endcapPosRegion_
Definition:
SpaceManager.h:116
Region.h
pftools::SpaceManager::assignCalibration
void assignCalibration(const CalibratorPtr &c, const std::map< DetectorElementPtr, double > &result)
Definition:
SpaceManager.cc:246
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
HLT_25ns10e33_v2_cff.nPhi
tuple nPhi
Definition:
HLT_25ns10e33_v2_cff.py:2905
pftools::SpaceManager::findCalibrator
CalibratorPtr findCalibrator(const double eta, const double phi, const double energy=0) const
Definition:
SpaceManager.cc:229
pftools::ENDCAP_POS
Definition:
Region.h:8
pftools::SpaceManager::name_
std::string name_
Definition:
SpaceManager.h:103
pftools::SpaceManager::barrelLimit_
double barrelLimit_
Definition:
SpaceManager.h:105
pftools::SpaceManager::endcapLimit_
double endcapLimit_
Definition:
SpaceManager.h:107
SpaceVoxel.h
relval_parameters_module.energy
string energy
Definition:
relval_parameters_module.py:29
pftools::SpaceManager::endcapPosEvolutions_
std::map< DetectorElementPtr, TF1 > endcapPosEvolutions_
Definition:
SpaceManager.h:119
HLT_25ns10e33_v2_cff.etaMax
tuple etaMax
Definition:
HLT_25ns10e33_v2_cff.py:8668
pftools::SpaceManager::SpaceManager
SpaceManager(std::string name)
Definition:
SpaceManager.cc:12
pftools::SpaceManager::interpolateCoefficient
double interpolateCoefficient(DetectorElementPtr det, double energy, double eta, double phi)
Definition:
SpaceManager.cc:330
HLT_25ns10e33_v2_cff.etaMin
tuple etaMin
Definition:
HLT_25ns10e33_v2_cff.py:8667
pftools::SpaceManager::printCalibrations
std::ostream & printCalibrations(std::ostream &stream)
Definition:
SpaceManager.cc:368
pftools::SpaceManager::inverseAddressBook_
std::map< CalibratorPtr, SpaceVoxelPtr > inverseAddressBook_
Definition:
SpaceManager.h:110
pftools::SpaceVoxelPtr
boost::shared_ptr< SpaceVoxel > SpaceVoxelPtr
Definition:
SpaceVoxel.h:89
pftools::SpaceManager::addEvolution
void addEvolution(const DetectorElementPtr &det, Region region, const TF1 &f)
Definition:
SpaceManager.h:79
Generated for CMSSW Reference Manual by
1.8.5