78 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: Begin of LS transition";
106 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: End of LS transition, performing the DQM client operation";
114 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: "<<nLumiSegs<<
" updates";
117 vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
118 vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
120 edm::LogVerbatim (
"deadChannel") <<
"[DTDeadChannelTest]: Occupancy tests results";
123 for (; ch_it != ch_end; ++ch_it) {
125 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
126 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
128 stringstream wheel; wheel << chID.
wheel();
130 stringstream sector; sector << chID.
sector();
134 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
137 MonitorElement * noise_histo = dbe->get(getMEName(
"OccupancyNoise_perCh", chID));
138 MonitorElement * hitInTime_histo = dbe->get(getMEName(
"OccupancyInTimeHits_perCh", chID));
141 if(noise_histo && hitInTime_histo) {
142 TH2F * noise_histo_root = noise_histo->
getTH2F();
143 TH2F * hitInTime_histo_root = hitInTime_histo->
getTH2F();
146 for(; sl_it != sl_end; ++sl_it) {
148 vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
149 vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
152 float tTrig, tTrigRMS, kFactor;
156 for(; l_it != l_end; ++l_it) {
160 stringstream superLayer; superLayer << slID.
superlayer();
161 stringstream layer; layer << lID.
layer();
162 string HistoNameTest =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
164 const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
165 const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
171 int YBinNumber = entry+lID.
layer();
175 for(
int bin=firstWire;
bin <= lastWire;
bin++) {
176 if (OccupancyDiffHistos.find(HistoNameTest) == OccupancyDiffHistos.end())
bookHistos(lID, firstWire, lastWire);
180 float difference = (hitInTime_histo_root->GetBinContent(
bin, YBinNumber) / tMax)
181 - (noise_histo_root->GetBinContent(
bin, YBinNumber) / tTrig);
182 OccupancyDiffHistos.find(HistoNameTest)->second->setBinContent(
bin, difference);
190 string OccupancyDiffCriterionName =
parameters.getUntrackedParameter<
string>(
"OccupancyDiffTestName",
"OccupancyDiffInRange");
191 for(map<string, MonitorElement*>::const_iterator hOccDiff = OccupancyDiffHistos.begin();
192 hOccDiff != OccupancyDiffHistos.end();
194 const QReport * theOccupancyDiffQReport = (*hOccDiff).second->getQReport(OccupancyDiffCriterionName);
195 if(theOccupancyDiffQReport) {
196 vector<dqm::me_util::Channel> badChannels = theOccupancyDiffQReport->
getBadChannels();
197 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
198 channel != badChannels.end(); channel++) {
199 edm::LogError (
"deadChannel") <<
"Layer : "<<(*hOccDiff).first<<
" Bad occupancy difference channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents();
213 dbe->rmdir(
"DT/Tests/DTDeadChannel");
219 stringstream wheel; wheel << chId.
wheel();
221 stringstream sector; sector << chId.
sector();
223 string folderRoot =
parameters.getUntrackedParameter<
string>(
"folderRoot",
"Collector/FU0/");
225 folderRoot +
"DT/DTDigiTask/Wheel" + wheel.str() +
226 "/Station" + station.str() +
227 "/Sector" + sector.str() +
228 "/Occupancies" +
"/";
230 string histoname = folderName + histoTag
232 +
"_St" + station.str()
233 +
"_Sec" + sector.str();
246 stringstream layer; layer << lId.
layer();
248 string HistoName =
"W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str() +
"_L" + layer.str();
249 string OccupancyDiffHistoName =
"OccupancyDiff_" +
HistoName;
251 dbe->setCurrentFolder(
"DT/Tests/DTDeadChannel/Wheel" + wheel.str() +
252 "/Station" + station.str() +
253 "/Sector" + sector.str());
255 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.
std::pair< std::string, MonitorElement * > entry
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.