CMS 3D CMS Logo

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 
8 
11 
18 
19 // Colin: corrected include for compiling in 1_7_X
20 // #include "FWCore/Framework/interface/Handle.h"
22 
26 
28 
29 
31 {
33  double energy;
35 };
36 
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 
49 
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 
61  double w0_;
62 
63  unsigned int currentClusterIndex_;
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];
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
std::map< DetId, RecHitWithFraction > RecHitMap
math::XYZVector position
Fraction of a PFRecHit (rechits can be shared between several PFCluster&#39;s)
std::vector< ClusterShape > ClusterShapeCollection
collection of ClusterShape objects
math::XYZVector meanPosition_
std::vector< const CaloSubdetectorGeometry * > geomVector
reco::PFClusterRef currentCluster_p
unsigned int currentClusterIndex_
Definition: DetId.h:18
edm::Handle< reco::PFRecHitCollection > currentRecHit_v_p
#define N
Definition: blowfish.cc:9
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
std::vector< const CaloSubdetectorTopology * > topoVector