CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
MeasurementTrackerImpl Class Referencefinal

#include <MeasurementTrackerImpl.h>

Inheritance diagram for MeasurementTrackerImpl:
MeasurementTracker MeasurementDetSystem

Classes

struct  BadStripCutsDet
 

Public Types

typedef std::unordered_map< unsigned int, MeasurementDet * > DetContainer
 
enum  QualityFlags {
  BadModules = 1, BadAPVFibers = 2, BadStrips = 4, MaskBad128StripBlocks = 8,
  BadROCs = 2
}
 
- Public Types inherited from MeasurementTracker
enum  QualityFlags {
  BadModules = 1, BadAPVFibers = 2, BadStrips = 4, MaskBad128StripBlocks = 8,
  BadROCs = 2
}
 

Public Member Functions

const DetContainerallDets () const
 For debug only. More...
 
const MeasurementDetfindDet (const DetId &id) const
 
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackerGeometrygeomTracker () const
 
const std::vector< TkGluedMeasurementDet > & gluedDets () const
 
MeasurementDetWithData idToDet (const DetId &id, const MeasurementTrackerEvent &data) const override
 MeasurementDetSystem interface (won't be overloaded anymore) More...
 
const MeasurementDetidToDetBare (const DetId &id, const MeasurementTrackerEvent &data) const
 
 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)
 
const Phase2OTMeasurementConditionSetphase2DetConditions () const override
 
const PxMeasurementConditionSetpixelDetConditions () const override
 
const std::vector< TkPixelMeasurementDet > & pixelDets () const
 
const std::vector< TkStackMeasurementDet > & stackDets () const
 
const StMeasurementConditionSetstripDetConditions () const override
 Provide templates to be filled in. More...
 
const std::vector< TkStripMeasurementDet > & stripDets () const
 
 ~MeasurementTrackerImpl () override
 
- Public Member Functions inherited from MeasurementTracker
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackerGeometrygeomTracker () const
 
 MeasurementTracker (TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
 
 ~MeasurementTracker () override
 
- Public Member Functions inherited from MeasurementDetSystem
virtual ~MeasurementDetSystem ()=default
 

Protected Member Functions

void addDets (const TrackingGeometry::DetContainer &dets, bool subIsPixel, bool subIsOT)
 
void addGluedDet (const GluedGeomDet *gd)
 
void addPhase2Det (const GeomDet *gd)
 
void addPixelDet (const GeomDet *gd)
 
void addStackDet (const StackGeomDet *gd)
 
void addStripDet (const GeomDet *gd)
 
bool checkDets ()
 
void initGluedDet (TkGluedMeasurementDet &det, const TrackerTopology *trackerTopology)
 
void initialize (const TrackerTopology *trackerTopology)
 
void initializePixelStatus (const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
 
void initializeStripStatus (const BadStripCutsDet &badStripCuts, const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
 
void initPhase2OTMeasurementConditionSet (std::vector< TkPhase2OTMeasurementDet > &phase2Dets)
 
void initPxMeasurementConditionSet (std::vector< TkPixelMeasurementDet > &pixelDets)
 
void initStackDet (TkStackMeasurementDet &det)
 
void initStMeasurementConditionSet (std::vector< TkStripMeasurementDet > &stripDets)
 

Protected Attributes

DetContainer theDetMap
 
std::vector< TkGluedMeasurementDettheGluedDets
 
Phase2OTMeasurementConditionSet thePhase2DetConditions
 
std::vector< TkPhase2OTMeasurementDetthePhase2Dets
 
const SiPixelFedCablingthePixelCabling
 
std::vector< TkPixelMeasurementDetthePixelDets
 
PxMeasurementConditionSet thePxDetConditions
 
std::vector< TkStackMeasurementDettheStackDets
 
StMeasurementConditionSet theStDetConditions
 
std::vector< TkStripMeasurementDettheStripDets
 
- Protected Attributes inherited from MeasurementTracker
const GeometricSearchTrackertheGeometricSearchTracker
 
const TrackerGeometrytheTrackerGeom
 

Detailed Description

Definition at line 38 of file MeasurementTrackerImpl.h.

Member Typedef Documentation

◆ DetContainer

typedef std::unordered_map<unsigned int, MeasurementDet*> MeasurementTrackerImpl::DetContainer

Definition at line 95 of file MeasurementTrackerImpl.h.

Member Enumeration Documentation

◆ QualityFlags

Enumerator
BadModules 
BadAPVFibers 
BadStrips 
MaskBad128StripBlocks 
BadROCs 

Definition at line 40 of file MeasurementTrackerImpl.h.

Constructor & Destructor Documentation

◆ MeasurementTrackerImpl()

MeasurementTrackerImpl::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 
)

Definition at line 74 of file MeasurementTrackerImpl.cc.

References initialize(), initializePixelStatus(), and initializeStripStatus().

90  theStDetConditions(hitMatcher, stripCPE),
92  thePhase2DetConditions(phase2OTCPE) {
93  this->initialize(trackerTopology);
94  this->initializeStripStatus(badStripCuts, stripQuality, stripQualityFlags, stripQualityDebugFlags);
95  this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags);
96 }
StMeasurementConditionSet theStDetConditions
void initializePixelStatus(const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
void initialize(const TrackerTopology *trackerTopology)
void initializeStripStatus(const BadStripCutsDet &badStripCuts, const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
MeasurementTracker(TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
const GeometricSearchTracker * geometricSearchTracker() const
PxMeasurementConditionSet thePxDetConditions
Phase2OTMeasurementConditionSet thePhase2DetConditions

◆ ~MeasurementTrackerImpl()

MeasurementTrackerImpl::~MeasurementTrackerImpl ( )
override

Definition at line 98 of file MeasurementTrackerImpl.cc.

98 {}

Member Function Documentation

◆ addDets()

void MeasurementTrackerImpl::addDets ( const TrackingGeometry::DetContainer dets,
bool  subIsPixel,
bool  subIsOT 
)
protected

Definition at line 216 of file MeasurementTrackerImpl.cc.

References addGluedDet(), addPhase2Det(), addPixelDet(), addStackDet(), addStripDet(), and GeomDet::isLeaf().

Referenced by initialize().

216  {
217  //in phase2, we can have composed subDetector made by Pixel or Strip
218  for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) {
219  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd);
220 
221  //Pixel or Strip GeomDetUnit
222  if (gdu->isLeaf()) {
223  if (subIsPixel) {
224  if (!subIsOT) {
225  addPixelDet(*gd);
226  } else {
227  addPhase2Det(*gd);
228  }
229  } else {
230  addStripDet(*gd);
231  }
232  } else {
233  //Glued or Stack GeomDet
234  const GluedGeomDet* gluedDet = dynamic_cast<const GluedGeomDet*>(*gd);
235  const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(*gd);
236 
237  if ((gluedDet == nullptr && stackDet == nullptr) || (gluedDet != nullptr && stackDet != nullptr)) {
238  throw MeasurementDetException("MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet");
239  }
240  if (gluedDet != nullptr)
241  addGluedDet(gluedDet);
242  else if (stackDet != nullptr)
243  addStackDet(stackDet);
244  }
245  }
246 }
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:70
void addStripDet(const GeomDet *gd)
void addStackDet(const StackGeomDet *gd)
void addPixelDet(const GeomDet *gd)
void addPhase2Det(const GeomDet *gd)
void addGluedDet(const GluedGeomDet *gd)

◆ addGluedDet()

void MeasurementTrackerImpl::addGluedDet ( const GluedGeomDet gd)
protected

Definition at line 278 of file MeasurementTrackerImpl.cc.

References StMeasurementConditionSet::matcher(), StMeasurementConditionSet::stripCPE(), theGluedDets, and theStDetConditions.

Referenced by addDets().

278  {
280 }
StMeasurementConditionSet theStDetConditions
const StripClusterParameterEstimator * stripCPE() const
const SiStripRecHitMatcher * matcher() const
std::vector< TkGluedMeasurementDet > theGluedDets

◆ addPhase2Det()

void MeasurementTrackerImpl::addPhase2Det ( const GeomDet gd)
protected

Definition at line 270 of file MeasurementTrackerImpl.cc.

References submitPVResolutionJobs::err, thePhase2DetConditions, and thePhase2Dets.

Referenced by addDets().

270  {
271  try {
273  } catch (MeasurementDetException& err) {
274  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what();
275  }
276 }
std::vector< TkPhase2OTMeasurementDet > thePhase2Dets
Log< level::Error, false > LogError
Phase2OTMeasurementConditionSet thePhase2DetConditions

◆ addPixelDet()

void MeasurementTrackerImpl::addPixelDet ( const GeomDet gd)
protected

Definition at line 262 of file MeasurementTrackerImpl.cc.

References submitPVResolutionJobs::err, thePixelDets, and thePxDetConditions.

Referenced by addDets().

262  {
263  try {
265  } catch (MeasurementDetException& err) {
266  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what();
267  }
268 }
Log< level::Error, false > LogError
std::vector< TkPixelMeasurementDet > thePixelDets
PxMeasurementConditionSet thePxDetConditions

◆ addStackDet()

void MeasurementTrackerImpl::addStackDet ( const StackGeomDet gd)
protected

Definition at line 282 of file MeasurementTrackerImpl.cc.

References PxMeasurementConditionSet::pixelCPE(), thePxDetConditions, and theStackDets.

Referenced by addDets().

282  {
283  //since the Stack will be composed by PS or 2S,
284  //both cluster parameter estimators are needed? - right now just the thePixelCPE is used.
286 }
std::vector< TkStackMeasurementDet > theStackDets
PxMeasurementConditionSet thePxDetConditions
const PixelClusterParameterEstimator * pixelCPE() const

◆ addStripDet()

void MeasurementTrackerImpl::addStripDet ( const GeomDet gd)
protected

Definition at line 254 of file MeasurementTrackerImpl.cc.

References submitPVResolutionJobs::err, theStDetConditions, and theStripDets.

Referenced by addDets().

254  {
255  try {
257  } catch (MeasurementDetException& err) {
258  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what();
259  }
260 }
std::vector< TkStripMeasurementDet > theStripDets
StMeasurementConditionSet theStDetConditions
Log< level::Error, false > LogError

◆ allDets()

const DetContainer& MeasurementTrackerImpl::allDets ( ) const
inline

For debug only.

Definition at line 98 of file MeasurementTrackerImpl.h.

98 { return theDetMap; }

◆ checkDets()

bool MeasurementTrackerImpl::checkDets ( )
protected

Definition at line 248 of file MeasurementTrackerImpl.cc.

References TrackerGeometry::dets(), theDetMap, and MeasurementTracker::theTrackerGeom.

Referenced by initialize().

248  {
249  if (theTrackerGeom->dets().size() == theDetMap.size())
250  return true;
251  return false;
252 }
const TrackerGeometry * theTrackerGeom
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)

◆ findDet()

const MeasurementDet* MeasurementTrackerImpl::findDet ( const DetId id) const
inline

Definition at line 84 of file MeasurementTrackerImpl.h.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

Referenced by initGluedDet(), and initStackDet().

84  {
85  auto it = theDetMap.find(id);
86  if (it != theDetMap.end()) {
87  return it->second;
88  } else {
89  //throw exception;
90  }
91 
92  return nullptr; //to avoid compile warning
93  }

◆ geometricSearchTracker()

const GeometricSearchTracker* MeasurementTrackerImpl::geometricSearchTracker ( ) const
inline

Definition at line 75 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theGeometricSearchTracker.

75 { return theGeometricSearchTracker; }
const GeometricSearchTracker * theGeometricSearchTracker

◆ geomTracker()

const TrackerGeometry* MeasurementTrackerImpl::geomTracker ( ) const
inline

Definition at line 73 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theTrackerGeom.

73 { return theTrackerGeom; }
const TrackerGeometry * theTrackerGeom

◆ gluedDets()

const std::vector<TkGluedMeasurementDet>& MeasurementTrackerImpl::gluedDets ( ) const
inline

Definition at line 101 of file MeasurementTrackerImpl.h.

101 { return theGluedDets; }
std::vector< TkGluedMeasurementDet > theGluedDets

◆ idToDet()

MeasurementDetWithData MeasurementTrackerImpl::idToDet ( const DetId id,
const MeasurementTrackerEvent data 
) const
inlineoverridevirtual

MeasurementDetSystem interface (won't be overloaded anymore)

Implements MeasurementTracker.

Definition at line 78 of file MeasurementTrackerImpl.h.

References data.

78  {
80  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const MeasurementDet * idToDetBare(const DetId &id, const MeasurementTrackerEvent &data) const

◆ idToDetBare()

const MeasurementDet* MeasurementTrackerImpl::idToDetBare ( const DetId id,
const MeasurementTrackerEvent data 
) const
inline

Definition at line 82 of file MeasurementTrackerImpl.h.

82 { return findDet(id); }
const MeasurementDet * findDet(const DetId &id) const

◆ initGluedDet()

void MeasurementTrackerImpl::initGluedDet ( TkGluedMeasurementDet det,
const TrackerTopology trackerTopology 
)
protected

Definition at line 288 of file MeasurementTrackerImpl.cc.

References findDet(), GeomDet::geographicalId(), TkGluedMeasurementDet::init(), GluedGeomDet::monoDet(), TkGluedMeasurementDet::specificGeomDet(), GluedGeomDet::stereoDet(), and theDetMap.

Referenced by initialize().

288  {
289  const GluedGeomDet& gd = det.specificGeomDet();
290  const MeasurementDet* monoDet = findDet(gd.monoDet()->geographicalId());
291  const MeasurementDet* stereoDet = findDet(gd.stereoDet()->geographicalId());
292  if (monoDet == nullptr || stereoDet == nullptr) {
293  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
294  throw MeasurementDetException("MeasurementTracker ERROR: GluedDet components not found as MeasurementDets");
295  }
296  det.init(monoDet, stereoDet, trackerTopology);
297  theDetMap[gd.geographicalId()] = &det;
298 }
const GluedGeomDet & specificGeomDet() const
Log< level::Error, false > LogError
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet, const TrackerTopology *tTopo)
const MeasurementDet * findDet(const DetId &id) const

◆ initialize()

void MeasurementTrackerImpl::initialize ( const TrackerTopology trackerTopology)
protected

Definition at line 100 of file MeasurementTrackerImpl.cc.

References addDets(), checkDets(), TrackerGeometry::detsPXB(), TrackerGeometry::detsPXF(), TrackerGeometry::detsTEC(), TrackerGeometry::detsTIB(), TrackerGeometry::detsTID(), TrackerGeometry::detsTOB(), TrackerGeometry::geomDetSubDetector(), mps_fire::i, StMeasurementConditionSet::id(), PxMeasurementConditionSet::id(), Phase2OTMeasurementConditionSet::id(), initGluedDet(), initPhase2OTMeasurementConditionSet(), initPxMeasurementConditionSet(), initStackDet(), initStMeasurementConditionSet(), GeomDetEnumerators::isTrackerPixel(), theDetMap, theGluedDets, thePhase2DetConditions, thePhase2Dets, thePixelDets, thePxDetConditions, theStackDets, theStDetConditions, theStripDets, and MeasurementTracker::theTrackerGeom.

Referenced by MeasurementTrackerImpl().

100  {
101  bool subIsPixel = false;
102  //FIXME:just temporary solution for phase2 :
103  //the OT is defined as PixelSubDetector!
104  bool subIsOT = false;
105 
106  //if the TkGeometry has the subDet vector filled, the theDetMap is filled, otherwise nothing should happen
107  if (!theTrackerGeom->detsPXB().empty()) {
109  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXB().front()->geographicalId().subdetId()));
110  addDets(theTrackerGeom->detsPXB(), subIsPixel, subIsOT);
111  }
112 
113  if (!theTrackerGeom->detsPXF().empty()) {
115  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXF().front()->geographicalId().subdetId()));
116  addDets(theTrackerGeom->detsPXF(), subIsPixel, subIsOT);
117  }
118 
119  subIsOT = true;
120 
121  if (!theTrackerGeom->detsTIB().empty()) {
123  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTIB().front()->geographicalId().subdetId()));
124  addDets(theTrackerGeom->detsTIB(), subIsPixel, subIsOT);
125  }
126 
127  if (!theTrackerGeom->detsTID().empty()) {
129  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTID().front()->geographicalId().subdetId()));
130  addDets(theTrackerGeom->detsTID(), subIsPixel, subIsOT);
131  }
132 
133  if (!theTrackerGeom->detsTOB().empty()) {
135  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTOB().front()->geographicalId().subdetId()));
136  addDets(theTrackerGeom->detsTOB(), subIsPixel, subIsOT);
137  }
138 
139  if (!theTrackerGeom->detsTEC().empty()) {
141  theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTEC().front()->geographicalId().subdetId()));
142  addDets(theTrackerGeom->detsTEC(), subIsPixel, subIsOT);
143  }
144 
145  // fist all stripdets
146  sortTKD(theStripDets);
148  for (unsigned int i = 0; i != theStripDets.size(); ++i)
150 
151  // now the glued dets
152  sortTKD(theGluedDets);
153  for (unsigned int i = 0; i != theGluedDets.size(); ++i)
154  initGluedDet(theGluedDets[i], trackerTopology);
155 
156  // then the pixels
157  sortTKD(thePixelDets);
159  for (unsigned int i = 0; i != thePixelDets.size(); ++i)
161 
162  // then the phase2 dets
163  sortTKD(thePhase2Dets);
165  for (unsigned int i = 0; i != thePhase2Dets.size(); ++i)
167 
168  // and then the stack dets, at last
169  sortTKD(theStackDets);
170  for (unsigned int i = 0; i != theStackDets.size(); ++i)
172 
173  if (!checkDets())
174  throw MeasurementDetException("Number of dets in MeasurementTracker not consistent with TrackerGeometry!");
175 }
const DetContainer & detsTIB() const
std::vector< TkStripMeasurementDet > theStripDets
const DetContainer & detsPXB() const
std::vector< TkStackMeasurementDet > theStackDets
StMeasurementConditionSet theStDetConditions
unsigned int id(int i) const
void addDets(const TrackingGeometry::DetContainer &dets, bool subIsPixel, bool subIsOT)
const TrackerGeometry * theTrackerGeom
const DetContainer & detsPXF() const
std::vector< TkPhase2OTMeasurementDet > thePhase2Dets
unsigned int id(int i) const
void initGluedDet(TkGluedMeasurementDet &det, const TrackerTopology *trackerTopology)
const DetContainer & detsTOB() const
std::vector< TkPixelMeasurementDet > thePixelDets
void initPhase2OTMeasurementConditionSet(std::vector< TkPhase2OTMeasurementDet > &phase2Dets)
void initStMeasurementConditionSet(std::vector< TkStripMeasurementDet > &stripDets)
unsigned int id(int i) const
std::vector< TkGluedMeasurementDet > theGluedDets
PxMeasurementConditionSet thePxDetConditions
Phase2OTMeasurementConditionSet thePhase2DetConditions
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
const DetContainer & detsTEC() const
void initPxMeasurementConditionSet(std::vector< TkPixelMeasurementDet > &pixelDets)
void initStackDet(TkStackMeasurementDet &det)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
const DetContainer & detsTID() const

◆ initializePixelStatus()

void MeasurementTrackerImpl::initializePixelStatus ( const SiPixelQuality stripQuality,
const SiPixelFedCabling pixelCabling,
int  qualityFlags,
int  qualityDebugFlags 
)
protected

Definition at line 390 of file MeasurementTrackerImpl.cc.

References BadModules, BadROCs, mps_fire::i, createfilelist::int, das-up-to-nevents::on, quality, nano_mu_digi_cff::rawId, thePixelDets, MeasurementTracker::theTrackerGeom, and compareTotals::tot.

Referenced by MeasurementTrackerImpl().

393  {
394  if ((quality != nullptr) && (qualityFlags != 0)) {
395  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
396  unsigned int on = 0, tot = 0, badrocs = 0;
397  for (std::vector<TkPixelMeasurementDet>::iterator i = thePixelDets.begin(); i != thePixelDets.end(); i++) {
398  uint32_t detid = ((*i).geomDet().geographicalId()).rawId();
399  if (qualityFlags & BadModules) {
400  bool isOn = quality->IsModuleUsable(detid);
401  (i)->setActive(isOn);
402  tot++;
403  on += (unsigned int)isOn;
404  if (qualityDebugFlags & BadModules) {
405  edm::LogInfo("MeasurementTracker")
406  << "MeasurementTrackerImpl::initializePixelStatus : detid " << detid << " is " << (isOn ? "on" : "off");
407  }
408  } else {
409  (i)->setActive(true);
410  }
411  if ((qualityFlags & BadROCs) && (quality->getBadRocs(detid) != 0)) {
412  std::vector<LocalPoint> badROCs = quality->getBadRocPositions(detid, *theTrackerGeom, pixelCabling);
413  badrocs += badROCs.size();
414  (i)->setBadRocPositions(badROCs);
415  } else {
416  (i)->clearBadRocPositions();
417  }
418  }
419  if (qualityDebugFlags & BadModules) {
420  edm::LogInfo("MeasurementTracker PixelModuleStatus")
421  << " Total modules: " << tot << ", active " << on << ", inactive " << (tot - on);
422  }
423  if (qualityDebugFlags & BadROCs) {
424  edm::LogInfo("MeasurementTracker PixelROCStatus") << " Total of bad ROCs: " << badrocs;
425  }
426  } else {
427  for (std::vector<TkPixelMeasurementDet>::iterator i = thePixelDets.begin(); i != thePixelDets.end(); i++) {
428  (i)->setActive(true); // module ON
429  }
430  }
431 }
const TrackerGeometry * theTrackerGeom
string quality
std::vector< TkPixelMeasurementDet > thePixelDets
Log< level::Info, false > LogInfo

◆ initializeStripStatus()

void MeasurementTrackerImpl::initializeStripStatus ( const BadStripCutsDet badStripCuts,
const SiStripQuality stripQuality,
int  qualityFlags,
int  qualityDebugFlags 
)
protected

Definition at line 312 of file MeasurementTrackerImpl.cc.

References BadAPVFibers, BadModules, HLTSiStripMonitoring_cff::badStripCuts, StMeasurementConditionSet::badStripCuts_, BadStrips, triggerObjects_cff::bit, StMeasurementConditionSet::getBadStripBlocks(), mps_fire::i, StMeasurementConditionSet::id(), createfilelist::int, dqmiolumiharvest::j, MaskBad128StripBlocks, StMeasurementConditionSet::nDet(), das-up-to-nevents::on, quality, FastTimerService_cff::range, StMeasurementConditionSet::set128StripStatus(), StMeasurementConditionSet::setActive(), StMeasurementConditionSet::setMaskBad128StripBlocks(), SiStripDetId::TEC, theStDetConditions, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, and compareTotals::tot.

Referenced by MeasurementTrackerImpl().

315  {
316  if (qualityFlags & BadStrips) {
321  }
323 
324  if ((quality != nullptr) && (qualityFlags != 0)) {
325  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
326  unsigned int on = 0, tot = 0;
327  unsigned int foff = 0, ftot = 0, aoff = 0, atot = 0;
328  for (int i = 0; i != theStDetConditions.nDet(); i++) {
329  uint32_t detid = theStDetConditions.id(i);
330  if (qualityFlags & BadModules) {
331  bool isOn = quality->IsModuleUsable(detid);
333  tot++;
334  on += (unsigned int)isOn;
335  if (qualityDebugFlags & BadModules) {
336  edm::LogInfo("MeasurementTracker")
337  << "MeasurementTrackerImpl::initializeStripStatus : detid " << detid << " is " << (isOn ? "on" : "off");
338  }
339  } else {
341  }
342  // first turn all APVs and fibers ON
344  if (qualityFlags & BadAPVFibers) {
345  short badApvs = quality->getBadApvs(detid);
346  short badFibers = quality->getBadFibers(detid);
347  for (int j = 0; j < 6; j++) {
348  atot++;
349  if (badApvs & (1 << j)) {
351  aoff++;
352  }
353  }
354  for (int j = 0; j < 3; j++) {
355  ftot++;
356  if (badFibers & (1 << j)) {
358  theStDetConditions.set128StripStatus(i, false, 2 * j + 1);
359  foff++;
360  }
361  }
362  }
363  auto& badStrips = theStDetConditions.getBadStripBlocks(i);
364  badStrips.clear();
365  if (qualityFlags & BadStrips) {
366  SiStripBadStrip::Range range = quality->getRange(detid);
367  for (SiStripBadStrip::ContainerIterator bit = range.first; bit != range.second; ++bit) {
368  badStrips.push_back(quality->decode(*bit));
369  }
370  }
371  }
372  if (qualityDebugFlags & BadModules) {
373  edm::LogInfo("MeasurementTracker StripModuleStatus")
374  << " Total modules: " << tot << ", active " << on << ", inactive " << (tot - on);
375  }
376  if (qualityDebugFlags & BadAPVFibers) {
377  edm::LogInfo("MeasurementTracker StripAPVStatus")
378  << " Total APVs: " << atot << ", active " << (atot - aoff) << ", inactive " << (aoff);
379  edm::LogInfo("MeasurementTracker StripFiberStatus")
380  << " Total Fibers: " << ftot << ", active " << (ftot - foff) << ", inactive " << (foff);
381  }
382  } else {
383  for (int i = 0; i != theStDetConditions.nDet(); i++) {
384  theStDetConditions.setActive(i, true); // module ON
385  theStDetConditions.set128StripStatus(i, true); // all APVs and fibers ON
386  }
387  }
388 }
StMeasurementConditionSet theStDetConditions
static constexpr auto TID
Definition: SiStripDetId.h:38
std::vector< unsigned int >::const_iterator ContainerIterator
string quality
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)
unsigned int id(int i) const
static constexpr auto TOB
Definition: SiStripDetId.h:39
Log< level::Info, false > LogInfo
void setMaskBad128StripBlocks(bool maskThem)
static constexpr auto TIB
Definition: SiStripDetId.h:37
std::pair< ContainerIterator, ContainerIterator > Range
void set128StripStatus(int i, bool good, int idx=-1)
static constexpr auto TEC
Definition: SiStripDetId.h:40

◆ initPhase2OTMeasurementConditionSet()

void MeasurementTrackerImpl::initPhase2OTMeasurementConditionSet ( std::vector< TkPhase2OTMeasurementDet > &  phase2Dets)
protected

Definition at line 204 of file MeasurementTrackerImpl.cc.

References mps_fire::i, Phase2OTMeasurementConditionSet::id_, Phase2OTMeasurementConditionSet::init(), findQualityFiles::size, and thePhase2DetConditions.

Referenced by initialize().

204  {
205  // assume vector is full and ordered!
206  int size = phase2Dets.size();
208 
209  for (int i = 0; i != size; ++i) {
210  auto& mdet = phase2Dets[i];
211  mdet.setIndex(i);
212  thePhase2DetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
213  }
214 }
size
Write out results.
std::vector< unsigned int > id_
Phase2OTMeasurementConditionSet thePhase2DetConditions

◆ initPxMeasurementConditionSet()

void MeasurementTrackerImpl::initPxMeasurementConditionSet ( std::vector< TkPixelMeasurementDet > &  pixelDets)
protected

Definition at line 192 of file MeasurementTrackerImpl.cc.

References mps_fire::i, PxMeasurementConditionSet::id_, PxMeasurementConditionSet::init(), pixelDets(), findQualityFiles::size, and thePxDetConditions.

Referenced by initialize().

192  {
193  // assume vector is full and ordered!
194  int size = pixelDets.size();
196 
197  for (int i = 0; i != size; ++i) {
198  auto& mdet = pixelDets[i];
199  mdet.setIndex(i);
200  thePxDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
201  }
202 }
size
Write out results.
std::vector< unsigned int > id_
PxMeasurementConditionSet thePxDetConditions
const std::vector< TkPixelMeasurementDet > & pixelDets() const

◆ initStackDet()

void MeasurementTrackerImpl::initStackDet ( TkStackMeasurementDet det)
protected

Definition at line 300 of file MeasurementTrackerImpl.cc.

References findDet(), GeomDet::geographicalId(), TkStackMeasurementDet::init(), StackGeomDet::lowerDet(), TkStackMeasurementDet::specificGeomDet(), theDetMap, and StackGeomDet::upperDet().

Referenced by initialize().

300  {
301  const StackGeomDet& gd = det.specificGeomDet();
302  const MeasurementDet* lowerDet = findDet(gd.lowerDet()->geographicalId());
303  const MeasurementDet* upperDet = findDet(gd.upperDet()->geographicalId());
304  if (lowerDet == nullptr || upperDet == nullptr) {
305  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: StackDet components not found as MeasurementDets ";
306  throw MeasurementDetException("MeasurementTracker ERROR: StackDet components not found as MeasurementDets");
307  }
308  det.init(lowerDet, upperDet);
309  theDetMap[gd.geographicalId()] = &det;
310 }
const GeomDetUnit * lowerDet() const
Definition: StackGeomDet.h:19
const GeomDetUnit * upperDet() const
Definition: StackGeomDet.h:20
Log< level::Error, false > LogError
void init(const MeasurementDet *lowerDet, const MeasurementDet *upperDet)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const MeasurementDet * findDet(const DetId &id) const
const StackGeomDet & specificGeomDet() const

◆ initStMeasurementConditionSet()

void MeasurementTrackerImpl::initStMeasurementConditionSet ( std::vector< TkStripMeasurementDet > &  stripDets)
protected

Definition at line 177 of file MeasurementTrackerImpl.cc.

References mps_fire::i, StMeasurementConditionSet::id_, StMeasurementConditionSet::init(), findQualityFiles::size, stripDets(), DetId::subdetId(), StMeasurementConditionSet::subId_, theStDetConditions, and StMeasurementConditionSet::totalStrips_.

Referenced by initialize().

177  {
178  // assume vector is full and ordered!
179  int size = stripDets.size();
181  for (int i = 0; i != size; ++i) {
182  auto& mdet = stripDets[i];
183  mdet.setIndex(i);
184  //intialize the detId !
185  theStDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
187  //initalize the total number of strips
188  theStDetConditions.totalStrips_[i] = mdet.specificGeomDet().specificTopology().nstrips();
189  }
190 }
size
Write out results.
StMeasurementConditionSet theStDetConditions
std::vector< unsigned char > subId_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
std::vector< int > totalStrips_
const std::vector< TkStripMeasurementDet > & stripDets() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
std::vector< unsigned int > id_

◆ phase2DetConditions()

const Phase2OTMeasurementConditionSet& MeasurementTrackerImpl::phase2DetConditions ( ) const
inlineoverridevirtual

Implements MeasurementTracker.

Definition at line 106 of file MeasurementTrackerImpl.h.

106 { return thePhase2DetConditions; }
Phase2OTMeasurementConditionSet thePhase2DetConditions

◆ pixelDetConditions()

const PxMeasurementConditionSet& MeasurementTrackerImpl::pixelDetConditions ( ) const
inlineoverridevirtual

Implements MeasurementTracker.

Definition at line 105 of file MeasurementTrackerImpl.h.

105 { return thePxDetConditions; }
PxMeasurementConditionSet thePxDetConditions

◆ pixelDets()

const std::vector<TkPixelMeasurementDet>& MeasurementTrackerImpl::pixelDets ( ) const
inline

Definition at line 100 of file MeasurementTrackerImpl.h.

Referenced by initPxMeasurementConditionSet().

100 { return thePixelDets; }
std::vector< TkPixelMeasurementDet > thePixelDets

◆ stackDets()

const std::vector<TkStackMeasurementDet>& MeasurementTrackerImpl::stackDets ( ) const
inline

Definition at line 102 of file MeasurementTrackerImpl.h.

102 { return theStackDets; }
std::vector< TkStackMeasurementDet > theStackDets

◆ stripDetConditions()

const StMeasurementConditionSet& MeasurementTrackerImpl::stripDetConditions ( ) const
inlineoverridevirtual

Provide templates to be filled in.

Implements MeasurementTracker.

Definition at line 104 of file MeasurementTrackerImpl.h.

104 { return theStDetConditions; }
StMeasurementConditionSet theStDetConditions

◆ stripDets()

const std::vector<TkStripMeasurementDet>& MeasurementTrackerImpl::stripDets ( ) const
inline

Definition at line 99 of file MeasurementTrackerImpl.h.

Referenced by initStMeasurementConditionSet().

99 { return theStripDets; }
std::vector< TkStripMeasurementDet > theStripDets

Member Data Documentation

◆ theDetMap

DetContainer MeasurementTrackerImpl::theDetMap
protected

Definition at line 113 of file MeasurementTrackerImpl.h.

Referenced by checkDets(), initGluedDet(), initialize(), and initStackDet().

◆ theGluedDets

std::vector<TkGluedMeasurementDet> MeasurementTrackerImpl::theGluedDets
protected

Definition at line 118 of file MeasurementTrackerImpl.h.

Referenced by addGluedDet(), and initialize().

◆ thePhase2DetConditions

Phase2OTMeasurementConditionSet MeasurementTrackerImpl::thePhase2DetConditions
protected

◆ thePhase2Dets

std::vector<TkPhase2OTMeasurementDet> MeasurementTrackerImpl::thePhase2Dets
protected

Definition at line 117 of file MeasurementTrackerImpl.h.

Referenced by addPhase2Det(), and initialize().

◆ thePixelCabling

const SiPixelFedCabling* MeasurementTrackerImpl::thePixelCabling
protected

Definition at line 121 of file MeasurementTrackerImpl.h.

◆ thePixelDets

std::vector<TkPixelMeasurementDet> MeasurementTrackerImpl::thePixelDets
protected

Definition at line 115 of file MeasurementTrackerImpl.h.

Referenced by addPixelDet(), initialize(), and initializePixelStatus().

◆ thePxDetConditions

PxMeasurementConditionSet MeasurementTrackerImpl::thePxDetConditions
protected

◆ theStackDets

std::vector<TkStackMeasurementDet> MeasurementTrackerImpl::theStackDets
protected

Definition at line 119 of file MeasurementTrackerImpl.h.

Referenced by addStackDet(), and initialize().

◆ theStDetConditions

StMeasurementConditionSet MeasurementTrackerImpl::theStDetConditions
protected

◆ theStripDets

std::vector<TkStripMeasurementDet> MeasurementTrackerImpl::theStripDets
protected

Definition at line 116 of file MeasurementTrackerImpl.h.

Referenced by addStripDet(), and initialize().