22 #define CORRECT_FOR_BIG_PIXELS
38 const float PI = 3.141593;
48 probabilityX_(0.0), probabilityY_(0.0),
49 probabilityQ_(0.0), qBin_(0),
52 loc_trk_pred_(0.0, 0.0, 0.0, 0.0)
81 = (
unsigned int) conf.
getParameter<
int>(
"ClusterProbComputationFlag");
100 <<
" Wrong pointer to PixelGeomDetUnit object !!!";
115 <<
"PixelCPEBase: A non-pixel detector type in here?" ;
137 auto const proxyT =
dynamic_cast<const ProxyPixelTopology*
>(
theTopol);
138 if (proxyT)
theRecTopol =
dynamic_cast<const RectangularPixelTopology*
>(&(proxyT->specificTopology()));
145 std::pair<float,float> pitchxy =
theRecTopol->pitch();
172 int minInX,minInY,maxInX,maxInY=0;
186 for(
unsigned int i=0;
i<cluster.
pixelADC().size(); ++
i) {
190 if(
theRecTopol->containsBigPixelInX(minInX,maxInX) ||
191 theRecTopol->containsBigPixelInY(minInY,maxInY) ) {
199 LogDebug(
"PixelCPEBase") <<
"***** PIXEL LAYOUT *****"
229 float locx = localDir.
x();
230 float locy = localDir.
y();
231 float locz = localDir.
z();
243 alpha_ = atan2( locz, locx );
244 beta_ = atan2( locz, locy );
285 float lpx =
xpos(cluster);
286 float lpy =
ypos(cluster);
345 <<
" Wrong pointer to pixel detector !!!" << endl;
350 float xcenter = cl.
x();
351 float ycenter = cl.
y();
362 float gp_mod =
sqrt( gp.
x()*gp.
x() + gp.
y()*gp.
y() + gp.
z()*gp.
z() );
365 float gpx = gp.
x()/gp_mod;
366 float gpy = gp.
y()/gp_mod;
367 float gpz = gp.
z()/gp_mod;
394 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
395 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
396 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
409 alpha_ = atan2( gv_dot_gvz, gv_dot_gvx );
410 beta_ = atan2( gv_dot_gvz, gv_dot_gvy );
438 if ( tmp2<tmp1 )
return true;
479 float lshift = ydrift / (
thePitchY * 2.f);
509 throw cms::Exception(
"invalidPointer") <<
"[PixelCPEBase::driftDirection] zero pointer to lorentz angle record ";
514 alpha2 = langle*langle;
526 float dir_x = ( langle * Bfield.
y() + alpha2* Bfield.
z()* Bfield.
x() );
527 float dir_y = -( langle * Bfield.
x() - alpha2* Bfield.
z()* Bfield.
y() );
528 float dir_z = -( 1.f + alpha2* Bfield.
z()*Bfield.
z() );
532 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is "
559 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is "
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)
void setIsOnEdge(bool flag, QualWordType &qualWord)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
void setProbabilityXY(float prob, QualWordType &qualWord)
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
unsigned int clusterProbComputationFlag_
SiPixelRecHitQuality::QualWordType rawQualityWord() const
const Bounds & bounds() const
MeasurementError measurementError(const SiPixelCluster &, const GeomDetUnit &det) const
GeomDetType::SubDetector thePart
const Plane & surface() const
The nominal surface of the GeomDet.
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 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
Param const & param() const
LocalPoint toLocal(const GlobalPoint &gp) const
LocalVector driftDirection(GlobalVector bfield) const
double lorentzShiftInCmX_
const SiPixelTemplateDBObject * templateDBobject_
MeasurementPoint measurementPosition(const SiPixelCluster &cluster, const GeomDetUnit &det) const
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.
const std::vector< uint16_t > & pixelADC() const
virtual LocalError localError(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
Point3DBase< float, LocalTag > Local3DPoint
void setHasFilledProb(bool flag, QualWordType &qualWord)
const RectangularPixelTopology * theRecTopol
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
AlgebraicVector5 mixedFormatVector() const
void setTheDet(const GeomDetUnit &det, const SiPixelCluster &cluster) const
float lorentzShiftX() const
Pixel cluster – collection of neighboring pixels above threshold.
LocalVector const & getDrift() const
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
float lorentzShiftY() const
const PositionType & position() const
virtual LocalPoint localPosition(const SiPixelCluster &cl, const GeomDetUnit &det) const
SubDetector subDetector() const
const SiPixelCPEGenericErrorParm * genErrorParm_
virtual float xpos(const SiPixelCluster &) const =0