CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 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 TrackerGeometry *trackerGeom, const GeometricSearchTracker *geometricSearchTracker, const SiStripQuality *stripQuality, int stripQualityFlags, int stripQualityDebugFlags, const SiPixelQuality *pixelQuality, const SiPixelFedCabling *pixelCabling, int pixelQualityFlags, int pixelQualityDebugFlags)
 
virtual const
PxMeasurementConditionSet
pixelDetConditions () const
 
const std::vector
< TkPixelMeasurementDet > & 
pixelDets () const
 
const std::vector
< TkStackMeasurementDet > & 
stackDets () const
 
virtual const
StMeasurementConditionSet
stripDetConditions () const
 Provide templates to be filled in. More...
 
const std::vector
< TkStripMeasurementDet > & 
stripDets () const
 
virtual ~MeasurementTrackerImpl ()
 
- Public Member Functions inherited from MeasurementTracker
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackingGeometrygeomTracker () const
 
 MeasurementTracker (TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
 
virtual ~MeasurementTracker ()
 

Protected Member Functions

void addDets (const TrackingGeometry::DetContainer &dets, bool subIsPixel)
 
void addGluedDet (const GluedGeomDet *gd)
 
void addPixelDet (const GeomDet *gd)
 
void addStackDet (const StackGeomDet *gd)
 
void addStripDet (const GeomDet *gd)
 
bool checkDets ()
 
void initGluedDet (TkGluedMeasurementDet &det)
 
void initialize ()
 
void initializePixelStatus (const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
 
void initializeStripStatus (const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
 
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
< TkGluedMeasurementDet
theGluedDets
 
const SiPixelFedCablingthePixelCabling
 
std::vector
< TkPixelMeasurementDet
thePixelDets
 
PxMeasurementConditionSet thePxDetConditions
 
std::vector
< TkStackMeasurementDet
theStackDets
 
StMeasurementConditionSet theStDetConditions
 
std::vector
< TkStripMeasurementDet
theStripDets
 
- Protected Attributes inherited from MeasurementTracker
const GeometricSearchTrackertheGeometricSearchTracker
 
const TrackerGeometrytheTrackerGeom
 

Detailed Description

Definition at line 43 of file MeasurementTrackerImpl.h.

Member Typedef Documentation

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

Definition at line 95 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 TrackerGeometry trackerGeom,
const GeometricSearchTracker geometricSearchTracker,
const SiStripQuality stripQuality,
int  stripQualityFlags,
int  stripQualityDebugFlags,
const SiPixelQuality pixelQuality,
const SiPixelFedCabling pixelCabling,
int  pixelQualityFlags,
int  pixelQualityDebugFlags 
)

Definition at line 79 of file MeasurementTrackerImpl.cc.

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

91  :
92  MeasurementTracker(trackerGeom,geometricSearchTracker),
93  pset_(conf),
94  name_(conf.getParameter<std::string>("ComponentName")),
95  theStDetConditions(hitMatcher,stripCPE),
96  thePxDetConditions(pixelCPE)
97 {
98  this->initialize();
99  this->initializeStripStatus(stripQuality, stripQualityFlags, stripQualityDebugFlags);
100  this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags);
101 }
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)
const edm::ParameterSet & pset_
MeasurementTracker(TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
PxMeasurementConditionSet thePxDetConditions
MeasurementTrackerImpl::~MeasurementTrackerImpl ( )
virtual

Definition at line 103 of file MeasurementTrackerImpl.cc.

104 {
105 }

Member Function Documentation

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

Definition at line 203 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

203  {
204 
205  //in phase2, we can have composed subDetector made by Pixel or Strip
206  for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
207  gd != dets.end(); gd++) {
208 
209  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd);
210 
211  //Pixel or Strip GeomDetUnit
212  if (gdu->isLeaf()) {
213  if(subIsPixel) {
214  addPixelDet(*gd);
215  } else {
216  addStripDet(*gd);
217  }
218  } else {
219 
220  //Glued or Stack GeomDet
221  const GluedGeomDet* gluedDet = dynamic_cast<const GluedGeomDet*>(*gd);
222  const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(*gd);
223 
224  if ((gluedDet == 0 && stackDet == 0) || (gluedDet != 0 && stackDet != 0)) {
225  throw MeasurementDetException("MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet");
226  }
227  if(gluedDet != 0)
228  addGluedDet(gluedDet);
229  else
230  addStackDet(stackDet);
231 
232  }
233  }
234 
235 }
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 addGluedDet(const GluedGeomDet *gd)
void MeasurementTrackerImpl::addGluedDet ( const GluedGeomDet gd)
protected

Definition at line 263 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

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

Definition at line 253 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

254 {
255  try {
257  }
258  catch(MeasurementDetException& err){
259  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ;
260  }
261 }
virtual char const * what() const
Definition: Exception.cc:141
std::vector< TkPixelMeasurementDet > thePixelDets
PxMeasurementConditionSet thePxDetConditions
void MeasurementTrackerImpl::addStackDet ( const StackGeomDet gd)
protected

Definition at line 268 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

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

Definition at line 243 of file MeasurementTrackerImpl.cc.

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

Referenced by addDets().

244 {
245  try {
247  }
248  catch(MeasurementDetException& err){
249  edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ;
250  }
251 }
virtual char const * what() const
Definition: Exception.cc:141
std::vector< TkStripMeasurementDet > theStripDets
StMeasurementConditionSet theStDetConditions
const DetContainer& MeasurementTrackerImpl::allDets ( ) const
inline

For debug only.

Definition at line 98 of file MeasurementTrackerImpl.h.

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

Definition at line 237 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

237  {
238  if(theTrackerGeom->dets().size() == theDetMap.size())
239  return true;
240  return false;
241 }
const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeometry * theTrackerGeom
const MeasurementDet* MeasurementTrackerImpl::findDet ( const DetId id) const
inline

Definition at line 83 of file MeasurementTrackerImpl.h.

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 0; //to avoid compile warning
93  }
const GeometricSearchTracker* MeasurementTrackerImpl::geometricSearchTracker ( ) const
inline

Definition at line 67 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theGeometricSearchTracker.

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

Definition at line 65 of file MeasurementTrackerImpl.h.

References MeasurementTracker::theTrackerGeom.

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

Definition at line 101 of file MeasurementTrackerImpl.h.

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

MeasurementDetSystem interface (won't be overloaded anymore)

Implements MeasurementTracker.

Definition at line 71 of file MeasurementTrackerImpl.h.

71  {
72  return MeasurementDetWithData(*idToDetBare(id, data), data);
73  }
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 76 of file MeasurementTrackerImpl.h.

76  {
77  return findDet(id);
78  }
const MeasurementDet * findDet(const DetId &id) const
void MeasurementTrackerImpl::initGluedDet ( TkGluedMeasurementDet det)
protected

Definition at line 275 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

276 {
277  const GluedGeomDet& gd = det.specificGeomDet();
278  const MeasurementDet* monoDet = findDet( gd.monoDet()->geographicalId());
279  const MeasurementDet* stereoDet = findDet( gd.stereoDet()->geographicalId());
280  if (monoDet == 0 || stereoDet == 0) {
281  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
282  throw MeasurementDetException("MeasurementTracker ERROR: GluedDet components not found as MeasurementDets");
283  }
284  det.init(monoDet,stereoDet);
285  theDetMap[gd.geographicalId()] = &det;
286 }
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
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
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
void MeasurementTrackerImpl::initialize ( void  )
protected

Definition at line 108 of file MeasurementTrackerImpl.cc.

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

Referenced by MeasurementTrackerImpl().

109 {
110 
111  bool subIsPixel = false;
112 
113  //if the TkGeometry has the subDet vector filled, the theDetMap is filled, otherwise nothing should happen
114  if(theTrackerGeom->detsPXB().size()!=0) {
115  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXB().front()->geographicalId().subdetId()));
116  addDets(theTrackerGeom->detsPXB(), subIsPixel);
117  }
118 
119  if(theTrackerGeom->detsPXF().size()!=0) {
120  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXF().front()->geographicalId().subdetId()));
121  addDets(theTrackerGeom->detsPXF(), subIsPixel);
122  }
123 
124  if(theTrackerGeom->detsTIB().size()!=0) {
125  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTIB().front()->geographicalId().subdetId()));
126  addDets(theTrackerGeom->detsTIB(), subIsPixel);
127  }
128 
129  if(theTrackerGeom->detsTID().size()!=0) {
130  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTID().front()->geographicalId().subdetId()));
131  addDets(theTrackerGeom->detsTID(), subIsPixel);
132  }
133 
134  if(theTrackerGeom->detsTOB().size()!=0) {
135  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTOB().front()->geographicalId().subdetId()));
136  addDets(theTrackerGeom->detsTOB(), subIsPixel);
137  }
138 
139  if(theTrackerGeom->detsTEC().size()!=0) {
140  subIsPixel = GeomDetEnumerators::isTrackerPixel(theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTEC().front()->geographicalId().subdetId()));
141  addDets(theTrackerGeom->detsTEC(), subIsPixel);
142  }
143 
144  // fist all stripdets
145  sortTKD(theStripDets);
147  for (unsigned int i=0; i!=theStripDets.size(); ++i)
149 
150  // now the glued dets
151  sortTKD(theGluedDets);
152  for (unsigned int i=0; i!=theGluedDets.size(); ++i)
154 
155  // then the stack dets
156  sortTKD(theStackDets);
157  for (unsigned int i=0; i!=theStackDets.size(); ++i)
159 
160  // and then the pixels, at last
161  sortTKD(thePixelDets);
163  for (unsigned int i=0; i!=thePixelDets.size(); ++i)
165 
166  if(!checkDets())
167  throw MeasurementDetException("Number of dets in MeasurementTracker not consistent with TrackerGeometry!");
168 
169 }
int i
Definition: DBlmapReader.cc:9
const GeomDetEnumerators::SubDetector geomDetSubDetector(int subdet) const
unsigned int id(int i) const
std::vector< TkStripMeasurementDet > theStripDets
std::vector< TkStackMeasurementDet > theStackDets
StMeasurementConditionSet theStDetConditions
const TrackerGeometry * theTrackerGeom
void initGluedDet(TkGluedMeasurementDet &det)
unsigned int id(int i) const
const DetContainer & detsTEC() const
std::vector< TkPixelMeasurementDet > thePixelDets
void addDets(const TrackingGeometry::DetContainer &dets, bool subIsPixel)
void initStMeasurementConditionSet(std::vector< TkStripMeasurementDet > &stripDets)
const DetContainer & detsPXB() const
const DetContainer & detsTIB() const
std::vector< TkGluedMeasurementDet > theGluedDets
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
PxMeasurementConditionSet thePxDetConditions
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
void initPxMeasurementConditionSet(std::vector< TkPixelMeasurementDet > &pixelDets)
void initStackDet(TkStackMeasurementDet &det)
const DetContainer & detsTID() const
void MeasurementTrackerImpl::initializePixelStatus ( const SiPixelQuality stripQuality,
const SiPixelFedCabling pixelCabling,
int  qualityFlags,
int  qualityDebugFlags 
)
protected

Definition at line 378 of file MeasurementTrackerImpl.cc.

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

Referenced by MeasurementTrackerImpl().

378  {
379  if ((quality != 0) && (qualityFlags != 0)) {
380  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
381  unsigned int on = 0, tot = 0, badrocs = 0;
382  for (std::vector<TkPixelMeasurementDet>::iterator i=thePixelDets.begin();
383  i!=thePixelDets.end(); i++) {
384  uint32_t detid = ((*i).geomDet().geographicalId()).rawId();
385  if (qualityFlags & BadModules) {
386  bool isOn = quality->IsModuleUsable(detid);
387  (i)->setActive(isOn);
388  tot++; on += (unsigned int) isOn;
389  if (qualityDebugFlags & BadModules) {
390  edm::LogInfo("MeasurementTracker")<< "MeasurementTrackerImpl::initializePixelStatus : detid " << detid << " is " << (isOn ? "on" : "off");
391  }
392  } else {
393  (i)->setActive(true);
394  }
395  if ((qualityFlags & BadROCs) && (quality->getBadRocs(detid) != 0)) {
396  std::vector<LocalPoint> badROCs = quality->getBadRocPositions(detid, *theTrackerGeom, pixelCabling);
397  badrocs += badROCs.size();
398  (i)->setBadRocPositions(badROCs);
399  } else {
400  (i)->clearBadRocPositions();
401  }
402  }
403  if (qualityDebugFlags & BadModules) {
404  edm::LogInfo("MeasurementTracker PixelModuleStatus") <<
405  " Total modules: " << tot << ", active " << on <<", inactive " << (tot - on);
406  }
407  if (qualityDebugFlags & BadROCs) {
408  edm::LogInfo("MeasurementTracker PixelROCStatus") << " Total of bad ROCs: " << badrocs ;
409  }
410  } else {
411  for (std::vector<TkPixelMeasurementDet>::iterator i=thePixelDets.begin();
412  i!=thePixelDets.end(); i++) {
413  (i)->setActive(true); // module ON
414  }
415  }
416 }
int i
Definition: DBlmapReader.cc:9
const TrackerGeometry * theTrackerGeom
std::vector< TkPixelMeasurementDet > thePixelDets
void MeasurementTrackerImpl::initializeStripStatus ( const SiStripQuality stripQuality,
int  qualityFlags,
int  qualityDebugFlags 
)
protected

Definition at line 301 of file MeasurementTrackerImpl.cc.

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

Referenced by MeasurementTrackerImpl().

301  {
302  edm::ParameterSet cutPset = pset_.getParameter<edm::ParameterSet>("badStripCuts");
303  if (qualityFlags & BadStrips) {
304  typedef StMeasurementConditionSet::BadStripCuts BadStripCuts;
309  }
311 
312 
313  if ((quality != 0) && (qualityFlags != 0)) {
314  edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags;
315  unsigned int on = 0, tot = 0;
316  unsigned int foff = 0, ftot = 0, aoff = 0, atot = 0;
317  for (int i=0; i!= theStDetConditions.nDet(); i++) {
318  uint32_t detid = theStDetConditions.id(i);
319  if (qualityFlags & BadModules) {
320  bool isOn = quality->IsModuleUsable(detid);
322  tot++; on += (unsigned int) isOn;
323  if (qualityDebugFlags & BadModules) {
324  edm::LogInfo("MeasurementTracker")<< "MeasurementTrackerImpl::initializeStripStatus : detid " << detid << " is " << (isOn ? "on" : "off");
325  }
326  } else {
328  }
329  // first turn all APVs and fibers ON
331  if (qualityFlags & BadAPVFibers) {
332  short badApvs = quality->getBadApvs(detid);
333  short badFibers = quality->getBadFibers(detid);
334  for (int j = 0; j < 6; j++) {
335  atot++;
336  if (badApvs & (1 << j)) {
338  aoff++;
339  }
340  }
341  for (int j = 0; j < 3; j++) {
342  ftot++;
343  if (badFibers & (1 << j)) {
346  foff++;
347  }
348  }
349  }
350  auto & badStrips = theStDetConditions.getBadStripBlocks(i);
351  badStrips.clear();
352  if (qualityFlags & BadStrips) {
353  SiStripBadStrip::Range range = quality->getRange(detid);
354  for (SiStripBadStrip::ContainerIterator bit = range.first; bit != range.second; ++bit) {
355  badStrips.push_back(quality->decode(*bit));
356  }
357  }
358  }
359  if (qualityDebugFlags & BadModules) {
360  edm::LogInfo("MeasurementTracker StripModuleStatus") <<
361  " Total modules: " << tot << ", active " << on <<", inactive " << (tot - on);
362  }
363  if (qualityDebugFlags & BadAPVFibers) {
364  edm::LogInfo("MeasurementTracker StripAPVStatus") <<
365  " Total APVs: " << atot << ", active " << (atot-aoff) <<", inactive " << (aoff);
366  edm::LogInfo("MeasurementTracker StripFiberStatus") <<
367  " Total Fibers: " << ftot << ", active " << (ftot-foff) <<", inactive " << (foff);
368  }
369  } else {
370  for (int i=0; i!=theStDetConditions.nDet(); i++) {
371  theStDetConditions.setActive(i,true); // module ON
372  theStDetConditions.set128StripStatus(i,true); // all APVs and fibers ON
373  }
374  }
375 
376 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
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)
int j
Definition: DBlmapReader.cc:9
const edm::ParameterSet & pset_
void setMaskBad128StripBlocks(bool maskThem)
std::pair< ContainerIterator, ContainerIterator > Range
void set128StripStatus(int i, bool good, int idx=-1)
void MeasurementTrackerImpl::initPxMeasurementConditionSet ( std::vector< TkPixelMeasurementDet > &  pixelDets)
protected

Definition at line 187 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

188 {
189  // assume vector is full and ordered!
190  int size = pixelDets.size();
191  thePxDetConditions.init(size);
192 
193  for (int i=0; i!=size; ++i) {
194  auto & mdet = pixelDets[i];
195  mdet.setIndex(i);
196  thePxDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
197  }
198 }
int i
Definition: DBlmapReader.cc:9
const std::vector< TkPixelMeasurementDet > & pixelDets() const
std::vector< unsigned int > id_
PxMeasurementConditionSet thePxDetConditions
tuple size
Write out results.
void MeasurementTrackerImpl::initStackDet ( TkStackMeasurementDet det)
protected

Definition at line 288 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

289 {
290  const StackGeomDet& gd = det.specificGeomDet();
291  const MeasurementDet* lowerDet = findDet( gd.lowerDet()->geographicalId());
292  const MeasurementDet* upperDet = findDet( gd.upperDet()->geographicalId());
293  if (lowerDet == 0 || upperDet == 0) {
294  edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: StackDet components not found as MeasurementDets ";
295  throw MeasurementDetException("MeasurementTracker ERROR: StackDet components not found as MeasurementDets");
296  }
297  det.init(lowerDet,upperDet);
298  theDetMap[gd.geographicalId()] = &det;
299 }
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 171 of file MeasurementTrackerImpl.cc.

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

Referenced by initialize().

172 {
173  // assume vector is full and ordered!
174  int size = stripDets.size();
175  theStDetConditions.init(size);
176  for (int i=0; i!=size; ++i) {
177  auto & mdet = stripDets[i];
178  mdet.setIndex(i);
179  //intialize the detId !
180  theStDetConditions.id_[i] = mdet.specificGeomDet().geographicalId().rawId();
182  //initalize the total number of strips
183  theStDetConditions.totalStrips_[i] = mdet.specificGeomDet().specificTopology().nstrips();
184  }
185 }
int i
Definition: DBlmapReader.cc:9
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:37
std::vector< int > totalStrips_
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
std::vector< unsigned int > id_
tuple size
Write out results.
virtual const PxMeasurementConditionSet& MeasurementTrackerImpl::pixelDetConditions ( ) const
inlinevirtual

Implements MeasurementTracker.

Definition at line 105 of file MeasurementTrackerImpl.h.

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

Definition at line 100 of file MeasurementTrackerImpl.h.

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

Definition at line 102 of file MeasurementTrackerImpl.h.

102 {return theStackDets;}
std::vector< TkStackMeasurementDet > theStackDets
virtual const StMeasurementConditionSet& MeasurementTrackerImpl::stripDetConditions ( ) const
inlinevirtual

Provide templates to be filled in.

Implements MeasurementTracker.

Definition at line 104 of file MeasurementTrackerImpl.h.

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

Definition at line 99 of file MeasurementTrackerImpl.h.

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

Member Data Documentation

const std::string MeasurementTrackerImpl::name_
protected

Definition at line 109 of file MeasurementTrackerImpl.h.

const edm::ParameterSet& MeasurementTrackerImpl::pset_
protected

Definition at line 108 of file MeasurementTrackerImpl.h.

Referenced by initializeStripStatus().

DetContainer MeasurementTrackerImpl::theDetMap
protected

Definition at line 114 of file MeasurementTrackerImpl.h.

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

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

Definition at line 118 of file MeasurementTrackerImpl.h.

Referenced by addGluedDet(), and initialize().

const SiPixelFedCabling* MeasurementTrackerImpl::thePixelCabling
protected

Definition at line 121 of file MeasurementTrackerImpl.h.

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

Definition at line 116 of file MeasurementTrackerImpl.h.

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

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

Definition at line 119 of file MeasurementTrackerImpl.h.

Referenced by addStackDet(), and initialize().

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

Definition at line 117 of file MeasurementTrackerImpl.h.

Referenced by addStripDet(), and initialize().