CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
PixelCPEBase Class Referenceabstract

#include <PixelCPEBase.h>

Inheritance diagram for PixelCPEBase:
PixelClusterParameterEstimator ClusterParameterEstimator< SiPixelCluster > PixelCPEGeneric PixelCPETemplateReco

Classes

struct  Param
 

Public Member Functions

unsigned int clusterProbComputationFlag () const
 
bool hasBadPixels () const
 
bool hasFilledProb () const
 
bool isOnEdge () const
 
LocalValues localParameters (const SiPixelCluster &cl, const GeomDetUnit &det) const
 
LocalValues localParameters (const SiPixelCluster &cl, const GeomDetUnit &det, const LocalTrajectoryParameters &ltp) const
 
 PixelCPEBase (edm::ParameterSet const &conf, const MagneticField *mag=0, const SiPixelLorentzAngle *lorentzAngle=0, const SiPixelCPEGenericErrorParm *genErrorParm=0, const SiPixelTemplateDBObject *templateDBobject=0)
 
float probabilityQ () const
 
float probabilityX () const
 
float probabilityXY () const
 
float probabilityY () const
 
float qBin () const
 
SiPixelRecHitQuality::QualWordType rawQualityWord () const
 
void setMagField (const MagneticField *mag) const
 
bool spansTwoRocks () const
 
- Public Member Functions inherited from PixelClusterParameterEstimator
unsigned int clusterProbComputationFlag () const
 
 PixelClusterParameterEstimator ()
 
- Public Member Functions inherited from ClusterParameterEstimator< SiPixelCluster >
virtual void clearParameters ()
 
virtual std::unique_ptr
< ClusterParameterEstimator
< SiPixelCluster > > 
clone () const
 
virtual void enterLocalParameters (unsigned int id, std::pair< int, int > &row_col, LocalValues pos_err_info)
 
virtual void enterLocalParameters (uint32_t id, uint16_t firstStrip, LocalValues pos_err_info)
 
virtual LocalValues localParameters (const SiPixelCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual VLocalValues localParametersV (const SiPixelCluster &cluster, const GeomDetUnit &gd) const
 
virtual VLocalValues localParametersV (const SiPixelCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual ~ClusterParameterEstimator ()
 

Protected Types

typedef GloballyPositioned
< double > 
Frame
 

Protected Member Functions

void computeLorentzShifts () const
 
LocalVector driftDirection (GlobalVector bfield) const
 
LocalVector driftDirection (LocalVector bfield) const
 
LocalVector driftDirectionCorrect (GlobalVector bfield) const
 
LocalVector const & getDrift () const
 
bool isFlipped () const
 
float lorentzShiftX () const
 
float lorentzShiftY () const
 
Param const & param () const
 
void setTheDet (const GeomDetUnit &det, const SiPixelCluster &cluster) const
 

Protected Attributes

bool alpha2Order
 
unsigned int clusterProbComputationFlag_
 
float cotalpha_
 
float cotbeta_
 
LocalVector driftDirection_
 
const SiPixelCPEGenericErrorParmgenErrorParm_
 
bool hasBadPixels_
 
bool hasFilledProb_
 
bool isOnEdge_
 
LocalTrajectoryParameters loc_traj_param_
 
Topology::LocalTrackPred loc_trk_pred_
 
const SiPixelLorentzAnglelorentzAngle_
 
float lorentzShiftInCmX_
 
float lorentzShiftInCmY_
 
float lorentzShiftX_
 
float lorentzShiftY_
 
const MagneticFieldmagfield_
 
int nRecHitsTotal_
 
int nRecHitsUsedEdge_
 
float probabilityQ_
 
float probabilityX_
 
float probabilityY_
 
float qBin_
 
bool spansTwoROCs_
 
const SiPixelTemplateDBObjecttemplateDBobject_
 
const PixelGeomDetUnittheDet
 
float theDetR
 
float theDetZ
 
float theLShiftX
 
float theLShiftY
 
float theNumOfCol
 
float theNumOfRow
 
Local3DPoint theOrigin
 
Param const * theParam
 
GeomDetType::SubDetector thePart
 
float thePitchX
 
float thePitchY
 
const RectangularPixelTopology * theRecTopol
 
float theSign
 
float theThickness
 
const PixelTopologytheTopol
 
int theVerboseLevel
 
float trk_lp_x
 
float trk_lp_y
 
bool with_track_angle
 
bool zneg
 
- Protected Attributes inherited from PixelClusterParameterEstimator
unsigned int clusterProbComputationFlag_
 

Private Types

using Params = std::vector< Param >
 

Private Member Functions

void computeAnglesFromDetPosition (const SiPixelCluster &cl) const
 
void computeAnglesFromTrajectory (const SiPixelCluster &cl, const LocalTrajectoryParameters &ltp) const
 
virtual LocalError localError (const SiPixelCluster &cl) const =0
 
virtual LocalPoint localPosition (const SiPixelCluster &cl) const =0
 

Private Attributes

Params m_Params =Params(1440)
 

Additional Inherited Members

- Public Types inherited from ClusterParameterEstimator< SiPixelCluster >
typedef std::pair< LocalPoint,
LocalError
LocalValues
 
typedef std::vector< LocalValuesVLocalValues
 

Detailed Description

Definition at line 47 of file PixelCPEBase.h.

Member Typedef Documentation

typedef GloballyPositioned<double> PixelCPEBase::Frame
protected

Definition at line 158 of file PixelCPEBase.h.

using PixelCPEBase::Params = std::vector<Param>
private

Definition at line 295 of file PixelCPEBase.h.

Constructor & Destructor Documentation

PixelCPEBase::PixelCPEBase ( edm::ParameterSet const &  conf,
const MagneticField mag = 0,
const SiPixelLorentzAngle lorentzAngle = 0,
const SiPixelCPEGenericErrorParm genErrorParm = 0,
const SiPixelTemplateDBObject templateDBobject = 0 
)

Definition at line 49 of file PixelCPEBase.cc.

References alpha2Order, clusterProbComputationFlag_, genErrorParm_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), lorentzAngle_, mag(), magfield_, templateDBobject_, and theVerboseLevel.

51  : theDet(nullptr), theTopol(nullptr), theRecTopol(nullptr), theParam(nullptr), nRecHitsTotal_(0), nRecHitsUsedEdge_(0),
52  probabilityX_(0.0), probabilityY_(0.0),
53  probabilityQ_(0.0), qBin_(0),
54  isOnEdge_(false), hasBadPixels_(false),
55  spansTwoROCs_(false), hasFilledProb_(false),
56  loc_trk_pred_(0.0, 0.0, 0.0, 0.0)
57 {
58  //--- Lorentz angle tangent per Tesla
59 
60  lorentzAngle_ = lorentzAngle;
61 
62  //--- Algorithm's verbosity
64  conf.getUntrackedParameter<int>("VerboseLevel",0);
65 
66  //-- Magnetic Field
67  magfield_ = mag;
68 
69  //-- Error Parametriaztion from DB for CPE Generic
70  genErrorParm_ = genErrorParm;
71 
72  //-- Template Calibration Object from DB
73  templateDBobject_ = templateDBobject;
74 
75  //-- Switch on/off E.B
76  alpha2Order = conf.getParameter<bool>("Alpha2Order");
77 
78  //--- A flag that could be used to change the behavior of
79  //--- clusterProbability() in TSiPixelRecHit (the *transient* one).
80  //--- The problem is that the transient hits are made after the CPE runs
81  //--- and they don't get the access to the PSet, so we pass it via the
82  //--- CPE itself...
83  //
85  = (unsigned int) conf.getParameter<int>("ClusterProbComputationFlag");
86 
87 }
Topology::LocalTrackPred loc_trk_pred_
Definition: PixelCPEBase.h:253
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
unsigned int clusterProbComputationFlag_
Definition: PixelCPEBase.h:221
float probabilityQ_
Definition: PixelCPEBase.h:208
bool spansTwoROCs_
Definition: PixelCPEBase.h:212
float probabilityY_
Definition: PixelCPEBase.h:207
bool hasBadPixels_
Definition: PixelCPEBase.h:211
bool hasFilledProb_
Definition: PixelCPEBase.h:213
const SiPixelTemplateDBObject * templateDBobject_
Definition: PixelCPEBase.h:246
const MagneticField * magfield_
Definition: PixelCPEBase.h:240
tuple conf
Definition: dbtoconf.py:185
const RectangularPixelTopology * theRecTopol
Definition: PixelCPEBase.h:169
const SiPixelLorentzAngle * lorentzAngle_
Definition: PixelCPEBase.h:242
const PixelTopology * theTopol
Definition: PixelCPEBase.h:168
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
Param const * theParam
Definition: PixelCPEBase.h:171
float probabilityX_
Definition: PixelCPEBase.h:206
const SiPixelCPEGenericErrorParm * genErrorParm_
Definition: PixelCPEBase.h:244
int nRecHitsUsedEdge_
Definition: PixelCPEBase.h:200

Member Function Documentation

unsigned int PixelCPEBase::clusterProbComputationFlag ( ) const
inline

Definition at line 139 of file PixelCPEBase.h.

References clusterProbComputationFlag_.

140  {
142  }
unsigned int clusterProbComputationFlag_
Definition: PixelCPEBase.h:221
void PixelCPEBase::computeAnglesFromDetPosition ( const SiPixelCluster cl) const
private

Definition at line 275 of file PixelCPEBase.cc.

References cotalpha_, cotbeta_, Topology::localPosition(), theOrigin, theTopol, with_track_angle, PV3DBase< T, PVType, FrameType >::x(), SiPixelCluster::x(), PV3DBase< T, PVType, FrameType >::y(), SiPixelCluster::y(), PV3DBase< T, PVType, FrameType >::z(), and zneg.

Referenced by localParameters().

276 {
277 
278 
279  /*
280  // get cluster center of gravity (of charge)
281  float xcenter = cl.x();
282  float ycenter = cl.y();
283 
284  // get the cluster position in local coordinates (cm)
285 
286  // ggiurgiu@jhu.edu 12/09/2010 : This function is called without track info, therefore there are no track
287  // angles to provide here. Call the default localPosition (without track info)
288  LocalPoint lp = theTopol->localPosition( MeasurementPoint(xcenter, ycenter) );
289 
290 
291  // get the cluster position in global coordinates (cm)
292  GlobalPoint gp = theDet->surface().toGlobal( lp );
293  float gp_mod = sqrt( gp.x()*gp.x() + gp.y()*gp.y() + gp.z()*gp.z() );
294 
295  // normalize
296  float gpx = gp.x()/gp_mod;
297  float gpy = gp.y()/gp_mod;
298  float gpz = gp.z()/gp_mod;
299 
300  // make a global vector out of the global point; this vector will point from the
301  // origin of the detector to the cluster
302  GlobalVector gv(gpx, gpy, gpz);
303 
304  // make local unit vector along local X axis
305  const Local3DVector lvx(1.0, 0.0, 0.0);
306 
307  // get the unit X vector in global coordinates/
308  GlobalVector gvx = theDet->surface().toGlobal( lvx );
309 
310  // make local unit vector along local Y axis
311  const Local3DVector lvy(0.0, 1.0, 0.0);
312 
313  // get the unit Y vector in global coordinates
314  GlobalVector gvy = theDet->surface().toGlobal( lvy );
315 
316  // make local unit vector along local Z axis
317  const Local3DVector lvz(0.0, 0.0, 1.0);
318 
319  // get the unit Z vector in global coordinates
320  GlobalVector gvz = theDet->surface().toGlobal( lvz );
321 
322  // calculate the components of gv (the unit vector pointing to the cluster)
323  // in the local coordinate system given by the basis {gvx, gvy, gvz}
324  // note that both gv and the basis {gvx, gvy, gvz} are given in global coordinates
325  float gv_dot_gvx = gv.x()*gvx.x() + gv.y()*gvx.y() + gv.z()*gvx.z();
326  float gv_dot_gvy = gv.x()*gvy.x() + gv.y()*gvy.y() + gv.z()*gvy.z();
327  float gv_dot_gvz = gv.x()*gvz.x() + gv.y()*gvz.y() + gv.z()*gvz.z();
328  */
329 
330  // all the above is equivalent to
331  LocalPoint lp = theTopol->localPosition( MeasurementPoint(cl.x(), cl.y()) );
332  auto gvx = lp.x()-theOrigin.x();
333  auto gvy = lp.y()-theOrigin.y();
334  auto gvz = -1.f/theOrigin.z();
335  // normalization not required as only ratio used...
336 
337 
338  zneg = (gvz < 0);
339 
340  // calculate angles
341  cotalpha_ = gvx*gvz;
342  cotbeta_ = gvy*gvz;
343 
344  with_track_angle = false;
345 
346 
347  /*
348  // used only in dberror param...
349  auto alpha = HALF_PI - std::atan(cotalpha_);
350  auto beta = HALF_PI - std::atan(cotbeta_);
351  if (zneg) { beta -=PI; alpha -=PI;}
352 
353  auto alpha_ = atan2( gv_dot_gvz, gv_dot_gvx );
354  auto beta_ = atan2( gv_dot_gvz, gv_dot_gvy );
355 
356  std::cout << "alpha/beta " << alpha_ <<','<<alpha <<' '<< beta_<<','<<beta <<','<< HALF_PI-beta << std::endl;
357  assert(std::abs(std::round(alpha*10000.f)-std::round(alpha_*10000.f))<2);
358  assert(std::abs(std::round(beta*10000.f)-std::round(beta_*10000.f))<2);
359  */
360 
361 }
bool with_track_angle
Definition: PixelCPEBase.h:203
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
T y() const
Definition: PV3DBase.h:63
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
T z() const
Definition: PV3DBase.h:64
Local3DPoint theOrigin
Definition: PixelCPEBase.h:174
const PixelTopology * theTopol
Definition: PixelCPEBase.h:168
float y() const
T x() const
Definition: PV3DBase.h:62
float x() const
void PixelCPEBase::computeAnglesFromTrajectory ( const SiPixelCluster cl,
const LocalTrajectoryParameters ltp 
) const
private

Definition at line 215 of file PixelCPEBase.cc.

References cotalpha_, cotbeta_, loc_traj_param_, loc_trk_pred_, LocalTrajectoryParameters::mixedFormatVector(), LocalTrajectoryParameters::momentum(), LocalTrajectoryParameters::position(), trk_lp_x, trk_lp_y, with_track_angle, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and zneg.

Referenced by localParameters().

217 {
218  loc_traj_param_ = ltp;
219 
220  LocalVector localDir = ltp.momentum();
221 
222 
223  float locx = localDir.x();
224  float locy = localDir.y();
225  float locz = localDir.z();
226 
227  /*
228  // Danek's definition
229  alpha_ = acos(locx/sqrt(locx*locx+locz*locz));
230  if ( isFlipped() ) // &&& check for FPIX !!!
231  alpha_ = PI - alpha_ ;
232  beta_ = acos(locy/sqrt(locy*locy+locz*locz));
233  */
234 
235 
236  cotalpha_ = locx/locz;
237  cotbeta_ = locy/locz;
238  zneg = (locz < 0);
239 
240 
241  LocalPoint trk_lp = ltp.position();
242  trk_lp_x = trk_lp.x();
243  trk_lp_y = trk_lp.y();
244 
245  with_track_angle = true;
246 
247 
248  // ggiurgiu@jhu.edu 12/09/2010 : needed to correct for bows/kinks
249  AlgebraicVector5 vec_trk_parameters = ltp.mixedFormatVector();
250  loc_trk_pred_ = Topology::LocalTrackPred( vec_trk_parameters );
251 
252 }
Topology::LocalTrackPred loc_trk_pred_
Definition: PixelCPEBase.h:253
bool with_track_angle
Definition: PixelCPEBase.h:203
LocalPoint position() const
Local x and y position coordinates.
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
LocalVector momentum() const
Momentum vector in the local frame.
ROOT::Math::SVector< double, 5 > AlgebraicVector5
LocalTrajectoryParameters loc_traj_param_
Definition: PixelCPEBase.h:255
AlgebraicVector5 mixedFormatVector() const
T x() const
Definition: PV3DBase.h:62
void PixelCPEBase::computeLorentzShifts ( ) const
protected

Definition at line 483 of file PixelCPEBase.cc.

References driftDirection_, getDrift(), LogDebug, lorentzShiftInCmX_, lorentzShiftInCmY_, lorentzShiftX_, lorentzShiftY_, thePitchX, thePitchY, theThickness, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by PixelCPEGeneric::localPosition().

483  {
484  // this "has wrong sign..." so "corrected below
486 
487  // Max shift (at the other side of the sensor) in cm
489  // Express the shift in units of pitch,
491 
492  // Max shift (at the other side of the sensor) in cm
494  // Express the shift in units of pitch,
496 
497 
498  LogDebug("PixelCPEBase") << " The drift direction in local coordinate is "
499  << driftDirection_ ;
500 }
#define LogDebug(id)
float theThickness
Definition: PixelCPEBase.h:176
T y() const
Definition: PV3DBase.h:63
float lorentzShiftX_
Definition: PixelCPEBase.h:230
LocalVector driftDirection_
Definition: PixelCPEBase.h:229
float lorentzShiftY_
Definition: PixelCPEBase.h:231
T z() const
Definition: PV3DBase.h:64
float lorentzShiftInCmY_
Definition: PixelCPEBase.h:233
float lorentzShiftInCmX_
Definition: PixelCPEBase.h:232
LocalVector const & getDrift() const
Definition: PixelCPEBase.h:288
T x() const
Definition: PV3DBase.h:62
LocalVector PixelCPEBase::driftDirection ( GlobalVector  bfield) const
protected

Definition at line 444 of file PixelCPEBase.cc.

References GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), GeomDet::surface(), and theDet.

Referenced by param().

444  {
445 
446  Frame detFrame(theDet->surface().position(), theDet->surface().rotation());
447  LocalVector Bfield = detFrame.toLocal(bfield);
448  return driftDirection(Bfield);
449 
450 }
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
LocalVector driftDirection(GlobalVector bfield) const
GloballyPositioned< double > Frame
Definition: PixelCPEBase.h:158
const RotationType & rotation() const
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
const PositionType & position() const
LocalVector PixelCPEBase::driftDirection ( LocalVector  bfield) const
protected

Definition at line 453 of file PixelCPEBase.cc.

References funct::abs(), alpha2Order, createTree::dd, f, GeomDet::geographicalId(), SiPixelLorentzAngle::getLorentzAngle(), LogDebug, lorentzAngle_, DetId::rawId(), pileupReCalc_HLTpaths::scale, theDet, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

453  {
454 
455 
457  float alpha2 = alpha2Order ? langle*langle : 0;
458 
459 
460  // &&& dir_x should have a "-" and dir_y a "+"
461  // **********************************************************************
462  // Our convention is the following:
463  // +x is defined by the direction of the Lorentz drift!
464  // +z is defined by the direction of E field (so electrons always go into -z!)
465  // +y is defined by +x and +z, and it turns out to be always opposite to the +B field.
466  // **********************************************************************
467 
468  float dir_x = ( langle * Bfield.y() + alpha2* Bfield.z()* Bfield.x() );
469  float dir_y = -( langle * Bfield.x() - alpha2* Bfield.z()* Bfield.y() );
470  float dir_z = -( 1.f + alpha2* Bfield.z()*Bfield.z() );
471  auto scale = 1.f/std::abs( dir_z ); // same as 1 + alpha2*Bfield.z()*Bfield.z()
472  LocalVector dd(dir_x*scale, dir_y*scale, -1.f ); // last is -1 !
473 
474  LogDebug("PixelCPEBase") << " The drift direction in local coordinate is " << dd ;
475 
476  return dd;
477 }
#define LogDebug(id)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
double f[11][100]
const SiPixelLorentzAngle * lorentzAngle_
Definition: PixelCPEBase.h:242
float getLorentzAngle(const uint32_t &) const
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
LocalVector PixelCPEBase::driftDirectionCorrect ( GlobalVector  bfield) const
protected
LocalVector const& PixelCPEBase::getDrift ( ) const
inlineprotected

Definition at line 288 of file PixelCPEBase.h.

References driftDirection_.

Referenced by computeLorentzShifts(), lorentzShiftX(), and lorentzShiftY().

288 {return driftDirection_ ;}
LocalVector driftDirection_
Definition: PixelCPEBase.h:229
bool PixelCPEBase::hasBadPixels ( ) const
inline

Definition at line 132 of file PixelCPEBase.h.

References hasBadPixels_.

132 { return hasBadPixels_ ; }
bool hasBadPixels_
Definition: PixelCPEBase.h:211
bool PixelCPEBase::hasFilledProb ( ) const
inline

Definition at line 134 of file PixelCPEBase.h.

References hasFilledProb_.

134 { return hasFilledProb_ ; }
bool hasFilledProb_
Definition: PixelCPEBase.h:213
bool PixelCPEBase::isFlipped ( ) const
protected

Definition at line 377 of file PixelCPEBase.cc.

References PV3DBase< T, PVType, FrameType >::perp2(), GeomDet::surface(), theDet, and Surface::toGlobal().

Referenced by setTheDet().

378 {
379  // Check the relative position of the local +/- z in global coordinates.
380  float tmp1 = theDet->surface().toGlobal(Local3DPoint(0.,0.,0.)).perp2();
381  float tmp2 = theDet->surface().toGlobal(Local3DPoint(0.,0.,1.)).perp2();
382  //cout << " 1: " << tmp1 << " 2: " << tmp2 << endl;
383  if ( tmp2<tmp1 ) return true;
384  else return false;
385 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
T perp2() const
Definition: PV3DBase.h:71
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
bool PixelCPEBase::isOnEdge ( ) const
inline

Definition at line 131 of file PixelCPEBase.h.

References isOnEdge_.

131 { return isOnEdge_ ; }
virtual LocalError PixelCPEBase::localError ( const SiPixelCluster cl) const
privatepure virtual

Implemented in PixelCPEGeneric, and PixelCPETemplateReco.

Referenced by localParameters().

LocalValues PixelCPEBase::localParameters ( const SiPixelCluster cl,
const GeomDetUnit det 
) const
inlinevirtual

Reimplemented from ClusterParameterEstimator< SiPixelCluster >.

Definition at line 73 of file PixelCPEBase.h.

References computeAnglesFromDetPosition(), asciidump::le, localError(), localPosition(), nRecHitsTotal_, and setTheDet().

Referenced by cms::SiPixelRecHitConverter::run().

75  {
76  nRecHitsTotal_++ ;
77  setTheDet( det, cl );
79 
80  // localPosition( cl, det ) must be called before localError( cl, det ) !!!
81  LocalPoint lp = localPosition( cl);
82  LocalError le = localError( cl);
83 
84  return std::make_pair( lp, le );
85  }
virtual LocalPoint localPosition(const SiPixelCluster &cl) const =0
void computeAnglesFromDetPosition(const SiPixelCluster &cl) const
virtual LocalError localError(const SiPixelCluster &cl) const =0
void setTheDet(const GeomDetUnit &det, const SiPixelCluster &cluster) const
Definition: PixelCPEBase.cc:93
LocalValues PixelCPEBase::localParameters ( const SiPixelCluster cl,
const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
inlinevirtual

Reimplemented from ClusterParameterEstimator< SiPixelCluster >.

Definition at line 90 of file PixelCPEBase.h.

References computeAnglesFromTrajectory(), asciidump::le, localError(), localPosition(), nRecHitsTotal_, and setTheDet().

93  {
94  nRecHitsTotal_++ ;
95  setTheDet( det, cl );
97 
98  // localPosition( cl, det ) must be called before localError( cl, det ) !!!
99  LocalPoint lp = localPosition( cl);
100  LocalError le = localError( cl);
101 
102  return std::make_pair( lp, le );
103  }
virtual LocalPoint localPosition(const SiPixelCluster &cl) const =0
virtual LocalError localError(const SiPixelCluster &cl) const =0
void setTheDet(const GeomDetUnit &det, const SiPixelCluster &cluster) const
Definition: PixelCPEBase.cc:93
void computeAnglesFromTrajectory(const SiPixelCluster &cl, const LocalTrajectoryParameters &ltp) const
virtual LocalPoint PixelCPEBase::localPosition ( const SiPixelCluster cl) const
privatepure virtual

Implemented in PixelCPEGeneric, and PixelCPETemplateReco.

Referenced by localParameters().

float PixelCPEBase::lorentzShiftX ( ) const
protected

Definition at line 405 of file PixelCPEBase.cc.

References dir, getDrift(), thePitchX, theThickness, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by setTheDet().

406 {
408 
409  // max shift in cm
410  float xdrift = dir.x()/dir.z() * theThickness;
411  // express the shift in units of pitch,
412  // divide by 2 to get the average correction
413  float lshift = xdrift / (thePitchX*2.);
414 
415  return lshift;
416 
417 
418 }
float theThickness
Definition: PixelCPEBase.h:176
T z() const
Definition: PV3DBase.h:64
LocalVector const & getDrift() const
Definition: PixelCPEBase.h:288
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
float PixelCPEBase::lorentzShiftY ( ) const
protected

Definition at line 420 of file PixelCPEBase.cc.

References dir, getDrift(), thePitchY, theThickness, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by setTheDet().

421 {
422 
424 
425  float ydrift = dir.y()/dir.z() * theThickness;
426  float lshift = ydrift / (thePitchY * 2.f);
427  return lshift;
428 
429 
430 }
float theThickness
Definition: PixelCPEBase.h:176
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
LocalVector const & getDrift() const
Definition: PixelCPEBase.h:288
dbl *** dir
Definition: mlp_gen.cc:35
PixelCPEBase::Param const & PixelCPEBase::param ( ) const
protected

Definition at line 387 of file PixelCPEBase.cc.

References PixelCPEBase::Param::bz, PixelCPEBase::Param::drift, driftDirection(), i, GeomDet::index(), MagneticField::inTesla(), m_Params, magfield_, AlCaHLTBitMon_ParallelJobs::p, GloballyPositioned< T >::position(), GeomDet::surface(), theDet, GloballyPositioned< T >::toLocal(), unlikely, and PV3DBase< T, PVType, FrameType >::z().

Referenced by setTheDet().

387  {
388  auto i = theDet->index();
389  if (i>=int(m_Params.size())) m_Params.resize(i+1); // should never happen!
390  Param & p = m_Params[i];
391  if unlikely ( p.bz<-1.e10f ) {
393  p.drift = driftDirection(Bfield );
394  p.bz = Bfield.z();
395  }
396  return p;
397 }
int i
Definition: DBlmapReader.cc:9
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
#define unlikely(x)
Definition: Likely.h:21
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:64
LocalVector driftDirection(GlobalVector bfield) const
const MagneticField * magfield_
Definition: PixelCPEBase.h:240
int index() const
Definition: GeomDet.h:92
Params m_Params
Definition: PixelCPEBase.h:297
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
const PositionType & position() const
float PixelCPEBase::probabilityQ ( ) const
inline

Definition at line 129 of file PixelCPEBase.h.

References probabilityQ_.

129 { return probabilityQ_ ; }
float probabilityQ_
Definition: PixelCPEBase.h:208
float PixelCPEBase::probabilityX ( ) const
inline

Definition at line 118 of file PixelCPEBase.h.

References probabilityX_.

118 { return probabilityX_ ; }
float probabilityX_
Definition: PixelCPEBase.h:206
float PixelCPEBase::probabilityXY ( ) const
inline

Definition at line 120 of file PixelCPEBase.h.

References create_public_lumi_plots::log, probabilityX_, and probabilityY_.

Referenced by rawQualityWord().

120  {
121  if ( probabilityX_ !=0 && probabilityY_ !=0 )
122  {
124  }
125  else
126  return 0;
127  }
float probabilityY_
Definition: PixelCPEBase.h:207
float probabilityX_
Definition: PixelCPEBase.h:206
float PixelCPEBase::probabilityY ( ) const
inline

Definition at line 119 of file PixelCPEBase.h.

References probabilityY_.

119 { return probabilityY_ ; }
float probabilityY_
Definition: PixelCPEBase.h:207
float PixelCPEBase::qBin ( ) const
inline

Definition at line 130 of file PixelCPEBase.h.

References qBin_.

130 { return qBin_ ; }
SiPixelRecHitQuality::QualWordType PixelCPEBase::rawQualityWord ( ) const
virtual

A convenience method to fill a whole SiPixelRecHitQuality word in one shot. This way, we can keep the details of what is filled within the pixel code and not expose the Transient SiPixelRecHit to it as well. The name of this function is chosen to match the one in SiPixelRecHit.

Reimplemented from PixelClusterParameterEstimator.

Definition at line 509 of file PixelCPEBase.cc.

References hasBadPixels_, hasFilledProb_, isOnEdge_, probabilityQ_, probabilityXY(), qBin_, SiPixelRecHitQuality::Packing::setHasBadPixels(), SiPixelRecHitQuality::Packing::setHasFilledProb(), SiPixelRecHitQuality::Packing::setIsOnEdge(), SiPixelRecHitQuality::Packing::setProbabilityQ(), SiPixelRecHitQuality::Packing::setProbabilityXY(), SiPixelRecHitQuality::Packing::setQBin(), SiPixelRecHitQuality::Packing::setSpansTwoROCs(), spansTwoROCs_, and SiPixelRecHitQuality::thePacking.

Referenced by cms::SiPixelRecHitConverter::run().

510 {
512 
514  qualWord );
515 
517  qualWord );
518 
520  qualWord );
521 
523  qualWord );
524 
526  qualWord );
527 
529  qualWord );
530 
532  qualWord );
533 
534  return qualWord;
535 }
void setProbabilityXY(float prob, QualWordType &qualWord) const
static const Packing thePacking
float probabilityQ_
Definition: PixelCPEBase.h:208
bool spansTwoROCs_
Definition: PixelCPEBase.h:212
bool hasBadPixels_
Definition: PixelCPEBase.h:211
bool hasFilledProb_
Definition: PixelCPEBase.h:213
void setHasBadPixels(bool flag, QualWordType &qualWord) const
void setProbabilityQ(float prob, QualWordType &qualWord) const
void setSpansTwoROCs(bool flag, QualWordType &qualWord) const
void setIsOnEdge(bool flag, QualWordType &qualWord) const
float probabilityXY() const
Definition: PixelCPEBase.h:120
void setHasFilledProb(bool flag, QualWordType &qualWord) const
void setQBin(int qbin, QualWordType &qualWord) const
void PixelCPEBase::setMagField ( const MagneticField mag) const
inline

Definition at line 66 of file PixelCPEBase.h.

References mag(), and magfield_.

66 { magfield_ = mag; }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const MagneticField * magfield_
Definition: PixelCPEBase.h:240
void PixelCPEBase::setTheDet ( const GeomDetUnit det,
const SiPixelCluster cluster 
) const
protected

Definition at line 93 of file PixelCPEBase.cc.

References Surface::bounds(), driftDirection_, edm::hlt::Exception, hasBadPixels_, i, isFlipped(), isOnEdge_, LogDebug, lorentzShiftX(), lorentzShiftY(), SiPixelCluster::maxPixelCol(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), param(), PV3DBase< T, PVType, FrameType >::perp(), SiPixelCluster::pixelADC(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GloballyPositioned< T >::position(), spansTwoROCs_, PixelGeomDetUnit::specificTopology(), GeomDetType::subDetector(), GeomDet::surface(), theDet, theDetR, theDetZ, theLShiftX, theLShiftY, theNumOfCol, theNumOfRow, theOrigin, theParam, thePart, thePitchX, thePitchY, theRecTopol, theSign, theThickness, theTopol, Bounds::thickness(), GloballyPositioned< T >::toLocal(), PixelGeomDetUnit::type(), unlikely, and PV3DBase< T, PVType, FrameType >::z().

Referenced by localParameters().

94 {
95  if ( theDet != &det ) {
96 
97  //--- This is a new det unit, so cache it
98  theDet = dynamic_cast<const PixelGeomDetUnit*>( &det );
99 
100  if unlikely( !theDet ) {
101  throw cms::Exception(" PixelCPEBase::setTheDet : ")
102  << " Wrong pointer to PixelGeomDetUnit object !!!";
103  }
104 
106 
107  //--- theDet->type() returns a GeomDetType, which implements subDetector()
109 
110 #ifdef EDM_ML_DEBUG
111  switch ( thePart ) {
113  // A barrel! A barrel!
114  break;
116  // A forward! A forward!
117  break;
118  default:
119  throw cms::Exception("PixelCPEBase::setTheDet :")
120  << "PixelCPEBase: A non-pixel detector type in here?" ;
121  }
122 #endif
123 
124  //--- The location in of this DetUnit in a cyllindrical coord system (R,Z)
125  //--- The call goes via BoundSurface, returned by theDet->surface(), but
126  //--- position() is implemented in GloballyPositioned<> template
127  //--- ( BoundSurface : Surface : GloballyPositioned<float> )
129  theDetZ = theDet->surface().position().z();
130  //--- Define parameters for chargewidth calculation
131 
132  //--- bounds() is implemented in BoundSurface itself.
134 
135  //--- Cache the topology.
136  // ggiurgiu@jhu.edu 12/09/2010 : no longer need to dynamyc cast to RectangularPixelTopology
137  //theTopol
138  //= dynamic_cast<const RectangularPixelTopology*>( & (theDet->specificTopology()) );
139 
140  auto topol = &(theDet->specificTopology());
141  if unlikely(topol!=theTopol) { // there is ONE topology!)
142  theTopol=topol;
143  auto const proxyT = dynamic_cast<const ProxyPixelTopology*>(theTopol);
144  if (proxyT) theRecTopol = dynamic_cast<const RectangularPixelTopology*>(&(proxyT->specificTopology()));
145  else theRecTopol = dynamic_cast<const RectangularPixelTopology*>(theTopol);
146  assert(theRecTopol);
147 
148  //---- The geometrical description of one module/plaquette
149  theNumOfRow = theRecTopol->nrows(); // rows in x
150  theNumOfCol = theRecTopol->ncolumns(); // cols in y
151  std::pair<float,float> pitchxy = theRecTopol->pitch();
152  thePitchX = pitchxy.first; // pitch along x
153  thePitchY = pitchxy.second; // pitch along y
154  }
155 
156  theSign = isFlipped() ? -1 : 1;
157 
158 
159  // will cache if not yest there (need some of the above)
160  theParam = &param();
161 
162  // this "has wrong sign..."
163  driftDirection_ = (*theParam).drift;
164 
165 
166  //--- The Lorentz shift.
168 
170 
171  // testing
173  //cout<<" lorentz shift "<<theLShiftX<<" "<<theLShiftY<<endl;
174  theLShiftY=0.;
175  }
176 
177  LogDebug("PixelCPEBase") << "***** PIXEL LAYOUT *****"
178  << " thePart = " << thePart
179  << " theThickness = " << theThickness
180  << " thePitchX = " << thePitchX
181  << " thePitchY = " << thePitchY
182  << " theLShiftX = " << theLShiftX;
183 
184 
185  }
186 
187 
188  //--- Geometric Quality Information
189  int minInX,minInY,maxInX,maxInY=0;
190  minInX = cluster.minPixelRow();
191  minInY = cluster.minPixelCol();
192  maxInX = cluster.maxPixelRow();
193  maxInY = cluster.maxPixelCol();
194 
195  isOnEdge_ = theRecTopol->isItEdgePixelInX(minInX) | theRecTopol->isItEdgePixelInX(maxInX) |
196  theRecTopol->isItEdgePixelInY(minInY) | theRecTopol->isItEdgePixelInY(maxInY) ;
197 
198  // Bad Pixels have their charge set to 0 in the clusterizer
199  hasBadPixels_ = false;
200  for(unsigned int i=0; i<cluster.pixelADC().size(); ++i) {
201  if(cluster.pixelADC()[i] == 0) { hasBadPixels_ = true; break;}
202  }
203 
204  spansTwoROCs_ = theRecTopol->containsBigPixelInX(minInX,maxInX) |
205  theRecTopol->containsBigPixelInY(minInY,maxInY);
206 
207 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int minPixelCol() const
float theNumOfRow
Definition: PixelCPEBase.h:181
T perp() const
Definition: PV3DBase.h:72
float theLShiftY
Definition: PixelCPEBase.h:186
float theThickness
Definition: PixelCPEBase.h:176
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const Bounds & bounds() const
Definition: Surface.h:128
bool spansTwoROCs_
Definition: PixelCPEBase.h:212
GeomDetType::SubDetector thePart
Definition: PixelCPEBase.h:173
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
float theNumOfCol
Definition: PixelCPEBase.h:182
int maxPixelRow() const
virtual float thickness() const =0
#define unlikely(x)
Definition: Likely.h:21
int minPixelRow() const
bool hasBadPixels_
Definition: PixelCPEBase.h:211
LocalVector driftDirection_
Definition: PixelCPEBase.h:229
bool isFlipped() const
Param const & param() const
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:64
const std::vector< uint16_t > & pixelADC() const
Local3DPoint theOrigin
Definition: PixelCPEBase.h:174
const RectangularPixelTopology * theRecTopol
Definition: PixelCPEBase.h:169
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const PixelTopology * theTopol
Definition: PixelCPEBase.h:168
int maxPixelCol() const
float lorentzShiftX() const
virtual const GeomDetType & type() const
const PixelGeomDetUnit * theDet
Definition: PixelCPEBase.h:164
Param const * theParam
Definition: PixelCPEBase.h:171
float theLShiftX
Definition: PixelCPEBase.h:185
float lorentzShiftY() const
const PositionType & position() const
SubDetector subDetector() const
Definition: GeomDetType.h:22
bool PixelCPEBase::spansTwoRocks ( ) const
inline

Definition at line 133 of file PixelCPEBase.h.

References spansTwoROCs_.

133 { return spansTwoROCs_ ; }
bool spansTwoROCs_
Definition: PixelCPEBase.h:212

Member Data Documentation

bool PixelCPEBase::alpha2Order
protected

Definition at line 248 of file PixelCPEBase.h.

Referenced by driftDirection(), and PixelCPEBase().

unsigned int PixelCPEBase::clusterProbComputationFlag_
protected

Definition at line 221 of file PixelCPEBase.h.

Referenced by clusterProbComputationFlag(), and PixelCPEBase().

float PixelCPEBase::cotalpha_
mutableprotected
float PixelCPEBase::cotbeta_
mutableprotected
LocalVector PixelCPEBase::driftDirection_
mutableprotected

Definition at line 229 of file PixelCPEBase.h.

Referenced by computeLorentzShifts(), getDrift(), and setTheDet().

const SiPixelCPEGenericErrorParm* PixelCPEBase::genErrorParm_
mutableprotected

Definition at line 244 of file PixelCPEBase.h.

Referenced by PixelCPEGeneric::localError(), and PixelCPEBase().

bool PixelCPEBase::hasBadPixels_
mutableprotected

Definition at line 211 of file PixelCPEBase.h.

Referenced by hasBadPixels(), rawQualityWord(), and setTheDet().

bool PixelCPEBase::hasFilledProb_
mutableprotected
bool PixelCPEBase::isOnEdge_
mutableprotected

Definition at line 210 of file PixelCPEBase.h.

Referenced by isOnEdge(), rawQualityWord(), and setTheDet().

LocalTrajectoryParameters PixelCPEBase::loc_traj_param_
mutableprotected

Definition at line 255 of file PixelCPEBase.h.

Referenced by computeAnglesFromTrajectory().

Topology::LocalTrackPred PixelCPEBase::loc_trk_pred_
mutableprotected
const SiPixelLorentzAngle* PixelCPEBase::lorentzAngle_
mutableprotected

Definition at line 242 of file PixelCPEBase.h.

Referenced by driftDirection(), and PixelCPEBase().

float PixelCPEBase::lorentzShiftInCmX_
mutableprotected

Definition at line 232 of file PixelCPEBase.h.

Referenced by computeLorentzShifts(), and PixelCPEGeneric::localPosition().

float PixelCPEBase::lorentzShiftInCmY_
mutableprotected

Definition at line 233 of file PixelCPEBase.h.

Referenced by computeLorentzShifts(), and PixelCPEGeneric::localPosition().

float PixelCPEBase::lorentzShiftX_
mutableprotected

Definition at line 230 of file PixelCPEBase.h.

Referenced by computeLorentzShifts().

float PixelCPEBase::lorentzShiftY_
mutableprotected

Definition at line 231 of file PixelCPEBase.h.

Referenced by computeLorentzShifts().

Params PixelCPEBase::m_Params =Params(1440)
mutableprivate

Definition at line 297 of file PixelCPEBase.h.

Referenced by param().

const MagneticField* PixelCPEBase::magfield_
mutableprotected

Definition at line 240 of file PixelCPEBase.h.

Referenced by param(), PixelCPEBase(), and setMagField().

int PixelCPEBase::nRecHitsTotal_
mutableprotected

Definition at line 199 of file PixelCPEBase.h.

Referenced by PixelCPEGeneric::generic_position_formula(), and localParameters().

int PixelCPEBase::nRecHitsUsedEdge_
mutableprotected

Definition at line 200 of file PixelCPEBase.h.

Referenced by PixelCPEGeneric::generic_position_formula().

float PixelCPEBase::probabilityQ_
mutableprotected
float PixelCPEBase::probabilityX_
mutableprotected
float PixelCPEBase::probabilityY_
mutableprotected
float PixelCPEBase::qBin_
mutableprotected
bool PixelCPEBase::spansTwoROCs_
mutableprotected

Definition at line 212 of file PixelCPEBase.h.

Referenced by rawQualityWord(), setTheDet(), and spansTwoRocks().

const SiPixelTemplateDBObject* PixelCPEBase::templateDBobject_
mutableprotected
const PixelGeomDetUnit* PixelCPEBase::theDet
mutableprotected
float PixelCPEBase::theDetR
mutableprotected

Definition at line 184 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theDetZ
mutableprotected

Definition at line 183 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theLShiftX
mutableprotected

Definition at line 185 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theLShiftY
mutableprotected

Definition at line 186 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theNumOfCol
mutableprotected

Definition at line 182 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theNumOfRow
mutableprotected

Definition at line 181 of file PixelCPEBase.h.

Referenced by setTheDet().

Local3DPoint PixelCPEBase::theOrigin
mutableprotected

Definition at line 174 of file PixelCPEBase.h.

Referenced by computeAnglesFromDetPosition(), and setTheDet().

Param const* PixelCPEBase::theParam
mutableprotected

Definition at line 171 of file PixelCPEBase.h.

Referenced by setTheDet().

GeomDetType::SubDetector PixelCPEBase::thePart
mutableprotected
float PixelCPEBase::thePitchX
mutableprotected
float PixelCPEBase::thePitchY
mutableprotected
const RectangularPixelTopology* PixelCPEBase::theRecTopol
mutableprotected
float PixelCPEBase::theSign
mutableprotected

Definition at line 187 of file PixelCPEBase.h.

Referenced by setTheDet().

float PixelCPEBase::theThickness
mutableprotected
const PixelTopology* PixelCPEBase::theTopol
mutableprotected
int PixelCPEBase::theVerboseLevel
protected
float PixelCPEBase::trk_lp_x
mutableprotected
float PixelCPEBase::trk_lp_y
mutableprotected
bool PixelCPEBase::with_track_angle
mutableprotected
bool PixelCPEBase::zneg
mutableprotected