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/CommonDetAlgo/interface/MeasurementPoint.h"
10 //#include "Geometry/CommonDetAlgo/interface/MeasurementError.h"
11 //#include "Geometry/Surface/interface/GloballyPositioned.h"
12 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
13 
14 // The template header files
15 //
21 
22 #include <utility>
23 #include <vector>
24 
25 #if 0
26 
30 #endif
31 
32 class MagneticField;
34 public:
37  // The result of PixelTemplateReco2D
38  float templXrec_;
39  float templYrec_;
40  float templSigmaX_;
41  float templSigmaY_;
42  // Add new information produced by SiPixelTemplateReco::PixelTempReco2D &&&
43  // These can only be accessed if we change silicon pixel data formats and add them to the rechit
44  int ierr;
45 
46  // 2D fit stuff.
47  float templProbXY_;
49  int ierr2;
50  };
51 
52  // PixelCPEClusterRepair( const DetUnit& det );
54  const MagneticField *,
55  const TrackerGeometry &,
56  const TrackerTopology &,
57  const SiPixelLorentzAngle *,
58  const std::vector<SiPixelTemplateStore> *,
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> const *thePixelTemp_;
101  std::vector<SiPixelTemplateStore> thePixelTempCache_;
102  std::vector<SiPixelTemplateStore2D> thePixelTemp2D_;
103 
104  int speed_;
105 
107 
108  // Template file management (when not getting the templates from the DB)
112 
114 
115  // Configure 2D reco.
118 
119  //bool DoCosmics_;
120  //bool LoadTemplatesFromDB_;
121 
122  // read sub-detectors to recommend 2D
123  class Rule {
124  public:
125  // parse a rule from a string
126  Rule(const std::string &str);
127  // check this DetId to recommend 2D or not (default false)
128  bool recommend(DetId detid, const TrackerTopology &tTopo) const {
129  // check detector
130  if (detid.subdetId() == subdet_) {
131  // check layer
132  if ((layer_ == 0) || (layer_ == int(tTopo.layer(detid)))) {
133  return true;
134  } else
135  return false;
136  } else
137  return false;
138  }
139 
140  private:
141  int subdet_;
142  int layer_;
143  };
144  std::vector<Rule> recommend2D_;
145 
146  // run on damaged hits or not
148 };
149 
150 #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)
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