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 Member Functions | Private Attributes
DTResolutionAnalysisTest Class Reference

#include <DTResolutionAnalysisTest.h>

Inheritance diagram for DTResolutionAnalysisTest:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void bookHistos ()
 book the summary histograms More...
 
void bookHistos (int wh)
 
void bookHistos (int wh, int sect)
 
 DTResolutionAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 DQM Client Diagnostic. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &c)
 
std::string getMEName (const DTSuperLayerId &slID)
 Get the ME name. More...
 
virtual ~DTResolutionAnalysisTest ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

bool meanInRange (double mean) const
 
void resetMEs ()
 
bool sigmaInRange (double sigma) const
 
int slFromBin (int bin) const
 
int stationFromBin (int bin) const
 

Private Attributes

DQMStoredbe
 
bool doCalibAnalysis
 
MonitorElementglobalResSummary
 
std::map< int, MonitorElement * > meanDistr
 
std::map< std::pair< int, int >
, MonitorElement * > 
MeanHistos
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
int percentual
 
double permittedMeanRange
 
double permittedSigmaRange
 
int prescaleFactor
 
int run
 
std::map< int, MonitorElement * > sigmaDistr
 
std::map< std::pair< int, int >
, MonitorElement * > 
SigmaHistos
 
std::string topHistoFolder
 
std::map< int, MonitorElement * > wheelMeanHistos
 
std::map< int, MonitorElement * > wheelSigmaHistos
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 31 of file DTResolutionAnalysisTest.h.

Constructor & Destructor Documentation

DTResolutionAnalysisTest::DTResolutionAnalysisTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 38 of file DTResolutionAnalysisTest.cc.

References edm::ParameterSet::getUntrackedParameter(), LogTrace, cmsCodeRules.cppFunctionSkipper::operator, and dtDQMClient_cfg::prescaleFactor.

38  {
39 
40  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTResolutionAnalysisTest]: Constructor";
41 
43 
44  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
45  // permitted test range
46  permittedMeanRange = ps.getUntrackedParameter<double>("permittedMeanRange",0.005);
47  permittedSigmaRange = ps.getUntrackedParameter<double>("permittedSigmaRange",0.01);
48  // top folder for the histograms in DQMStore
49  topHistoFolder = ps.getUntrackedParameter<string>("topHistoFolder","DT/02-Segments");
50 
51  doCalibAnalysis = ps.getUntrackedParameter<bool>("doCalibAnalysis",false);
52 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTResolutionAnalysisTest::~DTResolutionAnalysisTest ( )
virtual

Destructor.

Definition at line 55 of file DTResolutionAnalysisTest.cc.

References LogTrace, and nevents.

55  {
56 
57  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "DTResolutionAnalysisTest: analyzed " << nevents << " events";
58 
59 }
#define LogTrace(id)

Member Function Documentation

void DTResolutionAnalysisTest::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 91 of file DTResolutionAnalysisTest.cc.

References nevents.

91  {
92 
93  nevents++;
94 
95 }
void DTResolutionAnalysisTest::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file DTResolutionAnalysisTest.cc.

References LogTrace, and nevents.

62  {
63 
64  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: BeginJob";
65 
66  nevents = 0;
67 
68 }
#define LogTrace(id)
void DTResolutionAnalysisTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file DTResolutionAnalysisTest.cc.

References LogTrace, edm::LuminosityBlockBase::run(), and DTTTrigCorrFirst::run.

80  {
81 
82  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: Begin of LS transition";
83 
84  // Get the run number
85  run = lumiSeg.run();
86 
87 }
#define LogTrace(id)
void DTResolutionAnalysisTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file DTResolutionAnalysisTest.cc.

References edm::EventSetup::get(), and LogTrace.

70  {
71 
72  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: BeginRun";
73 
74  // Get the geometry
75  context.get<MuonGeometryRecord>().get(muonGeom);
76 
77 }
edm::ESHandle< DTGeometry > muonGeom
#define LogTrace(id)
void DTResolutionAnalysisTest::bookHistos ( )

book the summary histograms

Definition at line 104 of file DTResolutionAnalysisTest.cc.

References bookHistos().

104  {
105 
106  // global residual summary
108  globalResSummary = dbe->book2D("ResidualsGlbSummary", "# of SLs with good mean and good sigma of residuals",12,1,13,5,-2,3);
109 
110  // book summaries for mean and sigma
111  dbe->setCurrentFolder(topHistoFolder + "/00-MeanRes");
112  meanDistr[-2] = dbe->book1D("MeanDistr","Mean value of the residuals all (cm)",
113  100,-0.1,0.1);
114  meanDistr[-1] = dbe->book1D("MeanDistr_Phi","Mean value of the residuals #phi SL (cm)",
115  100,-0.1,0.1);
116  meanDistr[0] = dbe->book1D("MeanDistr_ThetaWh0","Mean values of the residuals #theta SL Wh 0 (cm)",
117  100,-0.1,0.1);
118  meanDistr[1] = dbe->book1D("MeanDistr_ThetaWh1","Mean value of the residuals #theta SL Wh +/-1 (cm)",
119  100,-0.1,0.1);
120  meanDistr[2] = dbe->book1D("MeanDistr_ThetaWh2","Mean value of the residuals #theta SL Wh +/-2 (cm)",
121  100,-0.1,0.1);
122 
123 
124  stringstream meanRange; meanRange << (permittedMeanRange*10000);
125  string histoTitle = "# of SLs with good mean of residuals";
126  wheelMeanHistos[3] = dbe->book2D("MeanResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
127  wheelMeanHistos[3]->setAxisTitle("Sector",1);
128  wheelMeanHistos[3]->setAxisTitle("Wheel",2);
129 
130 
131  dbe->setCurrentFolder(topHistoFolder + "/01-SigmaRes");
132  sigmaDistr[-2] = dbe->book1D("SigmaDistr","Sigma value of the residuals all (cm)",
133  50,0.0,0.2);
134  sigmaDistr[-1] = dbe->book1D("SigmaDistr_Phi","Sigma value of the residuals #phi SL (cm)",
135  50,0.0,0.2);
136  sigmaDistr[0] = dbe->book1D("SigmaDistr_ThetaWh0","Sigma value of the residuals #theta SL Wh 0 (cm)",
137  50,0.0,0.2);
138  sigmaDistr[1] = dbe->book1D("SigmaDistr_ThetaWh1","Sigma value of the residuals #theta SL Wh +/-1 (cm)",
139  50,0.0,0.2);
140  sigmaDistr[2] = dbe->book1D("SigmaDistr_ThetaWh2","Sigma value of the residuals #theta SL Wh +/-2 (cm)",
141  50,0.0,0.2);
142 
143  stringstream sigmaRange; sigmaRange << (permittedSigmaRange*10000);
144  histoTitle = "# of SLs with good sigma of residuals";
145  wheelSigmaHistos[3] = dbe->book2D("SigmaResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
146  wheelSigmaHistos[3]->setAxisTitle("Sector",1);
147  wheelSigmaHistos[3]->setAxisTitle("Wheel",2);
148 
149 
150  // loop over all the CMS wheels, sectors & book the summary histos
151  for (int wheel=-2; wheel<=2; wheel++){
152  bookHistos(wheel);
153  for (int sector=1; sector<=12; sector++){
154  bookHistos(wheel, sector);
155  }
156  }
157 
158 }
std::map< int, MonitorElement * > sigmaDistr
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void bookHistos()
book the summary histograms
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
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:642
std::map< int, MonitorElement * > meanDistr
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void DTResolutionAnalysisTest::bookHistos ( int  wh)

Definition at line 292 of file DTResolutionAnalysisTest.cc.

292  {
293 
294  stringstream wheel; wheel <<wh;
295 
296  dbe->setCurrentFolder(topHistoFolder + "/00-MeanRes");
297  string histoName = "MeanSummaryRes_W" + wheel.str();
298  stringstream meanRange; meanRange << (permittedMeanRange*10000);
299  string histoTitle = "# of SLs with wrong mean of residuals (Wheel " + wheel.str() + ")";
300  wheelMeanHistos[wh] = dbe->book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
301  wheelMeanHistos[wh]->setAxisTitle("Sector",1);
302  wheelMeanHistos[wh]->setBinLabel(1,"MB1_SL1",2);
303  wheelMeanHistos[wh]->setBinLabel(2,"MB1_SL2",2);
304  wheelMeanHistos[wh]->setBinLabel(3,"MB1_SL3",2);
305  wheelMeanHistos[wh]->setBinLabel(4,"MB2_SL1",2);
306  wheelMeanHistos[wh]->setBinLabel(5,"MB2_SL2",2);
307  wheelMeanHistos[wh]->setBinLabel(6,"MB2_SL3",2);
308  wheelMeanHistos[wh]->setBinLabel(7,"MB3_SL1",2);
309  wheelMeanHistos[wh]->setBinLabel(8,"MB3_SL2",2);
310  wheelMeanHistos[wh]->setBinLabel(9,"MB3_SL3",2);
311  wheelMeanHistos[wh]->setBinLabel(10,"MB4_SL1",2);
312  wheelMeanHistos[wh]->setBinLabel(11,"MB4_SL3",2);
313 // wheelMeanHistos[wh]->setBinLabel(12,"MB4_SL1",2);
314 // wheelMeanHistos[wh]->setBinLabel(13,"MB4_SL3",2);
315 
316 
317 
318  dbe->setCurrentFolder(topHistoFolder + "/01-SigmaRes");
319  histoName = "SigmaSummaryRes_W" + wheel.str();
320  stringstream sigmaRange; sigmaRange << (permittedSigmaRange*10000);
321  histoTitle = "# of SLs with wrong sigma of residuals (Wheel " + wheel.str() + ")";
322  wheelSigmaHistos[wh] = dbe->book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
323  wheelSigmaHistos[wh]->setAxisTitle("Sector",1);
324  wheelSigmaHistos[wh]->setBinLabel(1,"MB1_SL1",2);
325  wheelSigmaHistos[wh]->setBinLabel(2,"MB1_SL2",2);
326  wheelSigmaHistos[wh]->setBinLabel(3,"MB1_SL3",2);
327  wheelSigmaHistos[wh]->setBinLabel(4,"MB2_SL1",2);
328  wheelSigmaHistos[wh]->setBinLabel(5,"MB2_SL2",2);
329  wheelSigmaHistos[wh]->setBinLabel(6,"MB2_SL3",2);
330  wheelSigmaHistos[wh]->setBinLabel(7,"MB3_SL1",2);
331  wheelSigmaHistos[wh]->setBinLabel(8,"MB3_SL2",2);
332  wheelSigmaHistos[wh]->setBinLabel(9,"MB3_SL3",2);
333  wheelSigmaHistos[wh]->setBinLabel(10,"MB4_SL1",2);
334  wheelSigmaHistos[wh]->setBinLabel(11,"MB4_SL3",2);
335 // wheelSigmaHistos[wh]->setBinLabel(12,"MB4_SL1",2);
336 // wheelSigmaHistos[wh]->setBinLabel(13,"MB4_SL3",2);
337 
338 }
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
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:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void DTResolutionAnalysisTest::bookHistos ( int  wh,
int  sect 
)

Definition at line 341 of file DTResolutionAnalysisTest.cc.

341  {
342 
343  stringstream wheel; wheel << wh;
344  stringstream sector; sector << sect;
345 
346 
347  string MeanHistoName = "MeanTest_W" + wheel.str() + "_Sec" + sector.str();
348  string SigmaHistoName = "SigmaTest_W" + wheel.str() + "_Sec" + sector.str();
349 
350  string folder = topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str();
351  dbe->setCurrentFolder(folder);
352 
353  if(sect!=4 && sect!=10) {
354  MeanHistos[make_pair(wh,sect)] =
355  dbe->book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",11,1,12);
356  } else {
357  MeanHistos[make_pair(wh,sect)] =
358  dbe->book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",13,1,14);
359  }
360  (MeanHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
361  (MeanHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
362  (MeanHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
363  (MeanHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
364  (MeanHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
365  (MeanHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
366  (MeanHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
367  (MeanHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
368  (MeanHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
369  (MeanHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
370  (MeanHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
371  if(sect==4){
372  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
373  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
374  }
375  if(sect==10){
376  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
377  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
378  }
379 
380  if(sect!=4 && sect!=10) {
381  SigmaHistos[make_pair(wh,sect)] =
382  dbe->book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",11,1,12);
383  } else {
384  SigmaHistos[make_pair(wh,sect)] =
385  dbe->book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",13,1,14);
386  }
387  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
388  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
389  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
390  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
391  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
392  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
393  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
394  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
395  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
396  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
397  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
398  if(sect==4){
399  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
400  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
401  }
402  if(sect==10){
403  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
404  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
405  }
406 
407 
408 }
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
void DTResolutionAnalysisTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 99 of file DTResolutionAnalysisTest.cc.

99  {
100 
101 }
void DTResolutionAnalysisTest::endRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 160 of file DTResolutionAnalysisTest.cc.

References abs, bookHistos(), HcalObjRepresent::Fill(), MonitorElement::getMean(), MonitorElement::getRMS(), MonitorElement::getTH1F(), LogTrace, plotscripts::mean(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTSuperLayerId::superlayer(), CommonMethods::weight(), and DTChamberId::wheel().

160  {
161 
162  if (!dbe->dirExists(topHistoFolder)) {
163  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
164  <<"[DTResolutionAnalysisTest]: Base folder " << topHistoFolder
165  << " does not exist. Skipping client operation." << endl;
166  return;
167  }
168 
169  bookHistos(); // histos booked only if top histo folder exist
170  // as Standard/AlcaReco Harvest is performed in the same step
171 
172  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
173  << "[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
174 
175  // reset the ME with fixed scale
176  resetMEs();
177 
178  for (vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
179  ch_it != muonGeom->chambers().end(); ++ch_it) { // loop over the chambers
180 
181  DTChamberId chID = (*ch_it)->id();
182 
183  // Fill the test histos
184  for(vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
185  sl_it != (*ch_it)->superLayers().end(); ++sl_it) { // loop over SLs
186 
187 
188  DTSuperLayerId slID = (*sl_it)->id();
189  MonitorElement * res_histo = dbe->get(getMEName(slID));
190 
191  if(res_histo) { // Gaussian Fit
192  float statMean = res_histo->getMean(1);
193  float statSigma = res_histo->getRMS(1);
194  double mean = -1;
195  double sigma = -1;
196  TH1F * histo_root = res_histo->getTH1F();
197 
198  // fill the summaries
199  int entry= (chID.station() - 1) * 3;
200  int binSect = slID.sector();
201  if(slID.sector() == 13) binSect = 4;
202  else if(slID.sector() == 14) binSect = 10;
203  int binSL = entry+slID.superLayer();
204  if(chID.station() == 4 && slID.superLayer() == 3) binSL--;
205  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==1) binSL=12;
206  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==3) binSL=13;
207 
208  if(histo_root->GetEntries()>20) {
209  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
210  try {
211  histo_root->Fit(gfit, "Q0", "", -0.1, 0.1);
212  } catch (...) {
213  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
214  << "[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
215  // FIXME: the SL is set as OK in the summary
216  double weight = 1/11.;
217  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
218  globalResSummary->Fill(binSect, slID.wheel(), weight);
219  continue;
220  }
221 
222  if(gfit){
223  // get the mean and the sigma of the distribution
224  mean = gfit->GetParameter(1);
225  sigma = gfit->GetParameter(2);
226 
227  // fill the distributions
228  meanDistr[-2]->Fill(mean);
229  sigmaDistr[-2]->Fill(sigma);
230  if(slID.superlayer() == 2) {
231  meanDistr[abs(slID.wheel())]->Fill(mean);
232  sigmaDistr[abs(slID.wheel())]->Fill(sigma);
233  } else {
234  meanDistr[-1]->Fill(mean);
235  sigmaDistr[-1]->Fill(sigma);
236  }
237 
238  // sector summaries
239  MeanHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, mean);
240  SigmaHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, sigma);
241 
242  // set the weight
243  double weight = 1;
244  if(binSect == 13) binSect = 4;
245  if(binSect == 14) binSect = 10;
246  if((binSect == 13 || binSect == 14) && binSL == 12) binSL=10;
247  if((binSect == 13 || binSect == 14) && binSL == 13) binSL=11;
248 
249  // test the values of mean and sigma
250  if(meanInRange(mean) && sigmaInRange(sigma)) { // sigma and mean ok
251  globalResSummary->Fill(binSect, slID.wheel(), weight);
252  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
253  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
254  } else {
255  if(!meanInRange(mean)) { // only sigma ok
256  wheelMeanHistos[slID.wheel()]->Fill(binSect,binSL);
257  } else {
258  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
259  }
260  if(!sigmaInRange(sigma)) { // only mean ok
261  wheelSigmaHistos[slID.wheel()]->Fill(binSect,binSL);
262  } else {
263  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
264  }
265  }
266  }
267  delete gfit;
268  }
269  else{
270  LogVerbatim ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
271  << "[DTResolutionAnalysisTask] Fit of " << slID
272  << " not performed because # entries < 20 ";
273  // FIXME: the SL is set as OK in the summary
274  double weight = 1;
275  if(binSect == 13) binSect = 4;
276  if(binSect == 14) binSect = 10;
277  globalResSummary->Fill(binSect, slID.wheel(), weight);
278  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
279  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
280  }
281  } else {
282  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
283  << "[DTResolutionAnalysisTask] Histo: " << getMEName(slID) << " not found" << endl;
284  }
285  } // loop on SLs
286  } // Loop on Stations
287 
288 }
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
std::map< int, MonitorElement * > sigmaDistr
#define abs(x)
Definition: mlp_lapack.h:159
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
bool meanInRange(double mean) const
edm::ESHandle< DTGeometry > muonGeom
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
int superLayer() const
Return the superlayer number.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1265
#define LogTrace(id)
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:296
int superlayer() const
Return the superlayer number (deprecated method name)
void bookHistos()
book the summary histograms
TH1F * getTH1F(void) const
std::map< int, MonitorElement * > wheelMeanHistos
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
int sector() const
Definition: DTChamberId.h:63
std::map< int, MonitorElement * > wheelSigmaHistos
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
std::map< int, MonitorElement * > meanDistr
bool sigmaInRange(double sigma) const
string DTResolutionAnalysisTest::getMEName ( const DTSuperLayerId slID)

Get the ME name.

Definition at line 411 of file DTResolutionAnalysisTest.cc.

References DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), and DTChamberId::wheel().

411  {
412 
413  stringstream wheel; wheel << slID.wheel();
414  stringstream station; station << slID.station();
415  stringstream sector; sector << slID.sector();
416  stringstream superLayer; superLayer << slID.superlayer();
417 
418  string folderName =
419  topHistoFolder + "/Wheel" + wheel.str() +
420  "/Sector" + sector.str() +
421  "/Station" + station.str() + "/";
422 
423  if(doCalibAnalysis) folderName =
424  "DT/DTCalibValidation/Wheel" + wheel.str() +
425  "/Station" + station.str() + "/Sector" + sector.str() + "/";
426 
427  string histoname = folderName + "hResDist"
428  + "_W" + wheel.str()
429  + "_St" + station.str()
430  + "_Sec" + sector.str()
431  + "_SL" + superLayer.str();
432 
433  if(doCalibAnalysis) histoname = folderName + "hResDist_STEP3"
434  + "_W" + wheel.str()
435  + "_St" + station.str()
436  + "_Sec" + sector.str()
437  + "_SL" + superLayer.str();
438 
439  return histoname;
440 
441 }
int superlayer() const
Return the superlayer number (deprecated method name)
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
bool DTResolutionAnalysisTest::meanInRange ( double  mean) const
private

Definition at line 458 of file DTResolutionAnalysisTest.cc.

458  {
459  return fabs(mean) < permittedMeanRange;
460 }
void DTResolutionAnalysisTest::resetMEs ( )
private

Definition at line 468 of file DTResolutionAnalysisTest.cc.

References trackerHits::histo.

468  {
470  // Reset the summary histo
471  for(map<int, MonitorElement*> ::const_iterator histo = wheelMeanHistos.begin();
472  histo != wheelMeanHistos.end();
473  histo++) {
474  (*histo).second->Reset();
475  }
476  for(map<int, MonitorElement*> ::const_iterator histo = wheelSigmaHistos.begin();
477  histo != wheelSigmaHistos.end();
478  histo++) {
479  (*histo).second->Reset();
480  }
481 
482  for(int indx = -2; indx != 3; ++indx) {
483  meanDistr[indx]->Reset();
484  sigmaDistr[indx]->Reset();
485  }
486 }
std::map< int, MonitorElement * > sigmaDistr
tuple histo
Definition: trackerHits.py:12
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, MonitorElement * > meanDistr
bool DTResolutionAnalysisTest::sigmaInRange ( double  sigma) const
private

Definition at line 463 of file DTResolutionAnalysisTest.cc.

463  {
464  return sigma < permittedSigmaRange;
465 }
int DTResolutionAnalysisTest::slFromBin ( int  bin) const
private

Definition at line 450 of file DTResolutionAnalysisTest.cc.

References runTheMatrix::ret.

450  {
451  int ret = bin%3;
452  if(ret == 0 || bin == 11) ret = 3;
453 
454  return ret;
455 }
int DTResolutionAnalysisTest::stationFromBin ( int  bin) const
private

Definition at line 445 of file DTResolutionAnalysisTest.cc.

445  {
446  return (int) (bin /3.1)+1;
447 }

Member Data Documentation

DQMStore* DTResolutionAnalysisTest::dbe
private

Definition at line 75 of file DTResolutionAnalysisTest.h.

bool DTResolutionAnalysisTest::doCalibAnalysis
private

Definition at line 81 of file DTResolutionAnalysisTest.h.

MonitorElement* DTResolutionAnalysisTest::globalResSummary
private

Definition at line 104 of file DTResolutionAnalysisTest.h.

std::map< int, MonitorElement* > DTResolutionAnalysisTest::meanDistr
private

Definition at line 92 of file DTResolutionAnalysisTest.h.

std::map< std::pair<int,int> , MonitorElement* > DTResolutionAnalysisTest::MeanHistos
private

Definition at line 86 of file DTResolutionAnalysisTest.h.

edm::ESHandle<DTGeometry> DTResolutionAnalysisTest::muonGeom
private

Definition at line 83 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::nevents
private

Definition at line 69 of file DTResolutionAnalysisTest.h.

unsigned int DTResolutionAnalysisTest::nLumiSegs
private

Definition at line 70 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::percentual
private

Definition at line 73 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::permittedMeanRange
private

Definition at line 78 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::permittedSigmaRange
private

Definition at line 79 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::prescaleFactor
private

Definition at line 71 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::run
private
std::map< int, MonitorElement* > DTResolutionAnalysisTest::sigmaDistr
private

Definition at line 93 of file DTResolutionAnalysisTest.h.

std::map< std::pair<int,int> , MonitorElement* > DTResolutionAnalysisTest::SigmaHistos
private

Definition at line 87 of file DTResolutionAnalysisTest.h.

std::string DTResolutionAnalysisTest::topHistoFolder
private

Definition at line 107 of file DTResolutionAnalysisTest.h.

std::map< int, MonitorElement* > DTResolutionAnalysisTest::wheelMeanHistos
private

Definition at line 89 of file DTResolutionAnalysisTest.h.

std::map< int, MonitorElement* > DTResolutionAnalysisTest::wheelSigmaHistos
private

Definition at line 90 of file DTResolutionAnalysisTest.h.