Main Page
Namespaces
Classes
Package Documentation
RecoParticleFlow
PFClusterShapeProducer
interface
PFClusterShapeAlgo.h
Go to the documentation of this file.
1
#ifndef _RecoParticleFlow_PFClusterShapeProducer_PFClusterShapeAlgo_h_
2
#define _RecoParticleFlow_PFClusterShapeProducer_PFClusterShapeAlgo_h_
3
4
#include <map>
5
#include <algorithm>
6
7
#include "
DataFormats/Math/interface/Point3D.h
"
8
9
#include "
DataFormats/EgammaReco/interface/ClusterShape.h
"
10
#include "
DataFormats/EgammaReco/interface/ClusterShapeFwd.h
"
11
12
#include "
DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h
"
13
#include "
DataFormats/ParticleFlowReco/interface/PFRecHit.h
"
14
#include "
DataFormats/ParticleFlowReco/interface/PFClusterFwd.h
"
15
#include "
DataFormats/ParticleFlowReco/interface/PFCluster.h
"
16
#include "
DataFormats/ParticleFlowReco/interface/PFRecHitFraction.h
"
17
#include "
DataFormats/ParticleFlowReco/interface/PFClusterShapeAssociation.h
"
18
19
// Colin: corrected include for compiling in 1_7_X
20
// #include "FWCore/Framework/interface/Handle.h"
21
#include "
DataFormats/Common/interface/Handle.h
"
22
23
#include "
Geometry/CaloGeometry/interface/CaloGeometry.h
"
24
#include "
Geometry/CaloTopology/interface/EcalBarrelTopology.h
"
25
#include "
Geometry/CaloTopology/interface/EcalEndcapTopology.h
"
26
27
#include "
RecoCaloTools/Navigation/interface/CaloNavigator.h
"
28
29
30
struct
RecHitWithFraction
31
{
32
DetId
detId
;
33
double
energy
;
34
math::XYZVector
position
;
35
};
36
37
class
PFClusterShapeAlgo
38
{
39
typedef
std::map<DetId, RecHitWithFraction>
RecHitMap
;
40
41
enum
Direction
{
N
, NE, E, SE,
S
, SW,
W
, NW };
42
enum
GeomTopoIndex
{
BARREL
= 0,
ENDCAP
= 1 };
43
44
public
:
45
46
explicit
PFClusterShapeAlgo
(
bool
useFractions
,
double
w0);
47
48
~
PFClusterShapeAlgo
();
49
50
reco::ClusterShapeCollection
* makeClusterShapes(
edm::Handle<reco::PFClusterCollection>
clusterHandle,
51
edm::Handle<reco::PFRecHitCollection>
rechitHandle,
52
const
CaloSubdetectorGeometry
* barrelGeo_p,
53
const
CaloSubdetectorTopology
* barrelTop_p,
54
const
CaloSubdetectorGeometry
* endcapGeo_p,
55
const
CaloSubdetectorTopology
* endcapTop_p);
56
57
58
private
:
59
60
bool
useFractions_
;
61
double
w0_
;
62
63
unsigned
int
currentClusterIndex_
;
64
reco::PFClusterRef
currentCluster_p
;
65
edm::Handle<reco::PFRecHitCollection>
currentRecHit_v_p
;
66
67
unsigned
int
topoIndex
;
68
std::vector<const CaloSubdetectorTopology *>
topoVector
;
69
unsigned
int
geomIndex
;
70
std::vector<const CaloSubdetectorGeometry *>
geomVector
;
71
72
RecHitWithFraction
map5x5[5][5];
73
math::XYZVector
meanPosition_
;
74
double
totalE_
;
75
76
Direction
eMaxDir
;
// the direction of the highest-energy 2x2 subcluster
77
78
DetId
eMaxId_
, e2ndId_;
79
double
eMax_
, e2nd_;
80
double
e2x2_, e3x3_, e4x4_,
e5x5_
, e2x5Right_, e2x5Left_, e2x5Top_, e2x5Bottom_, e3x2_, e3x2Ratio_;
81
double
covEtaEta_, covEtaPhi_,
covPhiPhi_
;
82
83
reco::ClusterShape
makeClusterShape();
84
85
int
findPFRHIndexFromDetId(
unsigned
int
id
);
86
const
reco::PFRecHitFraction
* getFractionFromDetId(
const
DetId
&
id
);
87
88
void
fill5x5Map();
89
90
void
find_eMax_e2nd();
91
92
double
addMapEnergies(
int
etaIndexLow,
int
etaIndexHigh,
int
phiIndexLow,
int
phiIndexHigh);
93
94
void
find_e2x2();
95
void
find_e3x2();
96
void
find_e3x3();
97
void
find_e4x4();
98
void
find_e5x5();
99
100
void
find_e2x5Right();
// "Right" == "North" == greater Phi == greater navigator offset
101
void
find_e2x5Left();
102
void
find_e2x5Top();
// "Top" == "East" == lesser Eta == lesser navigator offset
103
void
find_e2x5Bottom();
104
105
void
covariances();
106
};
107
108
#endif
ENDCAP
Definition:
ElectronIdentifier.h:45
PFClusterShapeAlgo::RecHitMap
std::map< DetId, RecHitWithFraction > RecHitMap
Definition:
PFClusterShapeAlgo.h:39
PFClusterShapeAlgo::eMaxId_
DetId eMaxId_
Definition:
PFClusterShapeAlgo.h:78
RecHitWithFraction::position
math::XYZVector position
Definition:
PFClusterShapeAlgo.h:34
RecHitWithFraction
Definition:
PFClusterShapeAlgo.h:30
PFRecHit.h
PFRecHitFwd.h
PFClusterFwd.h
CaloSubdetectorGeometry
Definition:
CaloSubdetectorGeometry.h:25
edm::Ref< PFClusterCollection >
ClusterShape.h
edm::Handle< reco::PFClusterCollection >
PFClusterShapeAlgo::W
Definition:
PFClusterShapeAlgo.h:41
PFClusterShapeAlgo::eMaxDir
Direction eMaxDir
Definition:
PFClusterShapeAlgo.h:76
reco::PFRecHitFraction
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
Definition:
PFRecHitFraction.h:19
reco::ClusterShapeCollection
std::vector< ClusterShape > ClusterShapeCollection
collection of ClusterShape objects
Definition:
ClusterShapeFwd.h:8
PFClusterShapeAlgo::geomIndex
unsigned int geomIndex
Definition:
PFClusterShapeAlgo.h:69
pfClusterShapes_cfi.useFractions
useFractions
Definition:
pfClusterShapes_cfi.py:7
PFCluster.h
Point3D.h
PFClusterShapeAlgo::meanPosition_
math::XYZVector meanPosition_
Definition:
PFClusterShapeAlgo.h:73
PFClusterShapeAlgo::useFractions_
bool useFractions_
Definition:
PFClusterShapeAlgo.h:60
CaloNavigator.h
PFClusterShapeAlgo::geomVector
std::vector< const CaloSubdetectorGeometry * > geomVector
Definition:
PFClusterShapeAlgo.h:70
PFClusterShapeAlgo
Definition:
PFClusterShapeAlgo.h:37
EcalBarrelTopology.h
EcalEndcapTopology.h
ClusterShapeFwd.h
RecHitWithFraction::energy
double energy
Definition:
PFClusterShapeAlgo.h:33
CaloSubdetectorTopology
Definition:
CaloSubdetectorTopology.h:20
PFClusterShapeAlgo::currentCluster_p
reco::PFClusterRef currentCluster_p
Definition:
PFClusterShapeAlgo.h:64
PFClusterShapeAssociation.h
PFClusterShapeAlgo::currentClusterIndex_
unsigned int currentClusterIndex_
Definition:
PFClusterShapeAlgo.h:63
DetId
Definition:
DetId.h:18
PFClusterShapeAlgo::currentRecHit_v_p
edm::Handle< reco::PFRecHitCollection > currentRecHit_v_p
Definition:
PFClusterShapeAlgo.h:65
N
#define N
Definition:
blowfish.cc:9
CaloGeometry.h
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition:
Vector3D.h:30
PFClusterShapeAlgo::w0_
double w0_
Definition:
PFClusterShapeAlgo.h:61
PFClusterShapeAlgo::eMax_
double eMax_
Definition:
PFClusterShapeAlgo.h:79
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
PFClusterShapeAlgo::topoVector
std::vector< const CaloSubdetectorTopology * > topoVector
Definition:
PFClusterShapeAlgo.h:68
PFClusterShapeAlgo::GeomTopoIndex
GeomTopoIndex
Definition:
PFClusterShapeAlgo.h:42
PFClusterShapeAlgo::Direction
Direction
Definition:
PFClusterShapeAlgo.h:41
BARREL
Definition:
ElectronIdentifier.h:44
reco::ClusterShape
Definition:
ClusterShape.h:21
PFClusterShapeAlgo::covPhiPhi_
double covPhiPhi_
Definition:
PFClusterShapeAlgo.h:81
PFClusterShapeAlgo::topoIndex
unsigned int topoIndex
Definition:
PFClusterShapeAlgo.h:67
PFClusterShapeAlgo::totalE_
double totalE_
Definition:
PFClusterShapeAlgo.h:74
RecHitWithFraction::detId
DetId detId
Definition:
PFClusterShapeAlgo.h:32
PFRecHitFraction.h
PFClusterShapeAlgo::e5x5_
double e5x5_
Definition:
PFClusterShapeAlgo.h:80
Handle.h
Generated for CMSSW Reference Manual by
1.8.11