53 class StrictWeakOrdering {
55 bool operator()(uint32_t
p,
const uint32_t&
i)
const {
return p <
i; }
67 template <
typename TKD>
68 void sortTKD(std::vector<TKD*>& det) {
69 std::sort(det.begin(), det.end(), CmpTKD());
71 template <
typename TKD>
72 void sortTKD(std::vector<TKD>& det) {
73 std::sort(det.begin(), det.end(), CmpTKD());
86 int stripQualityFlags,
87 int stripQualityDebugFlags,
90 int pixelQualityFlags,
91 int pixelQualityDebugFlags,
94 theStDetConditions(hitMatcher, stripCPE),
96 thePhase2DetConditions(phase2OTCPE) {
105 bool subIsPixel =
false;
108 bool subIsOT =
false;
190 for (
int i = 0;
i !=
size; ++
i) {
206 for (
int i = 0;
i !=
size; ++
i) {
215 int size = phase2Dets.size();
218 for (
int i = 0;
i !=
size; ++
i) {
219 auto& mdet = phase2Dets[
i];
227 for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) {
247 if ((gluedDet ==
nullptr && stackDet ==
nullptr && doubleSensGeomDet ==
nullptr) ||
248 (gluedDet !=
nullptr && stackDet !=
nullptr && doubleSensGeomDet !=
nullptr)) {
250 "MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet nor DoubleSensGeomDet");
252 if (gluedDet !=
nullptr)
254 else if (stackDet !=
nullptr)
272 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
280 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
288 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
310 if (monoDet ==
nullptr || stereoDet ==
nullptr) {
311 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
314 det.
init(monoDet, stereoDet, trackerTopology);
322 if (lowerDet ==
nullptr || upperDet ==
nullptr) {
323 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: StackDet components not found as MeasurementDets ";
326 det.
init(lowerDet, upperDet);
334 if (firstDet ==
nullptr || secondDet ==
nullptr) {
336 <<
"MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets ";
337 throw MeasurementDetException(
"MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets");
339 det.
init(firstDet, secondDet);
346 int qualityDebugFlags) {
355 if ((
quality !=
nullptr) && (qualityFlags != 0)) {
356 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
357 unsigned int on = 0,
tot = 0;
358 unsigned int foff = 0, ftot = 0, aoff = 0, atot = 0;
362 bool isOn =
quality->IsModuleUsable(detid);
365 on += (
unsigned int)isOn;
368 <<
"MeasurementTrackerImpl::initializeStripStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
376 short badApvs =
quality->getBadApvs(detid);
377 short badFibers =
quality->getBadFibers(detid);
378 for (
int j = 0;
j < 6;
j++) {
380 if (badApvs & (1 <<
j)) {
385 for (
int j = 0;
j < 3;
j++) {
387 if (badFibers & (1 <<
j)) {
405 <<
" Total modules: " <<
tot <<
", active " << on <<
", inactive " << (
tot - on);
409 <<
" Total APVs: " << atot <<
", active " << (atot - aoff) <<
", inactive " << (aoff);
411 <<
" Total Fibers: " << ftot <<
", active " << (ftot - foff) <<
", inactive " << (foff);
424 int qualityDebugFlags) {
425 if ((
quality !=
nullptr) && (qualityFlags != 0)) {
426 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
427 unsigned int on = 0,
tot = 0, badrocs = 0;
429 uint32_t detid = ((*i).geomDet().geographicalId()).
rawId();
431 bool isOn =
quality->IsModuleUsable(detid);
432 (
i)->setActive(isOn);
434 on += (
unsigned int)isOn;
437 <<
"MeasurementTrackerImpl::initializePixelStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
440 (
i)->setActive(
true);
442 if ((qualityFlags &
BadROCs) && (
quality->getBadRocs(detid) != 0)) {
444 badrocs += badROCs.size();
445 (
i)->setBadRocPositions(badROCs);
447 (
i)->clearBadRocPositions();
452 <<
" Total modules: " <<
tot <<
", active " << on <<
", inactive " << (
tot - on);
454 if (qualityDebugFlags &
BadROCs) {
455 edm::LogInfo(
"MeasurementTracker PixelROCStatus") <<
" Total of bad ROCs: " << badrocs;
459 (
i)->setActive(
true);
const DetContainer & detsTIB() const
const GeomDetUnit * secondDet() const
void initDoubleSensDet(TkDoubleSensMeasurementDet &det)
virtual bool isLeaf() const
is a Unit
void addStripDet(const GeomDet *gd)
~MeasurementTrackerImpl() override
void addStackDet(const StackGeomDet *gd)
const GeomDetUnit * lowerDet() const
const GeomDetUnit * firstDet() const
std::vector< TkStripMeasurementDet > theStripDets
const DetContainer & detsPXB() const
std::vector< TkStackMeasurementDet > theStackDets
void init(const MeasurementDet *firstDet, const MeasurementDet *secondDet)
StMeasurementConditionSet theStDetConditions
static constexpr auto TID
const GeomDetUnit * upperDet() const
unsigned int id(int i) const
void addDoubleSensGeomDet(const DoubleSensGeomDet *gd)
std::vector< unsigned int >::const_iterator ContainerIterator
void addDets(const TrackingGeometry::DetContainer &dets, bool subIsPixel, bool subIsOT)
const TrackerGeometry * theTrackerGeom
const DetContainer & detsPXF() const
const StripClusterParameterEstimator * stripCPE() const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const GluedGeomDet & specificGeomDet() const
std::vector< TkPhase2OTMeasurementDet > thePhase2Dets
Log< level::Error, false > LogError
void addPixelDet(const GeomDet *gd)
const SiStripRecHitMatcher * matcher() const
std::vector< const GeomDet * > DetContainer
void init(const MeasurementDet *lowerDet, const MeasurementDet *upperDet)
std::vector< unsigned char > subId_
unsigned int id(int i) const
void initGluedDet(TkGluedMeasurementDet &det, const TrackerTopology *trackerTopology)
const DetContainer & detsTOB() const
std::vector< TkPixelMeasurementDet > thePixelDets
void initializePixelStatus(const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
void initPhase2OTMeasurementConditionSet(std::vector< TkPhase2OTMeasurementDet > &phase2Dets)
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
std::vector< BadStripBlock > & getBadStripBlocks(int i)
MeasurementTrackerImpl(const BadStripCutsDet &badStripCuts, const PixelClusterParameterEstimator *pixelCPE, const StripClusterParameterEstimator *stripCPE, const SiStripRecHitMatcher *hitMatcher, const TrackerTopology *trackerTopology, const TrackerGeometry *trackerGeom, const GeometricSearchTracker *geometricSearchTracker, const SiStripQuality *stripQuality, int stripQualityFlags, int stripQualityDebugFlags, const SiPixelQuality *pixelQuality, const SiPixelFedCabling *pixelCabling, int pixelQualityFlags, int pixelQualityDebugFlags, const ClusterParameterEstimator< Phase2TrackerCluster1D > *phase2OTCPE=nullptr)
void initialize(const TrackerTopology *trackerTopology)
void initStMeasurementConditionSet(std::vector< TkStripMeasurementDet > &stripDets)
unsigned int id(int i) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< TkDoubleSensMeasurementDet > theDoubleSensGeomDets
std::vector< unsigned int > id_
DetId geographicalId() const
The label of this GeomDet.
static constexpr auto TOB
std::vector< int > totalStrips_
void initializeStripStatus(const BadStripCutsDet &badStripCuts, const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
const std::vector< TkStripMeasurementDet > & stripDets() const
const GeomDetUnit * monoDet() const
void addPhase2Det(const GeomDet *gd)
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
void setMaskBad128StripBlocks(bool maskThem)
std::vector< unsigned int > id_
void addGluedDet(const GluedGeomDet *gd)
constexpr uint32_t rawId() const
get the raw id
std::vector< unsigned int > id_
const GeomDet & fastGeomDet() const
const GeomDetUnit * stereoDet() const
std::vector< TkGluedMeasurementDet > theGluedDets
static constexpr auto TIB
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet, const TrackerTopology *tTopo)
PxMeasurementConditionSet thePxDetConditions
Phase2OTMeasurementConditionSet thePhase2DetConditions
const MeasurementDet * findDet(const DetId &id) const
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
std::pair< ContainerIterator, ContainerIterator > Range
const std::vector< TkPixelMeasurementDet > & pixelDets() const
const DetContainer & detsTEC() const
BadStripCuts badStripCuts_[4]
const StackGeomDet & specificGeomDet() const
void initPxMeasurementConditionSet(std::vector< TkPixelMeasurementDet > &pixelDets)
const DoubleSensGeomDet & specificGeomDet() const
void set128StripStatus(int i, bool good, int idx=-1)
const PixelClusterParameterEstimator * pixelCPE() const
void initStackDet(TkStackMeasurementDet &det)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
static constexpr auto TEC
const DetContainer & detsTID() const