Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-11 04:34:09

0001 // Move geomCorrection to the concrete class. d.k. 06/06.
0002 // Change drift direction. d.k. 06/06
0003 // G. Giurgiu (ggiurgiu@pha.jhu.edu), 12/01/06, implemented the function:
0004 // computeAnglesFromDetPosition(const SiPixelCluster & cl,
0005 // change to use Lorentz angle from DB Lotte Wilke, Jan. 31st, 2008
0006 // Change to use Generic error & Template calibration from DB - D.Fehling 11/08
0007 
0008 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0009 #include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
0010 #include "Geometry/CommonTopologies/interface/ProxyPixelTopology.h"
0011 
0012 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h"
0013 
0014 #define CORRECT_FOR_BIG_PIXELS
0015 
0016 // MessageLogger
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 
0019 // Magnetic field
0020 #include "MagneticField/Engine/interface/MagneticField.h"
0021 
0022 #include <iostream>
0023 
0024 using namespace std;
0025 
0026 //-----------------------------------------------------------------------------
0027 //  A constructor run for generic and templates
0028 //
0029 //-----------------------------------------------------------------------------
0030 PixelCPEBase::PixelCPEBase(edm::ParameterSet const& conf,
0031                            const MagneticField* mag,
0032                            const TrackerGeometry& geom,
0033                            const TrackerTopology& ttopo,
0034                            const SiPixelLorentzAngle* lorentzAngle,
0035                            const SiPixelGenErrorDBObject* genErrorDBObject,
0036                            const SiPixelTemplateDBObject* templateDBobject,
0037                            const SiPixelLorentzAngle* lorentzAngleWidth,
0038                            int flag)
0039     //  : useLAAlignmentOffsets_(false), useLAOffsetFromConfig_(false),
0040     : useLAOffsetFromConfig_(false),
0041       useLAWidthFromConfig_(false),
0042       useLAWidthFromDB_(false),
0043       theFlag_(flag),
0044       magfield_(mag),
0045       geom_(geom),
0046       ttopo_(ttopo) {
0047 #ifdef EDM_ML_DEBUG
0048   nRecHitsTotal_ = 0;
0049   nRecHitsUsedEdge_ = 0,
0050 #endif
0051 
0052   //--- Lorentz angle tangent per Tesla
0053       lorentzAngle_ = lorentzAngle;
0054   lorentzAngleWidth_ = lorentzAngleWidth;
0055 
0056   //-- GenError Calibration Object from DB
0057   genErrorDBObject_ = genErrorDBObject;
0058 
0059   //-- Template Calibration Object from DB
0060   if (theFlag_ != 0)
0061     templateDBobject_ = templateDBobject;  // flag to check if it is generic or templates
0062 
0063   // Configurables
0064   // For both templates & generic
0065 
0066   // Read templates and/or generic errors from DB
0067   LoadTemplatesFromDB_ = conf.getParameter<bool>("LoadTemplatesFromDB");
0068 
0069   //--- Algorithm's verbosity
0070   theVerboseLevel = conf.getUntrackedParameter<int>("VerboseLevel", 0);
0071 
0072   //-- Switch on/off E.B
0073   alpha2Order = conf.getParameter<bool>("Alpha2Order");
0074 
0075   //--- A flag that could be used to change the behavior of
0076   //--- clusterProbability() in TSiPixelRecHit (the *transient* one).
0077   //--- The problem is that the transient hits are made after the CPE runs
0078   //--- and they don't get the access to the PSet, so we pass it via the
0079   //--- CPE itself...
0080   //
0081   clusterProbComputationFlag_ = (unsigned int)conf.getParameter<int>("ClusterProbComputationFlag");
0082 
0083   // This LA related parameters are only relevant for the Generic algo
0084   // They still have to be used in Base since the LA computation is in Base
0085 
0086   // Use LA-width from DB.
0087   // If both (this and from config) are false LA-width is calcuated from LA-offset
0088   useLAWidthFromDB_ = conf.getParameter<bool>("useLAWidthFromDB");
0089 
0090   // Use Alignment LA-offset in generic
0091   // (Experimental; leave commented out)
0092   //useLAAlignmentOffsets_ = conf.existsAs<bool>("useLAAlignmentOffsets")?
0093   //conf.getParameter<bool>("useLAAlignmentOffsets"):false;
0094 
0095   // Used only for testing
0096   lAOffset_ = conf.getParameter<double>("lAOffset");
0097   lAWidthBPix_ = conf.getParameter<double>("lAWidthBPix");
0098   lAWidthFPix_ = conf.getParameter<double>("lAWidthFPix");
0099 
0100   // Use LA-offset from config, for testing only
0101   if (lAOffset_ > 0.0)
0102     useLAOffsetFromConfig_ = true;
0103   // Use LA-width from config, split into fpix & bpix, for testing only
0104   if (lAWidthBPix_ > 0.0 || lAWidthFPix_ > 0.0)
0105     useLAWidthFromConfig_ = true;
0106 
0107   // For Templates only
0108   // Compute the Lorentz shifts for this detector element for templates (from Alignment)
0109   doLorentzFromAlignment_ = conf.getParameter<bool>("doLorentzFromAlignment");
0110   useLAFromDB_ = conf.getParameter<bool>("useLAFromDB");
0111 
0112   LogDebug("PixelCPEBase") << " LA constants - " << lAOffset_ << " " << lAWidthBPix_ << " " << lAWidthFPix_
0113                            << endl;  //dk
0114 
0115   fillDetParams();
0116 }
0117 
0118 //-----------------------------------------------------------------------------
0119 //  Fill all variables which are constant for an event (geometry)
0120 //-----------------------------------------------------------------------------
0121 void PixelCPEBase::fillDetParams() {
0122   // MM: this code finds the last Pixel (Inner Tracker) DetUnit to loop upon when filling the det params, by looking the first detId which is from
0123   // the Outer Tracker (Strips in case of the Phase-0/1 detector).
0124 
0125   auto const& dus = geom_.detUnits();
0126   unsigned m_detectors = dus.size();
0127   for (unsigned int i = 1; i < 7; ++i) {
0128     LogDebug("PixelCPEBase:: LookingForFirstStrip")
0129         << "Subdetector " << i << " GeomDetEnumerator " << GeomDetEnumerators::tkDetEnum[i] << " offset "
0130         << geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) << " is it strip? "
0131         << (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size()
0132                 ? dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isOuterTracker()
0133                 : false);
0134 
0135     if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() &&
0136         dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isOuterTracker()) {
0137       if (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) < m_detectors) {
0138         m_detectors = geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]);
0139       }
0140     }
0141   }
0142   LogDebug("LookingForFirstStrip") << " Chosen offset: " << m_detectors;
0143 
0144   m_DetParams.resize(m_detectors);
0145   LogDebug("PixelCPEBase::fillDetParams():") << "caching " << m_detectors << " pixel detectors" << endl;
0146   for (unsigned i = 0; i != m_detectors; ++i) {
0147     auto& p = m_DetParams[i];
0148     p.theDet = dynamic_cast<const PixelGeomDetUnit*>(dus[i]);
0149     assert(p.theDet);
0150     assert(p.theDet->index() == int(i));
0151 
0152     p.theOrigin = p.theDet->surface().toLocal(GlobalPoint(0, 0, 0));
0153 
0154     //--- p.theDet->type() returns a GeomDetType, which implements subDetector()
0155     p.thePart = p.theDet->type().subDetector();
0156 
0157     //--- The location in of this DetUnit in a cyllindrical coord system (R,Z)
0158     //--- The call goes via BoundSurface, returned by p.theDet->surface(), but
0159     //--- position() is implemented in GloballyPositioned<> template
0160     //--- ( BoundSurface : Surface : GloballyPositioned<float> )
0161     //p.theDetR = p.theDet->surface().position().perp();  //Not used, AH
0162     //p.theDetZ = p.theDet->surface().position().z();  //Not used, AH
0163     //--- Define parameters for chargewidth calculation
0164 
0165     //--- bounds() is implemented in BoundSurface itself.
0166     p.theThickness = p.theDet->surface().bounds().thickness();
0167 
0168     // Cache the det id for templates and generic erros
0169 
0170     if (theFlag_ == 0) {         // for generic
0171       if (LoadTemplatesFromDB_)  // do only if genError requested
0172         p.detTemplateId = genErrorDBObject_->getGenErrorID(p.theDet->geographicalId().rawId());
0173     } else {  // for templates
0174       p.detTemplateId = templateDBobject_->getTemplateID(p.theDet->geographicalId());
0175     }
0176 
0177     auto topol = &(p.theDet->specificTopology());
0178     p.theTopol = topol;
0179     auto const proxyT = dynamic_cast<const ProxyPixelTopology*>(p.theTopol);
0180     if (proxyT)
0181       p.theRecTopol = dynamic_cast<const RectangularPixelTopology*>(&(proxyT->specificTopology()));
0182     else
0183       p.theRecTopol = dynamic_cast<const RectangularPixelTopology*>(p.theTopol);
0184     assert(p.theRecTopol);
0185 
0186     //--- The geometrical description of one module/plaquette
0187     //p.theNumOfRow = p.theRecTopol->nrows();   // rows in x //Not used, AH. PM: leave commented out.
0188     //p.theNumOfCol = p.theRecTopol->ncolumns();    // cols in y //Not used, AH. PM: leave commented out.
0189     std::pair<float, float> pitchxy = p.theRecTopol->pitch();
0190     p.thePitchX = pitchxy.first;   // pitch along x
0191     p.thePitchY = pitchxy.second;  // pitch along y
0192 
0193     LocalVector Bfield = p.theDet->surface().toLocal(magfield_->inTesla(p.theDet->surface().position()));
0194     p.bz = Bfield.z();
0195     p.bx = Bfield.x();
0196 
0197     //---  Compute the Lorentz shifts for this detector element
0198     if ((theFlag_ == 0) || useLAFromDB_ ||
0199         doLorentzFromAlignment_) {  // do always for generic and if using LA from DB or alignment for templates
0200       p.driftDirection = driftDirection(p, Bfield);
0201       computeLorentzShifts(p);
0202     }
0203 
0204     LogDebug("PixelCPEBase::fillDetParams()") << "***** PIXEL LAYOUT *****"
0205                                               << " thePart = " << p.thePart << " theThickness = " << p.theThickness
0206                                               << " thePitchX  = " << p.thePitchX << " thePitchY  = " << p.thePitchY;
0207     //               << " theLShiftX  = " << p.theLShiftX;
0208   }
0209 }
0210 
0211 //-----------------------------------------------------------------------------
0212 //  One function to cache the variables common for one DetUnit.
0213 //-----------------------------------------------------------------------------
0214 void PixelCPEBase::setTheClu(DetParam const& theDetParam, ClusterParam& theClusterParam) const {
0215   //--- Geometric Quality Information
0216   int minInX, minInY, maxInX, maxInY = 0;
0217   minInX = theClusterParam.theCluster->minPixelRow();
0218   minInY = theClusterParam.theCluster->minPixelCol();
0219   maxInX = theClusterParam.theCluster->maxPixelRow();
0220   maxInY = theClusterParam.theCluster->maxPixelCol();
0221 
0222   int min_row(0), min_col(0);
0223   int max_row = theDetParam.theRecTopol->nrows() - 1;
0224   int max_col = theDetParam.theRecTopol->ncolumns() - 1;
0225 
0226   if (minInX == min_row)
0227     theClusterParam.edgeTypeX_ = 1;
0228   else if (maxInX == max_row)
0229     theClusterParam.edgeTypeX_ = 2;
0230   else
0231     theClusterParam.edgeTypeX_ = 0;
0232 
0233   if (minInY == min_col)
0234     theClusterParam.edgeTypeY_ = 1;
0235   else if (maxInY == max_col)
0236     theClusterParam.edgeTypeY_ = 2;
0237   else
0238     theClusterParam.edgeTypeY_ = 0;
0239 
0240   theClusterParam.isOnEdge_ = (theClusterParam.edgeTypeX_ || theClusterParam.edgeTypeY_);
0241 
0242   // &&& FOR NOW UNUSED. KEEP IT IN CASE WE WANT TO USE IT IN THE FUTURE
0243   // Bad Pixels have their charge set to 0 in the clusterizer
0244   //hasBadPixels_ = false;
0245   //for(unsigned int i=0; i<theClusterParam.theCluster->pixelADC().size(); ++i) {
0246   //if(theClusterParam.theCluster->pixelADC()[i] == 0) { hasBadPixels_ = true; break;}
0247   //}
0248 
0249   theClusterParam.spansTwoROCs_ = theDetParam.theRecTopol->containsBigPixelInX(minInX, maxInX) |
0250                                   theDetParam.theRecTopol->containsBigPixelInY(minInY, maxInY);
0251 }
0252 
0253 //-----------------------------------------------------------------------------
0254 //  Compute alpha_ and beta_ from the LocalTrajectoryParameters.
0255 //  Note: should become const after both localParameters() become const.
0256 //-----------------------------------------------------------------------------
0257 void PixelCPEBase::computeAnglesFromTrajectory(DetParam const& theDetParam,
0258                                                ClusterParam& theClusterParam,
0259                                                const LocalTrajectoryParameters& ltp) const {
0260   theClusterParam.cotalpha = ltp.dxdz();
0261   theClusterParam.cotbeta = ltp.dydz();
0262 
0263   LocalPoint trk_lp = ltp.position();
0264   theClusterParam.trk_lp_x = trk_lp.x();
0265   theClusterParam.trk_lp_y = trk_lp.y();
0266 
0267   theClusterParam.with_track_angle = true;
0268 
0269   // GG: needed to correct for bows/kinks
0270   theClusterParam.loc_trk_pred = Topology::LocalTrackPred(
0271       theClusterParam.trk_lp_x, theClusterParam.trk_lp_y, theClusterParam.cotalpha, theClusterParam.cotbeta);
0272 }
0273 
0274 //-----------------------------------------------------------------------------
0275 //  Estimate theAlpha for barrel, based on the det position.
0276 //  &&& Needs to be consolidated from the above.
0277 //-----------------------------------------------------------------------------
0278 //float
0279 //PixelCPEBase::estimatedAlphaForBarrel(float centerx) const
0280 //{
0281 //  float tanalpha = theSign * (centerx-theOffsetX) * thePitchX / theDetR;
0282 //  return PI/2.0 - atan(tanalpha);
0283 //}
0284 
0285 //-----------------------------------------------------------------------------
0286 //  Compute alpha_ and beta_ from the position of this DetUnit.
0287 //  &&& DOES NOT WORK FOR NOW. d.k. 6/06
0288 // The angles from dets are calculated internaly in the PixelCPEInitial class
0289 //-----------------------------------------------------------------------------
0290 // G. Giurgiu, 12/01/06 : implement the function
0291 void PixelCPEBase::computeAnglesFromDetPosition(DetParam const& theDetParam, ClusterParam& theClusterParam) const {
0292   LocalPoint lp = theDetParam.theTopol->localPosition(
0293       MeasurementPoint(theClusterParam.theCluster->x(), theClusterParam.theCluster->y()));
0294   auto gvx = lp.x() - theDetParam.theOrigin.x();
0295   auto gvy = lp.y() - theDetParam.theOrigin.y();
0296   auto gvz = -1.f / theDetParam.theOrigin.z();
0297   //--- Note that the normalization is not required as only the ratio used
0298 
0299   //theClusterParam.zneg = (gvz < 0); // Not used, AH
0300 
0301   // calculate angles
0302   theClusterParam.cotalpha = gvx * gvz;
0303   theClusterParam.cotbeta = gvy * gvz;
0304 
0305   theClusterParam.with_track_angle = false;
0306 
0307   /*
0308     // used only in dberror param...
0309     auto alpha = HALF_PI - std::atan(cotalpha_);
0310     auto beta = HALF_PI - std::atan(cotbeta_);
0311     if (zneg) { beta -=PI; alpha -=PI;}
0312     
0313     auto alpha_ = atan2( gv_dot_gvz, gv_dot_gvx );
0314     auto beta_  = atan2( gv_dot_gvz, gv_dot_gvy );
0315     
0316     assert(std::abs(std::round(alpha*10000.f)-std::round(alpha_*10000.f))<2);
0317     assert(std::abs(std::round(beta*10000.f)-std::round(beta_*10000.f))<2);
0318     */
0319 }
0320 
0321 //------------------------------------------------------------------------
0322 PixelCPEBase::DetParam const& PixelCPEBase::detParam(const GeomDetUnit& det) const {
0323   auto i = det.index();
0324   //cout << "get parameters of detector " << i << endl;
0325   assert(i < int(m_DetParams.size()));
0326   //if (i>=int(m_DetParams.size())) m_DetParams.resize(i+1);  // should never happen!
0327   const DetParam& p = m_DetParams[i];
0328   return p;
0329 }
0330 
0331 //-----------------------------------------------------------------------------
0332 //  Drift direction.
0333 //  Works OK for barrel and forward.
0334 //  The formulas used for dir_x,y,z have to be exactly the same as the ones
0335 //  used in the digitizer (SiPixelDigitizerAlgorithm.cc).
0336 //  &&& PM: needs to be consolidated, discuss with PS.
0337 //-----------------------------------------------------------------------------
0338 LocalVector PixelCPEBase::driftDirection(DetParam& theDetParam, GlobalVector bfield) const {
0339   Frame detFrame(theDetParam.theDet->surface().position(), theDetParam.theDet->surface().rotation());
0340   LocalVector Bfield = detFrame.toLocal(bfield);
0341   return driftDirection(theDetParam, Bfield);
0342 }
0343 
0344 LocalVector PixelCPEBase::driftDirection(DetParam& theDetParam, LocalVector Bfield) const {
0345   // Use LA from DB or from config
0346   float langle = 0.;
0347   if (!useLAOffsetFromConfig_) {     // get it from DB
0348     if (lorentzAngle_ != nullptr) {  // a real LA object
0349       langle = lorentzAngle_->getLorentzAngle(theDetParam.theDet->geographicalId().rawId());
0350       LogDebug("PixelCPEBase::driftDirection()")
0351           << " la " << langle << " " << theDetParam.theDet->geographicalId().rawId() << endl;
0352     } else {                                                                                      // no LA, unused
0353       langle = 0;                                                                                 // set to a fake value
0354       LogDebug("PixelCPEBase::driftDirection()") << " LA object is NULL, assume LA = 0" << endl;  //dk
0355     }
0356     LogDebug("PixelCPEBase::driftDirection()") << " Will use LA Offset from DB " << langle << endl;
0357   } else {  // from config file
0358     langle = lAOffset_;
0359     LogDebug("PixelCPEBase::driftDirection()") << " Will use LA Offset from config " << langle << endl;
0360   }
0361 
0362   // Now do the LA width stuff
0363   theDetParam.widthLAFractionX = 1.;  // predefine to 1 (default) if things fail
0364   theDetParam.widthLAFractionY = 1.;
0365 
0366   // Compute the charge width, generic only
0367   if (theFlag_ == 0) {
0368     if (useLAWidthFromDB_ && (lorentzAngleWidth_ != nullptr)) {
0369       // take it from a separate, special LA DB object (forWidth)
0370 
0371       auto langleWidth = lorentzAngleWidth_->getLorentzAngle(theDetParam.theDet->geographicalId().rawId());
0372       if (langleWidth != 0.0)
0373         theDetParam.widthLAFractionX = std::abs(langleWidth / langle);
0374       // leave the widthLAFractionY=1.
0375       //cout<<" LAWidth lorentz width "<<theDetParam.widthLAFractionX<<" "<<theDetParam.widthLAFractionY<<endl;
0376 
0377     } else if (useLAWidthFromConfig_) {  // get from config
0378 
0379       double lAWidth = 0;
0380       if (GeomDetEnumerators::isTrackerPixel(theDetParam.thePart) && GeomDetEnumerators::isBarrel(theDetParam.thePart))
0381         lAWidth = lAWidthBPix_;  // barrel
0382       else
0383         lAWidth = lAWidthFPix_;
0384 
0385       if (langle != 0.0)
0386         theDetParam.widthLAFractionX = std::abs(lAWidth / langle);
0387       // fix the FractionY at 1
0388 
0389       //cout<<" Lorentz width from config "<<theDetParam.widthLAFractionX<<" "<<theDetParam.widthLAFractionY<<endl;
0390 
0391     } else {  // get if from the offset LA (old method used until 2013)
0392               // do nothing
0393       //cout<<" Old default LA width method "<<theDetParam.widthLAFractionX<<" "<<theDetParam.widthLAFractionY<<endl;
0394     }
0395 
0396     //cout<<" Final LA fraction  "<<theDetParam.widthLAFractionX<<" "<<theDetParam.widthLAFractionY<<endl;
0397 
0398   }  // if flag
0399 
0400   float alpha2 = alpha2Order ? langle * langle : 0;  //
0401 
0402   // **********************************************************************
0403   // Our convention is the following:
0404   // +x is defined by the direction of the Lorentz drift!
0405   // +z is defined by the direction of E field (so electrons always go into -z!)
0406   // +y is defined by +x and +z, and it turns out to be always opposite to the +B field.
0407   // **********************************************************************
0408 
0409   float dir_x = -(langle * Bfield.y() + alpha2 * Bfield.z() * Bfield.x());
0410   float dir_y = (langle * Bfield.x() - alpha2 * Bfield.z() * Bfield.y());
0411   float dir_z = -(1.f + alpha2 * Bfield.z() * Bfield.z());
0412   auto scale = 1.f / std::abs(dir_z);                  // same as 1 + alpha2*Bfield.z()*Bfield.z()
0413   LocalVector dd(dir_x * scale, dir_y * scale, -1.f);  // last is -1 !
0414 
0415   LogDebug("PixelCPEBase") << " The drift direction in local coordinate is " << dd;
0416 
0417   return dd;
0418 }
0419 
0420 //-----------------------------------------------------------------------------
0421 //  One-shot computation of the driftDirection and both lorentz shifts
0422 //-----------------------------------------------------------------------------
0423 void PixelCPEBase::computeLorentzShifts(DetParam& theDetParam) const {
0424   // Max shift (at the other side of the sensor) in cm
0425   theDetParam.lorentzShiftInCmX =
0426       theDetParam.driftDirection.x() / theDetParam.driftDirection.z() * theDetParam.theThickness;  //
0427   theDetParam.lorentzShiftInCmY =
0428       theDetParam.driftDirection.y() / theDetParam.driftDirection.z() * theDetParam.theThickness;  //
0429 
0430   LogDebug("PixelCPEBase::computeLorentzShifts()")
0431       << " lorentzShiftsInCmX,Y = " << theDetParam.lorentzShiftInCmX << " " << theDetParam.lorentzShiftInCmY << " "
0432       << theDetParam.driftDirection;
0433 }
0434 
0435 //-----------------------------------------------------------------------------
0436 //! A convenience method to fill a whole SiPixelRecHitQuality word in one shot.
0437 //! This way, we can keep the details of what is filled within the pixel
0438 //! code and not expose the Transient SiPixelRecHit to it as well.  The name
0439 //! of this function is chosen to match the one in SiPixelRecHit.
0440 //-----------------------------------------------------------------------------
0441 SiPixelRecHitQuality::QualWordType PixelCPEBase::rawQualityWord(ClusterParam& theClusterParam) const {
0442   SiPixelRecHitQuality::QualWordType qualWord(0);
0443   if (theClusterParam.hasFilledProb_) {
0444     float probabilityXY = 0;
0445     if (theClusterParam.filled_from_2d)
0446       probabilityXY = theClusterParam.probabilityX_;
0447     else if (theClusterParam.probabilityX_ != 0 && theClusterParam.probabilityY_ != 0)
0448       probabilityXY = theClusterParam.probabilityX_ * theClusterParam.probabilityY_ *
0449                       (1.f - std::log(theClusterParam.probabilityX_ * theClusterParam.probabilityY_));
0450     SiPixelRecHitQuality::thePacking.setProbabilityXY(probabilityXY, qualWord);
0451 
0452     SiPixelRecHitQuality::thePacking.setProbabilityQ(theClusterParam.probabilityQ_, qualWord);
0453   }
0454   SiPixelRecHitQuality::thePacking.setQBin(theClusterParam.qBin_, qualWord);
0455 
0456   SiPixelRecHitQuality::thePacking.setIsOnEdge(theClusterParam.isOnEdge_, qualWord);
0457 
0458   SiPixelRecHitQuality::thePacking.setHasBadPixels(theClusterParam.hasBadPixels_, qualWord);
0459 
0460   SiPixelRecHitQuality::thePacking.setSpansTwoROCs(theClusterParam.spansTwoROCs_, qualWord);
0461 
0462   SiPixelRecHitQuality::thePacking.setHasFilledProb(theClusterParam.hasFilledProb_, qualWord);
0463 
0464   return qualWord;
0465 }
0466 
0467 void PixelCPEBase::fillPSetDescription(edm::ParameterSetDescription& desc) {
0468   desc.add<bool>("LoadTemplatesFromDB", true);
0469   desc.add<bool>("Alpha2Order", true);
0470   desc.add<int>("ClusterProbComputationFlag", 0);
0471   desc.add<bool>("useLAWidthFromDB", true);
0472   desc.add<double>("lAOffset", 0.0);
0473   desc.add<double>("lAWidthBPix", 0.0);
0474   desc.add<double>("lAWidthFPix", 0.0);
0475   desc.add<bool>("doLorentzFromAlignment", false);
0476   desc.add<bool>("useLAFromDB", true);
0477 }