CMS 3D CMS Logo

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

#include <MeasurementTrackerImpl.h>

Inheritance diagram for MeasurementTrackerImpl:
MeasurementTracker MeasurementDetSystem

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 TrackingGeometrygeomTracker () 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 edm::ParameterSet &conf, 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=0)
 
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 TrackingGeometrygeomTracker () 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 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

const std::string name_
 
const edm::ParameterSetpset_
 
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 45 of file MeasurementTrackerImpl.h.

Member Typedef Documentation

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

Definition at line 99 of file MeasurementTrackerImpl.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

MeasurementTrackerImpl::MeasurementTrackerImpl ( const edm::ParameterSet conf,
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 = 0 
)

Definition at line 79 of file MeasurementTrackerImpl.cc.

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

93  :
94  MeasurementTracker(trackerGeom,geometricSearchTracker),
95  pset_(conf),
96  name_(conf.getParameter<std::string>("ComponentName")),
97  theStDetConditions(hitMatcher,stripCPE),
98  thePxDetConditions(pixelCPE),
99  thePhase2DetConditions(phase2OTCPE)
100 {
101  this->initialize(trackerTopology);
102  this->initializeStripStatus(stripQuality, stripQualityFlags, stripQualityDebugFlags);
103  this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags);
104 }
T getParameter(std::string const &) const
StMeasurementConditionSet theStDetConditions
void initializeStripStatus(const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
void initializePixelStatus(const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
void initialize(const TrackerTopology *trackerTopology)
const edm::ParameterSet & pset_
MeasurementTracker(TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
PxMeasurementConditionSet thePxDetConditions
Phase2OTMeasurementConditionSet thePhase2DetConditions
MeasurementTrackerImpl::~MeasurementTrackerImpl ( )
override

Definition at line 106 of file MeasurementTrackerImpl.cc.

107 {
108 }

Member Function Documentation

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

Definition at line 227 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

227  {
228 
229  //in phase2, we can have composed subDetector made by Pixel or Strip
230  for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
231  gd != dets.end(); gd++) {
232 
233  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd);
234 
235  //Pixel or Strip GeomDetUnit
236  if (gdu->isLeaf()) {
237  if(subIsPixel) {
238  if(!subIsOT) {
239  addPixelDet(*gd);
240  } else {
241  addPhase2Det(*gd);
242  }
243  } else {
244  addStripDet(*gd);
245  }
246  } else {
247 
248  //Glued or Stack GeomDet
249  const GluedGeomDet* gluedDet = dynamic_cast<const GluedGeomDet*>(*gd);
250  const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(*gd);
251 
252  if ((gluedDet == nullptr && stackDet == nullptr) || (gluedDet != nullptr && stackDet != nullptr)) {
253  throw MeasurementDetException("MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet");
254  }
255  if(gluedDet != nullptr)
256  addGluedDet(gluedDet);
257  else
258  addStackDet(stackDet);
259 
260  }
261  }
262 
263 }
void addStripDet(const GeomDet *gd)
void addStackDet(const StackGeomDet *gd)
void addPixelDet(const GeomDet *gd)
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:85
void addPhase2Det(const GeomDet *gd)
void addGluedDet(const GluedGeomDet *gd)
void MeasurementTrackerImpl::addGluedDet ( const GluedGeomDet gd)
protected

Definition at line 301 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

302 {
304 }
StMeasurementConditionSet theStDetConditions
const SiStripRecHitMatcher * matcher() const
const StripClusterParameterEstimator * stripCPE() const
std::vector< TkGluedMeasurementDet > theGluedDets
void MeasurementTrackerImpl::addPhase2Det ( const GeomDet gd)
protected

Definition at line 291 of file MeasurementTrackerImpl.cc.

References thePhase2DetConditions, thePhase2Dets, and cms::Exception::what().

Referenced by addDets().

292 {
293  try {
295  }
296  catch(MeasurementDetException& err){
297  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ;
298  }
299 }
char const * what() const override
Definition: Exception.cc:141
std::vector< TkPhase2OTMeasurementDet > thePhase2Dets
Phase2OTMeasurementConditionSet thePhase2DetConditions
void MeasurementTrackerImpl::addPixelDet ( const GeomDet gd)
protected

Definition at line 281 of file MeasurementTrackerImpl.cc.

References thePixelDets, thePxDetConditions, and cms::Exception::what().

Referenced by addDets().

282 {
283  try {
285  }
286  catch(MeasurementDetException& err){
287  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ;
288  }
289 }
char const * what() const override
Definition: Exception.cc:141
std::vector< TkPixelMeasurementDet > thePixelDets
PxMeasurementConditionSet thePxDetConditions
void MeasurementTrackerImpl::addStackDet ( const StackGeomDet gd)
protected

Definition at line 306 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

307 {
308  //since the Stack will be composed by PS or 2S,
309  //both cluster parameter estimators are needed? - right now just the thePixelCPE is used.
311 }
std::vector< TkStackMeasurementDet > theStackDets
PxMeasurementConditionSet thePxDetConditions
const PixelClusterParameterEstimator * pixelCPE() const
void MeasurementTrackerImpl::addStripDet ( const GeomDet gd)
protected

Definition at line 271 of file MeasurementTrackerImpl.cc.

References theStDetConditions, theStripDets, and cms::Exception::what().

Referenced by addDets().

272 {
273  try {
275  }
276  catch(MeasurementDetException& err){
277  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ;
278  }
279 }
std::vector< TkStripMeasurementDet > theStripDets
StMeasurementConditionSet theStDetConditions
char const * what() const override
Definition: Exception.cc:141
const DetContainer& MeasurementTrackerImpl::allDets ( ) const
inline

For debug only.

Definition at line 102 of file MeasurementTrackerImpl.h.

102 {return theDetMap;}
bool MeasurementTrackerImpl::checkDets ( )
protected

Definition at line 265 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

265  {
266  if(theTrackerGeom->dets().size() == theDetMap.size())
267  return true;
268  return false;
269 }
const TrackerGeometry * theTrackerGeom
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const MeasurementDet* MeasurementTrackerImpl::findDet ( const DetId id) const
inline

Definition at line 87 of file MeasurementTrackerImpl.h.

Referenced by initGluedDet(), and initStackDet().

88  {
89  auto it = theDetMap.find(id);
90  if(it !=theDetMap.end()) {
91  return it->second;
92  }else{
93  //throw exception;
94  }
95 
96  return nullptr; //to avoid compile warning
97  }
const GeometricSearchTracker* MeasurementTrackerImpl::geometricSearchTracker ( ) const
inline

Definition at line 71 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theGeometricSearchTracker.

const GeometricSearchTracker * theGeometricSearchTracker
const TrackingGeometry* MeasurementTrackerImpl::geomTracker ( ) const
inline

Definition at line 69 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theTrackerGeom.

69 { return theTrackerGeom;}
const TrackerGeometry * theTrackerGeom
const std::vector<TkGluedMeasurementDet>& MeasurementTrackerImpl::gluedDets ( ) const
inline

Definition at line 105 of file MeasurementTrackerImpl.h.

105 {return theGluedDets;}
std::vector< TkGluedMeasurementDet > theGluedDets
MeasurementDetWithData MeasurementTrackerImpl::idToDet ( const DetId id,
const MeasurementTrackerEvent data 
) const
inlineoverridevirtual

MeasurementDetSystem interface (won't be overloaded anymore)

Implements MeasurementTracker.

Definition at line 75 of file MeasurementTrackerImpl.h.

75  {
76  return MeasurementDetWithData(*idToDetBare(id, data), data);
77  }
const MeasurementDet * idToDetBare(const DetId &id, const MeasurementTrackerEvent &data) const
const MeasurementDet* MeasurementTrackerImpl::idToDetBare ( const DetId id,
const MeasurementTrackerEvent data 
) const
inline

Definition at line 80 of file MeasurementTrackerImpl.h.

80  {
81  return findDet(id);
82  }
const MeasurementDet * findDet(const DetId &id) const
void MeasurementTrackerImpl::initGluedDet ( TkGluedMeasurementDet det,
const TrackerTopology trackerTopology 
)
protected

Definition at line 313 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

314 {
315  const GluedGeomDet& gd = det.specificGeomDet();
316  const MeasurementDet* monoDet = findDet( gd.monoDet()->geographicalId());
317  const MeasurementDet* stereoDet = findDet( gd.stereoDet()->geographicalId());
318  if (monoDet == nullptr || stereoDet == nullptr) {
319  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
320  throw MeasurementDetException("MeasurementTracker ERROR: GluedDet components not found as MeasurementDets");
321  }
322  det.init(monoDet, stereoDet, trackerTopology);
323  theDetMap[gd.geographicalId()] = &det;
324 }
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
const MeasurementDet * findDet(const DetId &id) const
const GluedGeomDet & specificGeomDet() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet, const TrackerTopology *tTopo)
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
void MeasurementTrackerImpl::initialize ( const TrackerTopology trackerTopology)
protected

Definition at line 111 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().

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

Definition at line 416 of file MeasurementTrackerImpl.cc.

References BadModules, BadROCs, SiPixelQuality::getBadRocPositions(), SiPixelQuality::getBadRocs(), mps_fire::i, createfilelist::int, SiPixelQuality::IsModuleUsable(), thePixelDets, and MeasurementTracker::theTrackerGeom.

Referenced by MeasurementTrackerImpl().

416  {
417  if ((quality != nullptr) && (qualityFlags != 0)) {
418  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
419  unsigned int on = 0, tot = 0, badrocs = 0;
420  for (std::vector<TkPixelMeasurementDet>::iterator i=thePixelDets.begin();
421  i!=thePixelDets.end(); i++) {
422  uint32_t detid = ((*i).geomDet().geographicalId()).rawId();
423  if (qualityFlags & BadModules) {
424  bool isOn = quality->IsModuleUsable(detid);
425  (i)->setActive(isOn);
426  tot++; on += (unsigned int) isOn;
427  if (qualityDebugFlags & BadModules) {
428  edm::LogInfo("MeasurementTracker")<< "MeasurementTrackerImpl::initializePixelStatus : detid " << detid << " is " << (isOn ? "on" : "off");
429  }
430  } else {
431  (i)->setActive(true);
432  }
433  if ((qualityFlags & BadROCs) && (quality->getBadRocs(detid) != 0)) {
434  std::vector<LocalPoint> badROCs = quality->getBadRocPositions(detid, *theTrackerGeom, pixelCabling);
435  badrocs += badROCs.size();
436  (i)->setBadRocPositions(badROCs);
437  } else {
438  (i)->clearBadRocPositions();
439  }
440  }
441  if (qualityDebugFlags & BadModules) {
442  edm::LogInfo("MeasurementTracker PixelModuleStatus") <<
443  " Total modules: " << tot << ", active " << on <<", inactive " << (tot - on);
444  }
445  if (qualityDebugFlags & BadROCs) {
446  edm::LogInfo("MeasurementTracker PixelROCStatus") << " Total of bad ROCs: " << badrocs ;
447  }
448  } else {
449  for (std::vector<TkPixelMeasurementDet>::iterator i=thePixelDets.begin();
450  i!=thePixelDets.end(); i++) {
451  (i)->setActive(true); // module ON
452  }
453  }
454 }
const TrackerGeometry * theTrackerGeom
std::vector< TkPixelMeasurementDet > thePixelDets
void MeasurementTrackerImpl::initializeStripStatus ( const SiStripQuality stripQuality,
int  qualityFlags,
int  qualityDebugFlags 
)
protected

Definition at line 339 of file MeasurementTrackerImpl.cc.

References BadAPVFibers, BadModules, StMeasurementConditionSet::badStripCuts_, BadStrips, SiStripBadStrip::decode(), SiStripQuality::getBadApvs(), SiStripQuality::getBadFibers(), StMeasurementConditionSet::getBadStripBlocks(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRange(), mps_fire::i, StMeasurementConditionSet::id(), createfilelist::int, SiStripQuality::IsModuleUsable(), MaskBad128StripBlocks, StMeasurementConditionSet::nDet(), pset_, StMeasurementConditionSet::set128StripStatus(), StMeasurementConditionSet::setActive(), StMeasurementConditionSet::setMaskBad128StripBlocks(), SiStripDetId::TEC, theStDetConditions, SiStripDetId::TIB, SiStripDetId::TID, and SiStripDetId::TOB.

Referenced by MeasurementTrackerImpl().

339  {
340  edm::ParameterSet cutPset = pset_.getParameter<edm::ParameterSet>("badStripCuts");
341  if (qualityFlags & BadStrips) {
342  typedef StMeasurementConditionSet::BadStripCuts BadStripCuts;
347  }
349 
350 
351  if ((quality != nullptr) && (qualityFlags != 0)) {
352  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
353  unsigned int on = 0, tot = 0;
354  unsigned int foff = 0, ftot = 0, aoff = 0, atot = 0;
355  for (int i=0; i!= theStDetConditions.nDet(); i++) {
356  uint32_t detid = theStDetConditions.id(i);
357  if (qualityFlags & BadModules) {
358  bool isOn = quality->IsModuleUsable(detid);
360  tot++; on += (unsigned int) isOn;
361  if (qualityDebugFlags & BadModules) {
362  edm::LogInfo("MeasurementTracker")<< "MeasurementTrackerImpl::initializeStripStatus : detid " << detid << " is " << (isOn ? "on" : "off");
363  }
364  } else {
366  }
367  // first turn all APVs and fibers ON
369  if (qualityFlags & BadAPVFibers) {
370  short badApvs = quality->getBadApvs(detid);
371  short badFibers = quality->getBadFibers(detid);
372  for (int j = 0; j < 6; j++) {
373  atot++;
374  if (badApvs & (1 << j)) {
376  aoff++;
377  }
378  }
379  for (int j = 0; j < 3; j++) {
380  ftot++;
381  if (badFibers & (1 << j)) {
383  theStDetConditions.set128StripStatus(i,false, 2*j+1);
384  foff++;
385  }
386  }
387  }
388  auto & badStrips = theStDetConditions.getBadStripBlocks(i);
389  badStrips.clear();
390  if (qualityFlags & BadStrips) {
391  SiStripBadStrip::Range range = quality->getRange(detid);
392  for (SiStripBadStrip::ContainerIterator bit = range.first; bit != range.second; ++bit) {
393  badStrips.push_back(quality->decode(*bit));
394  }
395  }
396  }
397  if (qualityDebugFlags & BadModules) {
398  edm::LogInfo("MeasurementTracker StripModuleStatus") <<
399  " Total modules: " << tot << ", active " << on <<", inactive " << (tot - on);
400  }
401  if (qualityDebugFlags & BadAPVFibers) {
402  edm::LogInfo("MeasurementTracker StripAPVStatus") <<
403  " Total APVs: " << atot << ", active " << (atot-aoff) <<", inactive " << (aoff);
404  edm::LogInfo("MeasurementTracker StripFiberStatus") <<
405  " Total Fibers: " << ftot << ", active " << (ftot-foff) <<", inactive " << (foff);
406  }
407  } else {
408  for (int i=0; i!=theStDetConditions.nDet(); i++) {
409  theStDetConditions.setActive(i,true); // module ON
410  theStDetConditions.set128StripStatus(i,true); // all APVs and fibers ON
411  }
412  }
413 
414 }
T getParameter(std::string const &) const
StMeasurementConditionSet theStDetConditions
std::vector< unsigned int >::const_iterator ContainerIterator
unsigned int id(int i) const
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)
const edm::ParameterSet & pset_
void setMaskBad128StripBlocks(bool maskThem)
std::pair< ContainerIterator, ContainerIterator > Range
void set128StripStatus(int i, bool good, int idx=-1)
void MeasurementTrackerImpl::initPhase2OTMeasurementConditionSet ( std::vector< TkPhase2OTMeasurementDet > &  phase2Dets)
protected

Definition at line 214 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

215 {
216  // assume vector is full and ordered!
217  int size = phase2Dets.size();
219 
220  for (int i=0; i!=size; ++i) {
221  auto & mdet = phase2Dets[i];
222  mdet.setIndex(i);
223  thePhase2DetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
224  }
225 }
size
Write out results.
std::vector< unsigned int > id_
Phase2OTMeasurementConditionSet thePhase2DetConditions
void MeasurementTrackerImpl::initPxMeasurementConditionSet ( std::vector< TkPixelMeasurementDet > &  pixelDets)
protected

Definition at line 201 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

202 {
203  // assume vector is full and ordered!
204  int size = pixelDets.size();
205  thePxDetConditions.init(size);
206 
207  for (int i=0; i!=size; ++i) {
208  auto & mdet = pixelDets[i];
209  mdet.setIndex(i);
210  thePxDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
211  }
212 }
size
Write out results.
const std::vector< TkPixelMeasurementDet > & pixelDets() const
std::vector< unsigned int > id_
PxMeasurementConditionSet thePxDetConditions
void MeasurementTrackerImpl::initStackDet ( TkStackMeasurementDet det)
protected

Definition at line 326 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

327 {
328  const StackGeomDet& gd = det.specificGeomDet();
329  const MeasurementDet* lowerDet = findDet( gd.lowerDet()->geographicalId());
330  const MeasurementDet* upperDet = findDet( gd.upperDet()->geographicalId());
331  if (lowerDet == nullptr || upperDet == nullptr) {
332  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: StackDet components not found as MeasurementDets ";
333  throw MeasurementDetException("MeasurementTracker ERROR: StackDet components not found as MeasurementDets");
334  }
335  det.init(lowerDet,upperDet);
336  theDetMap[gd.geographicalId()] = &det;
337 }
const GeomDetUnit * lowerDet() const
Definition: StackGeomDet.h:20
const MeasurementDet * findDet(const DetId &id) const
void init(const MeasurementDet *lowerDet, const MeasurementDet *upperDet)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
const GeomDetUnit * upperDet() const
Definition: StackGeomDet.h:21
const StackGeomDet & specificGeomDet() const
void MeasurementTrackerImpl::initStMeasurementConditionSet ( std::vector< TkStripMeasurementDet > &  stripDets)
protected

Definition at line 185 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

186 {
187  // assume vector is full and ordered!
188  int size = stripDets.size();
189  theStDetConditions.init(size);
190  for (int i=0; i!=size; ++i) {
191  auto & mdet = stripDets[i];
192  mdet.setIndex(i);
193  //intialize the detId !
194  theStDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
196  //initalize the total number of strips
197  theStDetConditions.totalStrips_[i] = mdet.specificGeomDet().specificTopology().nstrips();
198  }
199 }
size
Write out results.
StMeasurementConditionSet theStDetConditions
std::vector< unsigned char > subId_
const std::vector< TkStripMeasurementDet > & stripDets() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
std::vector< int > totalStrips_
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
std::vector< unsigned int > id_
const Phase2OTMeasurementConditionSet& MeasurementTrackerImpl::phase2DetConditions ( ) const
inlineoverridevirtual

Implements MeasurementTracker.

Definition at line 110 of file MeasurementTrackerImpl.h.

110 { return thePhase2DetConditions; }
Phase2OTMeasurementConditionSet thePhase2DetConditions
const PxMeasurementConditionSet& MeasurementTrackerImpl::pixelDetConditions ( ) const
inlineoverridevirtual

Implements MeasurementTracker.

Definition at line 109 of file MeasurementTrackerImpl.h.

109 { return thePxDetConditions; }
PxMeasurementConditionSet thePxDetConditions
const std::vector<TkPixelMeasurementDet>& MeasurementTrackerImpl::pixelDets ( ) const
inline

Definition at line 104 of file MeasurementTrackerImpl.h.

104 {return thePixelDets;}
std::vector< TkPixelMeasurementDet > thePixelDets
const std::vector<TkStackMeasurementDet>& MeasurementTrackerImpl::stackDets ( ) const
inline

Definition at line 106 of file MeasurementTrackerImpl.h.

106 {return theStackDets;}
std::vector< TkStackMeasurementDet > theStackDets
const StMeasurementConditionSet& MeasurementTrackerImpl::stripDetConditions ( ) const
inlineoverridevirtual

Provide templates to be filled in.

Implements MeasurementTracker.

Definition at line 108 of file MeasurementTrackerImpl.h.

108 { return theStDetConditions; }
StMeasurementConditionSet theStDetConditions
const std::vector<TkStripMeasurementDet>& MeasurementTrackerImpl::stripDets ( ) const
inline

Definition at line 103 of file MeasurementTrackerImpl.h.

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

Member Data Documentation

const std::string MeasurementTrackerImpl::name_
protected

Definition at line 114 of file MeasurementTrackerImpl.h.

const edm::ParameterSet& MeasurementTrackerImpl::pset_
protected

Definition at line 113 of file MeasurementTrackerImpl.h.

Referenced by initializeStripStatus().

DetContainer MeasurementTrackerImpl::theDetMap
protected

Definition at line 120 of file MeasurementTrackerImpl.h.

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

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

Definition at line 125 of file MeasurementTrackerImpl.h.

Referenced by addGluedDet(), and initialize().

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

Definition at line 124 of file MeasurementTrackerImpl.h.

Referenced by addPhase2Det(), and initialize().

const SiPixelFedCabling* MeasurementTrackerImpl::thePixelCabling
protected

Definition at line 128 of file MeasurementTrackerImpl.h.

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

Definition at line 122 of file MeasurementTrackerImpl.h.

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

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

Definition at line 126 of file MeasurementTrackerImpl.h.

Referenced by addStackDet(), and initialize().

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

Definition at line 123 of file MeasurementTrackerImpl.h.

Referenced by addStripDet(), and initialize().