CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PixelCPEGeneric Class Referencefinal

#include <PixelCPEGeneric.h>

Inheritance diagram for PixelCPEGeneric:
PixelCPEGenericBase PixelCPEBase PixelClusterParameterEstimator

Public Member Functions

 PixelCPEGeneric (edm::ParameterSet const &conf, const MagneticField *, const TrackerGeometry &, const TrackerTopology &, const SiPixelLorentzAngle *, const SiPixelGenErrorDBObject *, const SiPixelLorentzAngle *)
 The constructor. More...
 
 ~PixelCPEGeneric () override=default
 
- Public Member Functions inherited from PixelCPEGenericBase
 PixelCPEGenericBase (edm::ParameterSet const &conf, const MagneticField *mag, const TrackerGeometry &geom, const TrackerTopology &ttopo, const SiPixelLorentzAngle *lorentzAngle, const SiPixelGenErrorDBObject *genErrorDBObject, const SiPixelLorentzAngle *lorentzAngleWidth)
 
 ~PixelCPEGenericBase () override=default
 
- Public Member Functions inherited from PixelCPEBase
ReturnType getParameters (const SiPixelCluster &cl, const GeomDetUnit &det) const override
 
ReturnType getParameters (const SiPixelCluster &cl, const GeomDetUnit &det, const LocalTrajectoryParameters &ltp) const override
 
 PixelCPEBase (edm::ParameterSet const &conf, const MagneticField *mag, const TrackerGeometry &geom, const TrackerTopology &ttopo, const SiPixelLorentzAngle *lorentzAngle, const SiPixelGenErrorDBObject *genErrorDBObject, const SiPixelTemplateDBObject *templateDBobject, const SiPixelLorentzAngle *lorentzAngleWidth, int flag=0)
 
- Public Member Functions inherited from PixelClusterParameterEstimator
unsigned int clusterProbComputationFlag () const
 
virtual ReturnType getParameters (const SiPixelCluster &cl, const GeomDetUnit &det, const TrajectoryStateOnSurface &tsos) const
 
virtual VLocalValues localParametersV (const SiPixelCluster &cluster, const GeomDetUnit &gd) const
 
virtual VLocalValues localParametersV (const SiPixelCluster &cluster, const GeomDetUnit &gd, TrajectoryStateOnSurface &tsos) const
 
 PixelClusterParameterEstimator ()
 
virtual ~PixelClusterParameterEstimator ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from PixelCPEGenericBase
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from PixelCPEBase
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Member Functions

float err2X (bool &, int &) const
 
float err2Y (bool &, int &) const
 
LocalError localError (DetParam const &theDetParam, ClusterParam &theClusterParam) const override
 
LocalPoint localPosition (DetParam const &theDetParam, ClusterParam &theClusterParam) const override
 

Private Attributes

bool DoCosmics_
 
bool inflate_all_errors_no_trk_angle
 
bool inflate_errors
 
bool IrradiationBiasCorrection_
 
bool isUpgrade_
 
bool NoTemplateErrorsWhenNoTrkAngles_
 
float the_eff_charge_cut_highX
 
float the_eff_charge_cut_highY
 
float the_eff_charge_cut_lowX
 
float the_eff_charge_cut_lowY
 
float the_size_cutX
 
float the_size_cutY
 
std::vector< SiPixelGenErrorStorethePixelGenError_
 

Additional Inherited Members

- Public Types inherited from PixelClusterParameterEstimator
typedef std::pair< LocalPoint, LocalErrorLocalValues
 
using ReturnType = std::tuple< LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType >
 
typedef std::vector< LocalValuesVLocalValues
 
- Protected Types inherited from PixelCPEBase
using DetParams = std::vector< DetParam >
 
typedef GloballyPositioned< double > Frame
 
- Protected Member Functions inherited from PixelCPEGenericBase
std::unique_ptr< ClusterParamcreateClusterParam (const SiPixelCluster &cl) const override
 
void initializeLocalErrorVariables (float &xerr, float &yerr, bool &edgex, bool &edgey, bool &bigInX, bool &bigInY, int &maxPixelCol, int &maxPixelRow, int &minPixelCol, int &minPixelRow, uint &sizex, uint &sizey, DetParam const &theDetParam, ClusterParamGeneric const &theClusterParam) const
 
void setXYErrors (float &xerr, float &yerr, const bool edgex, const bool edgey, const unsigned int sizex, const unsigned int sizey, const bool bigInX, const bool bigInY, const bool useTemplateErrors, DetParam const &theDetParam, ClusterParamGeneric const &theClusterParam) const
 
- Protected Member Functions inherited from PixelCPEBase
void computeAnglesFromDetPosition (DetParam const &theDetParam, ClusterParam &theClusterParam) const
 
void computeAnglesFromTrajectory (DetParam const &theDetParam, ClusterParam &theClusterParam, const LocalTrajectoryParameters &ltp) const
 
void computeLorentzShifts (DetParam &) const
 
DetParam const & detParam (const GeomDetUnit &det) const
 
LocalVector driftDirection (DetParam &theDetParam, GlobalVector bfield) const
 
LocalVector driftDirection (DetParam &theDetParam, LocalVector bfield) const
 
void setTheClu (DetParam const &, ClusterParam &theClusterParam) const
 
- Static Protected Member Functions inherited from PixelCPEGenericBase
static void collect_edge_charges (ClusterParam &theClusterParam, int &q_f_X, int &q_l_X, int &q_f_Y, int &q_l_Y, bool truncate)
 
- Protected Attributes inherited from PixelCPEGenericBase
const float edgeClusterErrorX_
 
const float edgeClusterErrorY_
 
const bool truncatePixelCharge_
 
bool useErrorsFromTemplates_
 
const std::vector< float > xerr_barrel_l1_
 
const float xerr_barrel_l1_def_
 
const std::vector< float > xerr_barrel_ln_
 
const float xerr_barrel_ln_def_
 
const std::vector< float > xerr_endcap_
 
const float xerr_endcap_def_
 
const std::vector< float > yerr_barrel_l1_
 
const float yerr_barrel_l1_def_
 
const std::vector< float > yerr_barrel_ln_
 
const float yerr_barrel_ln_def_
 
const std::vector< float > yerr_endcap_
 
const float yerr_endcap_def_
 
- Protected Attributes inherited from PixelCPEBase
bool alpha2Order
 
bool doLorentzFromAlignment_
 
const SiPixelGenErrorDBObjectgenErrorDBObject_
 
const TrackerGeometrygeom_
 
float lAOffset_
 
float lAWidthBPix_
 
float lAWidthFPix_
 
bool LoadTemplatesFromDB_
 
const SiPixelLorentzAnglelorentzAngle_
 
const SiPixelLorentzAnglelorentzAngleWidth_
 
DetParams m_DetParams = DetParams(1440)
 
const MagneticFieldmagfield_
 
const SiPixelTemplateDBObjecttemplateDBobject_
 
int theFlag_
 
int theVerboseLevel
 
const TrackerTopologyttopo_
 
bool useLAFromDB_
 
bool useLAOffsetFromConfig_
 
bool useLAWidthFromConfig_
 
bool useLAWidthFromDB_
 
- Protected Attributes inherited from PixelClusterParameterEstimator
unsigned int clusterProbComputationFlag_
 
- Static Protected Attributes inherited from PixelCPEBase
static constexpr float bothEdgeXError_ = 31.0f
 
static constexpr float bothEdgeYError_ = 90.0f
 
static constexpr float clusterSplitMaxError_ = 7777.7f
 
static constexpr float xEdgeXError_ = 23.0f
 
static constexpr float xEdgeYError_ = 39.0f
 
static constexpr float yEdgeXError_ = 24.0f
 
static constexpr float yEdgeYError_ = 96.0f
 

Detailed Description

Definition at line 52 of file PixelCPEGeneric.h.

Constructor & Destructor Documentation

◆ PixelCPEGeneric()

PixelCPEGeneric::PixelCPEGeneric ( edm::ParameterSet const &  conf,
const MagneticField mag,
const TrackerGeometry geom,
const TrackerTopology ttopo,
const SiPixelLorentzAngle lorentzAngle,
const SiPixelGenErrorDBObject genErrorDBObject,
const SiPixelLorentzAngle lorentzAngleWidth = nullptr 
)

The constructor.

Definition at line 30 of file PixelCPEGeneric.cc.

37  : PixelCPEGenericBase(conf, mag, geom, ttopo, lorentzAngle, genErrorDBObject, lorentzAngleWidth) {
38  if (theVerboseLevel > 0)
39  LogDebug("PixelCPEGeneric") << " constructing a generic algorithm for ideal pixel detector.\n"
40  << " CPEGeneric:: VerboseLevel = " << theVerboseLevel;
41 
42  // Externally settable cuts
43  the_eff_charge_cut_lowX = conf.getParameter<double>("eff_charge_cut_lowX");
44  the_eff_charge_cut_lowY = conf.getParameter<double>("eff_charge_cut_lowY");
45  the_eff_charge_cut_highX = conf.getParameter<double>("eff_charge_cut_highX");
46  the_eff_charge_cut_highY = conf.getParameter<double>("eff_charge_cut_highY");
47  the_size_cutX = conf.getParameter<double>("size_cutX");
48  the_size_cutY = conf.getParameter<double>("size_cutY");
49 
50  // Externally settable flags to inflate errors
51  inflate_errors = conf.getParameter<bool>("inflate_errors");
52  inflate_all_errors_no_trk_angle = conf.getParameter<bool>("inflate_all_errors_no_trk_angle");
53 
54  NoTemplateErrorsWhenNoTrkAngles_ = conf.getParameter<bool>("NoTemplateErrorsWhenNoTrkAngles");
55  IrradiationBiasCorrection_ = conf.getParameter<bool>("IrradiationBiasCorrection");
56  DoCosmics_ = conf.getParameter<bool>("DoCosmics");
57 
58  // Upgrade means phase 2
59  isUpgrade_ = conf.getParameter<bool>("Upgrade");
60 
61  // For cosmics force the use of simple errors
62  if ((DoCosmics_))
64 
66  throw cms::Exception("PixelCPEGeneric::PixelCPEGeneric: ")
67  << "\nERROR: useErrorsFromTemplates_ is set to False in PixelCPEGeneric_cfi.py. "
68  << " In this case it does not make sense to set any of the following to True: "
69  << " truncatePixelCharge_, IrradiationBiasCorrection_, DoCosmics_, LoadTemplatesFromDB_ !!!"
70  << "\n\n";
71  }
72 
73  // Use errors from templates or from GenError
75  if (LoadTemplatesFromDB_) { // From DB
77  throw cms::Exception("InvalidCalibrationLoaded")
78  << "ERROR: GenErrors not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject version "
79  << (*genErrorDBObject_).version();
80  if (MYDEBUG)
81  cout << "Loaded genErrorDBObject v" << (*genErrorDBObject_).version() << endl;
82  } else { // From file
84  throw cms::Exception("InvalidCalibrationLoaded")
85  << "ERROR: GenErrors not loaded correctly from text file. Reconstruction will fail.";
86  } // if load from DB
87 
88  } else {
89  if (MYDEBUG)
90  cout << " Use simple parametrised errors " << endl;
91  } // if ( useErrorsFromTemplates_ )
92 
93  if (MYDEBUG) {
94  cout << "From PixelCPEGeneric::PixelCPEGeneric(...)" << endl;
95  cout << "(int)useErrorsFromTemplates_ = " << (int)useErrorsFromTemplates_ << endl;
96  cout << "truncatePixelCharge_ = " << (int)truncatePixelCharge_ << endl;
97  cout << "IrradiationBiasCorrection_ = " << (int)IrradiationBiasCorrection_ << endl;
98  cout << "(int)DoCosmics_ = " << (int)DoCosmics_ << endl;
99  cout << "(int)LoadTemplatesFromDB_ = " << (int)LoadTemplatesFromDB_ << endl;
100  }
101 }

References gather_cfg::cout, DoCosmics_, Exception, PixelCPEBase::genErrorDBObject_, edm::ParameterSet::getParameter(), inflate_all_errors_no_trk_angle, inflate_errors, createfilelist::int, IrradiationBiasCorrection_, isUpgrade_, PixelCPEBase::LoadTemplatesFromDB_, LogDebug, NoTemplateErrorsWhenNoTrkAngles_, SiPixelGenError::pushfile(), the_eff_charge_cut_highX, the_eff_charge_cut_highY, the_eff_charge_cut_lowX, the_eff_charge_cut_lowY, the_size_cutX, the_size_cutY, thePixelGenError_, PixelCPEBase::theVerboseLevel, PixelCPEGenericBase::truncatePixelCharge_, and PixelCPEGenericBase::useErrorsFromTemplates_.

◆ ~PixelCPEGeneric()

PixelCPEGeneric::~PixelCPEGeneric ( )
overridedefault

Member Function Documentation

◆ err2X()

float PixelCPEGeneric::err2X ( bool &  ,
int &   
) const
private

◆ err2Y()

float PixelCPEGeneric::err2Y ( bool &  ,
int &   
) const
private

◆ fillPSetDescription()

void PixelCPEGeneric::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 439 of file PixelCPEGeneric.cc.

439  {
441  desc.add<double>("eff_charge_cut_highX", 1.0);
442  desc.add<double>("eff_charge_cut_highY", 1.0);
443  desc.add<double>("eff_charge_cut_lowX", 0.0);
444  desc.add<double>("eff_charge_cut_lowY", 0.0);
445  desc.add<double>("size_cutX", 3.0);
446  desc.add<double>("size_cutY", 3.0);
447  desc.add<double>("EdgeClusterErrorX", 50.0);
448  desc.add<double>("EdgeClusterErrorY", 85.0);
449  desc.add<bool>("inflate_errors", false);
450  desc.add<bool>("inflate_all_errors_no_trk_angle", false);
451  desc.add<bool>("NoTemplateErrorsWhenNoTrkAngles", false);
452  desc.add<bool>("UseErrorsFromTemplates", true);
453  desc.add<bool>("TruncatePixelCharge", true);
454  desc.add<bool>("IrradiationBiasCorrection", false);
455  desc.add<bool>("DoCosmics", false);
456  desc.add<bool>("Upgrade", false);
457  desc.add<bool>("SmallPitch", false);
458 }

References submitPVResolutionJobs::desc, and PixelCPEGenericBase::fillPSetDescription().

Referenced by PixelCPEGenericESProducer::fillDescriptions().

◆ localError()

LocalError PixelCPEGeneric::localError ( DetParam const &  theDetParam,
ClusterParam theClusterParam 
) const
overrideprivatevirtual

Implements PixelCPEBase.

Definition at line 353 of file PixelCPEGeneric.cc.

353  {
354  ClusterParamGeneric& theClusterParam = static_cast<ClusterParamGeneric&>(theClusterParamBase);
355 
356  // local variables
357  float xerr, yerr;
358  bool edgex, edgey, bigInX, bigInY;
359  int maxPixelCol, maxPixelRow, minPixelCol, minPixelRow;
360  uint sizex, sizey;
361 
363  yerr,
364  edgex,
365  edgey,
366  bigInX,
367  bigInY,
368  maxPixelCol,
369  maxPixelRow,
370  minPixelCol,
371  minPixelRow,
372  sizex,
373  sizey,
374  theDetParam,
375  theClusterParam);
376 
377  bool useTempErrors =
378  useErrorsFromTemplates_ && (!NoTemplateErrorsWhenNoTrkAngles_ || theClusterParam.with_track_angle);
379 
380  if (int(sizex) != (maxPixelRow - minPixelRow + 1))
381  LogDebug("PixelCPEGeneric") << " wrong x" << endl;
382  if (int(sizey) != (maxPixelCol - minPixelCol + 1))
383  LogDebug("PixelCPEGeneric") << " wrong y" << endl;
384 
385  LogDebug("PixelCPEGeneric") << " edge clus " << xerr << " " << yerr << endl; //dk
386  if (bigInX || bigInY)
387  LogDebug("PixelCPEGeneric") << " big " << bigInX << " " << bigInY << endl;
388  if (edgex || edgey)
389  LogDebug("PixelCPEGeneric") << " edge " << edgex << " " << edgey << endl;
390  LogDebug("PixelCPEGeneric") << " before if " << useErrorsFromTemplates_ << " " << theClusterParam.qBin_ << endl;
391  if (theClusterParam.qBin_ == 0)
392  LogDebug("PixelCPEGeneric") << " qbin 0! " << edgex << " " << edgey << " " << bigInX << " " << bigInY << " "
393  << sizex << " " << sizey << endl;
394 
395  // from PixelCPEGenericBase
396  setXYErrors(xerr, yerr, edgex, edgey, sizex, sizey, bigInX, bigInY, useTempErrors, theDetParam, theClusterParam);
397 
398  if (!useTempErrors) {
399  LogDebug("PixelCPEGeneric") << "Track angles are not known.\n"
400  << "Default angle estimation which assumes track from PV (0,0,0) does not work.";
401  }
402 
403  if (!useTempErrors && inflate_errors) {
404  int n_bigx = 0;
405  int n_bigy = 0;
406 
407  for (int irow = 0; irow < 7; ++irow) {
408  if (theDetParam.theRecTopol->isItBigPixelInX(irow + minPixelRow))
409  ++n_bigx;
410  }
411 
412  for (int icol = 0; icol < 21; ++icol) {
413  if (theDetParam.theRecTopol->isItBigPixelInY(icol + minPixelCol))
414  ++n_bigy;
415  }
416 
417  xerr = (float)(sizex + n_bigx) * theDetParam.thePitchX / std::sqrt(12.0f);
418  yerr = (float)(sizey + n_bigy) * theDetParam.thePitchY / std::sqrt(12.0f);
419  }
420 
421 #ifdef EDM_ML_DEBUG
422  if (!(xerr > 0.0))
423  throw cms::Exception("PixelCPEGeneric::localError") << "\nERROR: Negative pixel error xerr = " << xerr << "\n\n";
424 
425  if (!(yerr > 0.0))
426  throw cms::Exception("PixelCPEGeneric::localError") << "\nERROR: Negative pixel error yerr = " << yerr << "\n\n";
427 #endif
428 
429  LogDebug("PixelCPEGeneric") << " errors " << xerr << " " << yerr << endl; //dk
430  if (theClusterParam.qBin_ == 0)
431  LogDebug("PixelCPEGeneric") << " qbin 0 " << xerr << " " << yerr << endl;
432 
433  auto xerr_sq = xerr * xerr;
434  auto yerr_sq = yerr * yerr;
435 
436  return LocalError(xerr_sq, 0, yerr_sq);
437 }

References Exception, f, dqmMemoryStats::float, HLTSiStripMonitoring_cff::inflate_errors, RectangularPixelTopology::isItBigPixelInX(), RectangularPixelTopology::isItBigPixelInY(), LogDebug, PixelCPEBase::ClusterParam::qBin_, mathSSE::sqrt(), PixelCPEBase::DetParam::thePitchX, PixelCPEBase::DetParam::thePitchY, PixelCPEBase::DetParam::theRecTopol, parallelization::uint, and PixelCPEBase::ClusterParam::with_track_angle.

◆ localPosition()

LocalPoint PixelCPEGeneric::localPosition ( DetParam const &  theDetParam,
ClusterParam theClusterParamBase 
) const
overrideprivatevirtual

Hit position in the local frame (in cm). Unlike other CPE's, this one converts everything from the measurement frame (in channel numbers) into the local frame (in centimeters).

< Q of the first pixel in X

< Q of the last pixel in X

< Q of the first pixel in Y

< Q of the last pixel in Y

Implements PixelCPEBase.

Definition at line 108 of file PixelCPEGeneric.cc.

108  {
109  ClusterParamGeneric& theClusterParam = static_cast<ClusterParamGeneric&>(theClusterParamBase);
110 
111  //cout<<" in PixelCPEGeneric:localPosition - "<<endl; //dk
112 
113  float chargeWidthX = (theDetParam.lorentzShiftInCmX * theDetParam.widthLAFractionX);
114  float chargeWidthY = (theDetParam.lorentzShiftInCmY * theDetParam.widthLAFractionY);
115  float shiftX = 0.5f * theDetParam.lorentzShiftInCmX;
116  float shiftY = 0.5f * theDetParam.lorentzShiftInCmY;
117 
118  //cout<<" main la width "<<chargeWidthX<<" "<<chargeWidthY<<endl;
119 
121  float qclus = theClusterParam.theCluster->charge();
122  float locBz = theDetParam.bz;
123  float locBx = theDetParam.bx;
124  //cout << "PixelCPEGeneric::localPosition(...) : locBz = " << locBz << endl;
125 
126  theClusterParam.pixmx = -999; // max pixel charge for truncation of 2-D cluster
127  theClusterParam.sigmay = -999.9; // CPE Generic y-error for multi-pixel cluster
128  theClusterParam.deltay = -999.9; // CPE Generic y-bias for multi-pixel cluster
129  theClusterParam.sigmax = -999.9; // CPE Generic x-error for multi-pixel cluster
130  theClusterParam.deltax = -999.9; // CPE Generic x-bias for multi-pixel cluster
131  theClusterParam.sy1 = -999.9; // CPE Generic y-error for single single-pixel
132  theClusterParam.dy1 = -999.9; // CPE Generic y-bias for single single-pixel cluster
133  theClusterParam.sy2 = -999.9; // CPE Generic y-error for single double-pixel cluster
134  theClusterParam.dy2 = -999.9; // CPE Generic y-bias for single double-pixel cluster
135  theClusterParam.sx1 = -999.9; // CPE Generic x-error for single single-pixel cluster
136  theClusterParam.dx1 = -999.9; // CPE Generic x-bias for single single-pixel cluster
137  theClusterParam.sx2 = -999.9; // CPE Generic x-error for single double-pixel cluster
138  theClusterParam.dx2 = -999.9; // CPE Generic x-bias for single double-pixel cluster
139 
141  int gtemplID_ = theDetParam.detTemplateId;
142 
143  //int gtemplID0 = genErrorDBObject_->getGenErrorID(theDetParam.theDet->geographicalId().rawId());
144  //if(gtemplID0!=gtemplID_) cout<<" different id "<< gtemplID_<<" "<<gtemplID0<<endl;
145 
146  theClusterParam.qBin_ = gtempl.qbin(gtemplID_,
147  theClusterParam.cotalpha,
148  theClusterParam.cotbeta,
149  locBz,
150  locBx,
151  qclus,
153  theClusterParam.pixmx,
154  theClusterParam.sigmay,
155  theClusterParam.deltay,
156  theClusterParam.sigmax,
157  theClusterParam.deltax,
158  theClusterParam.sy1,
159  theClusterParam.dy1,
160  theClusterParam.sy2,
161  theClusterParam.dy2,
162  theClusterParam.sx1,
163  theClusterParam.dx1,
164  theClusterParam.sx2,
165  theClusterParam.dx2);
166 
167  // now use the charge widths stored in the new generic template headers (change to the
168  // incorrect sign convention of the base class)
169  bool useLAWidthFromGenError = false;
170  if (useLAWidthFromGenError) {
171  chargeWidthX = (-micronsToCm * gtempl.lorxwidth());
172  chargeWidthY = (-micronsToCm * gtempl.lorywidth());
173  if (MYDEBUG)
174  cout << " redefine la width (gen-error) " << chargeWidthX << " " << chargeWidthY << endl;
175  }
176  if (MYDEBUG)
177  cout << " GenError: " << gtemplID_ << endl;
178 
179  // These numbers come in microns from the qbin(...) call. Transform them to cm.
180  theClusterParam.deltax = theClusterParam.deltax * micronsToCm;
181  theClusterParam.dx1 = theClusterParam.dx1 * micronsToCm;
182  theClusterParam.dx2 = theClusterParam.dx2 * micronsToCm;
183 
184  theClusterParam.deltay = theClusterParam.deltay * micronsToCm;
185  theClusterParam.dy1 = theClusterParam.dy1 * micronsToCm;
186  theClusterParam.dy2 = theClusterParam.dy2 * micronsToCm;
187 
188  theClusterParam.sigmax = theClusterParam.sigmax * micronsToCm;
189  theClusterParam.sx1 = theClusterParam.sx1 * micronsToCm;
190  theClusterParam.sx2 = theClusterParam.sx2 * micronsToCm;
191 
192  theClusterParam.sigmay = theClusterParam.sigmay * micronsToCm;
193  theClusterParam.sy1 = theClusterParam.sy1 * micronsToCm;
194  theClusterParam.sy2 = theClusterParam.sy2 * micronsToCm;
195 
196  } // if ( useErrorsFromTemplates_ )
197  else {
198  theClusterParam.qBin_ = 0;
199  }
200 
201  int q_f_X;
202  int q_l_X;
203  int q_f_Y;
204  int q_l_Y;
205  collect_edge_charges(theClusterParam, q_f_X, q_l_X, q_f_Y, q_l_Y, useErrorsFromTemplates_ && truncatePixelCharge_);
206 
207  //--- Find the inner widths along X and Y in one shot. We
208  //--- compute the upper right corner of the inner pixels
209  //--- (== lower left corner of upper right pixel) and
210  //--- the lower left corner of the inner pixels
211  //--- (== upper right corner of lower left pixel), and then
212  //--- subtract these two points in the formula.
213 
214  //--- Upper Right corner of Lower Left pixel -- in measurement frame
215  MeasurementPoint meas_URcorn_LLpix(theClusterParam.theCluster->minPixelRow() + 1.0,
216  theClusterParam.theCluster->minPixelCol() + 1.0);
217 
218  //--- Lower Left corner of Upper Right pixel -- in measurement frame
219  MeasurementPoint meas_LLcorn_URpix(theClusterParam.theCluster->maxPixelRow(),
220  theClusterParam.theCluster->maxPixelCol());
221 
222  //--- These two now converted into the local
223  LocalPoint local_URcorn_LLpix;
224  LocalPoint local_LLcorn_URpix;
225 
226  // PixelCPEGeneric can be used with or without track angles
227  // If PixelCPEGeneric is called with track angles, use them to correct for bows/kinks:
228  if (theClusterParam.with_track_angle) {
229  local_URcorn_LLpix = theDetParam.theTopol->localPosition(meas_URcorn_LLpix, theClusterParam.loc_trk_pred);
230  local_LLcorn_URpix = theDetParam.theTopol->localPosition(meas_LLcorn_URpix, theClusterParam.loc_trk_pred);
231  } else {
232  local_URcorn_LLpix = theDetParam.theTopol->localPosition(meas_URcorn_LLpix);
233  local_LLcorn_URpix = theDetParam.theTopol->localPosition(meas_LLcorn_URpix);
234  }
235 
236 #ifdef EDM_ML_DEBUG
237  if (theVerboseLevel > 20) {
238  cout << "\n\t >>> theClusterParam.theCluster->x = " << theClusterParam.theCluster->x()
239  << "\n\t >>> theClusterParam.theCluster->y = " << theClusterParam.theCluster->y()
240  << "\n\t >>> cluster: minRow = " << theClusterParam.theCluster->minPixelRow()
241  << " minCol = " << theClusterParam.theCluster->minPixelCol()
242  << "\n\t >>> cluster: maxRow = " << theClusterParam.theCluster->maxPixelRow()
243  << " maxCol = " << theClusterParam.theCluster->maxPixelCol()
244  << "\n\t >>> meas: inner lower left = " << meas_URcorn_LLpix.x() << "," << meas_URcorn_LLpix.y()
245  << "\n\t >>> meas: inner upper right = " << meas_LLcorn_URpix.x() << "," << meas_LLcorn_URpix.y() << endl;
246  }
247 #endif
248 
249  //--- &&& Note that the cuts below should not be hardcoded (like in Orca and
250  //--- &&& CPEFromDetPosition/PixelCPEInitial), but rather be
251  //--- &&& externally settable (but tracked) parameters.
252 
253  //--- Position, including the half lorentz shift
254 
255 #ifdef EDM_ML_DEBUG
256  if (theVerboseLevel > 20)
257  cout << "\t >>> Generic:: processing X" << endl;
258 #endif
259 
261  theClusterParam.theCluster->sizeX(),
262  q_f_X,
263  q_l_X,
264  local_URcorn_LLpix.x(),
265  local_LLcorn_URpix.x(),
266  chargeWidthX, // lorentz shift in cm
267  theDetParam.theThickness,
268  theClusterParam.cotalpha,
269  theDetParam.thePitchX,
270  theDetParam.theRecTopol->isItBigPixelInX(theClusterParam.theCluster->minPixelRow()),
271  theDetParam.theRecTopol->isItBigPixelInX(theClusterParam.theCluster->maxPixelRow()),
274  the_size_cutX); // cut for eff charge width &&&
275 
276  // apply the lorentz offset correction
277  xPos = xPos + shiftX;
278 
279 #ifdef EDM_ML_DEBUG
280  if (theVerboseLevel > 20)
281  cout << "\t >>> Generic:: processing Y" << endl;
282 #endif
283 
285  theClusterParam.theCluster->sizeY(),
286  q_f_Y,
287  q_l_Y,
288  local_URcorn_LLpix.y(),
289  local_LLcorn_URpix.y(),
290  chargeWidthY, // lorentz shift in cm
291  theDetParam.theThickness,
292  theClusterParam.cotbeta,
293  theDetParam.thePitchY,
294  theDetParam.theRecTopol->isItBigPixelInY(theClusterParam.theCluster->minPixelCol()),
295  theDetParam.theRecTopol->isItBigPixelInY(theClusterParam.theCluster->maxPixelCol()),
298  the_size_cutY); // cut for eff charge width &&&
299 
300  // apply the lorentz offset correction
301  yPos = yPos + shiftY;
302 
303  // Apply irradiation corrections
305  if (theClusterParam.theCluster->sizeX() == 1) { // size=1
306  // ggiurgiu@jhu.edu, 02/03/09 : for size = 1, the Lorentz shift is already accounted by the irradiation correction
307  //float tmp1 = (0.5 * theDetParam.lorentzShiftInCmX);
308  //cout << "Apply correction correction_dx1 = " << theClusterParam.dx1 << " to xPos = " << xPos;
309  xPos = xPos - (0.5f * theDetParam.lorentzShiftInCmX);
310  // Find if pixel is double (big).
311  bool bigInX = theDetParam.theRecTopol->isItBigPixelInX(theClusterParam.theCluster->maxPixelRow());
312  if (!bigInX)
313  xPos -= theClusterParam.dx1;
314  else
315  xPos -= theClusterParam.dx2;
316  //cout<<" to "<<xPos<<" "<<(tmp1+theClusterParam.dx1)<<endl;
317  } else { // size>1
318  //cout << "Apply correction correction_deltax = " << theClusterParam.deltax << " to xPos = " << xPos;
319  xPos -= theClusterParam.deltax;
320  //cout<<" to "<<xPos<<endl;
321  }
322 
323  if (theClusterParam.theCluster->sizeY() == 1) {
324  // ggiurgiu@jhu.edu, 02/03/09 : for size = 1, the Lorentz shift is already accounted by the irradiation correction
325  yPos = yPos - (0.5f * theDetParam.lorentzShiftInCmY);
326 
327  // Find if pixel is double (big).
328  bool bigInY = theDetParam.theRecTopol->isItBigPixelInY(theClusterParam.theCluster->maxPixelCol());
329  if (!bigInY)
330  yPos -= theClusterParam.dy1;
331  else
332  yPos -= theClusterParam.dy2;
333 
334  } else {
335  //cout << "Apply correction correction_deltay = " << theClusterParam.deltay << " to yPos = " << yPos << endl;
336  yPos -= theClusterParam.deltay;
337  }
338 
339  } // if ( IrradiationBiasCorrection_ )
340 
341  //cout<<" in PixelCPEGeneric:localPosition - pos = "<<xPos<<" "<<yPos<<endl; //dk
342 
343  //--- Now put the two together
344  LocalPoint pos_in_local(xPos, yPos);
345  return pos_in_local;
346 }

References PixelCPEBase::DetParam::bx, PixelCPEBase::DetParam::bz, SiPixelCluster::charge(), PixelCPEBase::ClusterParam::cotalpha, PixelCPEBase::ClusterParam::cotbeta, gather_cfg::cout, PixelCPEGenericBase::ClusterParamGeneric::deltax, PixelCPEGenericBase::ClusterParamGeneric::deltay, PixelCPEBase::DetParam::detTemplateId, PixelCPEGenericBase::ClusterParamGeneric::dx1, PixelCPEGenericBase::ClusterParamGeneric::dx2, PixelCPEGenericBase::ClusterParamGeneric::dy1, PixelCPEGenericBase::ClusterParamGeneric::dy2, SiPixelUtils::generic_position_formula(), RectangularPixelTopology::isItBigPixelInX(), RectangularPixelTopology::isItBigPixelInY(), PixelCPEBase::ClusterParam::loc_trk_pred, Topology::localPosition(), PixelCPEBase::DetParam::lorentzShiftInCmX, PixelCPEBase::DetParam::lorentzShiftInCmY, SiPixelGenError::lorxwidth(), SiPixelGenError::lorywidth(), SiPixelCluster::maxPixelCol(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), PixelCPEGenericBase::ClusterParamGeneric::pixmx, SiPixelGenError::qbin(), PixelCPEBase::ClusterParam::qBin_, PixelCPEGenericBase::ClusterParamGeneric::sigmax, PixelCPEGenericBase::ClusterParamGeneric::sigmay, SiPixelCluster::sizeX(), SiPixelCluster::sizeY(), PixelCPEGenericBase::ClusterParamGeneric::sx1, PixelCPEGenericBase::ClusterParamGeneric::sx2, PixelCPEGenericBase::ClusterParamGeneric::sy1, PixelCPEGenericBase::ClusterParamGeneric::sy2, PixelCPEBase::ClusterParam::theCluster, PixelCPEBase::DetParam::thePitchX, PixelCPEBase::DetParam::thePitchY, PixelCPEBase::DetParam::theRecTopol, PixelCPEBase::DetParam::theThickness, PixelCPEBase::DetParam::theTopol, theVerboseLevel, PixelCPEBase::DetParam::widthLAFractionX, PixelCPEBase::DetParam::widthLAFractionY, PixelCPEBase::ClusterParam::with_track_angle, PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), SiPixelCluster::x(), PV2DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::y(), and SiPixelCluster::y().

Member Data Documentation

◆ DoCosmics_

bool PixelCPEGeneric::DoCosmics_
private

Definition at line 89 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ inflate_all_errors_no_trk_angle

bool PixelCPEGeneric::inflate_all_errors_no_trk_angle
private

Definition at line 87 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ inflate_errors

bool PixelCPEGeneric::inflate_errors
private

Definition at line 86 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ IrradiationBiasCorrection_

bool PixelCPEGeneric::IrradiationBiasCorrection_
private

Definition at line 90 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ isUpgrade_

bool PixelCPEGeneric::isUpgrade_
private

Definition at line 91 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ NoTemplateErrorsWhenNoTrkAngles_

bool PixelCPEGeneric::NoTemplateErrorsWhenNoTrkAngles_
private

Definition at line 92 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_eff_charge_cut_highX

float PixelCPEGeneric::the_eff_charge_cut_highX
private

Definition at line 81 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_eff_charge_cut_highY

float PixelCPEGeneric::the_eff_charge_cut_highY
private

Definition at line 82 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_eff_charge_cut_lowX

float PixelCPEGeneric::the_eff_charge_cut_lowX
private

Definition at line 79 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_eff_charge_cut_lowY

float PixelCPEGeneric::the_eff_charge_cut_lowY
private

Definition at line 80 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_size_cutX

float PixelCPEGeneric::the_size_cutX
private

Definition at line 83 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ the_size_cutY

float PixelCPEGeneric::the_size_cutY
private

Definition at line 84 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

◆ thePixelGenError_

std::vector<SiPixelGenErrorStore> PixelCPEGeneric::thePixelGenError_
private

Definition at line 95 of file PixelCPEGeneric.h.

Referenced by PixelCPEGeneric().

Point2DBase
Definition: Point2DBase.h:9
PixelCPEGenericBase::useErrorsFromTemplates_
bool useErrorsFromTemplates_
Definition: PixelCPEGenericBase.h:86
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PixelCPEGenericBase::PixelCPEGenericBase
PixelCPEGenericBase(edm::ParameterSet const &conf, const MagneticField *mag, const TrackerGeometry &geom, const TrackerTopology &ttopo, const SiPixelLorentzAngle *lorentzAngle, const SiPixelGenErrorDBObject *genErrorDBObject, const SiPixelLorentzAngle *lorentzAngleWidth)
Definition: PixelCPEGenericBase.cc:11
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
PixelCPEBase::genErrorDBObject_
const SiPixelGenErrorDBObject * genErrorDBObject_
Definition: PixelCPEBase.h:235
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PixelCPEGenericBase::initializeLocalErrorVariables
void initializeLocalErrorVariables(float &xerr, float &yerr, bool &edgex, bool &edgey, bool &bigInX, bool &bigInY, int &maxPixelCol, int &maxPixelRow, int &minPixelCol, int &minPixelRow, uint &sizex, uint &sizey, DetParam const &theDetParam, ClusterParamGeneric const &theClusterParam) const
Definition: PixelCPEGenericBase.cc:87
PixelCPEGenericBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEGenericBase.cc:217
PixelCPEGeneric::DoCosmics_
bool DoCosmics_
Definition: PixelCPEGeneric.h:89
parallelization.uint
uint
Definition: parallelization.py:124
PixelCPEGeneric::thePixelGenError_
std::vector< SiPixelGenErrorStore > thePixelGenError_
Definition: PixelCPEGeneric.h:95
PixelCPEGeneric::the_size_cutX
float the_size_cutX
Definition: PixelCPEGeneric.h:83
PixelCPEGenericBase::collect_edge_charges
static void collect_edge_charges(ClusterParam &theClusterParam, int &q_f_X, int &q_l_X, int &q_f_Y, int &q_l_Y, bool truncate)
Definition: PixelCPEGenericBase.cc:45
PixelCPEGeneric::the_eff_charge_cut_lowX
float the_eff_charge_cut_lowX
Definition: PixelCPEGeneric.h:79
PixelCPEGeneric::IrradiationBiasCorrection_
bool IrradiationBiasCorrection_
Definition: PixelCPEGeneric.h:90
PixelCPEGeneric::the_size_cutY
float the_size_cutY
Definition: PixelCPEGeneric.h:84
PixelCPEGeneric::NoTemplateErrorsWhenNoTrkAngles_
bool NoTemplateErrorsWhenNoTrkAngles_
Definition: PixelCPEGeneric.h:92
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
PixelCPEGeneric::the_eff_charge_cut_lowY
float the_eff_charge_cut_lowY
Definition: PixelCPEGeneric.h:80
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
PixelCPEGeneric::the_eff_charge_cut_highX
float the_eff_charge_cut_highX
Definition: PixelCPEGeneric.h:81
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
SiPixelGenError
Definition: SiPixelGenError.h:113
PixelCPEGenericBase::truncatePixelCharge_
const bool truncatePixelCharge_
Definition: PixelCPEGenericBase.h:87
LocalError
Definition: LocalError.h:12
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
PixelCPEGeneric::the_eff_charge_cut_highY
float the_eff_charge_cut_highY
Definition: PixelCPEGeneric.h:82
PixelCPEBase::theVerboseLevel
int theVerboseLevel
Definition: PixelCPEBase.h:225
PixelCPEBase::LoadTemplatesFromDB_
bool LoadTemplatesFromDB_
Definition: PixelCPEBase.h:244
SiPixelGenError::pushfile
static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > &pixelTemp, std::string dir="")
Definition: SiPixelGenError.cc:55
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
Exception
Definition: hltDiff.cc:245
PixelCPEGenericBase::setXYErrors
void setXYErrors(float &xerr, float &yerr, const bool edgex, const bool edgey, const unsigned int sizex, const unsigned int sizey, const bool bigInX, const bool bigInY, const bool useTemplateErrors, DetParam const &theDetParam, ClusterParamGeneric const &theClusterParam) const
Definition: PixelCPEGenericBase.cc:125
PixelCPEGeneric::inflate_errors
bool inflate_errors
Definition: PixelCPEGeneric.h:86
PixelCPEGeneric::isUpgrade_
bool isUpgrade_
Definition: PixelCPEGeneric.h:91
SiPixelUtils::generic_position_formula
float generic_position_formula(int size, int Q_f, int Q_l, float upper_edge_first_pix, float lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big, float eff_charge_cut_low, float eff_charge_cut_high, float size_cut)
Definition: SiPixelUtils.cc:16
PixelCPEGeneric::inflate_all_errors_no_trk_angle
bool inflate_all_errors_no_trk_angle
Definition: PixelCPEGeneric.h:87