76 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: Begin of LS transition";
104 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: End of LS transition, performing the DQM client operation";
112 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: "<<nLumiSegs<<
" updates";
115 vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
116 vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
118 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: Occupancy tests results";
121 for (; ch_it != ch_end; ++ch_it) {
123 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
124 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
126 stringstream wheel; wheel << chID.
wheel();
128 stringstream sector; sector << chID.
sector();
132 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
135 MonitorElement * noise_histo = dbe->get(getMEName(
"OccupancyNoise_perCh", chID));
136 MonitorElement * hitInTime_histo = dbe->get(getMEName(
"OccupancyInTimeHits_perCh", chID));
139 if(noise_histo && hitInTime_histo) {
140 TH2F * noise_histo_root = noise_histo->
getTH2F();
141 TH2F * hitInTime_histo_root = hitInTime_histo->
getTH2F();
144 for(; sl_it != sl_end; ++sl_it) {
146 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
147 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
150 float tTrig, tTrigRMS, kFactor;
154 for(; l_it != l_end; ++l_it) {
158 stringstream superLayer; superLayer << slID.
superlayer();
159 stringstream layer; layer << lID.
layer();
160 string HistoNameTest =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
162 const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
163 const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
169 int YBinNumber = entry+lID.
layer();
173 for(
int bin=firstWire;
bin <= lastWire;
bin++) {
174 if (OccupancyDiffHistos.find(HistoNameTest) == OccupancyDiffHistos.end())
bookHistos(lID, firstWire, lastWire);
178 float difference = (hitInTime_histo_root->GetBinContent(
bin, YBinNumber) / tMax)
179 - (noise_histo_root->GetBinContent(
bin, YBinNumber) / tTrig);
180 OccupancyDiffHistos.find(HistoNameTest)->second->setBinContent(
bin, difference);
188 string OccupancyDiffCriterionName =
parameters.getUntrackedParameter<
string>(
"OccupancyDiffTestName",
"OccupancyDiffInRange");
189 for(map<string, MonitorElement*>::const_iterator hOccDiff = OccupancyDiffHistos.begin();
190 hOccDiff != OccupancyDiffHistos.end();
192 const QReport * theOccupancyDiffQReport = (*hOccDiff).second->getQReport(OccupancyDiffCriterionName);
193 if(theOccupancyDiffQReport) {
194 vector<dqm::me_util::Channel> badChannels = theOccupancyDiffQReport->
getBadChannels();
195 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
196 channel != badChannels.end(); channel++) {
197 edm::LogError (
"deadChannel") <<
"Layer : "<<(*hOccDiff).first<<
" Bad occupancy difference channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
211 dbe->rmdir(
"DT/Tests/DTDeadChannel");
217 stringstream wheel; wheel << chId.
wheel();
219 stringstream sector; sector << chId.
sector();
221 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
223 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
224 "/Station" + station.str() +
225 "/Sector" + sector.str() +
226 "/Occupancies" +
"/";
228 string histoname = folderName + histoTag
230 +
"_St" + station.str()
231 +
"_Sec" + sector.str();
244 stringstream layer; layer << lId.
layer();
246 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
247 string OccupancyDiffHistoName =
"OccupancyDiff_" +
HistoName;
249 dbe->setCurrentFolder(
"DT/Tests/DTDeadChannel/Wheel" + wheel.str() +
250 "/Station" + station.str() +
251 "/Sector" + sector.str());
253 OccupancyDiffHistos[
HistoName] = dbe->book1D(OccupancyDiffHistoName.c_str(),OccupancyDiffHistoName.c_str(),lastWire-firstWire+1, firstWire-0.5, lastWire+0.5);
LuminosityBlockID id() const
std::string getMEName(std::string histoTag, const DTChamberId &chId)
Get the ME name.
int layer() const
Return the layer number.
DTDeadChannelTest(const edm::ParameterSet &ps)
Constructor.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
const std::vector< DQMChannel > & getBadChannels(void) const
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
int superlayer() const
Return the superlayer number (deprecated method name)
LuminosityBlockNumber_t luminosityBlock() const
void bookHistos(const DTLayerId &ch, int firstWire, int lastWire)
book the new ME
int station() const
Return the station number.
TH2F * getTH2F(void) const
int wheel() const
Return the wheel number.
virtual ~DTDeadChannelTest()
Destructor.
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.