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
PixelCPEClusterRepair::barrelTemplateID_
int barrelTemplateID_
Definition: PixelCPEClusterRepair.h:108
PixelCPEBase::ClusterParam
Definition: PixelCPEBase.h:80
PixelCPEClusterRepair::Rule
Definition: PixelCPEClusterRepair.h:122
SiPixel2DTemplateDBObject
Definition: SiPixel2DTemplateDBObject.h:16
PixelCPEClusterRepair::forwardTemplateID_
int forwardTemplateID_
Definition: PixelCPEClusterRepair.h:109
SiPixel2DTemplateDBObject.h
PixelCPEClusterRepair::ClusterParamTemplate::templYrec_
float templYrec_
Definition: PixelCPEClusterRepair.h:40
TrackerTopology
Definition: TrackerTopology.h:16
PixelCPEClusterRepair::templateDBobject2D_
const SiPixel2DTemplateDBObject * templateDBobject2D_
Definition: PixelCPEClusterRepair.h:112
PixelCPEClusterRepair::ClusterParamTemplate::templProbXY_
float templProbXY_
Definition: PixelCPEClusterRepair.h:48
SiPixelTemplateReco.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PixelCPEClusterRepair::maxSizeMismatchInY_
float maxSizeMismatchInY_
Definition: PixelCPEClusterRepair.h:116
PixelCPEBase.h
PixelCPEClusterRepair::callTempReco1D
void callTempReco1D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
Definition: PixelCPEClusterRepair.cc:315
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
PixelCPEClusterRepair::localPosition
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
Definition: PixelCPEClusterRepair.cc:176
PixelCPEClusterRepair::callTempReco2D
void callTempReco2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco2D::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
Definition: PixelCPEClusterRepair.cc:414
PixelCPEClusterRepair::fill2DTemplIDs
void fill2DTemplIDs()
Definition: PixelCPEClusterRepair.cc:121
PixelCPEClusterRepair::ClusterParamTemplate::templSigmaY_
float templSigmaY_
Definition: PixelCPEClusterRepair.h:42
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:27
PixelCPEClusterRepair::ClusterParamTemplate::ClusterParamTemplate
ClusterParamTemplate(const SiPixelCluster &cl)
Definition: PixelCPEClusterRepair.h:37
PixelCPEClusterRepair::ClusterParamTemplate::templXrec_
float templXrec_
Definition: PixelCPEClusterRepair.h:39
PixelCPEClusterRepair::PixelCPEClusterRepair
PixelCPEClusterRepair(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelTemplateDBObject *, const SiPixel2DTemplateDBObject *)
Definition: PixelCPEClusterRepair.cc:38
PixelCPEClusterRepair
Definition: PixelCPEClusterRepair.h:34
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
DetId
Definition: DetId.h:17
PixelCPEClusterRepair::thePixelTemp_
std::vector< SiPixelTemplateStore > thePixelTemp_
Definition: PixelCPEClusterRepair.h:100
SiPixelTemplate.h
SiPixelTemplateReco2D::ClusMatrix
Definition: SiPixelTemplateReco2D.h:38
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
PixelCPEClusterRepair::Rule::Rule
Rule(const std::string &str)
Definition: PixelCPEClusterRepair.cc:702
str
#define str(s)
Definition: TestProcessor.cc:51
PixelCPEClusterRepair::createClusterParam
std::unique_ptr< ClusterParam > createClusterParam(const SiPixelCluster &cl) const override
Definition: PixelCPEClusterRepair.cc:165
PixelCPEClusterRepair::speed_
int speed_
Definition: PixelCPEClusterRepair.h:103
Point3DBase< float, LocalTag >
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
PixelCPEClusterRepair::checkRecommend2D
void checkRecommend2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID) const
Definition: PixelCPEClusterRepair.cc:531
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelTemplate2D.h
edm::ParameterSet
Definition: ParameterSet.h:47
PixelCPEClusterRepair::ClusterParamTemplate
Definition: PixelCPEClusterRepair.h:36
align::ID
uint32_t ID
Definition: Definitions.h:24
LocalError
Definition: LocalError.h:12
PixelCPEClusterRepair::Rule::recommend
bool recommend(DetId detid, const TrackerTopology &tTopo) const
Definition: PixelCPEClusterRepair.h:127
PixelCPEClusterRepair::ClusterParamTemplate::recommended2D_
bool recommended2D_
Definition: PixelCPEClusterRepair.h:49
SiPixelTemplateDBObject
Definition: SiPixelTemplateDBObject.h:16
createfilelist.int
int
Definition: createfilelist.py:10
PixelCPEClusterRepair::localError
LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
Definition: PixelCPEClusterRepair.cc:623
PixelCPEClusterRepair::UseClusterSplitter_
bool UseClusterSplitter_
Definition: PixelCPEClusterRepair.h:105
PixelCPEClusterRepair::Rule::subdet_
int subdet_
Definition: PixelCPEClusterRepair.h:140
PixelCPEBase::DetParam
Definition: PixelCPEBase.h:56
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
SiPixelTemplateReco2D.h
PixelCPEClusterRepair::minChargeRatio_
float minChargeRatio_
Definition: PixelCPEClusterRepair.h:115
PixelCPEBase
Definition: PixelCPEBase.h:54
SiPixelTemplateReco::ClusMatrix
Definition: SiPixelTemplateReco.h:73
PixelCPEClusterRepair::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEClusterRepair.cc:727
PixelCPEClusterRepair::~PixelCPEClusterRepair
~PixelCPEClusterRepair() override
Definition: PixelCPEClusterRepair.cc:158
PixelCPEClusterRepair::Rule::layer_
int layer_
Definition: PixelCPEClusterRepair.h:141
PixelCPEClusterRepair::ClusterParamTemplate::ierr2
int ierr2
Definition: PixelCPEClusterRepair.h:50
MagneticField
Definition: MagneticField.h:19
PixelCPEClusterRepair::thePixelTemp2D_
std::vector< SiPixelTemplateStore2D > thePixelTemp2D_
Definition: PixelCPEClusterRepair.h:101
PixelCPEClusterRepair::ClusterParamTemplate::ierr
int ierr
Definition: PixelCPEClusterRepair.h:45
PixelCPEClusterRepair::ClusterParamTemplate::templSigmaX_
float templSigmaX_
Definition: PixelCPEClusterRepair.h:41
PixelCPEClusterRepair::runDamagedClusters_
bool runDamagedClusters_
Definition: PixelCPEClusterRepair.h:146
PixelCPEClusterRepair::recommend2D_
std::vector< Rule > recommend2D_
Definition: PixelCPEClusterRepair.h:143
TrackerGeometry
Definition: TrackerGeometry.h:14
PixelCPEClusterRepair::templateDir_
std::string templateDir_
Definition: PixelCPEClusterRepair.h:110