CMS 3D CMS Logo

PixelCPEClusterRepair.cc
Go to the documentation of this file.
1 // Include our own header first
3 
4 // Geometry services
7 
8 // MessageLogger
10 
11 // Magnetic field
13 
14 // Commented for now (3/10/17) until we figure out how to resuscitate 2D template splitter
16 
17 #include <vector>
18 #include "boost/multi_array.hpp"
19 #include <boost/regex.hpp>
20 #include <map>
21 
22 #include <iostream>
23 
24 using namespace SiPixelTemplateReco;
25 //using namespace SiPixelTemplateSplit;
26 using namespace std;
27 
28 namespace {
29  constexpr float micronsToCm = 1.0e-4;
30  constexpr int cluster_matrix_size_x = 13;
31  constexpr int cluster_matrix_size_y = 21;
32 } // namespace
33 
34 //-----------------------------------------------------------------------------
35 // Constructor.
36 //
37 //-----------------------------------------------------------------------------
39  const MagneticField* mag,
40  const TrackerGeometry& geom,
41  const TrackerTopology& ttopo,
42  const SiPixelLorentzAngle* lorentzAngle,
43  const SiPixelTemplateDBObject* templateDBobject,
44  const SiPixel2DTemplateDBObject* templateDBobject2D)
45  : PixelCPEBase(conf, mag, geom, ttopo, lorentzAngle, nullptr, templateDBobject, nullptr, 1) {
46  LogDebug("PixelCPEClusterRepair::(constructor)") << endl;
47 
48  //--- Parameter to decide between DB or text file template access
50  // Initialize template store to the selected ID [Morris, 6/25/08]
52  throw cms::Exception("PixelCPEClusterRepair")
53  << "\nERROR: Templates not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject version "
54  << (*templateDBobject_).version() << "\n\n";
55 
56  // Initialize template store to the selected ID [Morris, 6/25/08]
57  if (!SiPixelTemplate2D::pushfile(*templateDBobject2D, thePixelTemp2D_))
58  throw cms::Exception("PixelCPEClusterRepair")
59  << "\nERROR: Templates not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject2D version "
60  << (*templateDBobject2D).version() << "\n\n";
61  } else {
62  LogDebug("PixelCPEClusterRepair") << "Loading templates for barrel and forward from ASCII files." << endl;
63  //--- (Archaic) Get configurable template IDs. This code executes only if we loading pixels from ASCII
64  // files, and then they are mandatory.
65  barrelTemplateID_ = conf.getParameter<int>("barrelTemplateID");
66  forwardTemplateID_ = conf.getParameter<int>("forwardTemplateID");
67  templateDir_ = conf.getParameter<int>("directoryWithTemplates");
68 
70  throw cms::Exception("PixelCPEClusterRepair")
71  << "\nERROR: Template ID " << barrelTemplateID_
72  << " not loaded correctly from text file. Reconstruction will fail.\n\n";
73 
75  throw cms::Exception("PixelCPEClusterRepair")
76  << "\nERROR: Template ID " << forwardTemplateID_
77  << " not loaded correctly from text file. Reconstruction will fail.\n\n";
78  }
79 
80  speed_ = conf.getParameter<int>("speed");
81  LogDebug("PixelCPEClusterRepair::PixelCPEClusterRepair:") << "Template speed = " << speed_ << "\n";
82 
83  // this returns the magnetic field value in kgauss (1T = 10 kgauss)
84  int theMagField = mag->nominalValue();
85 
86  if (theMagField >= 36 && theMagField < 39) {
87  LogDebug("PixelCPEClusterRepair::PixelCPEClusterRepair:")
88  << "Magnetic field value is: " << theMagField << " kgauss. Algorithm is being run \n";
89 
90  templateDBobject2D_ = templateDBobject2D;
92  }
93 
94  UseClusterSplitter_ = conf.getParameter<bool>("UseClusterSplitter");
95 
96  maxSizeMismatchInY_ = conf.getParameter<double>("MaxSizeMismatchInY");
97  minChargeRatio_ = conf.getParameter<double>("MinChargeRatio");
98 
99  // read sub-detectors and apply rule to recommend 2D
100  // can be:
101  // XYX (XYZ = PXB, PXE)
102  // XYZ n (XYZ as above, n = layer, wheel or disk = 1 .. 6 ;)
103  std::vector<std::string> str_recommend2D = conf.getParameter<std::vector<std::string>>("Recommend2D");
104  recommend2D_.reserve(str_recommend2D.size());
105  for (auto& str : str_recommend2D) {
106  recommend2D_.push_back(str);
107  }
108 
109  // do not recommend 2D if theMagField!=3.8T
110  if (theMagField < 36 || theMagField > 39) {
111  recommend2D_.clear();
112  }
113 
114  // run CR on damaged clusters (and not only on edge hits)
115  runDamagedClusters_ = conf.getParameter<bool>("RunDamagedClusters");
116 }
117 
118 //-----------------------------------------------------------------------------
119 // Fill all 2D template IDs
120 //-----------------------------------------------------------------------------
122  auto const& dus = geom_.detUnits();
123  unsigned m_detectors = dus.size();
124  for (unsigned int i = 1; i < 7; ++i) {
125  LogDebug("PixelCPEClusterRepair:: LookingForFirstStrip")
126  << "Subdetector " << i << " GeomDetEnumerator " << GeomDetEnumerators::tkDetEnum[i] << " offset "
127  << geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) << " is it strip? "
128  << (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size()
129  ? dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isOuterTracker()
130  : false);
131  if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() &&
132  dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isOuterTracker()) {
133  if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) < m_detectors)
135  }
136  }
137  LogDebug("LookingForFirstStrip") << " Chosen offset: " << m_detectors;
138 
139  m_DetParams.resize(m_detectors);
140  LogDebug("PixelCPEClusterRepair::fillDetParams():") << "caching " << m_detectors << " pixel detectors" << endl;
141  //Loop through detectors and store 2D template ID
142  bool printed_info = false;
143  for (unsigned i = 0; i != m_detectors; ++i) {
144  auto& p = m_DetParams[i];
145 
146  p.detTemplateId2D = templateDBobject2D_->getTemplateID(p.theDet->geographicalId());
147  if (p.detTemplateId != p.detTemplateId2D && !printed_info) {
148  edm::LogWarning("PixelCPEClusterRepair")
149  << "different template ID between 1D and 2D " << p.detTemplateId << " " << p.detTemplateId2D << endl;
150  printed_info = true;
151  }
152  }
153 }
154 
155 //-----------------------------------------------------------------------------
156 // Clean up.
157 //-----------------------------------------------------------------------------
159 
160 std::unique_ptr<PixelCPEBase::ClusterParam> PixelCPEClusterRepair::createClusterParam(const SiPixelCluster& cl) const {
161  return std::make_unique<ClusterParamTemplate>(cl);
162 }
163 
164 //------------------------------------------------------------------
165 // Public methods mandated by the base class.
166 //------------------------------------------------------------------
167 
168 //------------------------------------------------------------------
169 // The main call to the template code.
170 //------------------------------------------------------------------
171 LocalPoint PixelCPEClusterRepair::localPosition(DetParam const& theDetParam, ClusterParam& theClusterParamBase) const {
172  ClusterParamTemplate& theClusterParam = static_cast<ClusterParamTemplate&>(theClusterParamBase);
173  bool filled_from_2d = false;
174 
176  throw cms::Exception("PixelCPEClusterRepair::localPosition :") << "A non-pixel detector type in here?";
177 
178  int ID1 = -9999;
179  int ID2 = -9999;
180  if (LoadTemplatesFromDB_) {
181  ID1 = theDetParam.detTemplateId;
182  ID2 = theDetParam.detTemplateId2D;
183  } else { // from asci file
184  if (!GeomDetEnumerators::isEndcap(theDetParam.thePart))
185  ID1 = ID2 = barrelTemplateID_; // barrel
186  else
187  ID1 = ID2 = forwardTemplateID_; // forward
188  }
189 
190  // &&& PM, note for later: PixelCPEBase calculates minInX,Y, and maxInX,Y
191  // Why can't we simply use that and save time with row_offset, col_offset
192  // and mrow = maxInX-minInX, mcol = maxInY-minInY ... Except that we
193  // also need to take into account cluster_matrix_size_x,y.
194 
195  //--- Preparing to retrieve ADC counts from the SiPixeltheClusterParam.theCluster
196  // The pixels from minPixelRow() will go into clust_array_2d[0][*],
197  // and the pixels from minPixelCol() will go into clust_array_2d[*][0].
198  int row_offset = theClusterParam.theCluster->minPixelRow();
199  int col_offset = theClusterParam.theCluster->minPixelCol();
200 
201  //--- Store the coordinates of the center of the (0,0) pixel of the array that
202  // gets passed to PixelTempReco2D. Will add these values to the output of TemplReco2D
203  float tmp_x = float(row_offset) + 0.5f;
204  float tmp_y = float(col_offset) + 0.5f;
205 
206  //--- Store these offsets (to be added later) in a LocalPoint after tranforming
207  // them from measurement units (pixel units) to local coordinates (cm)
208  LocalPoint lp;
209  if (theClusterParam.with_track_angle)
210  //--- Update call with trk angles needed for bow/kink corrections // Gavril
211  lp = theDetParam.theTopol->localPosition(MeasurementPoint(tmp_x, tmp_y), theClusterParam.loc_trk_pred);
212  else {
213  edm::LogError("PixelCPEClusterRepair") << "@SUB = PixelCPEClusterRepair::localPosition"
214  << "Should never be here. PixelCPEClusterRepair should always be called "
215  "with track angles. This is a bad error !!! ";
216  lp = theDetParam.theTopol->localPosition(MeasurementPoint(tmp_x, tmp_y));
217  }
218 
219  //--- Compute the size of the matrix which will be passed to TemplateReco.
220  // We'll later make clustMatrix[ mrow ][ mcol ]
221  int mrow = 0, mcol = 0;
222  for (int i = 0; i != theClusterParam.theCluster->size(); ++i) {
223  auto pix = theClusterParam.theCluster->pixel(i);
224  int irow = int(pix.x);
225  int icol = int(pix.y);
226  mrow = std::max(mrow, irow);
227  mcol = std::max(mcol, icol);
228  }
229  mrow -= row_offset;
230  mrow += 1;
231  mrow = std::min(mrow, cluster_matrix_size_x);
232  mcol -= col_offset;
233  mcol += 1;
234  mcol = std::min(mcol, cluster_matrix_size_y);
235  assert(mrow > 0);
236  assert(mcol > 0);
237 
238  //--- Make and fill the bool arrays flagging double pixels
239  bool xdouble[mrow], ydouble[mcol];
240  // x directions (shorter), rows
241  for (int irow = 0; irow < mrow; ++irow)
242  xdouble[irow] = theDetParam.theRecTopol->isItBigPixelInX(irow + row_offset);
243  //
244  // y directions (longer), columns
245  for (int icol = 0; icol < mcol; ++icol)
246  ydouble[icol] = theDetParam.theRecTopol->isItBigPixelInY(icol + col_offset);
247 
248  //--- C-style matrix. We'll need it in either case.
249  float clustMatrix[mrow][mcol];
250  float clustMatrix2[mrow][mcol];
251 
252  //--- Prepare struct that passes pointers to TemplateReco. It doesn't own anything.
253  SiPixelTemplateReco::ClusMatrix clusterPayload{&clustMatrix[0][0], xdouble, ydouble, mrow, mcol};
254  SiPixelTemplateReco2D::ClusMatrix clusterPayload2d{&clustMatrix2[0][0], xdouble, ydouble, mrow, mcol};
255 
256  //--- Copy clust's pixels (calibrated in electrons) into clustMatrix;
257  memset(clustMatrix, 0, sizeof(float) * mrow * mcol); // Wipe it clean.
258  for (int i = 0; i != theClusterParam.theCluster->size(); ++i) {
259  auto pix = theClusterParam.theCluster->pixel(i);
260  int irow = int(pix.x) - row_offset;
261  int icol = int(pix.y) - col_offset;
262  // &&& Do we ever get pixels that are out of bounds ??? Need to check.
263  if ((irow < mrow) & (icol < mcol))
264  clustMatrix[irow][icol] = float(pix.adc);
265  }
266  // &&& Save for later: fillClustMatrix( float * clustMatrix );
267 
268  //--- Save a copy of clustMatrix into clustMatrix2
269  memcpy(clustMatrix2, clustMatrix, sizeof(float) * mrow * mcol);
270 
271  //--- Set both return statuses, since we may call only one.
272  theClusterParam.ierr = 0;
273  theClusterParam.ierr2 = 0;
274 
275  //--- Should we run the 2D reco?
276  checkRecommend2D(theDetParam, theClusterParam, clusterPayload, ID1);
277  if (theClusterParam.recommended2D_) {
278  //--- Call the Template Reco 2d with cluster repair
279  filled_from_2d = true;
280  callTempReco2D(theDetParam, theClusterParam, clusterPayload2d, ID2, lp);
281  } else {
282  //--- Call the vanilla Template Reco
283  callTempReco1D(theDetParam, theClusterParam, clusterPayload, ID1, lp);
284  filled_from_2d = false;
285  }
286 
287  //--- Make sure cluster repair returns all info about the hit back up to caller
288  //--- Necessary because it copied the base class so it does not modify it
289  theClusterParamBase.isOnEdge_ = theClusterParam.isOnEdge_;
290  theClusterParamBase.hasBadPixels_ = theClusterParam.hasBadPixels_;
291  theClusterParamBase.spansTwoROCs_ = theClusterParam.spansTwoROCs_;
292  theClusterParamBase.hasFilledProb_ = theClusterParam.hasFilledProb_;
293  theClusterParamBase.qBin_ = theClusterParam.qBin_;
294  theClusterParamBase.probabilityQ_ = theClusterParam.probabilityQ_;
295  theClusterParamBase.filled_from_2d = filled_from_2d;
296  if (filled_from_2d) {
297  theClusterParamBase.probabilityX_ = theClusterParam.templProbXY_;
298  theClusterParamBase.probabilityY_ = 0.;
299  } else {
300  theClusterParamBase.probabilityX_ = theClusterParam.probabilityX_;
301  theClusterParamBase.probabilityY_ = theClusterParam.probabilityY_;
302  }
303 
304  return LocalPoint(theClusterParam.templXrec_, theClusterParam.templYrec_);
305 }
306 
307 //------------------------------------------------------------------
308 // Helper function to aggregate call & handling of Template Reco
309 //------------------------------------------------------------------
311  ClusterParamTemplate& theClusterParam,
312  SiPixelTemplateReco::ClusMatrix& clusterPayload,
313  int ID,
314  LocalPoint& lp) const {
316 
317  // Output:
318  float nonsense = -99999.9f; // nonsense init value
319  theClusterParam.templXrec_ = theClusterParam.templYrec_ = theClusterParam.templSigmaX_ =
320  theClusterParam.templSigmaY_ = nonsense;
321  // If the template recontruction fails, we want to return 1.0 for now
322  theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 1.f;
323  theClusterParam.qBin_ = 0;
324  // We have a boolean denoting whether the reco failed or not
325  theClusterParam.hasFilledProb_ = false;
326 
327  // ******************************************************************
328  //--- Call normal TemplateReco
329  //
330  float locBz = theDetParam.bz;
331  float locBx = theDetParam.bx;
332  //
333  const bool deadpix = false;
334  std::vector<std::pair<int, int>> zeropix;
335  int nypix = 0, nxpix = 0;
336  //
337  theClusterParam.ierr = PixelTempReco1D(ID,
338  theClusterParam.cotalpha,
339  theClusterParam.cotbeta,
340  locBz,
341  locBx,
342  clusterPayload,
343  templ,
344  theClusterParam.templYrec_,
345  theClusterParam.templSigmaY_,
346  theClusterParam.probabilityY_,
347  theClusterParam.templXrec_,
348  theClusterParam.templSigmaX_,
349  theClusterParam.probabilityX_,
350  theClusterParam.qBin_,
351  speed_,
352  deadpix,
353  zeropix,
354  theClusterParam.probabilityQ_,
355  nypix,
356  nxpix);
357  // ******************************************************************
358 
359  //--- Check exit status
360  if UNLIKELY (theClusterParam.ierr != 0) {
361  LogDebug("PixelCPEClusterRepair::localPosition")
362  << "reconstruction failed with error " << theClusterParam.ierr << "\n";
363 
364  theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 0.f;
365  theClusterParam.qBin_ = 0;
366 
367  // Gavril: what do we do in this case ? For now, just return the cluster center of gravity in microns
368  // In the x case, apply a rough Lorentz drift average correction
369  // To do: call PixelCPEGeneric whenever PixelTempReco1D fails
370  float lorentz_drift = -999.9;
371  if (!GeomDetEnumerators::isEndcap(theDetParam.thePart))
372  lorentz_drift = 60.0f; // in microns
373  else
374  lorentz_drift = 10.0f; // in microns
375  // GG: trk angles needed to correct for bows/kinks
376  if (theClusterParam.with_track_angle) {
377  theClusterParam.templXrec_ =
378  theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) -
379  lorentz_drift * micronsToCm; // rough Lorentz drift correction
380  theClusterParam.templYrec_ =
381  theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred);
382  } else {
383  edm::LogError("PixelCPEClusterRepair") << "@SUB = PixelCPEClusterRepair::localPosition"
384  << "Should never be here. PixelCPEClusterRepair should always be called "
385  "with track angles. This is a bad error !!! ";
386 
387  theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) -
388  lorentz_drift * micronsToCm; // rough Lorentz drift correction
389  theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y());
390  }
391  } else {
392  //--- Template Reco succeeded. The probabilities are filled.
393  theClusterParam.hasFilledProb_ = true;
394 
395  //--- Go from microns to centimeters
396  theClusterParam.templXrec_ *= micronsToCm;
397  theClusterParam.templYrec_ *= micronsToCm;
398 
399  //--- Go back to the module coordinate system
400  theClusterParam.templXrec_ += lp.x();
401  theClusterParam.templYrec_ += lp.y();
402  }
403  return;
404 }
405 
406 //------------------------------------------------------------------
407 // Helper function to aggregate call & handling of Template 2D fit
408 //------------------------------------------------------------------
410  ClusterParamTemplate& theClusterParam,
411  SiPixelTemplateReco2D::ClusMatrix& clusterPayload,
412  int ID,
413  LocalPoint& lp) const {
415 
416  // Output:
417  float nonsense = -99999.9f; // nonsense init value
418  theClusterParam.templXrec_ = theClusterParam.templYrec_ = theClusterParam.templSigmaX_ =
419  theClusterParam.templSigmaY_ = nonsense;
420  // If the template recontruction fails, we want to return 1.0 for now
421  theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 1.f;
422  theClusterParam.qBin_ = 0;
423  // We have a boolean denoting whether the reco failed or not
424  theClusterParam.hasFilledProb_ = false;
425 
426  // ******************************************************************
427  //--- Call 2D TemplateReco
428  //
429  float locBz = theDetParam.bz;
430  float locBx = theDetParam.bx;
431 
432  //--- Input:
433  // edgeflagy - (input) flag to indicate the present of edges in y:
434  // 0=none (or interior gap),1=edge at small y, 2=edge at large y, 3=edge at either end
435  //
436  // edgeflagx - (input) flag to indicate the present of edges in x:
437  // 0=none, 1=edge at small x, 2=edge at large x
438  //
439  // These two variables are calculated in setTheClu() and stored in edgeTypeX_ and edgeTypeY_
440  //
441  //--- Output:
442  // deltay - (output) template y-length - cluster length [when > 0, possibly missing end]
443  // npixels - ??? &&& Ask Morris
444 
445  float deltay = 0; // return param
446  int npixels = 0; // return param
447 
448  //For now, turn off edgeX_ flags
449  theClusterParam.edgeTypeX_ = 0;
450 
451  if (clusterPayload.mrow > 4) {
452  // The cluster is too big, the 2D reco will perform horribly.
453  // Better to return immediately in error
454  theClusterParam.ierr2 = 8;
455 
456  } else {
457  theClusterParam.ierr2 = PixelTempReco2D(ID,
458  theClusterParam.cotalpha,
459  theClusterParam.cotbeta,
460  locBz,
461  locBx,
462  theClusterParam.edgeTypeY_,
463  theClusterParam.edgeTypeX_,
464  clusterPayload,
465  templ2d,
466  theClusterParam.templYrec_,
467  theClusterParam.templSigmaY_,
468  theClusterParam.templXrec_,
469  theClusterParam.templSigmaX_,
470  theClusterParam.templProbXY_,
471  theClusterParam.probabilityQ_,
472  theClusterParam.qBin_,
473  deltay,
474  npixels);
475  }
476  // ******************************************************************
477 
478  //--- Check exit status
479  if UNLIKELY (theClusterParam.ierr2 != 0) {
480  LogDebug("PixelCPEClusterRepair::localPosition")
481  << "2D reconstruction failed with error " << theClusterParam.ierr2 << "\n";
482 
483  theClusterParam.probabilityX_ = theClusterParam.probabilityY_ = theClusterParam.probabilityQ_ = 0.f;
484  theClusterParam.qBin_ = 0;
485  // GG: what do we do in this case? For now, just return the cluster center of gravity in microns
486  // In the x case, apply a rough Lorentz drift average correction
487  float lorentz_drift = -999.9;
488  if (!GeomDetEnumerators::isEndcap(theDetParam.thePart))
489  lorentz_drift = 60.0f; // in microns // &&& replace with a constant (globally)
490  else
491  lorentz_drift = 10.0f; // in microns
492  // GG: trk angles needed to correct for bows/kinks
493  if (theClusterParam.with_track_angle) {
494  theClusterParam.templXrec_ =
495  theDetParam.theTopol->localX(theClusterParam.theCluster->x(), theClusterParam.loc_trk_pred) -
496  lorentz_drift * micronsToCm; // rough Lorentz drift correction
497  theClusterParam.templYrec_ =
498  theDetParam.theTopol->localY(theClusterParam.theCluster->y(), theClusterParam.loc_trk_pred);
499  } else {
500  edm::LogError("PixelCPEClusterRepair") << "@SUB = PixelCPEClusterRepair::localPosition"
501  << "Should never be here. PixelCPEClusterRepair should always be called "
502  "with track angles. This is a bad error !!! ";
503 
504  theClusterParam.templXrec_ = theDetParam.theTopol->localX(theClusterParam.theCluster->x()) -
505  lorentz_drift * micronsToCm; // rough Lorentz drift correction
506  theClusterParam.templYrec_ = theDetParam.theTopol->localY(theClusterParam.theCluster->y());
507  }
508  } else {
509  //--- Template Reco succeeded.
510  theClusterParam.hasFilledProb_ = true;
511 
512  //--- Go from microns to centimeters
513  theClusterParam.templXrec_ *= micronsToCm;
514  theClusterParam.templYrec_ *= micronsToCm;
515 
516  //--- Go back to the module coordinate system
517  theClusterParam.templXrec_ += lp.x();
518  theClusterParam.templYrec_ += lp.y();
519  }
520  return;
521 }
522 //---------------------------------------------------------------------------------
523 // Helper function to see if we should recommend 2D reco to be run on this
524 // cluster
525 // ---------------------------------------------------------------------------------
527  ClusterParamTemplate& theClusterParam,
528  SiPixelTemplateReco::ClusMatrix& clusterPayload,
529  int ID) const
530 
531 {
532  // recommend2D is false by default
533  theClusterParam.recommended2D_ = false;
534 
535  DetId id = (theDetParam.theDet->geographicalId());
536 
537  bool recommend = false;
538  for (auto& rec : recommend2D_) {
539  recommend = rec.recommend(id, ttopo_);
540  if (recommend)
541  break;
542  }
543 
544  // only run on those layers recommended by configuration
545  if (!recommend) {
546  theClusterParam.recommended2D_ = false;
547  return;
548  }
549 
550  if (theClusterParam.edgeTypeY_) {
551  // For clusters that have edges in Y, run 2d reco.
552  // Flags already set by CPEBase
553  theClusterParam.recommended2D_ = true;
554  return;
555  }
556  // The 1d pixel template
558  if (!templ.interpolate(ID, theClusterParam.cotalpha, theClusterParam.cotbeta, theDetParam.bz, theDetParam.bx)) {
559  //error setting up template, return false
560  theClusterParam.recommended2D_ = false;
561  return;
562  }
563 
564  //length of the cluster taking into account double sized pixels
565  float nypix = clusterPayload.mcol;
566  for (int i = 0; i < clusterPayload.mcol; i++) {
567  if (clusterPayload.ydouble[i])
568  nypix += 1.;
569  }
570 
571  // templ.clsleny() is the expected length of the cluster along y axis.
572  // templ.qavg() is the expected total charge of the cluster
573  // theClusterParam.theCluster->charge() is the total charge of this cluster
574  float nydiff = templ.clsleny() - nypix;
575  float qratio = theClusterParam.theCluster->charge() / templ.qavg();
576 
577  if (nydiff > maxSizeMismatchInY_ && qratio < minChargeRatio_) {
578  // If the cluster is shorter than expected and has less charge, likely
579  // due to truncated cluster, try 2D reco
580 
581  theClusterParam.recommended2D_ = true;
582  theClusterParam.hasBadPixels_ = true;
583 
584  // if not RunDamagedClusters flag, don't try to fix any clusters
585  if (!runDamagedClusters_) {
586  theClusterParam.recommended2D_ = false;
587  }
588 
589  // Figure out what edge flags to set for truncated cluster
590  // Truncated clusters usually come from dead double columns
591  //
592  // If cluster is of even length, either both of or neither of beginning and ending
593  // edge are on a double column, so we cannot figure out the likely edge of
594  // truncation, let the 2D algorithm try extending on both sides (option 3)
595  if (theClusterParam.theCluster->sizeY() % 2 == 0)
596  theClusterParam.edgeTypeY_ = 3;
597  else {
598  //If the cluster is of odd length, only one of the edges can end on
599  //a double column, this is the likely edge of truncation
600  //Double columns always start on even indexes
601  int min_col = theClusterParam.theCluster->minPixelCol();
602  if (min_col % 2 == 0) {
603  //begining edge is at a double column (end edge cannot be,
604  //because odd length) so likely truncated at small y (option 1)
605  theClusterParam.edgeTypeY_ = 1;
606  } else {
607  //end edge is at a double column (beginning edge cannot be,
608  //because odd length) so likely truncated at large y (option 2)
609  theClusterParam.edgeTypeY_ = 2;
610  }
611  }
612  }
613 }
614 
615 //------------------------------------------------------------------
616 // localError() relies on localPosition() being called FIRST!!!
617 //------------------------------------------------------------------
618 LocalError PixelCPEClusterRepair::localError(DetParam const& theDetParam, ClusterParam& theClusterParamBase) const {
619  ClusterParamTemplate& theClusterParam = static_cast<ClusterParamTemplate&>(theClusterParamBase);
620 
621  //--- Default is the maximum error used for edge clusters.
622  //--- (never used, in fact: let comment it out, shut up the complains of the static analyzer, and save a few CPU cycles)
623  float xerr = 0.0f, yerr = 0.0f;
624 
625  // Check if the errors were already set at the clusters splitting level
626  if (theClusterParam.theCluster->getSplitClusterErrorX() > 0.0f &&
628  theClusterParam.theCluster->getSplitClusterErrorY() > 0.0f &&
630  xerr = theClusterParam.theCluster->getSplitClusterErrorX() * micronsToCm;
631  yerr = theClusterParam.theCluster->getSplitClusterErrorY() * micronsToCm;
632 
633  //cout << "Errors set at cluster splitting level : " << endl;
634  //cout << "xerr = " << xerr << endl;
635  //cout << "yerr = " << yerr << endl;
636  } else {
637  // If errors are not split at the cluster splitting level, set the errors here
638 
639  //--- Check status of both template calls.
640  if UNLIKELY ((theClusterParam.ierr != 0) || (theClusterParam.ierr2 != 0)) {
641  // If reconstruction fails the hit position is calculated from cluster center of gravity
642  // corrected in x by average Lorentz drift. Assign huge errors.
643  //
645  throw cms::Exception("PixelCPEClusterRepair::localPosition :") << "A non-pixel detector type in here?";
646 
647  // Assign better errors based on the residuals for failed template cases
648  if (GeomDetEnumerators::isBarrel(theDetParam.thePart)) {
649  xerr = 55.0f * micronsToCm; // &&& get errors from elsewhere?
650  yerr = 36.0f * micronsToCm;
651  } else {
652  xerr = 42.0f * micronsToCm;
653  yerr = 39.0f * micronsToCm;
654  }
655  }
656  // Use special edge hit errors (derived from observed RMS's) for edge hits that we did not run the 2D reco on
657  //
658  else if (!theClusterParamBase.filled_from_2d && (theClusterParam.edgeTypeX_ || theClusterParam.edgeTypeY_)) {
659  // for edge pixels assign errors according to observed residual RMS
660  if (theClusterParam.edgeTypeX_ && !theClusterParam.edgeTypeY_) {
661  xerr = xEdgeXError_ * micronsToCm;
662  yerr = xEdgeYError_ * micronsToCm;
663  } else if (!theClusterParam.edgeTypeX_ && theClusterParam.edgeTypeY_) {
664  xerr = yEdgeXError_ * micronsToCm;
665  yerr = yEdgeYError_ * micronsToCm;
666  } else if (theClusterParam.edgeTypeX_ && theClusterParam.edgeTypeY_) {
667  xerr = bothEdgeXError_ * micronsToCm;
668  yerr = bothEdgeYError_ * micronsToCm;
669  }
670  } else {
671  xerr = theClusterParam.templSigmaX_ * micronsToCm;
672  yerr = theClusterParam.templSigmaY_ * micronsToCm;
673  // &&& should also check ierr (saved as class variable) and return
674  // &&& nonsense (another class static) if the template fit failed.
675  }
676  }
677 
678  if (theVerboseLevel > 9) {
679  LogDebug("PixelCPEClusterRepair") << " Sizex = " << theClusterParam.theCluster->sizeX()
680  << " Sizey = " << theClusterParam.theCluster->sizeY()
681  << " Edgex = " << theClusterParam.edgeTypeX_
682  << " Edgey = " << theClusterParam.edgeTypeY_ << " ErrX = " << xerr
683  << " ErrY = " << yerr;
684  }
685 
686  if (!(xerr > 0.0f))
687  throw cms::Exception("PixelCPEClusterRepair::localError")
688  << "\nERROR: Negative pixel error xerr = " << xerr << "\n\n";
689 
690  if (!(yerr > 0.0f))
691  throw cms::Exception("PixelCPEClusterRepair::localError")
692  << "\nERROR: Negative pixel error yerr = " << yerr << "\n\n";
693 
694  return LocalError(xerr * xerr, 0, yerr * yerr);
695 }
696 
698  static const boost::regex rule("([A-Z]+)(\\s+(\\d+))?");
699  boost::cmatch match;
700  // match and check it works
701  if (!regex_match(str.c_str(), match, rule))
702  throw cms::Exception("Configuration") << "Rule '" << str << "' not understood.\n";
703 
704  // subdet
705  subdet_ = -1;
706  if (strncmp(match[1].first, "PXB", 3) == 0)
708  else if (strncmp(match[1].first, "PXE", 3) == 0)
710  if (subdet_ == -1) {
711  throw cms::Exception("PixelCPEClusterRepair::Configuration")
712  << "Detector '" << match[1].first << "' not understood. Should be PXB, PXE.\n";
713  }
714  // layer (if present)
715  if (match[3].first != match[3].second) {
716  layer_ = atoi(match[3].first);
717  } else {
718  layer_ = 0;
719  }
720 } //end Rule::Rule
721 
723  desc.add<int>("barrelTemplateID", 0);
724  desc.add<int>("forwardTemplateID", 0);
725  desc.add<int>("directoryWithTemplates", 0);
726  desc.add<int>("speed", -2);
727  desc.add<bool>("UseClusterSplitter", false);
728  desc.add<double>("MaxSizeMismatchInY", 0.3);
729  desc.add<double>("MinChargeRatio", 0.8);
730  desc.add<std::vector<std::string>>("Recommend2D", {"PXB 2", "PXB 3", "PXB 4"});
731  desc.add<bool>("RunDamagedClusters", false);
732 }
PixelCPEClusterRepair::barrelTemplateID_
int barrelTemplateID_
Definition: PixelCPEClusterRepair.h:108
SiPixelCluster::minPixelCol
int minPixelCol() const
Definition: SiPixelCluster.h:144
PixelCPEBase::ClusterParam
Definition: PixelCPEBase.h:69
PixelCPEBase::DetParam::bz
float bz
Definition: PixelCPEBase.h:58
PixelCPEBase::DetParam::bx
float bx
Definition: PixelCPEBase.h:59
PixelCPEBase::DetParam::theTopol
const PixelTopology * theTopol
Definition: PixelCPEBase.h:49
PixelCPEBase::bothEdgeYError_
static constexpr float bothEdgeYError_
Definition: PixelCPEBase.h:253
PixelCPEBase::templateDBobject_
const SiPixelTemplateDBObject * templateDBobject_
Definition: PixelCPEBase.h:238
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelTemplate::qavg
float qavg()
average cluster charge for this set of track angles
Definition: SiPixelTemplate.h:407
SiPixel2DTemplateDBObject
Definition: SiPixel2DTemplateDBObject.h:16
PixelCPEClusterRepair::forwardTemplateID_
int forwardTemplateID_
Definition: PixelCPEClusterRepair.h:109
SiPixelTemplate::pushfile
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
Definition: SiPixelTemplate.cc:129
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PixelCPEClusterRepair::ClusterParamTemplate::templYrec_
float templYrec_
Definition: PixelCPEClusterRepair.h:40
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
RectangularPixelTopology.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PixelCPEBase::DetParam::theRecTopol
const RectangularPixelTopology * theRecTopol
Definition: PixelCPEBase.h:50
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
min
T min(T a, T b)
Definition: MathUtil.h:58
SiPixelTemplate
Definition: SiPixelTemplate.h:246
TrackerTopology
Definition: TrackerTopology.h:16
PixelCPEClusterRepair::templateDBobject2D_
const SiPixel2DTemplateDBObject * templateDBobject2D_
Definition: PixelCPEClusterRepair.h:112
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiPixelCluster::y
float y() const
Definition: SiPixelCluster.h:117
PixelCPEBase::ttopo_
const TrackerTopology & ttopo_
Definition: PixelCPEBase.h:230
PixelCPEClusterRepair::ClusterParamTemplate::templProbXY_
float templProbXY_
Definition: PixelCPEClusterRepair.h:48
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PixelCPEClusterRepair::maxSizeMismatchInY_
float maxSizeMismatchInY_
Definition: PixelCPEClusterRepair.h:116
cms::cuda::assert
assert(be >=bs)
SiPixelTemplateReco::PixelTempReco1D
int PixelTempReco1D(int id, float cotalpha, float cotbeta, float locBz, float locBx, ClusMatrix &cluster, SiPixelTemplate &templ, float &yrec, float &sigmay, float &proby, float &xrec, float &sigmax, float &probx, int &qbin, int speed, bool deadpix, std::vector< std::pair< int, int > > &zeropix, float &probQ, int &nypix, int &nxpix)
Definition: SiPixelTemplateReco.cc:134
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
PixelCPEClusterRepair::callTempReco1D
void callTempReco1D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
Definition: PixelCPEClusterRepair.cc:310
PixelCPEBase::geom_
const TrackerGeometry & geom_
Definition: PixelCPEBase.h:229
PixelCPEClusterRepair::localPosition
LocalPoint localPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
Definition: PixelCPEClusterRepair.cc:171
Topology::localPosition
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
PixelCPEClusterRepair::callTempReco2D
void callTempReco2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco2D::ClusMatrix &clusterPayload, int ID, LocalPoint &lp) const
Definition: PixelCPEClusterRepair.cc:409
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:28
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
SiPixelTemplateReco2D::ClusMatrix::mrow
int mrow
Definition: SiPixelTemplateReco2D.h:44
PixelCPEClusterRepair::ClusterParamTemplate::templXrec_
float templXrec_
Definition: PixelCPEClusterRepair.h:39
PixelCPEBase::bothEdgeXError_
static constexpr float bothEdgeXError_
Definition: PixelCPEBase.h:252
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
PixelCPEBase::ClusterParam::hasFilledProb_
bool hasFilledProb_
Definition: PixelCPEBase.h:100
PixelCPEBase::DetParam::theDet
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:47
PixelCPEClusterRepair::PixelCPEClusterRepair
PixelCPEClusterRepair(edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelTemplateDBObject *, const SiPixel2DTemplateDBObject *)
Definition: PixelCPEClusterRepair.cc:38
PixelCPEBase::ClusterParam::theCluster
const SiPixelCluster * theCluster
Definition: PixelCPEBase.h:75
RectangularPixelTopology::isItBigPixelInY
bool isItBigPixelInY(const int iybin) const override
Definition: RectangularPixelTopology.h:118
SiPixelTemplate2D
Definition: SiPixelTemplate2D.h:128
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
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
SiPixelCluster::getSplitClusterErrorX
float getSplitClusterErrorX() const
Definition: SiPixelCluster.h:193
SiPixelCluster::sizeY
int sizeY() const
Definition: SiPixelCluster.h:132
SiPixelTemplateReco2D::ClusMatrix
Definition: SiPixelTemplateReco2D.h:38
RectangularPixelTopology::isItBigPixelInX
bool isItBigPixelInX(const int ixbin) const override
Definition: RectangularPixelTopology.h:114
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
PixelCPEBase::m_DetParams
DetParams m_DetParams
Definition: PixelCPEBase.h:281
GeomDetEnumerators::tkDetEnum
constexpr SubDetector tkDetEnum[8]
Definition: GeomDetEnumerators.h:37
SiPixelCluster::minPixelRow
int minPixelRow() const
Definition: SiPixelCluster.h:142
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
PixelCPEClusterRepair::Rule::Rule
Rule(const std::string &str)
Definition: PixelCPEClusterRepair.cc:697
str
#define str(s)
Definition: TestProcessor.cc:52
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
SiPixelTemplateReco
Definition: SiPixelTemplateReco.h:71
PixelCPEClusterRepair::createClusterParam
std::unique_ptr< ClusterParam > createClusterParam(const SiPixelCluster &cl) const override
Definition: PixelCPEClusterRepair.cc:160
PixelCPEClusterRepair::speed_
int speed_
Definition: PixelCPEClusterRepair.h:103
PixelCPEBase::xEdgeXError_
static constexpr float xEdgeXError_
Definition: PixelCPEBase.h:246
Point3DBase< float, LocalTag >
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
PixelCPEBase::DetParam::detTemplateId2D
int detTemplateId2D
Definition: PixelCPEBase.h:66
PixelCPEClusterRepair::checkRecommend2D
void checkRecommend2D(DetParam const &theDetParam, ClusterParamTemplate &theClusterParam, SiPixelTemplateReco::ClusMatrix &clusterPayload, int ID) const
Definition: PixelCPEClusterRepair.cc:526
PixelCPEBase::ClusterParam::filled_from_2d
bool filled_from_2d
Definition: PixelCPEBase.h:103
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelCPEBase::ClusterParam::spansTwoROCs_
bool spansTwoROCs_
Definition: PixelCPEBase.h:99
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
PixelCPEBase::ClusterParam::hasBadPixels_
bool hasBadPixels_
Definition: PixelCPEBase.h:98
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
PixelCPEClusterRepair::ClusterParamTemplate
Definition: PixelCPEClusterRepair.h:36
align::ID
uint32_t ID
Definition: Definitions.h:24
SiPixel2DTemplateDBObject::getTemplateID
short getTemplateID(const uint32_t &detid) const
Definition: SiPixel2DTemplateDBObject.h:90
SiPixelCluster::x
float x() const
Definition: SiPixelCluster.h:109
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
PixelCPEClusterRepair::ClusterParamTemplate::recommended2D_
bool recommended2D_
Definition: PixelCPEClusterRepair.h:49
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
SiPixelTemplateDBObject
Definition: SiPixelTemplateDBObject.h:16
createfilelist.int
int
Definition: createfilelist.py:10
GeomDetEnumerators::isTrackerPixel
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:68
PixelCPEBase::ClusterParam::probabilityY_
float probabilityY_
Definition: PixelCPEBase.h:93
PixelCPEBase::theVerboseLevel
int theVerboseLevel
Definition: PixelCPEBase.h:225
GeomDetEnumerators::isBarrel
bool isBarrel(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:57
PixelCPEClusterRepair::localError
LocalError localError(DetParam const &theDetParam, ClusterParam &theClusterParam) const override
Definition: PixelCPEClusterRepair.cc:618
PixelCPEClusterRepair.h
PixelCPEClusterRepair::UseClusterSplitter_
bool UseClusterSplitter_
Definition: PixelCPEClusterRepair.h:105
SiPixelCluster::getSplitClusterErrorY
float getSplitClusterErrorY() const
Definition: SiPixelCluster.h:194
MagneticField.h
SiPixelCluster::size
int size() const
Definition: SiPixelCluster.h:126
SiPixelCluster::pixel
Pixel pixel(int i) const
Definition: SiPixelCluster.h:162
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelCPEBase::LoadTemplatesFromDB_
bool LoadTemplatesFromDB_
Definition: PixelCPEBase.h:242
PixelCPEBase::DetParam::detTemplateId
int detTemplateId
Definition: PixelCPEBase.h:65
PixelCPEBase::DetParam::thePart
GeomDetType::SubDetector thePart
Definition: PixelCPEBase.h:52
PixelCPEClusterRepair::Rule::subdet_
int subdet_
Definition: PixelCPEClusterRepair.h:140
PixelCPEBase::ClusterParam::edgeTypeY_
int edgeTypeY_
Definition: PixelCPEBase.h:107
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
PixelCPEBase::DetParam
Definition: PixelCPEBase.h:45
PixelCPEBase::ClusterParam::probabilityX_
float probabilityX_
Definition: PixelCPEBase.h:92
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
SiPixelTemplateReco::ClusMatrix::mcol
int mcol
Definition: SiPixelTemplateReco.h:79
PixelCPEBase::ClusterParam::probabilityQ_
float probabilityQ_
Definition: PixelCPEBase.h:94
PixelCPEBase::ClusterParam::isOnEdge_
bool isOnEdge_
Definition: PixelCPEBase.h:97
PixelCPEClusterRepair::minChargeRatio_
float minChargeRatio_
Definition: PixelCPEClusterRepair.h:115
SiPixelTemplateReco::ClusMatrix::ydouble
bool const * ydouble
Definition: SiPixelTemplateReco.h:78
Exception
Definition: hltDiff.cc:245
PixelCPEBase::yEdgeYError_
static constexpr float yEdgeYError_
Definition: PixelCPEBase.h:250
PixelTopology::localY
virtual float localY(float mpY) const =0
PixelCPEBase
Definition: PixelCPEBase.h:43
SiPixelTemplateReco::ClusMatrix
Definition: SiPixelTemplateReco.h:73
PixelGeomDetUnit.h
PixelCPEClusterRepair::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEClusterRepair.cc:722
PixelCPEBase::ClusterParam::loc_trk_pred
Topology::LocalTrackPred loc_trk_pred
Definition: PixelCPEBase.h:89
PixelCPEClusterRepair::~PixelCPEClusterRepair
~PixelCPEClusterRepair() override
Definition: PixelCPEClusterRepair.cc:158
SiPixelCluster::charge
int charge() const
Definition: SiPixelCluster.h:134
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PixelCPEClusterRepair::Rule::layer_
int layer_
Definition: PixelCPEClusterRepair.h:141
PixelCPEBase::ClusterParam::cotbeta
float cotbeta
Definition: PixelCPEBase.h:79
PixelCPEBase::clusterSplitMaxError_
static constexpr float clusterSplitMaxError_
Definition: PixelCPEBase.h:255
PixelTopology::localX
virtual float localX(float mpX) const =0
cms::Exception
Definition: Exception.h:70
PixelCPEBase::ClusterParam::cotalpha
float cotalpha
Definition: PixelCPEBase.h:78
SiPixelCluster::sizeX
int sizeX() const
Definition: SiPixelCluster.h:129
PixelCPEClusterRepair::ClusterParamTemplate::ierr2
int ierr2
Definition: PixelCPEClusterRepair.h:50
SiPixelTemplateReco2D::PixelTempReco2D
int PixelTempReco2D(int id, float cotalpha, float cotbeta, float locBz, float locBx, int edgeflagy, int edgeflagx, ClusMatrix &cluster, SiPixelTemplate2D &templ, float &yrec, float &sigmay, float &xrec, float &sigmax, float &probxy, float &probQ, int &qbin, float &deltay, int &npixel)
Definition: SiPixelTemplateReco2D.cc:83
SiPixelTemplate::clsleny
float clsleny()
y-size of smaller interpolated template in pixels
Definition: SiPixelTemplate.h:437
MagneticField
Definition: MagneticField.h:19
TrackerGeometry::offsetDU
unsigned int offsetDU(SubDetector sid) const
Definition: TrackerGeometry.h:72
PixelCPEBase::xEdgeYError_
static constexpr float xEdgeYError_
Definition: PixelCPEBase.h:247
GeomDetEnumerators::isEndcap
bool isEndcap(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:62
SiPixelTemplate2D::pushfile
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore2D > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
Definition: SiPixelTemplate2D.cc:61
PixelCPEClusterRepair::thePixelTemp2D_
std::vector< SiPixelTemplateStore2D > thePixelTemp2D_
Definition: PixelCPEClusterRepair.h:101
PixelCPEClusterRepair::ClusterParamTemplate::ierr
int ierr
Definition: PixelCPEClusterRepair.h:45
PixelCPEBase::ClusterParam::with_track_angle
bool with_track_angle
Definition: PixelCPEBase.h:102
PixelCPEBase::ClusterParam::edgeTypeX_
int edgeTypeX_
Definition: PixelCPEBase.h:106
SiPixelTemplate::interpolate
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx)
Definition: SiPixelTemplate.cc:1327
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
PixelCPEBase::yEdgeXError_
static constexpr float yEdgeXError_
Definition: PixelCPEBase.h:249
TrackerGeometry
Definition: TrackerGeometry.h:14
PixelCPEClusterRepair::templateDir_
std::string templateDir_
Definition: PixelCPEClusterRepair.h:110
PixelCPEBase::ClusterParam::qBin_
int qBin_
Definition: PixelCPEBase.h:95