21 #define CORRECT_FOR_BIG_PIXELS
37 const float PI = 3.141593;
46 : theDet(0), nRecHitsTotal_(0), nRecHitsUsedEdge_(0),
47 probabilityX_(0.0), probabilityY_(0.0),
48 probabilityQ_(0.0), qBin_(0),
49 isOnEdge_(0), hasBadPixels_(0),
51 hasFilledProb_(0), clusterProbComputationFlag_(0),
52 loc_trk_pred_(0.0, 0.0, 0.0, 0.0)
87 = (
unsigned int) conf.
getParameter<
int>(
"ClusterProbComputationFlag");
106 <<
" Wrong pointer to PixelGeomDetUnit object !!!";
121 <<
"PixelCPEBase: A non-pixel detector type in here?" ;
177 int minInX,minInY,maxInX,maxInY=0;
191 for(
unsigned int i=0;
i<cluster.
pixelADC().size(); ++
i) {
204 LogDebug(
"PixelCPEBase") <<
"***** PIXEL LAYOUT *****"
231 <<
" Wrong pointer to pixel detector !!!" << endl;
236 float xcenter = cl.
x();
237 float ycenter = cl.
y();
247 float gp_mod =
sqrt( gp.
x()*gp.
x() + gp.
y()*gp.
y() + gp.
z()*gp.
z() );
250 float gpx = gp.
x()/gp_mod;
251 float gpy = gp.
y()/gp_mod;
252 float gpz = gp.
z()/gp_mod;
279 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
280 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
281 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
284 alpha_ = atan2( gv_dot_gvz, gv_dot_gvx );
285 beta_ = atan2( gv_dot_gvz, gv_dot_gvy );
310 float locx = localDir.
x();
311 float locy = localDir.
y();
312 float locz = localDir.
z();
324 alpha_ = atan2( locz, locx );
325 beta_ = atan2( locz, locy );
364 float lpx =
xpos(cluster);
365 float lpy =
ypos(cluster);
427 if ( tmp2<tmp1 )
return true;
522 const int& imin,
const int& imax,
523 float&
q1,
float&
q2)
const {
529 int isize = pixelsVec.size();
530 for (
int i=0;
i<isize; ++
i) {
531 if ( (pixelsVec[
i].
x) == imin )
532 q1 += pixelsVec[
i].adc;
533 else if ( (pixelsVec[
i].x) == imax)
534 q2 += float(pixelsVec[
i].
adc);
536 qm += float(pixelsVec[
i].adc);
546 const int& imin,
const int& imax,
547 float&
q1,
float&
q2)
const {
554 int isize = pixelsVec.size();
555 for (
int i=0;
i<isize; ++
i) {
556 if ( (pixelsVec[
i].
y) == imin)
557 q1 += pixelsVec[
i].adc;
558 else if ( (pixelsVec[
i].y) == imax)
559 q2 += pixelsVec[
i].adc;
562 qm += float(pixelsVec[
i].
adc);
583 throw cms::Exception(
"invalidPointer") <<
"[PixelCPEBase::driftDirection] zero pointer to lorentz angle record ";
588 alpha2 = langle*langle;
593 float dir_x = ( langle * Bfield.y() + alpha2* Bfield.z()* Bfield.x() );
594 float dir_y = -( langle * Bfield.x() - alpha2* Bfield.z()* Bfield.y() );
595 float dir_z = -( 1 + alpha2* Bfield.z()*Bfield.z() );
596 float scale = (1 + alpha2* Bfield.z()*Bfield.z() );
599 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is "
600 << theDriftDirection ;
602 return theDriftDirection;
613 LocalVector Bfield = detFrame.toLocal(global_Bfield);
615 throw cms::Exception(
"invalidPointer") <<
"[PixelCPEBase::computeLorentzShifts] zero pointer to lorentz angle record ";
620 alpha2 = langle * langle;
634 double dir_x = -( langle * Bfield.
y() + alpha2* Bfield.
z()* Bfield.
x() );
635 double dir_y = ( langle * Bfield.
x() - alpha2* Bfield.
z()* Bfield.
y() );
636 double dir_z = -( 1 + alpha2* Bfield.
z()* Bfield.
z() );
640 double scale = fabs( dir_z );
655 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is "
int adc(sample_type sample)
get the ADC sample (12 bits)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
Topology::LocalTrackPred loc_trk_pred_
PixelCPEBase(edm::ParameterSet const &conf, const MagneticField *mag=0, const SiPixelLorentzAngle *lorentzAngle=0, const SiPixelCPEGenericErrorParm *genErrorParm=0, const SiPixelTemplateDBObject *templateDBobject=0)
Local3DVector LocalVector
virtual bool containsBigPixelInX(const int &ixmin, const int &ixmax) const =0
void setIsOnEdge(bool flag, QualWordType &qualWord)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
void setProbabilityXY(float prob, QualWordType &qualWord)
virtual int ncolumns() const =0
static Packing thePacking
void setSpansTwoROCs(bool flag, QualWordType &qualWord)
LocalPoint position() const
Local x and y position coordinates.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
void setHasBadPixels(bool flag, QualWordType &qualWord)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
void computeAnglesFromDetPosition(const SiPixelCluster &cl, const GeomDetUnit &det) const
void xCharge(const std::vector< SiPixelCluster::Pixel > &, const int &, const int &, float &q1, float &q2) const
unsigned int clusterProbComputationFlag_
virtual int nrows() const =0
SiPixelRecHitQuality::QualWordType rawQualityWord() const
void yCharge(const std::vector< SiPixelCluster::Pixel > &, const int &, const int &, float &q1, float &q2) const
MeasurementError measurementError(const SiPixelCluster &, const GeomDetUnit &det) const
GeomDetType::SubDetector thePart
virtual float ypos(const SiPixelCluster &) const =0
double lorentzShiftInCmY_
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
void setProbabilityQ(float prob, QualWordType &qualWord)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual bool isItEdgePixelInX(int ixbin) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
LocalVector driftDirection_
void computeLorentzShifts() const
void computeAnglesFromTrajectory(const SiPixelCluster &cl, const GeomDetUnit &det, const LocalTrajectoryParameters <p) const
LocalVector driftDirection(GlobalVector bfield) const
double lorentzShiftInCmX_
const SiPixelTemplateDBObject * templateDBobject_
DetId geographicalId() const
The label of this GeomDet.
const MagneticField * magfield_
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
LocalVector momentum() const
Momentum vector in the local frame.
virtual bool containsBigPixelInY(const int &iymin, const int &iymax) const =0
const std::vector< uint16_t > & pixelADC() const
virtual LocalError localError(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
virtual std::pair< float, float > pitch() const =0
Point3DBase< float, LocalTag > Local3DPoint
const Bounds & bounds() const
void setHasFilledProb(bool flag, QualWordType &qualWord)
ROOT::Math::SVector< double, 5 > AlgebraicVector5
LocalTrajectoryParameters loc_traj_param_
const SiPixelLorentzAngle * lorentzAngle_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const PixelTopology * theTopol
MeasurementPoint measurementPosition(const SiPixelCluster &, const GeomDetUnit &det) const
AlgebraicVector5 mixedFormatVector() const
void setTheDet(const GeomDetUnit &det, const SiPixelCluster &cluster) const
virtual float lorentzShiftX() const
Pixel cluster – collection of neighboring pixels above threshold.
virtual bool isItEdgePixelInY(int iybin) const =0
float probabilityXY() const
float getLorentzAngle(const uint32_t &) const
const RotationType & rotation() const
virtual const GeomDetType & type() const
void setQBin(int qbin, QualWordType &qualWord)
const PixelGeomDetUnit * theDet
PixelTopology const * topology
virtual float lorentzShiftY() const
const PositionType & position() const
virtual LocalPoint localPosition(const SiPixelCluster &cl, const GeomDetUnit &det) const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
SubDetector subDetector() const
const SiPixelCPEGenericErrorParm * genErrorParm_
virtual float xpos(const SiPixelCluster &) const =0