15 #define CORRECT_FOR_BIG_PIXELS
28 #define NEW_CPEERROR // must be constistent with base.cc, generic cc/h and genericProducer.cc
33 const bool useNewSimplerErrors =
false;
51 : useLAOffsetFromConfig_(
false),
52 useLAWidthFromConfig_(
false), useLAWidthFromDB_(
false), theFlag_(flag),
53 magfield_(mag), geom_(geom), ttopo_(ttopo)
97 = (
unsigned int) conf.
getParameter<
int>(
"ClusterProbComputationFlag");
129 LogDebug(
"PixelCPEBase") <<
" LA constants - "
145 unsigned m_detectors = dus.size();
146 for(
unsigned int i=1;
i<7;++
i) {
147 LogDebug(
"LookingForFirstStrip") <<
"Subdetector " <<
i
157 LogDebug(
"LookingForFirstStrip") <<
" Chosen offset: " << m_detectors;
162 for (
unsigned i=0;
i!=m_detectors;++
i) {
168 p.theOrigin =
p.theDet->surface().toLocal(
GlobalPoint(0,0,0));
171 p.thePart =
p.theDet->type().subDetector();
184 p.theThickness =
p.theDet->surface().bounds().thickness();
193 if(useNewSimplerErrors)
210 auto topol = &(
p.theDet->specificTopology());
220 std::pair<float,float> pitchxy =
p.theRecTopol->pitch();
221 p.thePitchX = pitchxy.first;
222 p.thePitchY = pitchxy.second;
237 LogDebug(
"PixelCPEBase") <<
"***** PIXEL LAYOUT *****"
238 <<
" thePart = " <<
p.thePart
239 <<
" theThickness = " <<
p.theThickness
240 <<
" thePitchX = " <<
p.thePitchX
241 <<
" thePitchY = " <<
p.thePitchY;
256 int minInX,minInY,maxInX,maxInY=0;
293 float locx = localDir.
x();
294 float locy = localDir.
y();
295 float locz = localDir.
z();
306 theClusterParam.
cotalpha = locx/locz;
307 theClusterParam.
cotbeta = locy/locz;
412 theClusterParam.
cotbeta = gvy*gvz;
452 if ( tmp2<tmp1 )
return true;
483 const bool LocalPrint =
false;
495 if(LocalPrint)
cout<<
" Will use LA Offset from DB "<<langle<<endl;
498 if(LocalPrint)
cout<<
" Will use LA Offset from config "<<langle<<endl;
538 if(LocalPrint)
cout<<
" in PixelCPEBase:driftDirection - "<<langle<<
" "<<Bfield<<endl;
549 float dir_x = -( langle * Bfield.
y() + alpha2* Bfield.
z()* Bfield.
x() );
550 float dir_y = ( langle * Bfield.
x() - alpha2* Bfield.
z()* Bfield.
y() );
551 float dir_z = -( 1.f + alpha2* Bfield.
z()*Bfield.
z() );
555 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is " <<
dd ;
577 LogDebug(
"PixelCPEBase") <<
" The drift direction in local coordinate is "
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
bool containsBigPixelInY(int iymin, int iymax) const
void setProbabilityXY(float prob, QualWordType &qualWord) const
T getUntrackedParameter(std::string const &, T const &) const
static const Packing thePacking
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool isItEdgePixelInY(int iybin) const
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)
bool isItEdgePixelInX(int ixbin) const
Global3DPoint GlobalPoint
bool isFlipped(DetParam const &theDetParam) const
short getGenErrorID(const uint32_t &detid) const
const Plane & surface() const
The nominal surface of the GeomDet.
const PixelGeomDetUnit * theDet
GeomDetType::SubDetector thePart
const RectangularPixelTopology * theRecTopol
uint32_t rawId() const
get the raw id
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_
LocalVector momentum() const
Momentum vector in the local frame.
unsigned int clusterProbComputationFlag_
void computeAnglesFromDetPosition(DetParam const &theDetParam, ClusterParam &theClusterParam) const
void setProbabilityQ(float prob, QualWordType &qualWord) const
bool containsBigPixelInX(int ixmin, int ixmax) const
SiPixelRecHitQuality::QualWordType rawQualityWord(ClusterParam &theClusterParam) const
void setSpansTwoROCs(bool flag, QualWordType &qualWord) const
Point3DBase< float, LocalTag > Local3DPoint
Topology::LocalTrackPred loc_trk_pred
void setIsOnEdge(bool flag, QualWordType &qualWord) const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
const SiPixelLorentzAngle * lorentzAngle_
const SiPixelGenErrorDBObject * genErrorDBObject_
void setTheClu(DetParam const &, ClusterParam &theClusterParam) const
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
AlgebraicVector5 mixedFormatVector() 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
volatile std::atomic< bool > shutdown_flag false
void setHasFilledProb(bool flag, QualWordType &qualWord) const
const PositionType & position() const
void setQBin(int qbin, QualWordType &qualWord) const
const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
DetParam const & detParam(const GeomDetUnit &det) const