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 Attributes
SiStripCablingDQM Class Reference

#include <SiStripCablingDQM.h>

Inheritance diagram for SiStripCablingDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (ModMEs selModME_, uint32_t selDetId_)
 
void fillMEsForLayer (std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds)
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds)
 
void getActiveDetIds (const edm::EventSetup &eSetup)
 
unsigned long long getCache (const edm::EventSetup &eSetup)
 
void getConditionObject (const edm::EventSetup &eSetup)
 
 SiStripCablingDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripCablingDQM ()
 
- Public Member Functions inherited from SiStripBaseCondObjDQM
void analysis (const edm::EventSetup &eSetup_)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::vector< uint32_t > detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
virtual void end ()
 
std::vector< uint32_t > getCabledModules ()
 
void selectModules (std::vector< uint32_t > &detIds_)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Attributes

edm::ESHandle< SiStripDetCablingcablingHandle_
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripBaseCondObjDQM
void fillTkMap (const uint32_t &detid, const float &value)
 
std::pair< std::string, uint32_t > getLayerNameAndId (const uint32_t &detId_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (std::vector< uint32_t > activeDetIds, uint32_t selDetId)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
unsigned long long cacheID_current
 
unsigned long long cacheID_memory
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
const edm::EventSetupeSetup_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
SiStripDetInfoFileReaderreader
 
std::map< uint32_t, ModMEsSummaryMEsMap_
 
bool SummaryOnLayerLevel_On_
 
bool SummaryOnStringLevel_On_
 
TkHistoMapTk_HM_
 
TkHistoMapTk_HM_H
 
TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 

Detailed Description

Definition at line 15 of file SiStripCablingDQM.h.

Constructor & Destructor Documentation

SiStripCablingDQM::SiStripCablingDQM ( const edm::EventSetup eSetup,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 7 of file SiStripCablingDQM.cc.

References SiStripBaseCondObjDQM::HistoMaps_On_, and SiStripBaseCondObjDQM::Tk_HM_.

9  :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
10 
11  // Build the Histo_TkMap:
12  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","Cabling_TkMap",0.);
13 
14 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
SiStripCablingDQM::~SiStripCablingDQM ( )

Definition at line 18 of file SiStripCablingDQM.cc.

18 {}

Member Function Documentation

void SiStripCablingDQM::fillMEsForDet ( ModMEs  selModME_,
uint32_t  selDetId_ 
)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripCablingDQM.h.

28 {;}
void SiStripCablingDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripCablingDQM.h.

29 {;}
void SiStripCablingDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
inlinevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 25 of file SiStripCablingDQM.h.

25 {;}
void SiStripCablingDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
inlinevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 26 of file SiStripCablingDQM.h.

26 {;}
void SiStripCablingDQM::getActiveDetIds ( const edm::EventSetup eSetup)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripCablingDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, DQMStore::book2D(), alignmentValidation::c1, cablingHandle_, SiStripBaseCondObjDQM::dqmStore_, TkHistoMap::fill(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), SiStripBaseCondObjDQM::fPSet_, getConditionObject(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, j, TOBDetId::layer(), TIBDetId::layer(), mergeVDriftHistosByStation::name, cmsCodeRules.cppFunctionSkipper::operator, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), TIDDetId::side(), TECDetId::side(), DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, SiStripBaseCondObjDQM::Tk_HM_, StripSubdetector::TOB, TIDDetId::wheel(), and TECDetId::wheel().

24  {
25 
26  // Get active and total detIds
27  getConditionObject(eSetup);
28  cablingHandle_->addActiveDetectorsRawIds(activeDetIds);
29  cablingHandle_->addAllDetectorsRawIds(activeDetIds);
30 
31 
32  //Initialize arrays for counting:
33  int counterTIB[4];
34  for(int i=0;i<4;i++) counterTIB[i]=0;
35  int counterTID[2][3];
36  for(int i=0;i<2;i++){
37  for(int j=0;j<3;j++)counterTID[i][j]=0;
38  }
39  int counterTOB[6];
40  for(int i=0;i<6;i++)counterTOB[i]=0;
41  int counterTEC[2][9];
42  for(int i=0;i<2;i++){
43  for(int j=0;j<9;j++)counterTEC[i][j]=0;
44  }
45 
46 
47 
48  std::vector<uint32_t>::const_iterator idet=activeDetIds.begin();
49 
50  //fill arrays for counting and fill Histo_Map with value for connected :
51  for(;idet!=activeDetIds.end();++idet){
52  uint32_t detId = *idet;
53  StripSubdetector subdet(detId);
54 
55  if(HistoMaps_On_ ) {Tk_HM_->fill(detId, cablingHandle_->nApvPairs(detId)*2);}
56  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
57 
58  int32_t n_conn = 0;
59  for(uint32_t connDet_i=0; connDet_i<cablingHandle_->getConnections(detId).size(); connDet_i++){
60  if(cablingHandle_->getConnections(detId)[connDet_i].isConnected()!=0) n_conn++;
61  }
62  fillTkMap(detId,n_conn*2.);
63  }
64  switch (subdet.subdetId())
65  {
67  {
68  TIBDetId tibId(detId);
69  int i = tibId.layer() - 1;
70  counterTIB[i]++;
71  break;
72  }
74  {
75  TIDDetId tidId(detId);
76  if (tidId.side() == 2) {
77  int j = tidId.wheel() - 1;
78  counterTID[0][j]++;
79  } else if (tidId.side() == 1) {
80  int j = tidId.wheel() - 1;
81  counterTID[1][j]++;
82  }
83  break;
84  }
86  {
87  TOBDetId tobId(detId);
88  int i = tobId.layer() - 1;
89  counterTOB[i]++;
90  break;
91  }
93  {
94  TECDetId tecId(detId);
95  if (tecId.side() == 2) {
96  int j = tecId.wheel() - 1;
97  counterTEC[0][j]++;
98  } else if (tecId.side() == 1) {
99  int j = tecId.wheel() - 1;
100  counterTEC[1][j]++;
101  }
102  break;
103  }
104  }
105 
106  } // idet
107 
108  //obtained from tracker.dat and hard-coded
109  int TIBDetIds[4]={672,864,540,648};
110  int TIDDetIds[2][3]={{136,136,136},{136,136,136}};
111  int TOBDetIds[6]={1008,1152,648,720,792,888};
112  int TECDetIds[2][9]={{408,408,408,360,360,360,312,312,272},{408,408,408,360,360,360,312,312,272}};
113 
114 
115 
117 
118  std::string FolderName=fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
119 
120  dqmStore_->setCurrentFolder(FolderName);
121 
122  // dqmStore_->cd("SiStrip/MechanicalView/");
124  ME = dqmStore_->book2D("SummaryOfCabling","SummaryOfCabling",6,0.5,6.5,9,0.5,9.5);
125  ME->setAxisTitle("Sub Det",1);
126  ME->setAxisTitle("Layer",2);
127 
128 
129  ME->getTH1()->GetXaxis()->SetBinLabel(1,"TIB");
130  ME->getTH1()->GetXaxis()->SetBinLabel(2,"TID F");
131  ME->getTH1()->GetXaxis()->SetBinLabel(3,"TID B");
132  ME->getTH1()->GetXaxis()->SetBinLabel(4,"TOB");
133  ME->getTH1()->GetXaxis()->SetBinLabel(5,"TEC F");
134  ME->getTH1()->GetXaxis()->SetBinLabel(6,"TEC B");
135 
136  for(int i=0;i<4;i++){
137  ME->Fill(1,i+1,float(counterTIB[i])/TIBDetIds[i]);
138  }
139 
140  for(int i=0;i<2;i++){
141  for(int j=0;j<3;j++){
142  ME->Fill(i+2,j+1,float(counterTID[i][j])/TIDDetIds[i][j]);
143  }
144  }
145 
146  for(int i=0;i<6;i++){
147  ME->Fill(4,i+1,float(counterTOB[i])/TOBDetIds[i]);
148  }
149 
150  for(int i=0;i<2;i++){
151  for(int j=0;j<9;j++){
152  ME->Fill(i+5,j+1,float(counterTEC[i][j])/TECDetIds[i][j]);
153  }
154  }
155 
156  if (fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
157 
158  TCanvas c1("c1");
159  ME->getTH1()->Draw("TEXT");
160  ME->getTH1()->SetStats(kFALSE);
161  std::string name (ME->getTH1()->GetTitle());
162  name+=".png";
163  c1.Print(name.c_str());
164  }
165 
166 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
void fillTkMap(const uint32_t &detid, const float &value)
void Fill(long long x)
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:130
int j
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
void getConditionObject(const edm::EventSetup &eSetup)
edm::ESHandle< SiStripDetCabling > cablingHandle_
MonitorElement ME
std::vector< uint32_t > activeDetIds
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
unsigned long long SiStripCablingDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 32 of file SiStripCablingDQM.h.

References edm::EventSetup::get().

32 { return eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();}
const T & get() const
Definition: EventSetup.h:55
void SiStripCablingDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual

Member Data Documentation

edm::ESHandle<SiStripDetCabling> SiStripCablingDQM::cablingHandle_
private

Definition at line 44 of file SiStripCablingDQM.h.

Referenced by getActiveDetIds(), and getConditionObject().