CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
74  double totalE_;
75 
76  Direction eMaxDir; // the direction of the highest-energy 2x2 subcluster
77 
79  double eMax_, e2nd_;
82 
84 
85  int findPFRHIndexFromDetId(unsigned int 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
reco::ClusterShape makeClusterShape()
Fraction of a PFRecHit (rechits can be shared between several PFCluster&#39;s)
std::vector< ClusterShape > ClusterShapeCollection
collection of ClusterShape objects
int findPFRHIndexFromDetId(unsigned int id)
math::XYZVector meanPosition_
std::vector< const CaloSubdetectorGeometry * > geomVector
reco::ClusterShapeCollection * makeClusterShapes(edm::Handle< reco::PFClusterCollection > clusterHandle, edm::Handle< reco::PFRecHitCollection > rechitHandle, const CaloSubdetectorGeometry *barrelGeo_p, const CaloSubdetectorTopology *barrelTop_p, const CaloSubdetectorGeometry *endcapGeo_p, const CaloSubdetectorTopology *endcapTop_p)
RecHitWithFraction map5x5[5][5]
reco::PFClusterRef currentCluster_p
unsigned int currentClusterIndex_
Definition: DetId.h:18
edm::Handle< reco::PFRecHitCollection > currentRecHit_v_p
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< const CaloSubdetectorTopology * > topoVector
double addMapEnergies(int etaIndexLow, int etaIndexHigh, int phiIndexLow, int phiIndexHigh)
const reco::PFRecHitFraction * getFractionFromDetId(const DetId &id)
PFClusterShapeAlgo(bool useFractions, double w0)