CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTResolutionAnalysisTest Class Reference

#include <DTResolutionAnalysisTest.h>

Inheritance diagram for DTResolutionAnalysisTest:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void bookHistos (DQMStore::IBooker &)
 
void bookHistos (DQMStore::IBooker &, int wh)
 
void bookHistos (DQMStore::IBooker &, int wh, int sect)
 
 DTResolutionAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
std::string getMEName (const DTSuperLayerId &slID)
 Get the ME name. More...
 
virtual ~DTResolutionAnalysisTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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)
 

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

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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 33 of file DTResolutionAnalysisTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 37 of file DTResolutionAnalysisTest.cc.

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

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

Destructor.

Definition at line 54 of file DTResolutionAnalysisTest.cc.

References LogTrace, and cmsHarvester::nevents.

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

Member Function Documentation

void DTResolutionAnalysisTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

BeginRun.

Reimplemented from DQMEDHarvester.

Definition at line 60 of file DTResolutionAnalysisTest.cc.

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

60  {
61 
62  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") <<"[DTResolutionAnalysisTest]: BeginRun";
63 
64  nevents = 0;
65 
66  // Get the geometry
67  context.get<MuonGeometryRecord>().get(muonGeom);
68 
69 }
edm::ESHandle< DTGeometry > muonGeom
#define LogTrace(id)
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)

Definition at line 72 of file DTResolutionAnalysisTest.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), bookHistos(), MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

72  {
73 
74  // global residual summary
75 
77  globalResSummary = ibooker.book2D("ResidualsGlbSummary", "# of SLs with good mean and good sigma of residuals",12,1,13,5,-2,3);
78 
79  // book summaries for mean and sigma
80  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
81  meanDistr[-2] = ibooker.book1D("MeanDistr","Mean value of the residuals all (cm)",
82  100,-0.1,0.1);
83  meanDistr[-1] = ibooker.book1D("MeanDistr_Phi","Mean value of the residuals #phi SL (cm)",
84  100,-0.1,0.1);
85  meanDistr[0] = ibooker.book1D("MeanDistr_ThetaWh0","Mean values of the residuals #theta SL Wh 0 (cm)",
86  100,-0.1,0.1);
87  meanDistr[1] = ibooker.book1D("MeanDistr_ThetaWh1","Mean value of the residuals #theta SL Wh +/-1 (cm)",
88  100,-0.1,0.1);
89  meanDistr[2] = ibooker.book1D("MeanDistr_ThetaWh2","Mean value of the residuals #theta SL Wh +/-2 (cm)",
90  100,-0.1,0.1);
91 
92 
93  string histoTitle = "# of SLs with good mean of residuals";
94 
95  wheelMeanHistos[3] = ibooker.book2D("MeanResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
96  wheelMeanHistos[3]->setAxisTitle("Sector",1);
97  wheelMeanHistos[3]->setAxisTitle("Wheel",2);
98 
99  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
100  sigmaDistr[-2] = ibooker.book1D("SigmaDistr","Sigma value of the residuals all (cm)",
101  50,0.0,0.2);
102  sigmaDistr[-1] = ibooker.book1D("SigmaDistr_Phi","Sigma value of the residuals #phi SL (cm)",
103  50,0.0,0.2);
104  sigmaDistr[0] = ibooker.book1D("SigmaDistr_ThetaWh0","Sigma value of the residuals #theta SL Wh 0 (cm)",
105  50,0.0,0.2);
106  sigmaDistr[1] = ibooker.book1D("SigmaDistr_ThetaWh1","Sigma value of the residuals #theta SL Wh +/-1 (cm)",
107  50,0.0,0.2);
108  sigmaDistr[2] = ibooker.book1D("SigmaDistr_ThetaWh2","Sigma value of the residuals #theta SL Wh +/-2 (cm)",
109  50,0.0,0.2);
110 
111  histoTitle = "# of SLs with good sigma of residuals";
112  wheelSigmaHistos[3] = ibooker.book2D("SigmaResGlbSummary",histoTitle.c_str(),12,1,13,5,-2,3);
113  wheelSigmaHistos[3]->setAxisTitle("Sector",1);
114  wheelSigmaHistos[3]->setAxisTitle("Wheel",2);
115 
116 
117  // loop over all the CMS wheels, sectors & book the summary histos
118  for (int wheel=-2; wheel<=2; wheel++){
119  bookHistos(ibooker,wheel);
120  for (int sector=1; sector<=12; sector++){
121  bookHistos(ibooker,wheel, sector);
122  }
123  }
124 
125 }
void bookHistos(DQMStore::IBooker &)
std::map< int, MonitorElement * > sigmaDistr
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
std::map< int, MonitorElement * > meanDistr
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh 
)

Definition at line 270 of file DTResolutionAnalysisTest.cc.

References DQMStore::IBooker::book2D(), MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

270  {
271 
272  stringstream wheel; wheel <<wh;
273 
274  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
275  string histoName = "MeanSummaryRes_W" + wheel.str();
276  string histoTitle = "# of SLs with wrong mean of residuals (Wheel " + wheel.str() + ")";
277 
278  wheelMeanHistos[wh] = ibooker.book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
279  wheelMeanHistos[wh]->setAxisTitle("Sector",1);
280  wheelMeanHistos[wh]->setBinLabel(1,"MB1_SL1",2);
281  wheelMeanHistos[wh]->setBinLabel(2,"MB1_SL2",2);
282  wheelMeanHistos[wh]->setBinLabel(3,"MB1_SL3",2);
283  wheelMeanHistos[wh]->setBinLabel(4,"MB2_SL1",2);
284  wheelMeanHistos[wh]->setBinLabel(5,"MB2_SL2",2);
285  wheelMeanHistos[wh]->setBinLabel(6,"MB2_SL3",2);
286  wheelMeanHistos[wh]->setBinLabel(7,"MB3_SL1",2);
287  wheelMeanHistos[wh]->setBinLabel(8,"MB3_SL2",2);
288  wheelMeanHistos[wh]->setBinLabel(9,"MB3_SL3",2);
289  wheelMeanHistos[wh]->setBinLabel(10,"MB4_SL1",2);
290  wheelMeanHistos[wh]->setBinLabel(11,"MB4_SL3",2);
291 
292  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
293  histoName = "SigmaSummaryRes_W" + wheel.str();
294  histoTitle = "# of SLs with wrong sigma of residuals (Wheel " + wheel.str() + ")";
295 
296  wheelSigmaHistos[wh] = ibooker.book2D(histoName.c_str(),histoTitle.c_str(),12,1,13,11,1,12);
297  wheelSigmaHistos[wh]->setAxisTitle("Sector",1);
298  wheelSigmaHistos[wh]->setBinLabel(1,"MB1_SL1",2);
299  wheelSigmaHistos[wh]->setBinLabel(2,"MB1_SL2",2);
300  wheelSigmaHistos[wh]->setBinLabel(3,"MB1_SL3",2);
301  wheelSigmaHistos[wh]->setBinLabel(4,"MB2_SL1",2);
302  wheelSigmaHistos[wh]->setBinLabel(5,"MB2_SL2",2);
303  wheelSigmaHistos[wh]->setBinLabel(6,"MB2_SL3",2);
304  wheelSigmaHistos[wh]->setBinLabel(7,"MB3_SL1",2);
305  wheelSigmaHistos[wh]->setBinLabel(8,"MB3_SL2",2);
306  wheelSigmaHistos[wh]->setBinLabel(9,"MB3_SL3",2);
307  wheelSigmaHistos[wh]->setBinLabel(10,"MB4_SL1",2);
308  wheelSigmaHistos[wh]->setBinLabel(11,"MB4_SL3",2);
309 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh,
int  sect 
)

Definition at line 311 of file DTResolutionAnalysisTest.cc.

References DQMStore::IBooker::book1D(), and DQMStore::IBooker::setCurrentFolder().

311  {
312 
313  stringstream wheel; wheel << wh;
314  stringstream sector; sector << sect;
315 
316 
317  string MeanHistoName = "MeanTest_W" + wheel.str() + "_Sec" + sector.str();
318  string SigmaHistoName = "SigmaTest_W" + wheel.str() + "_Sec" + sector.str();
319 
320  string folder = topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str();
321  ibooker.setCurrentFolder(folder);
322 
323  if(sect!=4 && sect!=10) {
324  MeanHistos[make_pair(wh,sect)] =
325 
326  ibooker.book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",11,1,12);
327  } else {
328  MeanHistos[make_pair(wh,sect)] =
329  ibooker.book1D(MeanHistoName.c_str(),"Mean (from gaussian fit) of the residuals distribution",13,1,14);
330  }
331  (MeanHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
332  (MeanHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
333  (MeanHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
334  (MeanHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
335  (MeanHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
336  (MeanHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
337  (MeanHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
338  (MeanHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
339  (MeanHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
340  (MeanHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
341  (MeanHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
342  if(sect==4){
343  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
344  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
345  }
346  if(sect==10){
347  (MeanHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
348  (MeanHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
349  }
350 
351  if(sect!=4 && sect!=10) {
352  SigmaHistos[make_pair(wh,sect)] =
353  ibooker.book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",11,1,12);
354  } else {
355  SigmaHistos[make_pair(wh,sect)] =
356  ibooker.book1D(SigmaHistoName.c_str(),"Sigma (from gaussian fit) of the residuals distribution",13,1,14);
357  }
358  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(1,"MB1_SL1",1);
359  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(2,"MB1_SL2",1);
360  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(3,"MB1_SL3",1);
361  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(4,"MB2_SL1",1);
362  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(5,"MB2_SL2",1);
363  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(6,"MB2_SL3",1);
364  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(7,"MB3_SL1",1);
365  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(8,"MB3_SL2",1);
366  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(9,"MB3_SL3",1);
367  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(10,"MB4_SL1",1);
368  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(11,"MB4_SL3",1);
369  if(sect==4){
370  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S13_SL1",1);
371  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S13_SL3",1);
372  }
373  if(sect==10){
374  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(12,"MB4S14_SL1",1);
375  (SigmaHistos[make_pair(wh,sect)])->setBinLabel(13,"MB4S14_SL3",1);
376  }
377 
378 
379 }
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void DTResolutionAnalysisTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Implements DQMEDHarvester.

Definition at line 127 of file DTResolutionAnalysisTest.cc.

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

127  {
128 
129  if (!igetter.dirExists(topHistoFolder)) {
130  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
131  <<"[DTResolutionAnalysisTest]: Base folder " << topHistoFolder
132  << " does not exist. Skipping client operation." << endl;
133  return;
134  }
135 
136  bookHistos(ibooker); // histos booked only if top histo folder exist
137  // as Standard/AlcaReco Harvest is performed in the same step
138 
139  LogTrace ("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
140  << "[DTResolutionAnalysisTest]: End of Run transition, performing the DQM client operation" << endl;
141 
142  // reset the ME with fixed scale
143  resetMEs();
144 
145  for (vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
146  ch_it != muonGeom->chambers().end(); ++ch_it) { // loop over the chambers
147 
148  DTChamberId chID = (*ch_it)->id();
149 
150  // Fill the test histos
151  for(vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
152  sl_it != (*ch_it)->superLayers().end(); ++sl_it) { // loop over SLs
153 
154 
155  DTSuperLayerId slID = (*sl_it)->id();
156  MonitorElement * res_histo = igetter.get(getMEName(slID));
157 
158  if(res_histo) { // Gaussian Fit
159  float statMean = res_histo->getMean(1);
160  float statSigma = res_histo->getRMS(1);
161  double mean = -1;
162  double sigma = -1;
163  TH1F * histo_root = res_histo->getTH1F();
164 
165  // fill the summaries
166  int entry= (chID.station() - 1) * 3;
167  int binSect = slID.sector();
168  if(slID.sector() == 13) binSect = 4;
169  else if(slID.sector() == 14) binSect = 10;
170  int binSL = entry+slID.superLayer();
171  if(chID.station() == 4 && slID.superLayer() == 3) binSL--;
172  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==1) binSL=12;
173  if((slID.sector()==13 || slID.sector()==14) && slID.superLayer()==3) binSL=13;
174 
175  if(histo_root->GetEntries()>20) {
176  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
177  try {
178  histo_root->Fit(gfit, "Q0", "", -0.1, 0.1);
179  } catch (cms::Exception& iException) {
180  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
181  << "[DTResolutionAnalysisTask]: Exception when fitting SL : " << slID;
182  // FIXME: the SL is set as OK in the summary
183  double weight = 1/11.;
184  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
185  globalResSummary->Fill(binSect, slID.wheel(), weight);
186  continue;
187  }
188 
189  if(gfit){
190  // get the mean and the sigma of the distribution
191  mean = gfit->GetParameter(1);
192  sigma = gfit->GetParameter(2);
193 
194  // fill the distributions
195  meanDistr[-2]->Fill(mean);
196  sigmaDistr[-2]->Fill(sigma);
197  if(slID.superlayer() == 2) {
198  meanDistr[abs(slID.wheel())]->Fill(mean);
199  sigmaDistr[abs(slID.wheel())]->Fill(sigma);
200  } else {
201  meanDistr[-1]->Fill(mean);
202  sigmaDistr[-1]->Fill(sigma);
203  }
204 
205  // sector summaries
206  MeanHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, mean);
207  SigmaHistos[make_pair(slID.wheel(),binSect)]->setBinContent(binSL, sigma);
208 
209  if((slID.sector() == 13 || slID.sector() == 14) && binSL == 12) binSL=10;
210  if((slID.sector() == 13 || slID.sector() == 14) && binSL == 13) binSL=11;
211 
212 
213  if((slID.sector() == 13 || slID.sector() == 14) ) {
214 
215  double MeanVal = wheelMeanHistos[slID.wheel()]->getBinContent(binSect,binSL);
216  double MeanBinVal = (MeanVal > 0. && MeanVal < meanInRange(mean)) ? MeanVal : meanInRange(mean);
217  wheelMeanHistos[slID.wheel()]->setBinContent(binSect,binSL,MeanBinVal);
218 
219  double SigmaVal = wheelSigmaHistos[slID.wheel()]->getBinContent(binSect,binSL);
220  double SigmaBinVal = (SigmaVal > 0. && SigmaVal < sigmaInRange(sigma)) ? SigmaVal : sigmaInRange(sigma);
221  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect,binSL,SigmaBinVal);
222 
223  } else {
224  wheelMeanHistos[slID.wheel()]->setBinContent(binSect,binSL,meanInRange(mean));
225  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect,binSL,sigmaInRange(sigma));
226  }
227 
228  // set the weight
229  double weight = 1/11.;
230  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
231 
232  // test the values of mean and sigma
233  if( (meanInRange(mean) > 0.85) && (sigmaInRange(sigma) > 0.85) ) { // sigma and mean ok
234  globalResSummary->Fill(binSect, slID.wheel(), weight);
235  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
236  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
237  } else {
238  if( (meanInRange(mean) < 0.85) && (sigmaInRange(sigma) > 0.85) ) { // only sigma ok
239  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
240  }
241  if((meanInRange(mean) > 0.85) && (sigmaInRange(sigma) < 0.85) ) { // only mean ok
242  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
243  }
244  }
245  }
246  delete gfit;
247  }
248  else{
249  LogVerbatim ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
250  << "[DTResolutionAnalysisTask] Fit of " << slID
251  << " not performed because # entries < 20 ";
252  // FIXME: the SL is set as OK in the summary
253  double weight = 1/11.;
254  if((binSect == 4 || binSect == 10) && slID.station() == 4) weight = 1/22.;
255  globalResSummary->Fill(binSect, slID.wheel(), weight);
256  wheelMeanHistos[3]->Fill(binSect,slID.wheel(),weight);
257  wheelSigmaHistos[3]->Fill(binSect,slID.wheel(),weight);
258  wheelMeanHistos[slID.wheel()]->setBinContent(binSect,binSL,1.);
259  wheelSigmaHistos[slID.wheel()]->setBinContent(binSect,binSL,1.);
260  }
261  } else {
262  LogWarning ("DTDQM|DTMonitorModule|DTResolutionAnalysisTask")
263  << "[DTResolutionAnalysisTask] Histo: " << getMEName(slID) << " not found" << endl;
264  }
265  } // loop on SLs
266  } // Loop on Stations
267 
268 }
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
void bookHistos(DQMStore::IBooker &)
double meanInRange(double mean) const
std::map< int, MonitorElement * > sigmaDistr
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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.
#define LogTrace(id)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:318
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)
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 382 of file DTResolutionAnalysisTest.cc.

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

382  {
383 
384  stringstream wheel; wheel << slID.wheel();
385  stringstream station; station << slID.station();
386  stringstream sector; sector << slID.sector();
387  stringstream superLayer; superLayer << slID.superlayer();
388 
389  string folderName =
390  topHistoFolder + "/Wheel" + wheel.str() +
391  "/Sector" + sector.str() +
392  "/Station" + station.str() + "/";
393 
394  if(doCalibAnalysis) folderName =
395  "DT/DTCalibValidation/Wheel" + wheel.str() +
396  "/Station" + station.str() + "/Sector" + sector.str() + "/";
397 
398  string histoname = folderName + "hResDist"
399  + "_W" + wheel.str()
400  + "_St" + station.str()
401  + "_Sec" + sector.str()
402  + "_SL" + superLayer.str();
403 
404  if(doCalibAnalysis) histoname = folderName + "hResDist_STEP3"
405  + "_W" + wheel.str()
406  + "_St" + station.str()
407  + "_Sec" + sector.str()
408  + "_SL" + superLayer.str();
409 
410  return histoname;
411 
412 }
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 428 of file DTResolutionAnalysisTest.cc.

References relativeConstraints::value.

428  {
429  double value(0.);
430  if( fabs(mean) <= maxGoodMeanValue ) {value = 1.;}
431  else if( fabs(mean) > maxGoodMeanValue && fabs(mean) < minBadMeanValue ) {value = 0.9;}
432  else if( fabs(mean) >= minBadMeanValue ) {value = 0.1;}
433  return value;
434 }
void DTResolutionAnalysisTest::resetMEs ( )
private

Definition at line 444 of file DTResolutionAnalysisTest.cc.

References timingPdfMaker::histo.

444  {
446  // Reset the summary histo
447  for(map<int, MonitorElement*> ::const_iterator histo = wheelMeanHistos.begin();
448  histo != wheelMeanHistos.end();
449  histo++) {
450  (*histo).second->Reset();
451  }
452  for(map<int, MonitorElement*> ::const_iterator histo = wheelSigmaHistos.begin();
453  histo != wheelSigmaHistos.end();
454  histo++) {
455  (*histo).second->Reset();
456  }
457 
458  for(int indx = -2; indx != 3; ++indx) {
459  meanDistr[indx]->Reset();
460  sigmaDistr[indx]->Reset();
461  }
462 }
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 436 of file DTResolutionAnalysisTest.cc.

References relativeConstraints::value.

436  {
437  double value(0.);
438  if( sigma <= maxGoodSigmaValue ) {value = 1.;}
439  else if( sigma > maxGoodSigmaValue && sigma < minBadSigmaValue ) {value = 0.9;}
440  else if( sigma >= minBadSigmaValue ) {value = 0.1;}
441  return value;
442 }
int DTResolutionAnalysisTest::slFromBin ( int  bin) const
private

Definition at line 421 of file DTResolutionAnalysisTest.cc.

References run_regression::ret.

421  {
422  int ret = bin%3;
423  if(ret == 0 || bin == 11) ret = 3;
424 
425  return ret;
426 }
int DTResolutionAnalysisTest::stationFromBin ( int  bin) const
private

Definition at line 416 of file DTResolutionAnalysisTest.cc.

416  {
417  return (int) (bin /3.1)+1;
418 }

Member Data Documentation

bool DTResolutionAnalysisTest::doCalibAnalysis
private

Definition at line 71 of file DTResolutionAnalysisTest.h.

MonitorElement* DTResolutionAnalysisTest::globalResSummary
private

Definition at line 94 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::maxGoodMeanValue
private

Definition at line 66 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::maxGoodSigmaValue
private

Definition at line 68 of file DTResolutionAnalysisTest.h.

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

Definition at line 82 of file DTResolutionAnalysisTest.h.

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

Definition at line 76 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::minBadMeanValue
private

Definition at line 67 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::minBadSigmaValue
private

Definition at line 69 of file DTResolutionAnalysisTest.h.

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

Definition at line 73 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::nevents
private

Definition at line 59 of file DTResolutionAnalysisTest.h.

unsigned int DTResolutionAnalysisTest::nLumiSegs
private

Definition at line 60 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::percentual
private

Definition at line 63 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::prescaleFactor
private

Definition at line 61 of file DTResolutionAnalysisTest.h.

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

Definition at line 83 of file DTResolutionAnalysisTest.h.

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

Definition at line 77 of file DTResolutionAnalysisTest.h.

std::string DTResolutionAnalysisTest::topHistoFolder
private

Definition at line 97 of file DTResolutionAnalysisTest.h.

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

Definition at line 79 of file DTResolutionAnalysisTest.h.

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

Definition at line 80 of file DTResolutionAnalysisTest.h.