51 class StrictWeakOrdering {
53 bool operator()(uint32_t
p,
const uint32_t&
i)
const {
return p <
i; }
65 template <
typename TKD>
66 void sortTKD(std::vector<TKD*>& det) {
67 std::sort(det.begin(), det.end(), CmpTKD());
69 template <
typename TKD>
70 void sortTKD(std::vector<TKD>& det) {
71 std::sort(det.begin(), det.end(), CmpTKD());
84 int stripQualityFlags,
85 int stripQualityDebugFlags,
88 int pixelQualityFlags,
89 int pixelQualityDebugFlags,
92 theStDetConditions(hitMatcher, stripCPE),
94 thePhase2DetConditions(phase2OTCPE) {
103 bool subIsPixel =
false;
106 bool subIsOT =
false;
188 for (
int i = 0;
i !=
size; ++
i) {
204 for (
int i = 0;
i !=
size; ++
i) {
213 int size = phase2Dets.size();
216 for (
int i = 0;
i !=
size; ++
i) {
217 auto& mdet = phase2Dets[
i];
225 for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) {
245 if ((gluedDet ==
nullptr && stackDet ==
nullptr && doubleSensGeomDet ==
nullptr) ||
246 (gluedDet !=
nullptr && stackDet !=
nullptr && doubleSensGeomDet !=
nullptr)) {
248 "MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet nor DoubleSensGeomDet");
250 if (gluedDet !=
nullptr)
252 else if (stackDet !=
nullptr)
270 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
278 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
286 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " <<
err.what();
308 if (monoDet ==
nullptr || stereoDet ==
nullptr) {
309 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
312 det.
init(monoDet, stereoDet, trackerTopology);
320 if (lowerDet ==
nullptr || upperDet ==
nullptr) {
321 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: StackDet components not found as MeasurementDets ";
324 det.
init(lowerDet, upperDet);
332 if (firstDet ==
nullptr || secondDet ==
nullptr) {
334 <<
"MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets ";
335 throw MeasurementDetException(
"MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets");
337 det.
init(firstDet, secondDet);
344 int qualityDebugFlags) {
353 if ((
quality !=
nullptr) && (qualityFlags != 0)) {
354 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
355 unsigned int on = 0,
tot = 0;
356 unsigned int foff = 0, ftot = 0, aoff = 0, atot = 0;
360 bool isOn =
quality->IsModuleUsable(detid);
363 on += (
unsigned int)isOn;
366 <<
"MeasurementTrackerImpl::initializeStripStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
374 short badApvs =
quality->getBadApvs(detid);
375 short badFibers =
quality->getBadFibers(detid);
376 for (
int j = 0;
j < 6;
j++) {
378 if (badApvs & (1 <<
j)) {
383 for (
int j = 0;
j < 3;
j++) {
385 if (badFibers & (1 <<
j)) {
403 <<
" Total modules: " <<
tot <<
", active " << on <<
", inactive " << (
tot - on);
407 <<
" Total APVs: " << atot <<
", active " << (atot - aoff) <<
", inactive " << (aoff);
409 <<
" Total Fibers: " << ftot <<
", active " << (ftot - foff) <<
", inactive " << (foff);
422 int qualityDebugFlags) {
423 if ((
quality !=
nullptr) && (qualityFlags != 0)) {
424 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
425 unsigned int on = 0,
tot = 0, badrocs = 0;
427 uint32_t detid = ((*i).geomDet().geographicalId()).
rawId();
429 bool isOn =
quality->IsModuleUsable(detid);
430 (
i)->setActive(isOn);
432 on += (
unsigned int)isOn;
435 <<
"MeasurementTrackerImpl::initializePixelStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
438 (
i)->setActive(
true);
440 if ((qualityFlags &
BadROCs) && (
quality->getBadRocs(detid) != 0)) {
442 badrocs += badROCs.size();
443 (
i)->setBadRocPositions(badROCs);
445 (
i)->clearBadRocPositions();
450 <<
" Total modules: " <<
tot <<
", active " << on <<
", inactive " << (
tot - on);
452 if (qualityDebugFlags &
BadROCs) {
453 edm::LogInfo(
"MeasurementTracker PixelROCStatus") <<
" Total of bad ROCs: " << badrocs;
457 (
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