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 (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo)
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo)
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
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_, const 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_, const TrackerTopology *tTopo)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
- 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 ( const ModMEs selModME_,
uint32_t  selDetId_,
const TrackerTopology tTopo 
)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripCablingDQM.h.

28 {;}
void SiStripCablingDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripCablingDQM.h.

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 25 of file SiStripCablingDQM.h.

25 {;}
void SiStripCablingDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
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_, edm::EventSetup::get(), getConditionObject(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, edm::ESHandleBase::isValid(), j, mergeVDriftHistosByStation::name, cppFunctionSkipper::operator, edm::ESHandle< class >::product(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripBaseCondObjDQM::Tk_HM_, StripSubdetector::TOB, and TrackerTopology::tobLayer().

24  {
25 
26  //Retrieve tracker topology from geometry
28  eSetup.get<IdealGeometryRecord>().get(tTopoHandle);
29  const TrackerTopology* const tTopo = tTopoHandle.product();
30 
31  // Get active and total detIds
32  getConditionObject(eSetup);
33  if(!cablingHandle_.isValid()) {
34  edm::LogError("InvalidCablingHandle") << "Invalid Cabling Handle";
35  return;
36  }
37  cablingHandle_->addActiveDetectorsRawIds(activeDetIds);
38  cablingHandle_->addAllDetectorsRawIds(activeDetIds);
39 
40 
41  //Initialize arrays for counting:
42  int counterTIB[4];
43  for(int i=0;i<4;i++) counterTIB[i]=0;
44  int counterTID[2][3];
45  for(int i=0;i<2;i++){
46  for(int j=0;j<3;j++)counterTID[i][j]=0;
47  }
48  int counterTOB[6];
49  for(int i=0;i<6;i++)counterTOB[i]=0;
50  int counterTEC[2][9];
51  for(int i=0;i<2;i++){
52  for(int j=0;j<9;j++)counterTEC[i][j]=0;
53  }
54 
55 
56 
57  std::vector<uint32_t>::const_iterator idet=activeDetIds.begin();
58 
59  //fill arrays for counting and fill Histo_Map with value for connected :
60  for(;idet!=activeDetIds.end();++idet){
61  uint32_t detId = *idet;
62  StripSubdetector subdet(detId);
63 
64  if(HistoMaps_On_ ) {Tk_HM_->fill(detId, cablingHandle_->nApvPairs(detId)*2);}
65  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
66 
67  int32_t n_conn = 0;
68  for(uint32_t connDet_i=0; connDet_i<cablingHandle_->getConnections(detId).size(); connDet_i++){
69  if(cablingHandle_->getConnections(detId)[connDet_i]!=0 && cablingHandle_->getConnections(detId)[connDet_i]->isConnected()!=0) n_conn++;
70  }
71  fillTkMap(detId,n_conn*2.);
72  }
73  switch (subdet.subdetId())
74  {
76  {
77  int i = tTopo->tibLayer(detId) - 1;
78  counterTIB[i]++;
79  break;
80  }
82  {
83  int j = tTopo->tidWheel(detId) - 1;
84  int side = tTopo->tidSide(detId);
85  if (side == 2) {
86  counterTID[0][j]++;
87  } else if (side == 1) {
88  counterTID[1][j]++;
89  }
90  break;
91  }
93  {
94  int i = tTopo->tobLayer(detId) - 1;
95  counterTOB[i]++;
96  break;
97  }
99  {
100  int j = tTopo->tecWheel(detId) - 1;
101  int side = tTopo->tecSide(detId);
102  if (side == 2) {
103  counterTEC[0][j]++;
104  } else if (side == 1) {
105  counterTEC[1][j]++;
106  }
107  break;
108  }
109  }
110 
111  } // idet
112 
113  //obtained from tracker.dat and hard-coded
114  int TIBDetIds[4]={672,864,540,648};
115  int TIDDetIds[2][3]={{136,136,136},{136,136,136}};
116  int TOBDetIds[6]={1008,1152,648,720,792,888};
117  int TECDetIds[2][9]={{408,408,408,360,360,360,312,312,272},{408,408,408,360,360,360,312,312,272}};
118 
119 
120 
122 
123  std::string FolderName=fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
124 
125  dqmStore_->setCurrentFolder(FolderName);
126 
127  // dqmStore_->cd("SiStrip/MechanicalView/");
129  ME = dqmStore_->book2D("SummaryOfCabling","SummaryOfCabling",6,0.5,6.5,9,0.5,9.5);
130  ME->setAxisTitle("Sub Det",1);
131  ME->setAxisTitle("Layer",2);
132 
133 
134  ME->getTH1()->GetXaxis()->SetBinLabel(1,"TIB");
135  ME->getTH1()->GetXaxis()->SetBinLabel(2,"TID F");
136  ME->getTH1()->GetXaxis()->SetBinLabel(3,"TID B");
137  ME->getTH1()->GetXaxis()->SetBinLabel(4,"TOB");
138  ME->getTH1()->GetXaxis()->SetBinLabel(5,"TEC F");
139  ME->getTH1()->GetXaxis()->SetBinLabel(6,"TEC B");
140 
141  for(int i=0;i<4;i++){
142  ME->Fill(1,i+1,float(counterTIB[i])/TIBDetIds[i]);
143  }
144 
145  for(int i=0;i<2;i++){
146  for(int j=0;j<3;j++){
147  ME->Fill(i+2,j+1,float(counterTID[i][j])/TIDDetIds[i][j]);
148  }
149  }
150 
151  for(int i=0;i<6;i++){
152  ME->Fill(4,i+1,float(counterTOB[i])/TOBDetIds[i]);
153  }
154 
155  for(int i=0;i<2;i++){
156  for(int j=0;j<9;j++){
157  ME->Fill(i+5,j+1,float(counterTEC[i][j])/TECDetIds[i][j]);
158  }
159  }
160 
161  if (fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
162 
163  TCanvas c1("c1");
164  ME->getTH1()->Draw("TEXT");
165  ME->getTH1()->SetStats(kFALSE);
166  std::string name (ME->getTH1()->GetTitle());
167  name+=".png";
168  c1.Print(name.c_str());
169  }
170 
171 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
unsigned int tibLayer(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
void fillTkMap(const uint32_t &detid, const float &value)
void Fill(long long x)
unsigned int tidSide(const DetId &id) const
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:180
int j
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
void getConditionObject(const edm::EventSetup &eSetup)
edm::ESHandle< SiStripDetCabling > cablingHandle_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
MonitorElement ME
std::vector< uint32_t > activeDetIds
bool isValid() const
Definition: ESHandle.h:37
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:1082
unsigned int tecWheel(const DetId &id) const
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:667
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
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().