CMS 3D CMS Logo

PixelCPEClusterRepair.h
Go to the documentation of this file.
1 #ifndef RecoLocalTracker_SiPixelRecHits_PixelCPEClusterRepair_H
2 #define RecoLocalTracker_SiPixelRecHits_PixelCPEClusterRepair_H
3 
5 
6 // Already in the base class
7 //#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
8 //#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
9 //#include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
10 //#include "Geometry/CommonDetAlgo/interface/MeasurementPoint.h"
11 //#include "Geometry/CommonDetAlgo/interface/MeasurementError.h"
12 //#include "Geometry/Surface/interface/GloballyPositioned.h"
13 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
14 
15 // The template header files
16 //
22 
23 #include <utility>
24 #include <vector>
25 
26 
27 #if 0
28 
32 #endif
33 
34 class MagneticField;
36 {
37 public:
39  {
41  // The result of PixelTemplateReco2D
42  float templXrec_ ;
43  float templYrec_ ;
44  float templSigmaX_ ;
45  float templSigmaY_ ;
46  // Add new information produced by SiPixelTemplateReco::PixelTempReco2D &&&
47  // These can only be accessed if we change silicon pixel data formats and add them to the rechit
48  int ierr;
49 
50  // 2D fit stuff.
51  float templProbXY_ ;
53  int ierr2;
54  };
55 
56  // PixelCPEClusterRepair( const DetUnit& det );
59 
60  ~PixelCPEClusterRepair() override;
61 
62 private:
63  ClusterParam * createClusterParam(const SiPixelCluster & cl) const override;
64 
65  // Calculate local position. (Calls TemplateReco)
66  LocalPoint localPosition (DetParam const & theDetParam, ClusterParam & theClusterParam) const override;
67  // Calculate local error. Note: it MUST be called AFTER localPosition() !!!
68  LocalError localError (DetParam const & theDetParam, ClusterParam & theClusterParam) const override;
69 
70  // Helper functions:
71 
72  // Call vanilla template reco, then clean-up
73  void callTempReco1D( DetParam const & theDetParam,
74  ClusterParamTemplate & theClusterParam,
75  SiPixelTemplateReco::ClusMatrix & clusterPayload,
76  int ID, LocalPoint & lp ) const;
77 
78  // Call 2D template reco, then clean-up
79  void callTempReco2D( DetParam const & theDetParam,
80  ClusterParamTemplate & theClusterParam,
81  SiPixelTemplateReco2D::ClusMatrix & clusterPayload,
82  int ID, LocalPoint & lp ) const;
83 
84  //Helper function to see if 2D reco should be run
85  void checkRecommend2D( DetParam const & theDetParam,
86  ClusterParamTemplate & theClusterParam,
87  SiPixelTemplateReco::ClusMatrix & clusterPayload,
88  int ID) const;
89 
90  //Fill IDs for 2D template
91  void fill2DTemplIDs();
92 
93 
94 
95 
96  // Template storage
97  std::vector< SiPixelTemplateStore > thePixelTemp_;
98  std::vector< SiPixelTemplateStore2D > thePixelTemp2D_;
99 
100  int speed_ ;
101 
103 
104  // Template file management (when not getting the templates from the DB)
108 
110 
111  // Configure 2D reco.
114 
115  //bool DoCosmics_;
116  //bool LoadTemplatesFromDB_;
117 
118  // read sub-detectors to recommend 2D
119  class Rule {
120  public:
121  // parse a rule from a string
122  Rule(const std::string &str) ;
123  // check this DetId to recommend 2D or not (default false)
124  bool recommend(DetId detid, const TrackerTopology &tTopo) const {
125  // check detector
126  if (detid.subdetId() == subdet_) {
127  // check layer
128  if ( (layer_ == 0) || (layer_ == int(tTopo.layer(detid))) ) {
129  return true;
130  }
131  else return false;
132  }
133  else return false;
134  }
135  private:
136  int subdet_;
137  int layer_;
138  };
139  std::vector<Rule> recommend2D_;
140 
141  // run on damaged hits or not
143 };
144 
145 #endif
146 
147 
148 
149 
LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
static const char layer_[]
std::vector< SiPixelTemplateStore > thePixelTemp_
uint32_t ID
Definition: Definitions.h:26
ClusterParam * createClusterParam(const SiPixelCluster &cl) const override
std::vector< Rule > recommend2D_
bool recommend(DetId detid, const TrackerTopology &tTopo) const
PixelCPEClusterRepair(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelTemplateDBObject *, const SiPixel2DTemplateDBObject *)
const SiPixel2DTemplateDBObject * templateDBobject2D_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::vector< SiPixelTemplateStore2D > thePixelTemp2D_
void callTempReco2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco2D::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
Definition: DetId.h:18
void checkRecommend2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID) const
void callTempReco1D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
unsigned int layer(const DetId &id) const
Pixel cluster – collection of neighboring pixels above threshold.
#define str(s)
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override