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 *,
59  const std::vector<SiPixelTemplateStore> *,
62 
63  ~PixelCPEClusterRepair() override;
64 
66 
67 private:
68  std::unique_ptr<ClusterParam> createClusterParam(const SiPixelCluster &cl) const override;
69 
70  // Calculate local position. (Calls TemplateReco)
71  LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
72  // Calculate local error. Note: it MUST be called AFTER localPosition() !!!
73  LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override;
74 
75  // Helper functions:
76 
77  // Call vanilla template reco, then clean-up
78  void callTempReco1D(DetParam const &theDetParam,
79  ClusterParamTemplate &theClusterParam,
80  SiPixelTemplateReco::ClusMatrix &clusterPayload,
81  int ID,
82  LocalPoint &lp) const;
83 
84  // Call 2D template reco, then clean-up
85  void callTempReco2D(DetParam const &theDetParam,
86  ClusterParamTemplate &theClusterParam,
87  SiPixelTemplateReco2D::ClusMatrix &clusterPayload,
88  int ID,
89  LocalPoint &lp) const;
90 
91  //Helper function to see if 2D reco should be run
92  void checkRecommend2D(DetParam const &theDetParam,
93  ClusterParamTemplate &theClusterParam,
94  SiPixelTemplateReco::ClusMatrix &clusterPayload,
95  int ID) const;
96 
97  //Fill IDs for 2D template
98  void fill2DTemplIDs();
99 
100  // Template storage
101  std::vector<SiPixelTemplateStore> const *thePixelTemp_;
102  std::vector<SiPixelTemplateStore> thePixelTempCache_;
103  std::vector<SiPixelTemplateStore2D> thePixelTemp2D_;
104 
105  int speed_;
106 
108 
109  // Template file management (when not getting the templates from the DB)
113 
115 
116  // Configure 2D reco.
119 
120  //bool DoCosmics_;
121  //bool LoadTemplatesFromDB_;
122 
123  // read sub-detectors to recommend 2D
124  class Rule {
125  public:
126  // parse a rule from a string
127  Rule(const std::string &str);
128  // check this DetId to recommend 2D or not (default false)
129  bool recommend(DetId detid, const TrackerTopology &tTopo) const {
130  // check detector
131  if (detid.subdetId() == subdet_) {
132  // check layer
133  if ((layer_ == 0) || (layer_ == int(tTopo.layer(detid)))) {
134  return true;
135  } else
136  return false;
137  } else
138  return false;
139  }
140 
141  private:
142  int subdet_;
143  int layer_;
144  };
145  std::vector<Rule> recommend2D_;
146 
147  // run on damaged hits or not
149 };
150 
151 #endif
std::vector< SiPixelTemplateStore > thePixelTempCache_
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 > const * 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 std::vector< SiPixelTemplateStore > *, 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