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/CommonDetUnit/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 #if 0
27 
31 #endif
32 
33 class MagneticField;
35 public:
38  // The result of PixelTemplateReco2D
39  float templXrec_;
40  float templYrec_;
41  float templSigmaX_;
42  float templSigmaY_;
43  // Add new information produced by SiPixelTemplateReco::PixelTempReco2D &&&
44  // These can only be accessed if we change silicon pixel data formats and add them to the rechit
45  int ierr;
46 
47  // 2D fit stuff.
48  float templProbXY_;
50  int ierr2;
51  };
52 
53  // PixelCPEClusterRepair( const DetUnit& det );
55  const MagneticField *,
56  const TrackerGeometry &,
57  const TrackerTopology &,
58  const SiPixelLorentzAngle *,
61 
62  ~PixelCPEClusterRepair() override;
63 
65 
66 private:
67  std::unique_ptr<ClusterParam> createClusterParam(const SiPixelCluster &cl) const override;
68 
69  // Calculate local position. (Calls TemplateReco)
70  LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
71  // Calculate local error. Note: it MUST be called AFTER localPosition() !!!
72  LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
73 
74  // Helper functions:
75 
76  // Call vanilla template reco, then clean-up
77  void callTempReco1D(DetParam const &theDetParam,
78  ClusterParamTemplate &theClusterParam,
79  SiPixelTemplateReco::ClusMatrix &clusterPayload,
80  int ID,
81  LocalPoint &lp) const;
82 
83  // Call 2D template reco, then clean-up
84  void callTempReco2D(DetParam const &theDetParam,
85  ClusterParamTemplate &theClusterParam,
86  SiPixelTemplateReco2D::ClusMatrix &clusterPayload,
87  int ID,
88  LocalPoint &lp) const;
89 
90  //Helper function to see if 2D reco should be run
91  void checkRecommend2D(DetParam const &theDetParam,
92  ClusterParamTemplate &theClusterParam,
93  SiPixelTemplateReco::ClusMatrix &clusterPayload,
94  int ID) const;
95 
96  //Fill IDs for 2D template
97  void fill2DTemplIDs();
98 
99  // Template storage
100  std::vector<SiPixelTemplateStore> thePixelTemp_;
101  std::vector<SiPixelTemplateStore2D> thePixelTemp2D_;
102 
103  int speed_;
104 
106 
107  // Template file management (when not getting the templates from the DB)
111 
113 
114  // Configure 2D reco.
117 
118  //bool DoCosmics_;
119  //bool LoadTemplatesFromDB_;
120 
121  // read sub-detectors to recommend 2D
122  class Rule {
123  public:
124  // parse a rule from a string
125  Rule(const std::string &str);
126  // check this DetId to recommend 2D or not (default false)
127  bool recommend(DetId detid, const TrackerTopology &tTopo) const {
128  // check detector
129  if (detid.subdetId() == subdet_) {
130  // check layer
131  if ((layer_ == 0) || (layer_ == int(tTopo.layer(detid)))) {
132  return true;
133  } else
134  return false;
135  } else
136  return false;
137  }
138 
139  private:
140  int subdet_;
141  int layer_;
142  };
143  std::vector<Rule> recommend2D_;
144 
145  // run on damaged hits or not
147 };
148 
149 #endif
std::unique_ptr< ClusterParam > createClusterParam(const SiPixelCluster &cl) const override
uint32_t ID
Definition: Definitions.h:24
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
std::vector< SiPixelTemplateStore2D > thePixelTemp2D_
std::vector< SiPixelTemplateStore > thePixelTemp_
unsigned int layer(const DetId &id) const
std::vector< Rule > recommend2D_
PixelCPEClusterRepair(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelTemplateDBObject *, const SiPixel2DTemplateDBObject *)
const SiPixel2DTemplateDBObject * templateDBobject2D_
LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
static void fillPSetDescription(edm::ParameterSetDescription &desc)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool recommend(DetId detid, const TrackerTopology &tTopo) const
Definition: DetId.h:17
Pixel cluster – collection of neighboring pixels above threshold.
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
#define str(s)
void callTempReco2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco2D::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const