-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
ECAL2DPositionCalcWithDepthCorr.h
71 lines (58 loc) · 2.58 KB
/
ECAL2DPositionCalcWithDepthCorr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef __ECAL2DPositionCalcWithDepthCorr_H__
#define __ECAL2DPositionCalcWithDepthCorr_H__
#include "RecoParticleFlow/PFClusterProducer/interface/PFCPositionCalculatorBase.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "RecoParticleFlow/PFClusterProducer/interface/CaloRecHitResolutionProvider.h"
/// This is EGM version of the ECAL position + depth correction calculation
class ECAL2DPositionCalcWithDepthCorr : public PFCPositionCalculatorBase {
public:
ECAL2DPositionCalcWithDepthCorr(const edm::ParameterSet& conf) :
PFCPositionCalculatorBase(conf),
_param_T0_EB(conf.getParameter<double>("T0_EB")),
_param_T0_EE(conf.getParameter<double>("T0_EE")),
_param_T0_ES(conf.getParameter<double>("T0_ES")),
_param_W0(conf.getParameter<double>("W0")),
_param_X0(conf.getParameter<double>("X0")),
_minAllowedNorm(conf.getParameter<double>("minAllowedNormalization")),
_ebGeom(NULL),
_eeGeom(NULL),
_esGeom(NULL),
_esPlus(false),
_esMinus(false) {
_timeResolutionCalc.reset(NULL);
if( conf.exists("timeResolutionCalc") ) {
const edm::ParameterSet& timeResConf =
conf.getParameterSet("timeResolutionCalc");
_timeResolutionCalc.reset(new CaloRecHitResolutionProvider(timeResConf));
}
}
ECAL2DPositionCalcWithDepthCorr(const ECAL2DPositionCalcWithDepthCorr&) = delete;
ECAL2DPositionCalcWithDepthCorr& operator=(const ECAL2DPositionCalcWithDepthCorr&) = delete;
void update(const edm::EventSetup& es);
void calculateAndSetPosition(reco::PFCluster&);
void calculateAndSetPositions(reco::PFClusterCollection&);
private:
const double _param_T0_EB;
const double _param_T0_EE;
const double _param_T0_ES;
const double _param_W0;
const double _param_X0;
const double _minAllowedNorm;
//const CaloGeometryRecord _caloGeom;
const CaloSubdetectorGeometry* _ebGeom;
const CaloSubdetectorGeometry* _eeGeom;
const CaloSubdetectorGeometry* _esGeom;
bool _esPlus, _esMinus;
std::unique_ptr<CaloRecHitResolutionProvider> _timeResolutionCalc;
void calculateAndSetPositionActual(reco::PFCluster&) const;
};
DEFINE_EDM_PLUGIN(PFCPositionCalculatorFactory,
ECAL2DPositionCalcWithDepthCorr,
"ECAL2DPositionCalcWithDepthCorr");
#endif