14 #define CORRECT_FOR_BIG_PIXELS
40 : useLAOffsetFromConfig_(
false),
41 useLAWidthFromConfig_(
false),
42 useLAWidthFromDB_(
false),
49 nRecHitsUsedEdge_ = 0,
104 if (lAWidthBPix_ > 0.0 || lAWidthFPix_ > 0.0)
112 LogDebug(
"PixelCPEBase") <<
" LA constants - " << lAOffset_ <<
" " << lAWidthBPix_ <<
" " << lAWidthFPix_
126 unsigned m_detectors = dus.size();
127 for (
unsigned int i = 1;
i < 7; ++
i) {
128 LogDebug(
"PixelCPEBase:: LookingForFirstStrip")
142 LogDebug(
"LookingForFirstStrip") <<
" Chosen offset: " << m_detectors;
145 LogDebug(
"PixelCPEBase::fillDetParams():") <<
"caching " << m_detectors <<
" pixel detectors" << endl;
146 for (
unsigned i = 0;
i != m_detectors; ++
i) {
150 assert(
p.theDet->index() == int(
i));
152 p.theOrigin =
p.theDet->surface().toLocal(
GlobalPoint(0, 0, 0));
155 p.thePart =
p.theDet->type().subDetector();
166 p.theThickness =
p.theDet->surface().bounds().thickness();
177 auto topol = &(
p.theDet->specificTopology());
189 std::pair<float, float> pitchxy =
p.theRecTopol->pitch();
190 p.thePitchX = pitchxy.first;
191 p.thePitchY = pitchxy.second;
204 LogDebug(
"PixelCPEBase::fillDetParams()") <<
"***** PIXEL LAYOUT *****"
205 <<
" thePart = " <<
p.thePart <<
" theThickness = " <<
p.theThickness
206 <<
" thePitchX = " <<
p.thePitchX <<
" thePitchY = " <<
p.thePitchY;
216 int minInX, minInY, maxInX, maxInY = 0;
222 int min_row(0), min_col(0);
226 if (minInX == min_row)
228 else if (maxInX == max_row)
233 if (minInY == min_col)
235 else if (maxInY == max_col)
302 theClusterParam.
cotalpha = gvx * gvz;
303 theClusterParam.
cotbeta = gvy * gvz;
350 LogDebug(
"PixelCPEBase::driftDirection()")
354 LogDebug(
"PixelCPEBase::driftDirection()") <<
" LA object is NULL, assume LA = 0" << endl;
356 LogDebug(
"PixelCPEBase::driftDirection()") <<
" Will use LA Offset from DB " << langle << endl;
359 LogDebug(
"PixelCPEBase::driftDirection()") <<
" Will use LA Offset from config " << langle << endl;
372 if (langleWidth != 0.0)
409 float dir_x = -(langle * Bfield.
y() + alpha2 * Bfield.
z() * Bfield.
x());
410 float dir_y = (langle * Bfield.
x() - alpha2 * Bfield.
z() * Bfield.
y());
411 float dir_z = -(1.f + alpha2 * Bfield.
z() * Bfield.
z());
415 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is " <<
dd;
430 LogDebug(
"PixelCPEBase::computeLorentzShifts()")
444 float probabilityXY = 0;
468 desc.
add<
bool>(
"LoadTemplatesFromDB",
true);
469 desc.
add<
bool>(
"Alpha2Order",
true);
470 desc.
add<
int>(
"ClusterProbComputationFlag", 0);
471 desc.
add<
bool>(
"useLAWidthFromDB",
true);
472 desc.
add<
double>(
"lAOffset", 0.0);
473 desc.
add<
double>(
"lAWidthBPix", 0.0);
474 desc.
add<
double>(
"lAWidthFPix", 0.0);
475 desc.
add<
bool>(
"doLorentzFromAlignment",
false);
476 desc.
add<
bool>(
"useLAFromDB",
true);
void setProbabilityXY(float prob, QualWordType &qualWord) const
T getUntrackedParameter(std::string const &, T const &) const
static const Packing thePacking
static std::vector< std::string > checklist log
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const SiPixelLorentzAngle * lorentzAngleWidth_
LocalVector driftDirection(DetParam &theDetParam, GlobalVector bfield) const
short getTemplateID(const uint32_t &detid) const
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.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const SiPixelCluster * theCluster
bool isBarrel(GeomDetEnumerators::SubDetector m)
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
bool containsBigPixelInY(int iymin, int iymax) const override
static void fillPSetDescription(edm::ParameterSetDescription &desc)
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
short getGenErrorID(const uint32_t &detid) const
bool doLorentzFromAlignment_
int nrows() const override
const Plane & surface() const
The nominal surface of the GeomDet.
const PixelGeomDetUnit * theDet
GeomDetType::SubDetector thePart
const RectangularPixelTopology * theRecTopol
bool containsBigPixelInX(int ixmin, int ixmax) const override
bool useLAWidthFromConfig_
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
const PixelTopology * theTopol
bool LoadTemplatesFromDB_
void computeAnglesFromTrajectory(DetParam const &theDetParam, ClusterParam &theClusterParam, const LocalTrajectoryParameters <p) const
unsigned int offsetDU(SubDetector sid) const
void computeLorentzShifts(DetParam &) const
Abs< T >::type abs(const T &t)
const SiPixelTemplateDBObject * templateDBobject_
void setHasBadPixels(bool flag, QualWordType &qualWord) const
DetId geographicalId() const
The label of this GeomDet.
const MagneticField * magfield_
unsigned int clusterProbComputationFlag_
void computeAnglesFromDetPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const
void setProbabilityQ(float prob, QualWordType &qualWord) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
SiPixelRecHitQuality::QualWordType rawQualityWord(ClusterParam &theClusterParam) const
void setSpansTwoROCs(bool flag, QualWordType &qualWord) const
Topology::LocalTrackPred loc_trk_pred
void setIsOnEdge(bool flag, QualWordType &qualWord) const
const SiPixelLorentzAngle * lorentzAngle_
const SiPixelGenErrorDBObject * genErrorDBObject_
T getParameter(std::string const &) const
int ncolumns() const override
void setTheClu(DetParam const &, ClusterParam &theClusterParam) const
bool useLAOffsetFromConfig_
const TrackerGeometry & geom_
unsigned int QualWordType
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)
float getLorentzAngle(const uint32_t &) const
LocalVector driftDirection
const RotationType & rotation() const
void setHasFilledProb(bool flag, QualWordType &qualWord) const
const PositionType & position() const
void setQBin(int qbin, QualWordType &qualWord) const
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
constexpr SubDetector tkDetEnum[8]
DetParam const & detParam(const GeomDetUnit &det) const