CMS 3D CMS Logo

DTNoiseAnalysisTest Class Reference

* DQM Test Client More...

#include <DQM/DTMonitorClient/src/DTNoiseAnalysisTest.h>

Inheritance diagram for DTNoiseAnalysisTest:

edm::EDAnalyzer

List of all members.

Public Member Functions

 DTNoiseAnalysisTest (const edm::ParameterSet &ps)
 Constructor.
virtual ~DTNoiseAnalysisTest ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob (const edm::EventSetup &c)
 BeginJob.
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
void bookHistos ()
 book the summary histograms
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 DQM Client Diagnostic.

Private Member Functions

std::string getMEName (const DTChamberId &chID)
 Get the ME name.
std::string getSynchNoiseMEName (int wheelId) const

Private Attributes

DQMStoredbe
bool doSynchNoise
double maxSynchNoiseRate
edm::ESHandle< DTGeometrymuonGeom
int nevents
std::map< int, MonitorElement * > noiseHistos
int noisyCellDef
std::map< int, MonitorElement * > noisyCellHistos
MonitorElementsummaryNoiseHisto
MonitorElementsummarySynchNoiseHisto


Detailed Description

* DQM Test Client

Date
2008/11/03 14:21:43
Revision
1.4
Author:
G. Mila - INFN Torino

Definition at line 34 of file DTNoiseAnalysisTest.h.


Constructor & Destructor Documentation

DTNoiseAnalysisTest::DTNoiseAnalysisTest ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 40 of file DTNoiseAnalysisTest.cc.

References dbe, doSynchNoise, edm::ParameterSet::getUntrackedParameter(), LogTrace, maxSynchNoiseRate, and noisyCellDef.

00040                                                                  {
00041   LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "[DTNoiseAnalysisTest]: Constructor";
00042 
00043   dbe = edm::Service<DQMStore>().operator->();
00044 
00045   // get the cfi parameters
00046   noisyCellDef = ps.getUntrackedParameter<int>("noisyCellDef",500);
00047 
00048   // switch on/off the summaries for the Synchronous noise
00049   doSynchNoise = ps.getUntrackedParameter<bool>("doSynchNoise", false);
00050   maxSynchNoiseRate =  ps.getUntrackedParameter<double>("maxSynchNoiseRate", 0.001);
00051 
00052 }

DTNoiseAnalysisTest::~DTNoiseAnalysisTest (  )  [virtual]

Destructor.

Definition at line 55 of file DTNoiseAnalysisTest.cc.

References LogTrace, and nevents.

00055                                          {
00056   LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "DTNoiseAnalysisTest: analyzed " << nevents << " events";
00057 }


Member Function Documentation

void DTNoiseAnalysisTest::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Analyze.

Implements edm::EDAnalyzer.

Definition at line 79 of file DTNoiseAnalysisTest.cc.

References LogTrace, and nevents.

00079                                                                                 {
00080 
00081   nevents++;
00082   if(nevents%1000 == 0) LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00083     << "[DTNoiseAnalysisTest]: "<<nevents<<" events";
00084 
00085 }

void DTNoiseAnalysisTest::beginJob ( const edm::EventSetup c  )  [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file DTNoiseAnalysisTest.cc.

References bookHistos(), edm::EventSetup::get(), LogTrace, muonGeom, and nevents.

00060                                                               {
00061   LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<"[DTNoiseAnalysisTest]: BeginJob"; 
00062 
00063   nevents = 0;
00064   // Get the geometry
00065   context.get<MuonGeometryRecord>().get(muonGeom);
00066 
00067   // book the histos
00068   bookHistos();  
00069 
00070 }

void DTNoiseAnalysisTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file DTNoiseAnalysisTest.cc.

References LogTrace.

00073                                                                                                         {
00074 
00075   LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") <<"[DTNoiseAnalysisTest]: Begin of LS transition";
00076 }

void DTNoiseAnalysisTest::bookHistos (  )  [protected]

book the summary histograms

Definition at line 215 of file DTNoiseAnalysisTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, doSynchNoise, noiseHistos, noisyCellHistos, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), summaryNoiseHisto, summarySynchNoiseHisto, and muonGeometry::wheel.

Referenced by beginJob().

00215                                      {
00216   
00217   dbe->setCurrentFolder("DT/04-Noise");
00218   string histoName;
00219 
00220   for(int wh=-2; wh<=2; wh++){
00221       stringstream wheel; wheel << wh;
00222       histoName =  "NoiseRateSummary_W" + wheel.str();
00223       noiseHistos[wh] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
00224       noiseHistos[wh]->setAxisTitle("rate (Hz)",1);
00225       noiseHistos[wh]->setAxisTitle("entries",2);
00226   }
00227   histoName =  "NoiseRateSummary";
00228   noiseHistos[3] = dbe->book1D(histoName.c_str(),histoName.c_str(),100,0,2000);
00229   noiseHistos[3]->setAxisTitle("rate (Hz)",1);
00230   noiseHistos[3]->setAxisTitle("entries",2);
00231 
00232   
00233   for(int wh=-2; wh<=2; wh++){
00234     stringstream wheel; wheel << wh;
00235     histoName =  "NoiseSummary_W" + wheel.str();
00236     noisyCellHistos[wh] = dbe->book2D(histoName.c_str(),"# of noisy channels",12,1,13,4,1,5);
00237     noisyCellHistos[wh]->setBinLabel(1,"MB1",2);
00238     noisyCellHistos[wh]->setBinLabel(2,"MB2",2);
00239     noisyCellHistos[wh]->setBinLabel(3,"MB3",2);
00240     noisyCellHistos[wh]->setBinLabel(4,"MB4",2);  
00241     noisyCellHistos[wh]->setAxisTitle("Sector",1);
00242   }
00243 
00244   histoName =  "NoiseSummary";
00245   summaryNoiseHisto =  dbe->book2D(histoName.c_str(),"# of noisy channels",12,1,13,5,-2,3);
00246   summaryNoiseHisto->setAxisTitle("Sector",1);
00247   summaryNoiseHisto->setAxisTitle("Wheel",2);
00248 
00249 
00250   if(doSynchNoise) {
00251     dbe->setCurrentFolder("DT/04-Noise/SynchNoise/");
00252     histoName =  "SynchNoiseSummary";
00253     summarySynchNoiseHisto = dbe->book2D(histoName.c_str(),"Summary Synch. Noise",12,1,13,5,-2,3);
00254     summarySynchNoiseHisto->setAxisTitle("Sector",1);
00255     summarySynchNoiseHisto->setAxisTitle("Wheel",2);
00256   }
00257 
00258 }

void DTNoiseAnalysisTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file DTNoiseAnalysisTest.cc.

References dbe, doSynchNoise, lat::endl(), MonitorElement::Fill(), DQMStore::get(), getMEName(), getSynchNoiseMEName(), MonitorElement::getTH2F(), histo, LogTrace, maxSynchNoiseRate, muonGeom, noiseHistos, noisyCellDef, noisyCellHistos, root::plot(), MonitorElement::Reset(), DTChamberId::sector(), sl, DTChamberId::station(), summaryNoiseHisto, summarySynchNoiseHisto, muonGeometry::wheel, and DTChamberId::wheel().

00087                                                                                                       {
00088   LogVerbatim ("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00089     <<"[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
00090 
00091   // Reset the summary plots
00092   for(map<int, MonitorElement* >::iterator plot =  noiseHistos.begin();
00093       plot != noiseHistos.end(); ++plot) {
00094     (*plot).second->Reset();
00095   }
00096   
00097   for(map<int,  MonitorElement* >::iterator plot = noisyCellHistos.begin();
00098       plot != noisyCellHistos.end(); ++plot) {
00099     (*plot).second->Reset();
00100   }
00101 
00102   summaryNoiseHisto->Reset();
00103 
00104 
00105 
00106   vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
00107   vector<DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
00108   
00109   LogTrace ("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00110     <<"[DTNoiseAnalysisTest]: Fill the summary histos";
00111 
00112   for (; ch_it != ch_end; ++ch_it) { // loop over chambers
00113     DTChamberId chID = (*ch_it)->id();
00114     
00115     MonitorElement * histo = dbe->get(getMEName(chID));
00116     
00117     if(histo) { // check the pointer
00118       
00119       TH2F * histo_root = histo->getTH2F();
00120       
00121       for(int sl = 1; sl != 4; ++sl) { // loop over SLs
00122         // skip theta SL in MB4 chambers
00123         if(chID.station() == 4 && sl == 2) continue;
00124 
00125         int binYlow = ((sl-1)*4)+1;
00126 
00127         for(int layer = 1; layer <= 4; ++layer) { // loop over layers
00128           
00129           // Get the layer ID
00130           DTLayerId layID(chID,sl,layer);
00131 
00132           int nWires = muonGeom->layer(layID)->specificTopology().channels();
00133           int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
00134 
00135           int binY = binYlow+(layer-1);
00136 
00137           for(int wire = firstWire; wire != (nWires+firstWire); wire++){ // loop over wires
00138 
00139             double noise = histo_root->GetBinContent(wire, binY);
00140             // fill the histos
00141             noiseHistos[chID.wheel()]->Fill(noise);
00142             noiseHistos[3]->Fill(noise);
00143             int sector = chID.sector();
00144             if(noise>noisyCellDef) {
00145               if(sector == 13) {
00146                 sector = 4;
00147               } else if(sector == 14) {
00148                 sector = 10;
00149               }
00150               noisyCellHistos[chID.wheel()]->Fill(sector,chID.station());
00151               summaryNoiseHisto->Fill(sector,chID.wheel());
00152             }
00153           }
00154         }
00155       }
00156     }
00157   }
00158 
00159 
00160   // build the summary of synch noise
00161   
00162 
00163   if(doSynchNoise) {
00164     LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00165       << "[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
00166     summarySynchNoiseHisto->Reset();
00167     for(int wheel = -2; wheel != 3; ++wheel) {
00168       // Get the histo produced by DTDigiTask
00169       MonitorElement * histoNoiseSynch = dbe->get(getSynchNoiseMEName(wheel));
00170       if(histoNoiseSynch != 0) {
00171         for(int sect = 1; sect != 13; ++sect) { // loop over sectors
00172           TH2F * histo = histoNoiseSynch->getTH2F();
00173           for(int sta = 1; sta != 5; ++sta) {
00174             LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00175               << "   Wheel: " << wheel << " sect: " << sect
00176               << " station: " << sta
00177               << " rate is: " << histo->GetBinContent(sect, sta) << endl;
00178             if(histo->GetBinContent(sect, sta) > maxSynchNoiseRate) {
00179               summarySynchNoiseHisto->Fill(sect,wheel,1);
00180             }
00181           }
00182         }
00183       } else {
00184         LogWarning("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
00185           << "   Histo: " << getSynchNoiseMEName(wheel) << " not found!" << endl;
00186       }
00187     }
00188 
00189   }
00190 
00191 }              

string DTNoiseAnalysisTest::getMEName ( const DTChamberId chID  )  [private]

Get the ME name.

Definition at line 194 of file DTNoiseAnalysisTest.cc.

References DTChamberId::sector(), DTChamberId::station(), muonGeometry::wheel, and DTChamberId::wheel().

Referenced by endLuminosityBlock().

00194                                                               {
00195   
00196   stringstream wheel; wheel << chID.wheel();    
00197   stringstream station; station << chID.station();      
00198   stringstream sector; sector << chID.sector(); 
00199   
00200   string folderName = 
00201     "DT/04-Noise/Wheel" +  wheel.str() +
00202 //     "/Station" + station.str() +
00203     "/Sector" + sector.str() + "/";
00204 
00205   string histoname = folderName + string("NoiseRate")  
00206     + "_W" + wheel.str() 
00207     + "_St" + station.str() 
00208     + "_Sec" + sector.str();
00209   
00210   return histoname;
00211   
00212 }

string DTNoiseAnalysisTest::getSynchNoiseMEName ( int  wheelId  )  const [private]

Definition at line 262 of file DTNoiseAnalysisTest.cc.

References muonGeometry::wheel.

Referenced by endLuminosityBlock().

00262                                                                  {
00263   
00264   stringstream wheel; wheel << wheelId; 
00265   string folderName = 
00266     "DT/04-Noise/SynchNoise/";
00267   string histoname = folderName + string("SyncNoiseEvents")  
00268     + "_W" + wheel.str();
00269 
00270   return histoname;
00271   
00272 }


Member Data Documentation

DQMStore* DTNoiseAnalysisTest::dbe [private]

Definition at line 70 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), DTNoiseAnalysisTest(), and endLuminosityBlock().

bool DTNoiseAnalysisTest::doSynchNoise [private]

Definition at line 84 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), DTNoiseAnalysisTest(), and endLuminosityBlock().

double DTNoiseAnalysisTest::maxSynchNoiseRate [private]

Definition at line 85 of file DTNoiseAnalysisTest.h.

Referenced by DTNoiseAnalysisTest(), and endLuminosityBlock().

edm::ESHandle<DTGeometry> DTNoiseAnalysisTest::muonGeom [private]

Definition at line 73 of file DTNoiseAnalysisTest.h.

Referenced by beginJob(), and endLuminosityBlock().

int DTNoiseAnalysisTest::nevents [private]

Definition at line 68 of file DTNoiseAnalysisTest.h.

Referenced by analyze(), beginJob(), and ~DTNoiseAnalysisTest().

std::map< int, MonitorElement* > DTNoiseAnalysisTest::noiseHistos [private]

Definition at line 79 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and endLuminosityBlock().

int DTNoiseAnalysisTest::noisyCellDef [private]

Definition at line 76 of file DTNoiseAnalysisTest.h.

Referenced by DTNoiseAnalysisTest(), and endLuminosityBlock().

std::map< int, MonitorElement* > DTNoiseAnalysisTest::noisyCellHistos [private]

Definition at line 80 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and endLuminosityBlock().

MonitorElement* DTNoiseAnalysisTest::summaryNoiseHisto [private]

Definition at line 81 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and endLuminosityBlock().

MonitorElement* DTNoiseAnalysisTest::summarySynchNoiseHisto [private]

Definition at line 82 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and endLuminosityBlock().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:58 2009 for CMSSW by  doxygen 1.5.4