CMS 3D CMS Logo

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::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 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...
 
 ~DTResolutionAnalysisTest () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 30 of file DTResolutionAnalysisTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file DTResolutionAnalysisTest.cc.

References dtResolutionTestFinalCalib_cfi::doCalibAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, dtResolutionAnalysisTest_cfi::maxGoodMeanValue, dtResolutionAnalysisTest_cfi::maxGoodSigmaValue, dtResolutionAnalysisTest_cfi::minBadMeanValue, dtResolutionAnalysisTest_cfi::minBadSigmaValue, Skims_PDWG_cff::prescaleFactor, and ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder.

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

Destructor.

Definition at line 47 of file DTResolutionAnalysisTest.cc.

References LogTrace, and cmsHarvester::nevents.

47  {
48  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest")
49  << "DTResolutionAnalysisTest: analyzed " << nevents << " events";
50 }
#define LogTrace(id)

Member Function Documentation

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

BeginRun.

Definition at line 52 of file DTResolutionAnalysisTest.cc.

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

52  {
53  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTResolutionAnalysisTest]: BeginRun";
54 
55  nevents = 0;
56 
57  // Get the geometry
58  context.get<MuonGeometryRecord>().get(muonGeom);
59 }
edm::ESHandle< DTGeometry > muonGeom
#define LogTrace(id)
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)

Definition at line 61 of file DTResolutionAnalysisTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), bookHistos(), dqm::impl::MonitorElement::setAxisTitle(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, and makeMuonMisalignmentScenario::wheel.

61  {
62  // global residual summary
63 
64  ibooker.setCurrentFolder(topHistoFolder);
66  ibooker.book2D("ResidualsGlbSummary", "# of SLs with good mean and good sigma of residuals", 12, 1, 13, 5, -2, 3);
67 
68  // book summaries for mean and sigma
69  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
70  meanDistr[-2] = ibooker.book1D("MeanDistr", "Mean value of the residuals all (cm)", 100, -0.1, 0.1);
71  meanDistr[-1] = ibooker.book1D("MeanDistr_Phi", "Mean value of the residuals #phi SL (cm)", 100, -0.1, 0.1);
72  meanDistr[0] =
73  ibooker.book1D("MeanDistr_ThetaWh0", "Mean values of the residuals #theta SL Wh 0 (cm)", 100, -0.1, 0.1);
74  meanDistr[1] =
75  ibooker.book1D("MeanDistr_ThetaWh1", "Mean value of the residuals #theta SL Wh +/-1 (cm)", 100, -0.1, 0.1);
76  meanDistr[2] =
77  ibooker.book1D("MeanDistr_ThetaWh2", "Mean value of the residuals #theta SL Wh +/-2 (cm)", 100, -0.1, 0.1);
78 
79  string histoTitle = "# of SLs with good mean of residuals";
80 
81  wheelMeanHistos[3] = ibooker.book2D("MeanResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
82  wheelMeanHistos[3]->setAxisTitle("Sector", 1);
83  wheelMeanHistos[3]->setAxisTitle("Wheel", 2);
84 
85  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
86  sigmaDistr[-2] = ibooker.book1D("SigmaDistr", "Sigma value of the residuals all (cm)", 50, 0.0, 0.2);
87  sigmaDistr[-1] = ibooker.book1D("SigmaDistr_Phi", "Sigma value of the residuals #phi SL (cm)", 50, 0.0, 0.2);
88  sigmaDistr[0] =
89  ibooker.book1D("SigmaDistr_ThetaWh0", "Sigma value of the residuals #theta SL Wh 0 (cm)", 50, 0.0, 0.2);
90  sigmaDistr[1] =
91  ibooker.book1D("SigmaDistr_ThetaWh1", "Sigma value of the residuals #theta SL Wh +/-1 (cm)", 50, 0.0, 0.2);
92  sigmaDistr[2] =
93  ibooker.book1D("SigmaDistr_ThetaWh2", "Sigma value of the residuals #theta SL Wh +/-2 (cm)", 50, 0.0, 0.2);
94 
95  histoTitle = "# of SLs with good sigma of residuals";
96  wheelSigmaHistos[3] = ibooker.book2D("SigmaResGlbSummary", histoTitle.c_str(), 12, 1, 13, 5, -2, 3);
97  wheelSigmaHistos[3]->setAxisTitle("Sector", 1);
98  wheelSigmaHistos[3]->setAxisTitle("Wheel", 2);
99 
100  // loop over all the CMS wheels, sectors & book the summary histos
101  for (int wheel = -2; wheel <= 2; wheel++) {
102  bookHistos(ibooker, wheel);
103  for (int sector = 1; sector <= 12; sector++) {
104  bookHistos(ibooker, wheel, sector);
105  }
106  }
107 }
std::map< int, MonitorElement * > meanDistr
void bookHistos(DQMStore::IBooker &)
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
std::map< int, MonitorElement * > sigmaDistr
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh 
)

Definition at line 257 of file DTResolutionAnalysisTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), HltBtagPostValidation_cff::histoName, dqm::impl::MonitorElement::setAxisTitle(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, and makeMuonMisalignmentScenario::wheel.

257  {
258  stringstream wheel;
259  wheel << wh;
260 
261  ibooker.setCurrentFolder(topHistoFolder + "/00-MeanRes");
262  string histoName = "MeanSummaryRes_W" + wheel.str();
263  string histoTitle = "# of SLs with wrong mean of residuals (Wheel " + wheel.str() + ")";
264 
265  wheelMeanHistos[wh] = ibooker.book2D(histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
266  wheelMeanHistos[wh]->setAxisTitle("Sector", 1);
267  wheelMeanHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
268  wheelMeanHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
269  wheelMeanHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
270  wheelMeanHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
271  wheelMeanHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
272  wheelMeanHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
273  wheelMeanHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
274  wheelMeanHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
275  wheelMeanHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
276  wheelMeanHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
277  wheelMeanHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
278 
279  ibooker.setCurrentFolder(topHistoFolder + "/01-SigmaRes");
280  histoName = "SigmaSummaryRes_W" + wheel.str();
281  histoTitle = "# of SLs with wrong sigma of residuals (Wheel " + wheel.str() + ")";
282 
283  wheelSigmaHistos[wh] = ibooker.book2D(histoName.c_str(), histoTitle.c_str(), 12, 1, 13, 11, 1, 12);
284  wheelSigmaHistos[wh]->setAxisTitle("Sector", 1);
285  wheelSigmaHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
286  wheelSigmaHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
287  wheelSigmaHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
288  wheelSigmaHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
289  wheelSigmaHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
290  wheelSigmaHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
291  wheelSigmaHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
292  wheelSigmaHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
293  wheelSigmaHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
294  wheelSigmaHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
295  wheelSigmaHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
296 }
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
void DTResolutionAnalysisTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh,
int  sect 
)

Definition at line 298 of file DTResolutionAnalysisTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), printsummarytable::folder, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, and makeMuonMisalignmentScenario::wheel.

298  {
299  stringstream wheel;
300  wheel << wh;
301  stringstream sector;
302  sector << sect;
303 
304  string MeanHistoName = "MeanTest_W" + wheel.str() + "_Sec" + sector.str();
305  string SigmaHistoName = "SigmaTest_W" + wheel.str() + "_Sec" + sector.str();
306 
307  string folder = topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str();
308  ibooker.setCurrentFolder(folder);
309 
310  if (sect != 4 && sect != 10) {
311  MeanHistos[make_pair(wh, sect)] =
312 
313  ibooker.book1D(MeanHistoName.c_str(), "Mean (from gaussian fit) of the residuals distribution", 11, 1, 12);
314  } else {
315  MeanHistos[make_pair(wh, sect)] =
316  ibooker.book1D(MeanHistoName.c_str(), "Mean (from gaussian fit) of the residuals distribution", 13, 1, 14);
317  }
318  (MeanHistos[make_pair(wh, sect)])->setBinLabel(1, "MB1_SL1", 1);
319  (MeanHistos[make_pair(wh, sect)])->setBinLabel(2, "MB1_SL2", 1);
320  (MeanHistos[make_pair(wh, sect)])->setBinLabel(3, "MB1_SL3", 1);
321  (MeanHistos[make_pair(wh, sect)])->setBinLabel(4, "MB2_SL1", 1);
322  (MeanHistos[make_pair(wh, sect)])->setBinLabel(5, "MB2_SL2", 1);
323  (MeanHistos[make_pair(wh, sect)])->setBinLabel(6, "MB2_SL3", 1);
324  (MeanHistos[make_pair(wh, sect)])->setBinLabel(7, "MB3_SL1", 1);
325  (MeanHistos[make_pair(wh, sect)])->setBinLabel(8, "MB3_SL2", 1);
326  (MeanHistos[make_pair(wh, sect)])->setBinLabel(9, "MB3_SL3", 1);
327  (MeanHistos[make_pair(wh, sect)])->setBinLabel(10, "MB4_SL1", 1);
328  (MeanHistos[make_pair(wh, sect)])->setBinLabel(11, "MB4_SL3", 1);
329  if (sect == 4) {
330  (MeanHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S13_SL1", 1);
331  (MeanHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S13_SL3", 1);
332  }
333  if (sect == 10) {
334  (MeanHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S14_SL1", 1);
335  (MeanHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S14_SL3", 1);
336  }
337 
338  if (sect != 4 && sect != 10) {
339  SigmaHistos[make_pair(wh, sect)] =
340  ibooker.book1D(SigmaHistoName.c_str(), "Sigma (from gaussian fit) of the residuals distribution", 11, 1, 12);
341  } else {
342  SigmaHistos[make_pair(wh, sect)] =
343  ibooker.book1D(SigmaHistoName.c_str(), "Sigma (from gaussian fit) of the residuals distribution", 13, 1, 14);
344  }
345  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(1, "MB1_SL1", 1);
346  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(2, "MB1_SL2", 1);
347  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(3, "MB1_SL3", 1);
348  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(4, "MB2_SL1", 1);
349  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(5, "MB2_SL2", 1);
350  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(6, "MB2_SL3", 1);
351  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(7, "MB3_SL1", 1);
352  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(8, "MB3_SL2", 1);
353  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(9, "MB3_SL3", 1);
354  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(10, "MB4_SL1", 1);
355  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(11, "MB4_SL3", 1);
356  if (sect == 4) {
357  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S13_SL1", 1);
358  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S13_SL3", 1);
359  }
360  if (sect == 10) {
361  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(12, "MB4S14_SL1", 1);
362  (SigmaHistos[make_pair(wh, sect)])->setBinLabel(13, "MB4S14_SL3", 1);
363  }
364 }
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
void DTResolutionAnalysisTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 109 of file DTResolutionAnalysisTest.cc.

References funct::abs(), bookHistos(), dqm::dqmstoreimpl::DQMStore::IGetter::dirExists(), mps_splice::entry, HcalObjRepresent::Fill(), dqm::dqmstoreimpl::DQMStore::IGetter::get(), dqm::impl::MonitorElement::getMean(), dqm::impl::MonitorElement::getRMS(), dqm::legacy::MonitorElement::getTH1F(), LogTrace, SiStripPI::mean, DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTSuperLayerId::superlayer(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, mps_merge::weight, and DTChamberId::wheel().

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

Get the ME name.

Definition at line 366 of file DTResolutionAnalysisTest.cc.

References dtResolutionTestFinalCalib_cfi::doCalibAnalysis, ALCARECODTCalibSynchCosmicsDQM_cff::folderName, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

366  {
367  stringstream wheel;
368  wheel << slID.wheel();
369  stringstream station;
370  station << slID.station();
371  stringstream sector;
372  sector << slID.sector();
373  stringstream superLayer;
374  superLayer << slID.superlayer();
375 
376  string folderName =
377  topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
378 
379  if (doCalibAnalysis)
380  folderName =
381  "DT/DTCalibValidation/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" + sector.str() + "/";
382 
383  string histoname = folderName + "hResDist" + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
384  "_SL" + superLayer.str();
385 
386  if (doCalibAnalysis)
387  histoname = folderName + "hResDist_STEP3" + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
388  "_SL" + superLayer.str();
389 
390  return histoname;
391 }
int superlayer() const
Return the superlayer number (deprecated method name)
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
double DTResolutionAnalysisTest::meanInRange ( double  mean) const
private

Definition at line 403 of file DTResolutionAnalysisTest.cc.

References dtResolutionAnalysisTest_cfi::maxGoodMeanValue, dtResolutionAnalysisTest_cfi::minBadMeanValue, and relativeConstraints::value.

403  {
404  double value(0.);
405  if (fabs(mean) <= maxGoodMeanValue) {
406  value = 1.;
407  } else if (fabs(mean) > maxGoodMeanValue && fabs(mean) < minBadMeanValue) {
408  value = 0.9;
409  } else if (fabs(mean) >= minBadMeanValue) {
410  value = 0.1;
411  }
412  return value;
413 }
Definition: value.py:1
void DTResolutionAnalysisTest::resetMEs ( )
private

Definition at line 427 of file DTResolutionAnalysisTest.cc.

References timingPdfMaker::histo.

427  {
429  // Reset the summary histo
430  for (map<int, MonitorElement*>::const_iterator histo = wheelMeanHistos.begin(); histo != wheelMeanHistos.end();
431  histo++) {
432  (*histo).second->Reset();
433  }
434  for (map<int, MonitorElement*>::const_iterator histo = wheelSigmaHistos.begin(); histo != wheelSigmaHistos.end();
435  histo++) {
436  (*histo).second->Reset();
437  }
438 
439  for (int indx = -2; indx != 3; ++indx) {
440  meanDistr[indx]->Reset();
441  sigmaDistr[indx]->Reset();
442  }
443 }
std::map< int, MonitorElement * > meanDistr
std::map< int, MonitorElement * > wheelMeanHistos
virtual void Reset()
reset ME (ie. contents, errors, etc)
std::map< int, MonitorElement * > wheelSigmaHistos
std::map< int, MonitorElement * > sigmaDistr
double DTResolutionAnalysisTest::sigmaInRange ( double  sigma) const
private

Definition at line 415 of file DTResolutionAnalysisTest.cc.

References dtResolutionAnalysisTest_cfi::maxGoodSigmaValue, dtResolutionAnalysisTest_cfi::minBadSigmaValue, and relativeConstraints::value.

415  {
416  double value(0.);
417  if (sigma <= maxGoodSigmaValue) {
418  value = 1.;
419  } else if (sigma > maxGoodSigmaValue && sigma < minBadSigmaValue) {
420  value = 0.9;
421  } else if (sigma >= minBadSigmaValue) {
422  value = 0.1;
423  }
424  return value;
425 }
Definition: value.py:1
int DTResolutionAnalysisTest::slFromBin ( int  bin) const
private

Definition at line 395 of file DTResolutionAnalysisTest.cc.

References runTheMatrix::ret.

395  {
396  int ret = bin % 3;
397  if (ret == 0 || bin == 11)
398  ret = 3;
399 
400  return ret;
401 }
ret
prodAgent to be discontinued
int DTResolutionAnalysisTest::stationFromBin ( int  bin) const
private

Definition at line 393 of file DTResolutionAnalysisTest.cc.

393 { return (int)(bin / 3.1) + 1; }

Member Data Documentation

bool DTResolutionAnalysisTest::doCalibAnalysis
private

Definition at line 66 of file DTResolutionAnalysisTest.h.

MonitorElement* DTResolutionAnalysisTest::globalResSummary
private

Definition at line 88 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::maxGoodMeanValue
private

Definition at line 61 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::maxGoodSigmaValue
private

Definition at line 63 of file DTResolutionAnalysisTest.h.

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

Definition at line 77 of file DTResolutionAnalysisTest.h.

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

Definition at line 71 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::minBadMeanValue
private

Definition at line 62 of file DTResolutionAnalysisTest.h.

double DTResolutionAnalysisTest::minBadSigmaValue
private

Definition at line 64 of file DTResolutionAnalysisTest.h.

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

Definition at line 68 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::nevents
private

Definition at line 54 of file DTResolutionAnalysisTest.h.

unsigned int DTResolutionAnalysisTest::nLumiSegs
private

Definition at line 55 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::percentual
private

Definition at line 58 of file DTResolutionAnalysisTest.h.

int DTResolutionAnalysisTest::prescaleFactor
private

Definition at line 56 of file DTResolutionAnalysisTest.h.

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

Definition at line 78 of file DTResolutionAnalysisTest.h.

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

Definition at line 72 of file DTResolutionAnalysisTest.h.

std::string DTResolutionAnalysisTest::topHistoFolder
private

Definition at line 91 of file DTResolutionAnalysisTest.h.

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

Definition at line 74 of file DTResolutionAnalysisTest.h.

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

Definition at line 75 of file DTResolutionAnalysisTest.h.