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 (int wh)
 book the summary histograms More...
 
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, ExpressReco_HICollisions_FallBack::prescaleFactor, and ExpressReco_HICollisions_FallBack::topHistoFolder.

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  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "DTResolutionAnalysisTest: analyzed " << nevents << " events";
57 
58 }
#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 145 of file DTResolutionAnalysisTest.cc.

References nevents.

145  {
146 
147  nevents++;
148 
149 }
void DTResolutionAnalysisTest::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 61 of file DTResolutionAnalysisTest.cc.

References bookHistos(), LogTrace, nevents, and ExpressReco_HICollisions_FallBack::topHistoFolder.

61  {
62 
63  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: BeginJob";
64 
65  nevents = 0;
66 
67  // global residual summary
69  globalResSummary = dbe->book2D("ResidualsGlbSummary", "Summary residuals",12,1,13,5,-2,3);
70 
71 
72 
73  // book summaries for mean and sigma
74  dbe->setCurrentFolder(topHistoFolder + "/00-MeanRes");
75  meanDistr[-2] = dbe->book1D("MeanDistr","Mean value of the residuals all (cm)",
76  100,-0.1,0.1);
77  meanDistr[-1] = dbe->book1D("MeanDistr_Phi","Mean value of the residuals #phi SL (cm)",
78  100,-0.1,0.1);
79  meanDistr[0] = dbe->book1D("MeanDistr_ThetaWh0","Mean values of the residuals #theta SL Wh 0 (cm)",
80  100,-0.1,0.1);
81  meanDistr[1] = dbe->book1D("MeanDistr_ThetaWh1","Mean value of the residuals #theta SL Wh +/-1 (cm)",
82  100,-0.1,0.1);
83  meanDistr[2] = dbe->book1D("MeanDistr_ThetaWh2","Mean value of the residuals #theta SL Wh +/-2 (cm)",
84  100,-0.1,0.1);
85 
86 
87  stringstream meanRange; meanRange << (permittedMeanRange*10000);
88  string histoTitle = "Fraction of SLs with |mean of res.| > " + meanRange.str() + "#mum";
89  wheelMeanHistos[3] = dbe->book2D("MeanResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
90  wheelMeanHistos[3]->setAxisTitle("Sector",1);
91  wheelMeanHistos[3]->setAxisTitle("Wheel",2);
92 
93 
94  dbe->setCurrentFolder(topHistoFolder + "/01-SigmaRes");
95  sigmaDistr[-2] = dbe->book1D("SigmaDistr","Sigma value of the residuals all (cm)",
96  50,0.0,0.2);
97  sigmaDistr[-1] = dbe->book1D("SigmaDistr_Phi","Sigma value of the residuals #phi SL (cm)",
98  50,0.0,0.2);
99  sigmaDistr[0] = dbe->book1D("SigmaDistr_ThetaWh0","Sigma value of the residuals #theta SL Wh 0 (cm)",
100  50,0.0,0.2);
101  sigmaDistr[1] = dbe->book1D("SigmaDistr_ThetaWh1","Sigma value of the residuals #theta SL Wh +/-1 (cm)",
102  50,0.0,0.2);
103  sigmaDistr[2] = dbe->book1D("SigmaDistr_ThetaWh2","Sigma value of the residuals #theta SL Wh +/-2 (cm)",
104  50,0.0,0.2);
105 
106  stringstream sigmaRange; sigmaRange << (permittedSigmaRange*10000);
107  histoTitle = "Fraction of SLs with #sigma res. > " + sigmaRange.str() + "#mum";
108  wheelSigmaHistos[3] = dbe->book2D("SigmaResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
109  wheelSigmaHistos[3]->setAxisTitle("Sector",1);
110  wheelSigmaHistos[3]->setAxisTitle("Wheel",2);
111 
112 
113  // loop over all the CMS wheels, sectors & book the summary histos
114  for (int wheel=-2; wheel<=2; wheel++){
115  bookHistos(wheel);
116  for (int sector=1; sector<=12; sector++){
117  bookHistos(wheel, sector);
118  }
119  }
120 
121 }
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:519
#define LogTrace(id)
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
void bookHistos(int wh)
book the summary histograms
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:647
std::map< int, MonitorElement * > meanDistr
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void DTResolutionAnalysisTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file DTResolutionAnalysisTest.cc.

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

133  {
134 
135  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: Begin of LS transition";
136 
137  // Get the run number
138  run = lumiSeg.run();
139 
140 
141 }
#define LogTrace(id)
void DTResolutionAnalysisTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file DTResolutionAnalysisTest.cc.

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

123  {
124 
125  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: BeginRun";
126 
127  // Get the geometry
128  context.get<MuonGeometryRecord>().get(muonGeom);
129 
130 }
edm::ESHandle< DTGeometry > muonGeom
#define LogTrace(id)
void DTResolutionAnalysisTest::bookHistos ( int  wh)

book the summary histograms

Definition at line 283 of file DTResolutionAnalysisTest.cc.

References ExpressReco_HICollisions_FallBack::topHistoFolder.

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

Definition at line 332 of file DTResolutionAnalysisTest.cc.

References ExpressReco_HICollisions_FallBack::topHistoFolder.

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

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file DTResolutionAnalysisTest.cc.

153  {
154 }
void DTResolutionAnalysisTest::endRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file DTResolutionAnalysisTest.cc.

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

157  {
158 
159 
160  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation";
161 
162 // // counts number of lumiSegs
163 // nLumiSegs = lumiSeg.id().luminosityBlock();
164 
165 // // prescale factor
166 // if ( nLumiSegs%prescaleFactor != 0 ) return;
167 
168  // reset the ME with fixed scale
169  resetMEs();
170 
171  for (vector<DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
172  ch_it != muonGeom->chambers().end(); ++ch_it) { // loop over the chambers
173 
174  DTChamberId chID = (*ch_it)->id();
175 
176  // Fill the test histos
177  for(vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
178  sl_it != (*ch_it)->superLayers().end(); ++sl_it) { // loop over SLs
179 
180 
181  DTSuperLayerId slID = (*sl_it)->id();
182  MonitorElement * res_histo = dbe->get(getMEName(slID));
183 
184  if(res_histo) { // Gaussian Fit
185  float statMean = res_histo->getMean(1);
186  float statSigma = res_histo->getRMS(1);
187  double mean = -1;
188  double sigma = -1;
189  TH1F * histo_root = res_histo->getTH1F();
190 
191  // fill the summaries
192  int entry= (chID.station() - 1) * 3;
193  int binSect = slID.sector();
194  if(slID.sector() == 13) binSect = 4;
195  else if(slID.sector() == 14) binSect = 10;
196  int binSL = entry+slID.superLayer();
197  if(chID.station() == 4 && slID.superLayer() == 3) binSL--;
198  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==1) binSL=12;
199  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==3) binSL=13;
200 
201  if(histo_root->GetEntries()>20) {
202  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
203  try {
204  histo_root->Fit(gfit, "Q0", "", -0.1, 0.1);
205  } catch (...) {
206  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
207  << "[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
208  // FIXME: the SL is set as OK in the summary
209  double weight = 1/11.;
210  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
211  globalResSummary->Fill(binSect, slID.wheel(), weight);
212  continue;
213  }
214 
215  if(gfit){
216  // get the mean and the sigma of the distribution
217  mean = gfit->GetParameter(1);
218  sigma = gfit->GetParameter(2);
219 
220  // fill the distributions
221  meanDistr[-2]->Fill(mean);
222  sigmaDistr[-2]->Fill(sigma);
223  if(slID.superlayer() == 2) {
224  meanDistr[abs(slID.wheel())]->Fill(mean);
225  sigmaDistr[abs(slID.wheel())]->Fill(sigma);
226  } else {
227  meanDistr[-1]->Fill(mean);
228  sigmaDistr[-1]->Fill(sigma);
229  }
230 
231 
232 
233  // sector summaries
234  MeanHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, mean);
235  SigmaHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, sigma);
236 
237  // set the weight
238  double weight = 1/11.;
239  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
240 
241  // test the values of mean and sigma
242  if(meanInRange(mean) && sigmaInRange(sigma)) { // sigma and mean ok
243  globalResSummary->Fill(binSect, slID.wheel(), weight);
244  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
245  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
246  } else {
247  if(!meanInRange(mean)) { // only sigma ok
248  wheelMeanHistos[slID.wheel()]->Fill(binSect,binSL);
249  } else {
250  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
251  }
252  if(!sigmaInRange(sigma)) { // only mean ok
253  wheelSigmaHistos[slID.wheel()]->Fill(binSect,binSL);
254  } else {
255  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
256  }
257  }
258  }
259  delete gfit;
260  }
261  else{
262  LogVerbatim ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
263  << "[DTResolutionAnalysisTask] Fit of " << slID
264  << " not performed because # entries < 20 ";
265  // FIXME: the SL is set as OK in the summary
266  double weight = 1/11.;
267  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
268  globalResSummary->Fill(binSect, slID.wheel(), weight);
269  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
270  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
271  }
272  } else {
273  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
274  << "[DTResolutionAnalysisTask] Histo: " << getMEName(slID) << " not found" << endl;
275  }
276  } // loop on SLs
277  } // Loop on Stations
278 
279 }
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
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:1270
#define LogTrace(id)
int superlayer() const
Return the superlayer number (deprecated method name)
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 402 of file DTResolutionAnalysisTest.cc.

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

402  {
403 
404  stringstream wheel; wheel << slID.wheel();
405  stringstream station; station << slID.station();
406  stringstream sector; sector << slID.sector();
407  stringstream superLayer; superLayer << slID.superlayer();
408 
409  string folderName =
410  topHistoFolder + "/Wheel" + wheel.str() +
411  "/Sector" + sector.str() +
412  "/Station" + station.str() + "/";
413 
414  if(doCalibAnalysis) folderName =
415  "DT/DTCalibValidation/Wheel" + wheel.str() +
416  "/Station" + station.str() + "/Sector" + sector.str() + "/";
417 
418  string histoname = folderName + "hResDist"
419  + "_W" + wheel.str()
420  + "_St" + station.str()
421  + "_Sec" + sector.str()
422  + "_SL" + superLayer.str();
423 
424  if(doCalibAnalysis) histoname = folderName + "hResDist_STEP3"
425  + "_W" + wheel.str()
426  + "_St" + station.str()
427  + "_Sec" + sector.str()
428  + "_SL" + superLayer.str();
429 
430  return histoname;
431 
432 }
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 449 of file DTResolutionAnalysisTest.cc.

449  {
450  return fabs(mean) < permittedMeanRange;
451 }
void DTResolutionAnalysisTest::resetMEs ( )
private

Definition at line 459 of file DTResolutionAnalysisTest.cc.

References trackerHits::histo.

459  {
461  // Reset the summary histo
462  for(map<int, MonitorElement*> ::const_iterator histo = wheelMeanHistos.begin();
463  histo != wheelMeanHistos.end();
464  histo++) {
465  (*histo).second->Reset();
466  }
467  for(map<int, MonitorElement*> ::const_iterator histo = wheelSigmaHistos.begin();
468  histo != wheelSigmaHistos.end();
469  histo++) {
470  (*histo).second->Reset();
471  }
472 
473  for(int indx = -2; indx != 3; ++indx) {
474  meanDistr[indx]->Reset();
475  sigmaDistr[indx]->Reset();
476  }
477 }
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
int DTResolutionAnalysisTest::slFromBin ( int  bin) const
private

Definition at line 441 of file DTResolutionAnalysisTest.cc.

References runTheMatrix::ret.

441  {
442  int ret = bin%3;
443  if(ret == 0 || bin == 11) ret = 3;
444 
445  return ret;
446 }
int DTResolutionAnalysisTest::stationFromBin ( int  bin) const
private

Definition at line 436 of file DTResolutionAnalysisTest.cc.

436  {
437  return (int) (bin /3.1)+1;
438 }

Member Data Documentation

DQMStore* DTResolutionAnalysisTest::dbe
private

Definition at line 74 of file DTResolutionAnalysisTest.h.

bool DTResolutionAnalysisTest::doCalibAnalysis
private

Definition at line 80 of file DTResolutionAnalysisTest.h.

MonitorElement* DTResolutionAnalysisTest::globalResSummary
private

Definition at line 103 of file DTResolutionAnalysisTest.h.

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

Definition at line 91 of file DTResolutionAnalysisTest.h.

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

Definition at line 85 of file DTResolutionAnalysisTest.h.

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

Definition at line 82 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::nevents
private

Definition at line 68 of file DTResolutionAnalysisTest.h.

unsigned int DTResolutionAnalysisTest::nLumiSegs
private

Definition at line 69 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::percentual
private

Definition at line 72 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::permittedMeanRange
private

Definition at line 77 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::permittedSigmaRange
private

Definition at line 78 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::prescaleFactor
private

Definition at line 70 of file DTResolutionAnalysisTest.h.

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

Definition at line 92 of file DTResolutionAnalysisTest.h.

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

Definition at line 86 of file DTResolutionAnalysisTest.h.

std::string DTResolutionAnalysisTest::topHistoFolder
private

Definition at line 106 of file DTResolutionAnalysisTest.h.

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

Definition at line 88 of file DTResolutionAnalysisTest.h.

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

Definition at line 89 of file DTResolutionAnalysisTest.h.