CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripTrackerMapCreator Class Reference

#include <SiStripTrackerMapCreator.h>

Public Member Functions

void create (const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &htype, const edm::EventSetup &eSetup)
 
void createForOffline (const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &htype, const edm::EventSetup &eSetup)
 
bool readConfiguration ()
 
 SiStripTrackerMapCreator (const edm::EventSetup &eSetup)
 
 ~SiStripTrackerMapCreator ()
 

Private Member Functions

uint16_t getDetectorFlagAndComment (DQMStore *dqm_store, uint32_t det_id, const TrackerTopology *tTopo, std::ostringstream &comment)
 
void paintTkMapFromAlarm (uint32_t det_id, const TrackerTopology *tTopo, DQMStore *dqm_store, bool isBad=false, std::map< unsigned int, std::string > *badmodmap=0)
 
void paintTkMapFromHistogram (DQMStore *dqm_store, MonitorElement *me, std::string &map_type)
 
void printBadModuleList (std::map< unsigned int, std::string > *badmodmap, const edm::EventSetup &eSetup)
 
void setTkMapFromAlarm (DQMStore *dqm_store, const edm::EventSetup &eSetup)
 
void setTkMapFromHistogram (DQMStore *dqm_store, std::string &htype)
 
void setTkMapRange (std::string &map_type)
 
void setTkMapRangeOffline ()
 

Private Attributes

edm::ESHandle< SiStripDetCablingdetcabling_
 
const edm::EventSetupeSetup_
 
float meanToMaxFactor_
 
int nDet
 
std::string ssqLabel_
 
std::string stripTopLevelDir_
 
TkDetMaptkDetMap_
 
float tkMapMax_
 
float tkMapMin_
 
std::string tkMapName_
 
TrackerMaptrackerMap_
 
bool useSSQuality_
 

Detailed Description

Definition at line 22 of file SiStripTrackerMapCreator.h.

Constructor & Destructor Documentation

SiStripTrackerMapCreator::SiStripTrackerMapCreator ( const edm::EventSetup eSetup)

Definition at line 38 of file SiStripTrackerMapCreator.cc.

References detcabling_, eSetup_, edm::EventSetup::get(), cppFunctionSkipper::operator, stripTopLevelDir_, tkDetMap_, and trackerMap_.

38  : meanToMaxFactor_(2.5),eSetup_(eSetup)
39  //, psumap_()
40 {
41  trackerMap_ = 0;
44  // psumap_.BuildMap("CalibTracker/SiStripDCS/data/StripPSUDetIDMap_FromJan132010.dat",false);
45  if(!edm::Service<TkDetMap>().isAvailable()){
46  edm::LogError("TkHistoMap") <<
47  "\n------------------------------------------"
48  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
49  "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
50  "\n------------------------------------------";
51  }
53 }
edm::ESHandle< SiStripDetCabling > detcabling_
const edm::EventSetup & eSetup_
const T & get() const
Definition: EventSetup.h:55
SiStripTrackerMapCreator::~SiStripTrackerMapCreator ( )

Definition at line 57 of file SiStripTrackerMapCreator.cc.

References trackerMap_.

57  {
58  if (trackerMap_) delete trackerMap_;
59 }

Member Function Documentation

void SiStripTrackerMapCreator::create ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
std::string &  htype,
const edm::EventSetup eSetup 
)

Definition at line 63 of file SiStripTrackerMapCreator.cc.

References detcabling_, TrackerMap::fill_all_blank(), meanToMaxFactor_, nDet, TrackerMap::printonline(), TrackerMap::setTitle(), setTkMapFromAlarm(), setTkMapFromHistogram(), setTkMapRange(), ssqLabel_, AlCaHLTBitMon_QueryRunRegistry::string, stripTopLevelDir_, tkMapMax_, tkMapMin_, trackerMap_, and useSSQuality_.

Referenced by SiStripActionExecutor::createTkMap().

65  {
66 
67  const SiStripFedCabling* fedcabling = detcabling_->fedCabling();
68 
69  if(!fedcabling) return;
70 
71  if (trackerMap_) delete trackerMap_;
72  trackerMap_ = new TrackerMap(tkmapPset, fedcabling);
73  std::string tmap_title = " Tracker Map from " + map_type;
74  trackerMap_->setTitle(tmap_title);
75 
76  nDet = 0;
77  tkMapMax_ = 0.0;
78  tkMapMin_ = 0.0;
79  meanToMaxFactor_ = 2.5;
80  useSSQuality_ = false;
81  ssqLabel_ = "";
82  stripTopLevelDir_="SiStrip";
83 
84  if (map_type == "QTestAlarm") {
85  setTkMapFromAlarm(dqm_store, eSetup);
86  /*
87  trackerMap_->fillc_all_blank();
88  const std::vector<uint16_t>& feds = fedcabling->feds();
89  uint32_t detId_save = 0;
90  for(std::vector<unsigned short>::const_iterator ifed = feds.begin();
91  ifed < feds.end(); ifed++){
92  const std::vector<FedChannelConnection> fedChannels = fedcabling->connections( *ifed );
93  for(std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin(); iconn < fedChannels.end(); iconn++){
94 
95  uint32_t detId = iconn->detId();
96  if (detId == 0 || detId == 0xFFFFFFFF) continue;
97  if (detId_save != detId) {
98  detId_save = detId;
99  paintTkMapFromAlarm(detId, dqm_store);
100  }
101  }
102  }
103  */
104  } else {
106  setTkMapFromHistogram(dqm_store, map_type);
107  setTkMapRange(map_type);
108  }
110  delete trackerMap_;
111  trackerMap_ = 0;
112 }
void setTkMapFromHistogram(DQMStore *dqm_store, std::string &htype)
edm::ESHandle< SiStripDetCabling > detcabling_
void setTitle(std::string s)
Definition: TrackerMap.h:126
void fill_all_blank()
Definition: TrackerMap.cc:2739
void setTkMapFromAlarm(DQMStore *dqm_store, const edm::EventSetup &eSetup)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void printonline()
Definition: TrackerMap.cc:2877
void setTkMapRange(std::string &map_type)
void SiStripTrackerMapCreator::createForOffline ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
std::string &  htype,
const edm::EventSetup eSetup 
)

Definition at line 116 of file SiStripTrackerMapCreator.cc.

References DQMStore::cd(), detcabling_, edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), SiStripUtility::goToDir(), meanToMaxFactor_, DQMStore::pwd(), TrackerMap::save(), TrackerMap::save_as_fedtrackermap(), TrackerMap::save_as_psutrackermap(), TrackerMap::setTitle(), setTkMapFromAlarm(), setTkMapFromHistogram(), setTkMapRangeOffline(), ssqLabel_, AlCaHLTBitMon_QueryRunRegistry::string, stripTopLevelDir_, tkMapMax_, tkMapMin_, trackerMap_, and useSSQuality_.

Referenced by SiStripActionExecutor::createOfflineTkMap().

118  {
119 
120  // Determine the strip top level dirctory in the DQM file: it is the path where MechanicalView is minus one directory
121 
122  std::string mdir = "MechanicalView";
123  dqm_store->cd();
124  if (!SiStripUtility::goToDir(dqm_store, mdir)) {
125  edm::LogError("SiStripTopLevelDirNotFound") << "I cannot find the SiStrip top level directory in the DQM file";
126  }
127  else {
128  std::string mechanicalview_dir = dqm_store->pwd();
129  stripTopLevelDir_=mechanicalview_dir.substr(0,mechanicalview_dir.find_last_of("/"));
130  edm::LogInfo("SiStripTopLevelDirFound") << "SiStrip top level directory is " << stripTopLevelDir_;
131  }
132  dqm_store->cd();
133 
134  //
135  const SiStripFedCabling* fedcabling = detcabling_->fedCabling();
136 
137  if(!fedcabling) return;
138 
139  if (trackerMap_) delete trackerMap_;
140  trackerMap_ = new TrackerMap(tkmapPset,fedcabling);
141 
142  meanToMaxFactor_ = tkmapPset.getUntrackedParameter<double>("meanToMaxFact",2.5);
143  useSSQuality_ = tkmapPset.getUntrackedParameter<bool>("useSSQuality",false);
144  ssqLabel_ = tkmapPset.getUntrackedParameter<std::string>("ssqLabel","");
145  bool tkMapPSU = tkmapPset.getUntrackedParameter<bool>("psuMap",false);
146  bool tkMapFED = tkmapPset.getUntrackedParameter<bool>("fedMap",false);
147  std::string namesuffix = tkmapPset.getUntrackedParameter<std::string>("mapSuffix","");
148 
149  std::string tmap_title = " Tracker Map from " + map_type;
150  trackerMap_->setTitle(tmap_title);
151 
152  if (map_type == "QTestAlarm") {
153  setTkMapFromAlarm(dqm_store, eSetup);
154  }
155  else {
156  setTkMapFromHistogram(dqm_store, map_type);
157  }
158  // if not overwitten by manual configuration min=0 and max= mean value * meanToMaxFactor_
160 
161  // check manual setting
162 
163  if(tkmapPset.exists("mapMax")) tkMapMax_ = tkmapPset.getUntrackedParameter<double>("mapMax");
164  if(tkmapPset.exists("mapMin")) tkMapMin_ = tkmapPset.getUntrackedParameter<double>("mapMin");
165 
166  edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;
167 
168  trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".svg");
169  trackerMap_->save(true, tkMapMin_,tkMapMax_, map_type+namesuffix+".png",4500,2400);
170 
171  if(tkMapPSU) {
172 
173  edm::LogInfo("PSUMapToBeSaved") << "Ready to save PSU TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;
174  // trackerMap_->save_as_psutrackermap(true, tkMapMin_,tkMapMax_, map_type+namesuffix+"_psu.svg");
175  trackerMap_->save_as_psutrackermap(true, tkMapMin_,tkMapMax_, map_type+namesuffix+"_psu.png");
176 
177  }
178 
179  if(tkMapFED) {
180 
181  edm::LogInfo("FEDMapToBeSaved") << "Ready to save FED TkMap " << map_type << namesuffix << " with range set to " << tkMapMin_ << " - " << tkMapMax_;
182  // trackerMap_->save_as_fedtrackermap(true, tkMapMin_,tkMapMax_, map_type+"_fed.svg");
183  trackerMap_->save_as_fedtrackermap(true, tkMapMin_,tkMapMax_, map_type+namesuffix+"_fed.png");
184 
185  }
186 
187  delete trackerMap_;
188  trackerMap_ = 0;
189 }
T getUntrackedParameter(std::string const &, T const &) const
void setTkMapFromHistogram(DQMStore *dqm_store, std::string &htype)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
edm::ESHandle< SiStripDetCabling > detcabling_
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setTitle(std::string s)
Definition: TrackerMap.h:126
void setTkMapFromAlarm(DQMStore *dqm_store, const edm::EventSetup &eSetup)
void save_as_psutrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="psu_svgmap.svg", int width=YPSUOFFSET+(YPSURSIZE+YPSUOFFSET)*NUMPSURACK_INROW+300, int height=XPSUOFFSET+(XPSURSIZE+XPSUOFFSET)*NUMPSURACK_INCOLUMN+300)
Definition: TrackerMap.cc:1843
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:698
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void save_as_fedtrackermap(bool print_total=true, float minval=0., float maxval=0., std::string s="fed_svgmap.svg", int width=YFEDOFFSET+(YFEDCSIZE+YFEDOFFSET)*NUMFEDCRATE_INROW+300, int height=XFEDOFFSET+(XFEDCSIZE+XFEDOFFSET)*NUMFEDCRATE_INCOLUMN+300)
Definition: TrackerMap.cc:2125
static bool goToDir(DQMStore *dqm_store, std::string name)
const std::string & pwd(void) const
Definition: DQMStore.cc:556
uint16_t SiStripTrackerMapCreator::getDetectorFlagAndComment ( DQMStore dqm_store,
uint32_t  det_id,
const TrackerTopology tTopo,
std::ostringstream &  comment 
)
private

Definition at line 460 of file SiStripTrackerMapCreator.cc.

References DQMStore::cd(), detcabling_, DQMStore::dirExists(), MonitorElement::DQM_KIND_INT, DQMStore::get(), SiStripUtility::getBadModuleStatus(), MonitorElement::getIntValue(), SiStripFolderOrganizer::getSubDetFolder(), i, MonitorElement::kind(), LogDebug, python.rootplot.argparse::message, SiStripFolderOrganizer::setSiStripFolderName(), AlCaHLTBitMon_QueryRunRegistry::string, and stripTopLevelDir_.

Referenced by paintTkMapFromAlarm().

461  {
462  // comment << " DetId " << det_id << " : ";
463  comment << "Module " << det_id;
464  uint16_t flag = 0;
465 
466  // get FED channels corresponding to the det_id
467 
468  // if(detcabling_) {
469  comment << " FEDCHs ";
470  std::vector<const FedChannelConnection*> conns = detcabling_->getConnections(det_id);
471  for(unsigned int i=0; i< conns.size() ;++i) {
472  if(conns[i]) {
473  comment << std::setw(3) << conns[i]->fedId() << "/" << std::setw(2) << conns[i]->fedCh()<< " ";
474  }
475  else {
476  comment << " ";
477  }
478  }
479  if(conns.size()==0) { comment << " "; }
480  if(conns.size()==1) { comment << " "; }
481  if(conns.size()==2) { comment << " "; }
482  // }
483 
484  // get PSU channel corresponding to the det_id
485  /*
486  comment << " PSU: ";
487  comment << psumap_.getPSUName(det_id);
488  */
489  //
490 
491  SiStripFolderOrganizer folder_organizer;
492  std::string subdet_folder, badmodule_folder;
493 
494  dqm_store->cd();
495 
496  folder_organizer.setSiStripFolderName(stripTopLevelDir_);
497  folder_organizer.getSubDetFolder(det_id, tTopo, subdet_folder);
498 
499  LogDebug("SearchBadModule") << det_id << " " << subdet_folder << " " << stripTopLevelDir_;
500 
501  if (dqm_store->dirExists(subdet_folder)){
502  badmodule_folder = subdet_folder + "/BadModuleList";
503  LogDebug("SearchBadModule") << subdet_folder << " exists: " << badmodule_folder;
504  } else {
505  // badmodule_folder = dqm_store->pwd() + "/BadModuleList";
506  edm::LogError("SubDetFolderNotFound") << subdet_folder << " does not exist for detid " << det_id;
507  return flag;
508  }
509  if (!dqm_store->dirExists(badmodule_folder)) {
510  LogDebug("BadModuleFolderNotFound") << badmodule_folder << " does not exist for detid " << det_id;
511  return flag;
512  }
513  std::ostringstream badmodule_path;
514  badmodule_path << badmodule_folder << "/" << det_id;
515  LogDebug("SearchBadModule") << badmodule_folder << " exists: " << badmodule_path;
516 
517  MonitorElement* bad_module_me = dqm_store->get(badmodule_path.str());
518  if (bad_module_me && bad_module_me->kind() == MonitorElement::DQM_KIND_INT) {
519  LogDebug("SearchBadModule") << "Monitor Element found";
520  flag = bad_module_me->getIntValue();
522  SiStripUtility::getBadModuleStatus(flag, message);
523  comment << message.c_str();
524  }
525  return flag;
526 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void setSiStripFolderName(std::string name)
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
edm::ESHandle< SiStripDetCabling > detcabling_
static void getBadModuleStatus(uint16_t flag, std::string &message)
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:648
int64_t getIntValue(void) const
#define comment(par)
Definition: vmac.h:161
void SiStripTrackerMapCreator::paintTkMapFromAlarm ( uint32_t  det_id,
const TrackerTopology tTopo,
DQMStore dqm_store,
bool  isBad = false,
std::map< unsigned int, std::string > *  badmodmap = 0 
)
private

Definition at line 320 of file SiStripTrackerMapCreator.cc.

References comment, TrackerMap::fillc(), getDetectorFlagAndComment(), SiStripUtility::getDetectorStatusColor(), TrackerMap::setText(), and trackerMap_.

Referenced by setTkMapFromAlarm().

321  {
322  std::ostringstream comment;
323  uint16_t flag = 0;
324  flag = getDetectorFlagAndComment(dqm_store, det_id, tTopo, comment);
325 
326  int rval, gval, bval;
327  SiStripUtility::getDetectorStatusColor(flag, rval, gval, bval);
328  if(isBad) { rval=255; gval=255; bval = 0; comment << " PCLBadModule ";}
329  trackerMap_->setText(det_id, comment.str());
330  trackerMap_->fillc(det_id, rval, gval, bval);
331  if(badmodmap && (flag!=0 || isBad)) (*badmodmap)[det_id] = comment.str();
332 }
static void getDetectorStatusColor(int status, int &rval, int &gval, int &bval)
uint16_t getDetectorFlagAndComment(DQMStore *dqm_store, uint32_t det_id, const TrackerTopology *tTopo, std::ostringstream &comment)
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:103
unsigned long long int rval
Definition: vlib.h:22
void setText(int idmod, std::string s)
Definition: TrackerMap.cc:2787
#define comment(par)
Definition: vmac.h:161
void SiStripTrackerMapCreator::paintTkMapFromHistogram ( DQMStore dqm_store,
MonitorElement me,
std::string &  map_type 
)
private

Definition at line 385 of file SiStripTrackerMapCreator.cc.

References MonitorElement::DQM_KIND_TPROFILE2D, TrackerMap::fill_current_val(), TrackerMap::fillc(), MonitorElement::getBinContent(), TkDetMap::getDetsForLayer(), TkDetMap::getLayerNum(), MonitorElement::getName(), MonitorElement::getTProfile2D(), TkDetMap::getXY(), TkLayerMap::XYbin::ix, TkLayerMap::XYbin::iy, MonitorElement::kind(), mergeVDriftHistosByStation::name, nDet, AlCaHLTBitMon_QueryRunRegistry::string, tkDetMap_, tkMapMax_, and trackerMap_.

Referenced by setTkMapFromHistogram().

385  {
386 
387  // edm::ESHandle<SiStripQuality> ssq;
388 
389  // if(useSSQuality_) { eSetup_.get<SiStripQualityRcd>().get(ssqLabel_,ssq); }
390 
391  std::string name = me->getName();
392  std::string lname = name.substr(name.find("TkHMap_")+7);
393  lname = lname.substr(lname.find("_T")+1);
394  std::vector<uint32_t> layer_detids;
395  tkDetMap_->getDetsForLayer(tkDetMap_->getLayerNum(lname), layer_detids);
396  for (std::vector<uint32_t>::const_iterator idet = layer_detids.begin(); idet != layer_detids.end(); idet++) {
397  uint32_t det_id= (*idet);
398  if (det_id <= 0) continue;
399  nDet++;
400  const TkLayerMap::XYbin& xyval = tkDetMap_->getXY(det_id);
401  float fval = 0.0;
402  if ( (name.find("NumberOfOfffTrackCluster") != std::string::npos) ||
403  (name.find("NumberOfOnTrackCluster") != std::string::npos) ) {
405  TProfile2D* tp = me->getTProfile2D() ;
406  fval = tp->GetBinEntries(tp->GetBin(xyval.ix, xyval.iy)) * tp->GetBinContent(xyval.ix, xyval.iy);
407  }
408  } else fval = me->getBinContent(xyval.ix, xyval.iy);
409  if (htype == "QTestAlarm") {
410  edm::LogError("ItShouldNotBeHere") << "QTestAlarm map: you should not be here!";
411  /*
412  int rval, gval, bval;
413  std::ostringstream comment;
414  uint32_t flag = 0;
415  flag = getDetectorFlagAndComment(dqm_store, det_id, comment);
416  SiStripUtility::getDetectorStatusColor(flag, rval, gval, bval);
417  if(useSSQuality_ && ssq->IsModuleBad(det_id)) { rval=255; gval=255; bval = 0;}
418  trackerMap_->fillc(det_id, rval, gval, bval);
419  trackerMap_->setText(det_id, comment.str());
420  */
421  } else {
422  if (fval == 0.0) trackerMap_->fillc(det_id,255, 255, 255);
423  else {
424  trackerMap_->fill_current_val(det_id, fval);
425  }
426  tkMapMax_ += fval;
427  }
428  }
429 }
const std::string & getName(void) const
get name of ME
TProfile2D * getTProfile2D(void) const
int getLayerNum(std::string &in)
Definition: TkDetMap.cc:759
void getDetsForLayer(int layer, std::vector< uint32_t > &output)
Definition: TkDetMap.cc:677
Kind kind(void) const
Get the type of the monitor element.
void fillc(int idmod, int RGBcode)
Definition: TrackerMap.h:103
double getBinContent(int binx) const
get content of bin (1-D)
const TkLayerMap::XYbin & getXY(uint32_t &)
Definition: TkDetMap.cc:633
void fill_current_val(int idmod, float current_val)
Definition: TrackerMap.cc:2749
void SiStripTrackerMapCreator::printBadModuleList ( std::map< unsigned int, std::string > *  badmodmap,
const edm::EventSetup eSetup 
)
private

Definition at line 232 of file SiStripTrackerMapCreator.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), SiStripDetId::subDetector(), SiStripDetId::TEC, TrackerTopology::tecSide(), SiStripDetId::TIB, SiStripDetId::TID, TrackerTopology::tidSide(), and SiStripDetId::TOB.

Referenced by setTkMapFromAlarm().

232  {
233 
234  //Retrieve tracker topology from geometry
235  edm::ESHandle<TrackerTopology> tTopoHandle;
236  eSetup.get<IdealGeometryRecord>().get(tTopoHandle);
237  const TrackerTopology* const tTopo = tTopoHandle.product();
238 
239  bool tibDone=false,tidSide1Done=false,tidSide2Done=false,tobDone=false,tecSide1Done=false,tecSide2Done=false;
240  unsigned int tibFirst=369120277-1,
241  tidSide1First=402664197-1,tidSide2First=402672389-1,
242  tobFirst=436228134-1,
243  tecSide1First=470044965-1,tecSide2First=470307109-1;
244 
245  int ntib=0,ntids1=0,ntids2=0,ntob=0,ntecs1=0,ntecs2=0;
246 
247  for(std::map<unsigned int,std::string>::const_iterator badmod = badmodmap->begin(); badmod!= badmodmap->end(); ++badmod) {
248  SiStripDetId ssdetid(badmod->first);
249  if(ssdetid.subDetector()==SiStripDetId::TIB) ntib++;
250  if(ssdetid.subDetector()==SiStripDetId::TID) {
251 
252  if(tTopo->tidSide(ssdetid)==1) ntids1++;
253  if(tTopo->tidSide(ssdetid)==2) ntids2++;
254  }
255  if(ssdetid.subDetector()==SiStripDetId::TOB) ntob++;
256  if(ssdetid.subDetector()==SiStripDetId::TEC) {
257 
258  if(tTopo->tecSide(ssdetid)==1) ntecs1++;
259  if(tTopo->tecSide(ssdetid)==2) ntecs2++;
260  }
261  }
262 
263  edm::LogVerbatim("BadModuleList") << "Number of bad modules in total:";
264  edm::LogVerbatim("BadModuleList") << "--------------------------------------------------------------";
265  edm::LogVerbatim("BadModuleList") << "TIB: " << ntib;
266  edm::LogVerbatim("BadModuleList") << "TID/MINUS: " << ntids1;
267  edm::LogVerbatim("BadModuleList") << "TID/PLUS: " << ntids2;
268  edm::LogVerbatim("BadModuleList") << "TOB: " << ntob;
269  edm::LogVerbatim("BadModuleList") << "TEC/MINUS: " << ntecs1;
270  edm::LogVerbatim("BadModuleList") << "TEC/PLUS: " << ntecs2;
271  edm::LogVerbatim("BadModuleList") << "-------------------------------";
272  edm::LogVerbatim("BadModuleList") ;
273  edm::LogVerbatim("BadModuleList") << "List of bad modules per partition:";
274  edm::LogVerbatim("BadModuleList") << "----------------------------------";
275 
276  for(std::map<unsigned int,std::string>::const_iterator badmod = badmodmap->begin(); badmod!= badmodmap->end(); ++badmod) {
277  if(!tibDone && badmod->first >= tibFirst) {
278  tibDone = true;
279  edm::LogVerbatim("BadModuleList") ;
280  edm::LogVerbatim("BadModuleList") << "SubDetector TIB";
281  edm::LogVerbatim("BadModuleList") ;
282  }
283  if(!tidSide1Done && badmod->first >= tidSide1First) {
284  tidSide1Done = true;
285  edm::LogVerbatim("BadModuleList") ;
286  edm::LogVerbatim("BadModuleList") << "SubDetector TID/MINUS";
287  edm::LogVerbatim("BadModuleList") ;
288  }
289  if(!tidSide2Done && badmod->first >= tidSide2First) {
290  tidSide2Done = true;
291  edm::LogVerbatim("BadModuleList") ;
292  edm::LogVerbatim("BadModuleList") << "SubDetector TID/PLUS";
293  edm::LogVerbatim("BadModuleList") ;
294  }
295  if(!tobDone && badmod->first >= tobFirst) {
296  tobDone = true;
297  edm::LogVerbatim("BadModuleList") ;
298  edm::LogVerbatim("BadModuleList") << "SubDetector TOB";
299  edm::LogVerbatim("BadModuleList") ;
300  }
301  if(!tecSide1Done && badmod->first >= tecSide1First) {
302  tecSide1Done = true;
303  edm::LogVerbatim("BadModuleList") ;
304  edm::LogVerbatim("BadModuleList") << "SubDetector TEC/MINUS";
305  edm::LogVerbatim("BadModuleList") ;
306  }
307  if(!tecSide2Done && badmod->first >= tecSide2First) {
308  tecSide2Done = true;
309  edm::LogVerbatim("BadModuleList") ;
310  edm::LogVerbatim("BadModuleList") << "SubDetector TEC/PLUS";
311  edm::LogVerbatim("BadModuleList") ;
312  }
313  edm::LogVerbatim("BadModuleList") << badmod->second;
314  }
315 }
unsigned int tidSide(const DetId &id) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
unsigned int tecSide(const DetId &id) const
bool SiStripTrackerMapCreator::readConfiguration ( )
void SiStripTrackerMapCreator::setTkMapFromAlarm ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)
private

Definition at line 192 of file SiStripTrackerMapCreator.cc.

References detcabling_, eSetup_, TrackerMap::fillc_all_blank(), edm::EventSetup::get(), python.multivaluedict::map(), python.rootplot.argparse::module, nDet, paintTkMapFromAlarm(), printBadModuleList(), edm::ESHandle< class >::product(), ssqLabel_, tkMapMax_, tkMapMin_, trackerMap_, and useSSQuality_.

Referenced by create(), and createForOffline().

192  {
193 
194  //Retrieve tracker topology from geometry
195  edm::ESHandle<TrackerTopology> tTopoHandle;
196  eSetup.get<IdealGeometryRecord>().get(tTopoHandle);
197  const TrackerTopology* const tTopo = tTopoHandle.product();
198 
199  nDet = 0;
200  tkMapMax_ = 0.0;
201  tkMapMin_ = 0.0;
202 
204 
206 
208 
209  std::map<unsigned int,std::string>* badmodmap = new std::map<unsigned int,std::string>;
210 
211  // used to avoid multiple checks on the same detid since the loop is done on the FED channels
212  uint32_t detId_save = 0;
213  // example of loop using SiStripDetCabling
214  for(std::map< uint32_t, std::vector<const FedChannelConnection *> >::const_iterator module = detcabling_->getDetCabling().begin();
215  module!=detcabling_->getDetCabling().end();++module) {
216  uint32_t detId = module->first;
217  if (detId == 0 || detId == 0xFFFFFFFF) continue;
218  if (detId_save != detId) {
219  detId_save = detId;
220  bool isBad = useSSQuality_ && ssq->IsModuleBad(detId);
221  paintTkMapFromAlarm(detId, tTopo, dqm_store,isBad,badmodmap);
222  }
223  else {
224  edm::LogWarning("TwiceTheSameDetId") << "The detid " << detId << " was found already in the loop on SiStripDetCabling";
225  }
226  }
227  //
228  printBadModuleList(badmodmap, eSetup);
229  delete badmodmap;
230 }
void fillc_all_blank()
Definition: TrackerMap.cc:2731
edm::ESHandle< SiStripDetCabling > detcabling_
void printBadModuleList(std::map< unsigned int, std::string > *badmodmap, const edm::EventSetup &eSetup)
void paintTkMapFromAlarm(uint32_t det_id, const TrackerTopology *tTopo, DQMStore *dqm_store, bool isBad=false, std::map< unsigned int, std::string > *badmodmap=0)
const edm::EventSetup & eSetup_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
Definition: vlib.h:208
void SiStripTrackerMapCreator::setTkMapFromHistogram ( DQMStore dqm_store,
std::string &  htype 
)
private

Definition at line 336 of file SiStripTrackerMapCreator.cc.

References DQMStore::cd(), DQMStore::dirExists(), RefreshWebPage::dname, DQMStore::getContents(), DQMStore::getSubdirs(), SiStripUtility::goToDir(), mergeVDriftHistosByStation::name, nDet, paintTkMapFromHistogram(), DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, tkMapMax_, and tkMapMin_.

Referenced by create(), and createForOffline().

336  {
337  dqm_store->cd();
338 
339  std::string mdir = "MechanicalView";
340  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
341  std::string mechanicalview_dir = dqm_store->pwd();
342 
343  std::vector<std::string> subdet_folder;
344  subdet_folder.push_back("TIB");
345  subdet_folder.push_back("TOB");
346  subdet_folder.push_back("TEC/MINUS");
347  subdet_folder.push_back("TEC/PLUS");
348  subdet_folder.push_back("TID/MINUS");
349  subdet_folder.push_back("TID/PLUS");
350 
351  nDet = 0;
352  tkMapMax_ = 0.0;
353  tkMapMin_ = 0.0;
354 
355  for (std::vector<std::string>::const_iterator it = subdet_folder.begin(); it != subdet_folder.end(); it++) {
356  std::string dname = mechanicalview_dir + "/" + (*it);
357  if (!dqm_store->dirExists(dname)) continue;
358  dqm_store->cd(dname);
359  std::vector<std::string> layerVec = dqm_store->getSubdirs();
360  for (std::vector<std::string>::const_iterator iLayer = layerVec.begin(); iLayer != layerVec.end(); iLayer++) {
361  if ((*iLayer).find("BadModuleList") !=std::string::npos) continue;
362  std::vector<MonitorElement*> meVec = dqm_store->getContents((*iLayer));
363  MonitorElement* tkhmap_me = 0;
365  for (std::vector<MonitorElement*>::const_iterator itkh = meVec.begin(); itkh != meVec.end(); itkh++) {
366  name = (*itkh)->getName();
367  if (name.find("TkHMap") == std::string::npos) continue;
368  if (htype == "QTestAlarm" ){
369  edm::LogError("ItShouldNotBeHere") << "QTestAlarm map: you should not be here!";
370  tkhmap_me = (*itkh);
371  break;
372  } else if (name.find(htype) != std::string::npos) {
373  tkhmap_me = (*itkh);
374  break;
375  }
376  }
377  if (tkhmap_me != 0) {
378  paintTkMapFromHistogram(dqm_store,tkhmap_me, htype);
379  }
380  }
381  dqm_store->cd(mechanicalview_dir);
382  }
383  dqm_store->cd();
384 }
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1574
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
void paintTkMapFromHistogram(DQMStore *dqm_store, MonitorElement *me, std::string &map_type)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1652
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:648
static bool goToDir(DQMStore *dqm_store, std::string name)
const std::string & pwd(void) const
Definition: DQMStore.cc:556
void SiStripTrackerMapCreator::setTkMapRange ( std::string &  map_type)
private

Definition at line 433 of file SiStripTrackerMapCreator.cc.

References meanToMaxFactor_, nDet, TrackerMap::setRange(), tkMapMax_, tkMapMin_, and trackerMap_.

Referenced by create().

433  {
434  tkMapMin_ = 0.0;
435  if (tkMapMax_ == 0.0) {
436  if (map_type.find("FractionOfBadChannels") != std::string::npos) tkMapMax_ = 1.0;
437  else if (map_type.find("NumberOfCluster") != std::string::npos) tkMapMax_ = 0.01;
438  else if (map_type.find("NumberOfDigi") != std::string::npos) tkMapMax_ = 0.6;
439  else if (map_type.find("NumberOfOffTrackCluster") != std::string::npos) tkMapMax_ = 100.0;
440  else if (map_type.find("NumberOfOnTrackCluster") != std::string::npos) tkMapMax_ = 50.0;
441  else if (map_type.find("StoNCorrOnTrack") != std::string::npos) tkMapMax_ = 200.0;
442  } else {
443  tkMapMax_ = tkMapMax_/nDet*1.0;
445  }
447 }
void setRange(float min, float max)
Definition: TrackerMap.cc:670
void SiStripTrackerMapCreator::setTkMapRangeOffline ( )
private

Definition at line 448 of file SiStripTrackerMapCreator.cc.

References meanToMaxFactor_, nDet, tkMapMax_, and tkMapMin_.

Referenced by createForOffline().

448  {
449  tkMapMin_ = 0.0;
450  if (tkMapMax_ != 0.0) {
451  tkMapMax_ = tkMapMax_/(nDet*1.0);
453  }
454  // the following line seems to be useless and misleading: in the offline map creation the range is set with the save... methods
455  // trackerMap_->setRange(tkMapMin_, tkMapMax_);
456 }

Member Data Documentation

edm::ESHandle< SiStripDetCabling > SiStripTrackerMapCreator::detcabling_
private
const edm::EventSetup& SiStripTrackerMapCreator::eSetup_
private

Definition at line 60 of file SiStripTrackerMapCreator.h.

Referenced by setTkMapFromAlarm(), and SiStripTrackerMapCreator().

float SiStripTrackerMapCreator::meanToMaxFactor_
private
int SiStripTrackerMapCreator::nDet
private
std::string SiStripTrackerMapCreator::ssqLabel_
private

Definition at line 57 of file SiStripTrackerMapCreator.h.

Referenced by create(), createForOffline(), and setTkMapFromAlarm().

std::string SiStripTrackerMapCreator::stripTopLevelDir_
private
TkDetMap* SiStripTrackerMapCreator::tkDetMap_
private

Definition at line 59 of file SiStripTrackerMapCreator.h.

Referenced by paintTkMapFromHistogram(), and SiStripTrackerMapCreator().

float SiStripTrackerMapCreator::tkMapMax_
private
float SiStripTrackerMapCreator::tkMapMin_
private
std::string SiStripTrackerMapCreator::tkMapName_
private

Definition at line 50 of file SiStripTrackerMapCreator.h.

TrackerMap* SiStripTrackerMapCreator::trackerMap_
private
bool SiStripTrackerMapCreator::useSSQuality_
private

Definition at line 56 of file SiStripTrackerMapCreator.h.

Referenced by create(), createForOffline(), and setTkMapFromAlarm().