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 edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

DQMStoredbe
 
bool doCalibAnalysis
 
MonitorElementglobalResSummary
 
double maxGoodMeanValue
 
double maxGoodSigmaValue
 
std::map< int, MonitorElement * > meanDistr
 
std::map< std::pair< int, int >
, MonitorElement * > 
MeanHistos
 
double minBadMeanValue
 
double minBadSigmaValue
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
int percentual
 
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
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 29 of file DTResolutionAnalysisTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 36 of file DTResolutionAnalysisTest.cc.

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

36  {
37 
38  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTResolutionAnalysisTest]: Constructor";
39 
41 
42  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
43  // permitted test range
44  maxGoodMeanValue = ps.getUntrackedParameter<double>("maxGoodMeanValue",0.02);
45  minBadMeanValue = ps.getUntrackedParameter<double>("minBadMeanValue",0.04);
46  maxGoodSigmaValue = ps.getUntrackedParameter<double>("maxGoodSigmaValue",0.08);
47  minBadSigmaValue = ps.getUntrackedParameter<double>("minBadSigmaValue",0.16);
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  string histoTitle = "# of SLs with good mean of residuals";
125  wheelMeanHistos[3] = dbe->book2D("MeanResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
126  wheelMeanHistos[3]->setAxisTitle("Sector",1);
127  wheelMeanHistos[3]->setAxisTitle("Wheel",2);
128 
129 
130  dbe->setCurrentFolder(topHistoFolder + "/01-SigmaRes");
131  sigmaDistr[-2] = dbe->book1D("SigmaDistr","Sigma value of the residuals all (cm)",
132  50,0.0,0.2);
133  sigmaDistr[-1] = dbe->book1D("SigmaDistr_Phi","Sigma value of the residuals #phi SL (cm)",
134  50,0.0,0.2);
135  sigmaDistr[0] = dbe->book1D("SigmaDistr_ThetaWh0","Sigma value of the residuals #theta SL Wh 0 (cm)",
136  50,0.0,0.2);
137  sigmaDistr[1] = dbe->book1D("SigmaDistr_ThetaWh1","Sigma value of the residuals #theta SL Wh +/-1 (cm)",
138  50,0.0,0.2);
139  sigmaDistr[2] = dbe->book1D("SigmaDistr_ThetaWh2","Sigma value of the residuals #theta SL Wh +/-2 (cm)",
140  50,0.0,0.2);
141 
142  histoTitle = "# of SLs with good sigma of residuals";
143  wheelSigmaHistos[3] = dbe->book2D("SigmaResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
144  wheelSigmaHistos[3]->setAxisTitle("Sector",1);
145  wheelSigmaHistos[3]->setAxisTitle("Wheel",2);
146 
147 
148  // loop over all the CMS wheels, sectors & book the summary histos
149  for (int wheel=-2; wheel<=2; wheel++){
150  bookHistos(wheel);
151  for (int sector=1; sector<=12; sector++){
152  bookHistos(wheel, sector);
153  }
154  }
155 
156 }
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:954
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:1082
std::map< int, MonitorElement * > meanDistr
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void DTResolutionAnalysisTest::bookHistos ( int  wh)

Definition at line 303 of file DTResolutionAnalysisTest.cc.

303  {
304 
305  stringstream wheel; wheel <<wh;
306 
307  dbe->setCurrentFolder(topHistoFolder + "/00-MeanRes");
308  string histoName = "MeanSummaryRes_W" + wheel.str();
309  string histoTitle = "# of SLs with wrong mean of residuals (Wheel " + wheel.str() + ")";
310  wheelMeanHistos[wh] = dbe->book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
311  wheelMeanHistos[wh]->setAxisTitle("Sector",1);
312  wheelMeanHistos[wh]->setBinLabel(1,"MB1_SL1",2);
313  wheelMeanHistos[wh]->setBinLabel(2,"MB1_SL2",2);
314  wheelMeanHistos[wh]->setBinLabel(3,"MB1_SL3",2);
315  wheelMeanHistos[wh]->setBinLabel(4,"MB2_SL1",2);
316  wheelMeanHistos[wh]->setBinLabel(5,"MB2_SL2",2);
317  wheelMeanHistos[wh]->setBinLabel(6,"MB2_SL3",2);
318  wheelMeanHistos[wh]->setBinLabel(7,"MB3_SL1",2);
319  wheelMeanHistos[wh]->setBinLabel(8,"MB3_SL2",2);
320  wheelMeanHistos[wh]->setBinLabel(9,"MB3_SL3",2);
321  wheelMeanHistos[wh]->setBinLabel(10,"MB4_SL1",2);
322  wheelMeanHistos[wh]->setBinLabel(11,"MB4_SL3",2);
323  // wheelMeanHistos[wh]->setBinLabel(12,"MB4_SL1",2);
324  // wheelMeanHistos[wh]->setBinLabel(13,"MB4_SL3",2);
325 
326 
327 
328  dbe->setCurrentFolder(topHistoFolder + "/01-SigmaRes");
329  histoName = "SigmaSummaryRes_W" + wheel.str();
330  histoTitle = "# of SLs with wrong sigma of residuals (Wheel " + wheel.str() + ")";
331  wheelSigmaHistos[wh] = dbe->book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
332  wheelSigmaHistos[wh]->setAxisTitle("Sector",1);
333  wheelSigmaHistos[wh]->setBinLabel(1,"MB1_SL1",2);
334  wheelSigmaHistos[wh]->setBinLabel(2,"MB1_SL2",2);
335  wheelSigmaHistos[wh]->setBinLabel(3,"MB1_SL3",2);
336  wheelSigmaHistos[wh]->setBinLabel(4,"MB2_SL1",2);
337  wheelSigmaHistos[wh]->setBinLabel(5,"MB2_SL2",2);
338  wheelSigmaHistos[wh]->setBinLabel(6,"MB2_SL3",2);
339  wheelSigmaHistos[wh]->setBinLabel(7,"MB3_SL1",2);
340  wheelSigmaHistos[wh]->setBinLabel(8,"MB3_SL2",2);
341  wheelSigmaHistos[wh]->setBinLabel(9,"MB3_SL3",2);
342  wheelSigmaHistos[wh]->setBinLabel(10,"MB4_SL1",2);
343  wheelSigmaHistos[wh]->setBinLabel(11,"MB4_SL3",2);
344  // wheelSigmaHistos[wh]->setBinLabel(12,"MB4_SL1",2);
345  // wheelSigmaHistos[wh]->setBinLabel(13,"MB4_SL3",2);
346 
347 }
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:1082
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void DTResolutionAnalysisTest::bookHistos ( int  wh,
int  sect 
)

Definition at line 350 of file DTResolutionAnalysisTest.cc.

350  {
351 
352  stringstream wheel; wheel << wh;
353  stringstream sector; sector << sect;
354 
355 
356  string MeanHistoName = "MeanTest_W" + wheel.str() + "_Sec" + sector.str();
357  string SigmaHistoName = "SigmaTest_W" + wheel.str() + "_Sec" + sector.str();
358 
359  string folder = topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str();
360  dbe->setCurrentFolder(folder);
361 
362  if(sect!=4 && sect!=10) {
363  MeanHistos[make_pair(wh,sect)] =
364  dbe->book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",11,1,12);
365  } else {
366  MeanHistos[make_pair(wh,sect)] =
367  dbe->book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",13,1,14);
368  }
369  (MeanHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
370  (MeanHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
371  (MeanHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
372  (MeanHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
373  (MeanHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
374  (MeanHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
375  (MeanHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
376  (MeanHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
377  (MeanHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
378  (MeanHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
379  (MeanHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
380  if(sect==4){
381  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
382  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
383  }
384  if(sect==10){
385  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
386  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
387  }
388 
389  if(sect!=4 && sect!=10) {
390  SigmaHistos[make_pair(wh,sect)] =
391  dbe->book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",11,1,12);
392  } else {
393  SigmaHistos[make_pair(wh,sect)] =
394  dbe->book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",13,1,14);
395  }
396  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
397  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
398  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
399  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
400  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
401  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
402  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
403  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
404  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
405  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
406  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
407  if(sect==4){
408  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
409  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
410  }
411  if(sect==10){
412  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
413  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
414  }
415 
416 
417 }
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:954
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
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 158 of file DTResolutionAnalysisTest.cc.

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

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

Get the ME name.

Definition at line 420 of file DTResolutionAnalysisTest.cc.

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

420  {
421 
422  stringstream wheel; wheel << slID.wheel();
423  stringstream station; station << slID.station();
424  stringstream sector; sector << slID.sector();
425  stringstream superLayer; superLayer << slID.superlayer();
426 
427  string folderName =
428  topHistoFolder + "/Wheel" + wheel.str() +
429  "/Sector" + sector.str() +
430  "/Station" + station.str() + "/";
431 
432  if(doCalibAnalysis) folderName =
433  "DT/DTCalibValidation/Wheel" + wheel.str() +
434  "/Station" + station.str() + "/Sector" + sector.str() + "/";
435 
436  string histoname = folderName + "hResDist"
437  + "_W" + wheel.str()
438  + "_St" + station.str()
439  + "_Sec" + sector.str()
440  + "_SL" + superLayer.str();
441 
442  if(doCalibAnalysis) histoname = folderName + "hResDist_STEP3"
443  + "_W" + wheel.str()
444  + "_St" + station.str()
445  + "_Sec" + sector.str()
446  + "_SL" + superLayer.str();
447 
448  return histoname;
449 
450 }
int superlayer() const
Return the superlayer number (deprecated method name)
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
double DTResolutionAnalysisTest::meanInRange ( double  mean) const
private

Definition at line 466 of file DTResolutionAnalysisTest.cc.

References relativeConstraints::value.

466  {
467  double value(0.);
468  if( fabs(mean) <= maxGoodMeanValue ) {value = 1.;}
469  else if( fabs(mean) > maxGoodMeanValue && fabs(mean) < minBadMeanValue ) {value = 0.9;}
470  else if( fabs(mean) >= minBadMeanValue ) {value = 0.1;}
471  return value;
472 }
void DTResolutionAnalysisTest::resetMEs ( )
private

Definition at line 482 of file DTResolutionAnalysisTest.cc.

References timingPdfMaker::histo.

482  {
484  // Reset the summary histo
485  for(map<int, MonitorElement*> ::const_iterator histo = wheelMeanHistos.begin();
486  histo != wheelMeanHistos.end();
487  histo++) {
488  (*histo).second->Reset();
489  }
490  for(map<int, MonitorElement*> ::const_iterator histo = wheelSigmaHistos.begin();
491  histo != wheelSigmaHistos.end();
492  histo++) {
493  (*histo).second->Reset();
494  }
495 
496  for(int indx = -2; indx != 3; ++indx) {
497  meanDistr[indx]->Reset();
498  sigmaDistr[indx]->Reset();
499  }
500 }
std::map< int, MonitorElement * > sigmaDistr
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, MonitorElement * > meanDistr
double DTResolutionAnalysisTest::sigmaInRange ( double  sigma) const
private

Definition at line 474 of file DTResolutionAnalysisTest.cc.

References relativeConstraints::value.

474  {
475  double value(0.);
476  if( sigma <= maxGoodSigmaValue ) {value = 1.;}
477  else if( sigma > maxGoodSigmaValue && sigma < minBadSigmaValue ) {value = 0.9;}
478  else if( sigma >= minBadSigmaValue ) {value = 0.1;}
479  return value;
480 }
int DTResolutionAnalysisTest::slFromBin ( int  bin) const
private

Definition at line 459 of file DTResolutionAnalysisTest.cc.

References run_regression::ret.

459  {
460  int ret = bin%3;
461  if(ret == 0 || bin == 11) ret = 3;
462 
463  return ret;
464 }
int DTResolutionAnalysisTest::stationFromBin ( int  bin) const
private

Definition at line 454 of file DTResolutionAnalysisTest.cc.

454  {
455  return (int) (bin /3.1)+1;
456 }

Member Data Documentation

DQMStore* DTResolutionAnalysisTest::dbe
private

Definition at line 73 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.

double DTResolutionAnalysisTest::maxGoodMeanValue
private

Definition at line 76 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::maxGoodSigmaValue
private

Definition at line 78 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.

double DTResolutionAnalysisTest::minBadMeanValue
private

Definition at line 77 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::minBadSigmaValue
private

Definition at line 79 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 67 of file DTResolutionAnalysisTest.h.

unsigned int DTResolutionAnalysisTest::nLumiSegs
private

Definition at line 68 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::percentual
private

Definition at line 71 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::prescaleFactor
private

Definition at line 69 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.