72 (*histo).second->Reset();
78 (*histo).second->Reset();
81 edm::LogVerbatim (
"efficiency") <<
"[DTEfficiencyTest]: End of LS transition, performing the DQM client operation";
84 nLumiSegs = lumiSeg.id().luminosityBlock();
91 vector<const DTChamber*>::const_iterator ch_it =
muonGeom->
chambers().begin();
92 vector<const DTChamber*>::const_iterator ch_end =
muonGeom->
chambers().end();
94 edm::LogVerbatim (
"efficiency") <<
"[DTEfficiencyTest]: Efficiency tests results";
97 map <DTLayerId, vector<double> > LayerBadCells;
98 LayerBadCells.clear();
99 map <DTLayerId, vector<double> > LayerUnassBadCells;
100 LayerUnassBadCells.clear();
101 map <DTSuperLayerId, vector<double> > SuperLayerBadCells;
102 SuperLayerBadCells.clear();
103 map <DTSuperLayerId,vector<double> > SuperLayerUnassBadCells;
104 SuperLayerUnassBadCells.clear();
105 map <pair<int,int>,
int> cmsHistos;
107 map <pair<int,int>,
bool> filled;
108 for(
int i=-2;
i<3;
i++){
109 for(
int j=1; j<15; j++){
110 filled[make_pair(
i,j)]=
false;
113 map <pair<int,int>,
int> cmsUnassHistos;
114 cmsUnassHistos.clear();
115 map <pair<int,int>,
bool> UnassFilled;
116 for(
int i=-2;
i<3;
i++){
117 for(
int j=1; j<15; j++){
118 UnassFilled[make_pair(
i,j)]=
false;
125 for (; ch_it != ch_end; ++ch_it) {
127 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
128 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
131 for(; sl_it != sl_end; ++sl_it) {
133 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
134 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
137 for(; l_it != l_end; ++l_it) {
142 stringstream sector; sector << chID.
sector();
143 stringstream superLayer; superLayer << slID.
superlayer();
144 stringstream layer; layer << lID.
layer();
146 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
154 if(occupancy_histo && unassOccupancy_histo && recSegmOccupancy_histo) {
155 TH1F * occupancy_histo_root = occupancy_histo->
getTH1F();
156 TH1F * unassOccupancy_histo_root = unassOccupancy_histo->
getTH1F();
157 TH1F * recSegmOccupancy_histo_root = recSegmOccupancy_histo->
getTH1F();
163 for(
int bin=firstWire;
bin <= lastWire;
bin++) {
164 if((recSegmOccupancy_histo_root->GetBinContent(
bin))!=0) {
167 float efficiency = occupancy_histo_root->GetBinContent(
bin) / recSegmOccupancy_histo_root->GetBinContent(
bin);
168 float errorEff =
sqrt(efficiency*(1-efficiency) / recSegmOccupancy_histo_root->GetBinContent(
bin));
173 float unassEfficiency = unassOccupancy_histo_root->GetBinContent(
bin) / recSegmOccupancy_histo_root->GetBinContent(
bin);
174 float errorUnassEff =
sqrt(unassEfficiency*(1-unassEfficiency) / recSegmOccupancy_histo_root->GetBinContent(
bin));
189 for(map<DTLayerId, MonitorElement*>::const_iterator hEff =
EfficiencyHistos.begin();
192 const QReport * theEfficiencyQReport = (*hEff).second->getQReport(EfficiencyCriterionName);
194 if(theEfficiencyQReport) {
195 vector<dqm::me_util::Channel> badChannels = theEfficiencyQReport->
getBadChannels();
196 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
197 channel != badChannels.end(); channel++) {
198 edm::LogError (
"efficiency") <<
"LayerID : "<<
getMEName(
"hEffOccupancy",(*hEff).first)<<
" Bad efficiency channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
201 LayerBadCells[(*hEff).first].push_back(counter);
216 const QReport * theUnassEfficiencyQReport = (*hUnassEff).second->getQReport(UnassEfficiencyCriterionName);
218 if(theUnassEfficiencyQReport) {
219 vector<dqm::me_util::Channel> badChannels = theUnassEfficiencyQReport->
getBadChannels();
220 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
221 channel != badChannels.end(); channel++) {
222 edm::LogError (
"efficiency") <<
"Bad unassEfficiency channels: "<<(*channel).getBin()<<
" "<<(*channel).getContents();
225 LayerUnassBadCells[(*hUnassEff).first].push_back(counter);
233 vector<const DTChamber*>::const_iterator ch2_it =
muonGeom->
chambers().begin();
234 vector<const DTChamber*>::const_iterator ch2_end =
muonGeom->
chambers().end();
235 for (; ch2_it != ch2_end; ++ch2_it) {
236 vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch2_it)->superLayers().begin();
237 vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch2_it)->superLayers().end();
239 for(; sl2_it != sl2_end; ++sl2_it) {
241 double superLayerBadC=0;
242 double superLayerTotC=0;
243 double superLayerUnassBadC=0;
244 double superLayerUnassTotC=0;
246 vector<const DTLayer*>::const_iterator l2_it = (*sl2_it)->layers().begin();
247 vector<const DTLayer*>::const_iterator l2_end = (*sl2_it)->layers().end();
249 for(; l2_it != l2_end; ++l2_it) {
251 if(LayerBadCells.find(layerId) != LayerBadCells.end() &&
252 LayerUnassBadCells.find(layerId) != LayerUnassBadCells.end()){
254 superLayerBadC+=LayerBadCells[layerId][0];
255 superLayerTotC+=LayerBadCells[layerId][1];
256 superLayerUnassBadC+=LayerUnassBadCells[layerId][0];
257 superLayerUnassTotC+=LayerUnassBadCells[layerId][1];
261 SuperLayerBadCells[sl].push_back(superLayerBadC);
262 SuperLayerBadCells[sl].push_back(superLayerTotC);
263 SuperLayerUnassBadCells[sl].push_back(superLayerUnassBadC);
264 SuperLayerUnassBadCells[sl].push_back(superLayerUnassTotC);
270 for(
map<
DTSuperLayerId, vector<double> >::const_iterator SLBCells = SuperLayerBadCells.begin();
271 SLBCells != SuperLayerBadCells.end();
273 if((*SLBCells).second[0]/(*SLBCells).second[1] >
double(
percentual/100)){
275 if(!((*SLBCells).first.station() == 4 && (*SLBCells).first.superlayer() == 3))
276 wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector()-1,((*SLBCells).first.superlayer()-1)+3*((*SLBCells).first.station()-1));
278 wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector()-1,10);
281 cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]++;
282 if(((*SLBCells).first.sector()<13 &&
283 double(cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())])/11>double(
percentual)/100 &&
284 filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]==
false) ||
285 ((*SLBCells).first.sector()>=13 &&
286 double(cmsHistos[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())])/2>double(
percentual)/100 &&
287 filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]==
false)){
288 filled[make_pair((*SLBCells).first.wheel(),(*SLBCells).first.sector())]=
true;
289 wheelHistos[3]->Fill((*SLBCells).first.sector()-1,(*SLBCells).first.wheel());
295 for(
map<
DTSuperLayerId, vector<double> >::const_iterator SLUBCells = SuperLayerUnassBadCells.begin();
296 SLUBCells != SuperLayerUnassBadCells.end();
298 if((*SLUBCells).second[0]/(*SLUBCells).second[1] >
double(
percentual/100)){
300 if(!((*SLUBCells).first.station() == 4 && (*SLUBCells).first.superlayer() == 3))
301 wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector()-1,((*SLUBCells).first.superlayer()-1)+3*((*SLUBCells).first.station()-1));
303 wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector()-1,10);
306 cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]++;
307 if(((*SLUBCells).first.sector()<13 &&
308 double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())])/11>double(
percentual)/100 &&
309 UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]==
false) ||
310 ((*SLUBCells).first.sector()>=13 &&
311 double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())])/2>double(
percentual)/100 &&
312 UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]==
false)){
313 UnassFilled[make_pair((*SLUBCells).first.wheel(),(*SLUBCells).first.sector())]=
true;
314 wheelUnassHistos[3]->Fill((*SLUBCells).first.sector()-1,(*SLUBCells).first.wheel());
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::map< int, MonitorElement * > wheelHistos
MonitorElement * get(const std::string &path)
edm::ParameterSet parameters
int layer() const
Return the layer number.
void bookHistos(DQMStore::IBooker &, const DTLayerId &ch, int firstWire, int lastWire)
book the new ME
std::map< int, MonitorElement * > wheelUnassHistos
int firstChannel() const
Returns the wire number of the first wire.
int lastChannel() const
Returns the wire number of the last wire.
const DTTopology & specificTopology() const
const std::vector< DQMChannel > & getBadChannels(void) const
bin
set the eta bin as selection string.
int superlayer() const
Return the superlayer number (deprecated method name)
int channels() const
Returns the number of wires in the layer.
edm::ESHandle< DTGeometry > muonGeom
std::map< DTLayerId, MonitorElement * > EfficiencyHistos
TH1F * getTH1F(void) const
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
int station() const
Return the station number.
int wheel() const
Return the wheel number.
std::map< DTLayerId, MonitorElement * > UnassEfficiencyHistos
std::string getMEName(std::string histoTag, const DTLayerId &lID)
Get the ME name.