CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTResolutionTest Class Reference

#include <DTResolutionTest.h>

Inheritance diagram for DTResolutionTest:
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

 DTResolutionTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTResolutionTest () 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 ()
 
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 bookHistos (DQMStore::IBooker &, const DTChamberId &ch)
 book the new ME More...
 
void bookHistos (DQMStore::IBooker &, int wh)
 book the summary histograms More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 Endjob. More...
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
std::string getMEName (const DTSuperLayerId &slID)
 Get the ME name. More...
 
std::string getMEName2D (const DTSuperLayerId &slID)
 
- 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

int slFromBin (int bin) const
 
int stationFromBin (int bin) const
 

Private Attributes

bool bookingdone
 
std::map< std::pair< int, int >, int > cmsMeanHistos
 
std::map< std::pair< int, int >, int > cmsSigmaHistos
 
std::map< std::pair< int, int >, int > cmsSlopeHistos
 
std::map< std::pair< int, int >, bool > MeanFilled
 
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
 
std::map< std::string, MonitorElement * > MeanHistosSetRange
 
std::map< std::string, MonitorElement * > MeanHistosSetRange2D
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int percentual
 
int prescaleFactor
 
int run
 
std::map< std::pair< int, int >, bool > SigmaFilled
 
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
 
std::map< std::string, MonitorElement * > SigmaHistosSetRange
 
std::map< std::string, MonitorElement * > SigmaHistosSetRange2D
 
std::map< std::pair< int, int >, bool > SlopeFilled
 
std::map< std::pair< int, int >, MonitorElement * > SlopeHistos
 
std::map< std::string, MonitorElement * > SlopeHistosSetRange
 
std::map< std::string, MonitorElement * > SlopeHistosSetRange2D
 
std::map< int, MonitorElement * > wheelMeanHistos
 
std::map< int, MonitorElement * > wheelSigmaHistos
 
std::map< int, MonitorElement * > wheelSlopeHistos
 

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 40 of file DTResolutionTest.h.

Constructor & Destructor Documentation

DTResolutionTest::DTResolutionTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 39 of file DTResolutionTest.cc.

References cmsHarvester::nevents, and Skims_PDWG_cff::prescaleFactor.

39  {
40  edm::LogVerbatim("resolution") << "[DTResolutionTest]: Constructor";
41  parameters = ps;
42 
43  //FR: no idea if this input file needs to be used! comment it for now
44  //- if(ps.getUntrackedParameter<bool>("readFile", false))
45  //- dbe->open(ps.getUntrackedParameter<string>("inputFile", "residuals.root"));
46 
47  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
48 
49  percentual = parameters.getUntrackedParameter<int>("BadSLpercentual", 10);
50 
51  nevents = 0;
52 
53  bookingdone = false;
54 }
DTResolutionTest::~DTResolutionTest ( )
override

Destructor.

Definition at line 56 of file DTResolutionTest.cc.

References cmsHarvester::nevents.

56  {
57  edm::LogVerbatim("resolution") << "DTResolutionTest: analyzed " << nevents << " events";
58 }

Member Function Documentation

void DTResolutionTest::bookHistos ( DQMStore::IBooker ibooker,
const DTChamberId ch 
)
protected

book the new ME

Definition at line 454 of file DTResolutionTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), DTChamberId::sector(), dqm::impl::MonitorElement::setBinLabel(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

454  {
455  stringstream wheel;
456  wheel << ch.wheel();
457  stringstream sector;
458  sector << ch.sector();
459 
460  string MeanHistoName = "MeanTest_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" + wheel.str() +
461  "_Sec" + sector.str();
462  string SigmaHistoName = "SigmaTest_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
463  wheel.str() + "_Sec" + sector.str();
464  string SlopeHistoName = "SlopeTest_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
465  wheel.str() + "_Sec" + sector.str();
466 
467  ibooker.setCurrentFolder("DT/Tests/DTResolution");
468 
469  // Book the histo for the mean value and set the axis labels
470 
471  MeanHistos[make_pair(ch.wheel(), ch.sector())] =
472  ibooker.book1D(MeanHistoName.c_str(), MeanHistoName.c_str(), 11, 0, 11);
473  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(1, "MB1_SL1", 1);
474  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(2, "MB1_SL2", 1);
475  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(3, "MB1_SL3", 1);
476  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(4, "MB2_SL1", 1);
477  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(5, "MB2_SL2", 1);
478  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(6, "MB2_SL3", 1);
479  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(7, "MB3_SL1", 1);
480  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(8, "MB3_SL2", 1);
481  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(9, "MB3_SL3", 1);
482  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(10, "MB4_SL1", 1);
483  (MeanHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(11, "MB4_SL3", 1);
484 
485  // Book the histo for the sigma value and set the axis labels
486  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
487  SigmaHistos[make_pair(ch.wheel(), ch.sector())] =
488  ibooker.book1D(SigmaHistoName.c_str(), SigmaHistoName.c_str(), 11, 0, 11);
489  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(1, "MB1_SL1", 1);
490  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(2, "MB1_SL2", 1);
491  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(3, "MB1_SL3", 1);
492  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(4, "MB2_SL1", 1);
493  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(5, "MB2_SL2", 1);
494  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(6, "MB2_SL3", 1);
495  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(7, "MB3_SL1", 1);
496  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(8, "MB3_SL2", 1);
497  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(9, "MB3_SL3", 1);
498  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(10, "MB4_SL1", 1);
499  (SigmaHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(11, "MB4_SL3", 1);
500  }
501 
502  // Book the histo for the slope value and set the axis labels
503  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
504  SlopeHistos[make_pair(ch.wheel(), ch.sector())] =
505  ibooker.book1D(SlopeHistoName.c_str(), SlopeHistoName.c_str(), 11, 0, 11);
506  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(1, "MB1_SL1", 1);
507  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(2, "MB1_SL2", 1);
508  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(3, "MB1_SL3", 1);
509  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(4, "MB2_SL1", 1);
510  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(5, "MB2_SL2", 1);
511  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(6, "MB2_SL3", 1);
512  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(7, "MB3_SL1", 1);
513  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(8, "MB3_SL2", 1);
514  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(9, "MB3_SL3", 1);
515  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(10, "MB4_SL1", 1);
516  (SlopeHistos[make_pair(ch.wheel(), ch.sector())])->setBinLabel(11, "MB4_SL3", 1);
517  }
518 
519  string HistoName = "W" + wheel.str() + "_Sec" + sector.str();
520 
521  if (parameters.getUntrackedParameter<bool>("meanWrongHisto")) {
522  string MeanHistoNameSetRange = "MeanWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
523  wheel.str() + "_Sec" + sector.str() + "_SetRange";
524 
526  ibooker.book1D(MeanHistoNameSetRange.c_str(), MeanHistoNameSetRange.c_str(), 11, 0.5, 11.5);
527  string MeanHistoNameSetRange2D = "MeanWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
528  wheel.str() + "_Sec" + sector.str() + "_SetRange" + "_2D";
529  MeanHistosSetRange2D[HistoName] = ibooker.book2D(
530  MeanHistoNameSetRange2D.c_str(), MeanHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 100, -0.05, 0.05);
531  }
532 
533  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
534  string SigmaHistoNameSetRange = "SigmaWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
535  wheel.str() + "_Sec" + sector.str() + "_SetRange";
536 
538  ibooker.book1D(SigmaHistoNameSetRange.c_str(), SigmaHistoNameSetRange.c_str(), 11, 0.5, 11.5);
539  string SigmaHistoNameSetRange2D = "SigmaWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
540  wheel.str() + "_Sec" + sector.str() + "_SetRange" + "_2D";
541 
543  ibooker.book2D(SigmaHistoNameSetRange2D.c_str(), SigmaHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 500, 0, 0.5);
544  }
545 
546  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
547  string SlopeHistoNameSetRange = "SlopeWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
548  wheel.str() + "_Sec" + sector.str() + "_SetRange";
549 
551  ibooker.book1D(SlopeHistoNameSetRange.c_str(), SlopeHistoNameSetRange.c_str(), 11, 0.5, 11.5);
552  string SlopeHistoNameSetRange2D = "SlopeWrong_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" +
553  wheel.str() + "_Sec" + sector.str() + "_SetRange" + "_2D";
554 
555  SlopeHistosSetRange2D[HistoName] = ibooker.book2D(
556  SlopeHistoNameSetRange2D.c_str(), SlopeHistoNameSetRange2D.c_str(), 11, 0.5, 11.5, 200, -0.1, 0.1);
557  }
558 }
std::map< std::string, MonitorElement * > MeanHistosSetRange
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
std::map< std::pair< int, int >, MonitorElement * > SlopeHistos
std::map< std::string, MonitorElement * > SigmaHistosSetRange2D
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
std::map< std::string, MonitorElement * > MeanHistosSetRange2D
std::map< std::string, MonitorElement * > SlopeHistosSetRange2D
std::map< std::string, MonitorElement * > SigmaHistosSetRange
std::string HistoName
int sector() const
Definition: DTChamberId.h:49
std::map< std::string, MonitorElement * > SlopeHistosSetRange
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void DTResolutionTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh 
)
protected

book the summary histograms

Definition at line 560 of file DTResolutionTest.cc.

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

560  {
561  ibooker.setCurrentFolder("DT/CalibrationSummary");
562 
563  if (wheelMeanHistos.find(3) == wheelMeanHistos.end()) {
564  string histoName =
565  "MeanSummaryRes_testFailedByAtLeastBadSL_" + parameters.getUntrackedParameter<string>("STEP", "STEP3");
566 
567  wheelMeanHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 3);
568  wheelMeanHistos[3]->setBinLabel(1, "Sector1", 1);
569  wheelMeanHistos[3]->setBinLabel(1, "Sector1", 1);
570  wheelMeanHistos[3]->setBinLabel(2, "Sector2", 1);
571  wheelMeanHistos[3]->setBinLabel(3, "Sector3", 1);
572  wheelMeanHistos[3]->setBinLabel(4, "Sector4", 1);
573  wheelMeanHistos[3]->setBinLabel(5, "Sector5", 1);
574  wheelMeanHistos[3]->setBinLabel(6, "Sector6", 1);
575  wheelMeanHistos[3]->setBinLabel(7, "Sector7", 1);
576  wheelMeanHistos[3]->setBinLabel(8, "Sector8", 1);
577  wheelMeanHistos[3]->setBinLabel(9, "Sector9", 1);
578  wheelMeanHistos[3]->setBinLabel(10, "Sector10", 1);
579  wheelMeanHistos[3]->setBinLabel(11, "Sector11", 1);
580  wheelMeanHistos[3]->setBinLabel(12, "Sector12", 1);
581  wheelMeanHistos[3]->setBinLabel(13, "Sector13", 1);
582  wheelMeanHistos[3]->setBinLabel(14, "Sector14", 1);
583  wheelMeanHistos[3]->setBinLabel(1, "Wheel-2", 2);
584  wheelMeanHistos[3]->setBinLabel(2, "Wheel-1", 2);
585  wheelMeanHistos[3]->setBinLabel(3, "Wheel0", 2);
586  wheelMeanHistos[3]->setBinLabel(4, "Wheel+1", 2);
587  wheelMeanHistos[3]->setBinLabel(5, "Wheel+2", 2);
588  }
589 
590  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
591  if (wheelSigmaHistos.find(3) == wheelSigmaHistos.end()) {
592  string histoName =
593  "SigmaSummaryRes_testFailedByAtLeastBadSL_" + parameters.getUntrackedParameter<string>("STEP", "STEP3");
594 
595  wheelSigmaHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 3);
596  wheelSigmaHistos[3]->setBinLabel(1, "Sector1", 1);
597  wheelSigmaHistos[3]->setBinLabel(1, "Sector1", 1);
598  wheelSigmaHistos[3]->setBinLabel(2, "Sector2", 1);
599  wheelSigmaHistos[3]->setBinLabel(3, "Sector3", 1);
600  wheelSigmaHistos[3]->setBinLabel(4, "Sector4", 1);
601  wheelSigmaHistos[3]->setBinLabel(5, "Sector5", 1);
602  wheelSigmaHistos[3]->setBinLabel(6, "Sector6", 1);
603  wheelSigmaHistos[3]->setBinLabel(7, "Sector7", 1);
604  wheelSigmaHistos[3]->setBinLabel(8, "Sector8", 1);
605  wheelSigmaHistos[3]->setBinLabel(9, "Sector9", 1);
606  wheelSigmaHistos[3]->setBinLabel(10, "Sector10", 1);
607  wheelSigmaHistos[3]->setBinLabel(11, "Sector11", 1);
608  wheelSigmaHistos[3]->setBinLabel(12, "Sector12", 1);
609  wheelSigmaHistos[3]->setBinLabel(13, "Sector13", 1);
610  wheelSigmaHistos[3]->setBinLabel(14, "Sector14", 1);
611  wheelSigmaHistos[3]->setBinLabel(1, "Wheel-2", 2);
612  wheelSigmaHistos[3]->setBinLabel(2, "Wheel-1", 2);
613  wheelSigmaHistos[3]->setBinLabel(3, "Wheel0", 2);
614  wheelSigmaHistos[3]->setBinLabel(4, "Wheel+1", 2);
615  wheelSigmaHistos[3]->setBinLabel(5, "Wheel+2", 2);
616  }
617  }
618 
619  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
620  if (wheelSlopeHistos.find(3) == wheelSlopeHistos.end()) {
621  string histoName =
622  "SlopeSummaryRes_testFailedByAtLeastBadSL_" + parameters.getUntrackedParameter<string>("STEP", "STEP3");
623 
624  wheelSlopeHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 3);
625  wheelSlopeHistos[3]->setBinLabel(1, "Sector1", 1);
626  wheelSlopeHistos[3]->setBinLabel(1, "Sector1", 1);
627  wheelSlopeHistos[3]->setBinLabel(2, "Sector2", 1);
628  wheelSlopeHistos[3]->setBinLabel(3, "Sector3", 1);
629  wheelSlopeHistos[3]->setBinLabel(4, "Sector4", 1);
630  wheelSlopeHistos[3]->setBinLabel(5, "Sector5", 1);
631  wheelSlopeHistos[3]->setBinLabel(6, "Sector6", 1);
632  wheelSlopeHistos[3]->setBinLabel(7, "Sector7", 1);
633  wheelSlopeHistos[3]->setBinLabel(8, "Sector8", 1);
634  wheelSlopeHistos[3]->setBinLabel(9, "Sector9", 1);
635  wheelSlopeHistos[3]->setBinLabel(10, "Sector10", 1);
636  wheelSlopeHistos[3]->setBinLabel(11, "Sector11", 1);
637  wheelSlopeHistos[3]->setBinLabel(12, "Sector12", 1);
638  wheelSlopeHistos[3]->setBinLabel(13, "Sector13", 1);
639  wheelSlopeHistos[3]->setBinLabel(14, "Sector14", 1);
640  wheelSlopeHistos[3]->setBinLabel(1, "Wheel-2", 2);
641  wheelSlopeHistos[3]->setBinLabel(2, "Wheel-1", 2);
642  wheelSlopeHistos[3]->setBinLabel(3, "Wheel0", 2);
643  wheelSlopeHistos[3]->setBinLabel(4, "Wheel+1", 2);
644  wheelSlopeHistos[3]->setBinLabel(5, "Wheel+2", 2);
645  }
646  }
647 
648  stringstream wheel;
649  wheel << wh;
650 
651  if (wheelMeanHistos.find(wh) == wheelMeanHistos.end()) {
652  string histoName =
653  "MeanSummaryRes_testFailed_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") + "_W" + wheel.str();
654 
655  wheelMeanHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
656  wheelMeanHistos[wh]->setBinLabel(1, "Sector1", 1);
657  wheelMeanHistos[wh]->setBinLabel(2, "Sector2", 1);
658  wheelMeanHistos[wh]->setBinLabel(3, "Sector3", 1);
659  wheelMeanHistos[wh]->setBinLabel(4, "Sector4", 1);
660  wheelMeanHistos[wh]->setBinLabel(5, "Sector5", 1);
661  wheelMeanHistos[wh]->setBinLabel(6, "Sector6", 1);
662  wheelMeanHistos[wh]->setBinLabel(7, "Sector7", 1);
663  wheelMeanHistos[wh]->setBinLabel(8, "Sector8", 1);
664  wheelMeanHistos[wh]->setBinLabel(9, "Sector9", 1);
665  wheelMeanHistos[wh]->setBinLabel(10, "Sector10", 1);
666  wheelMeanHistos[wh]->setBinLabel(11, "Sector11", 1);
667  wheelMeanHistos[wh]->setBinLabel(12, "Sector12", 1);
668  wheelMeanHistos[wh]->setBinLabel(13, "Sector13", 1);
669  wheelMeanHistos[wh]->setBinLabel(14, "Sector14", 1);
670  wheelMeanHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
671  wheelMeanHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
672  wheelMeanHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
673  wheelMeanHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
674  wheelMeanHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
675  wheelMeanHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
676  wheelMeanHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
677  wheelMeanHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
678  wheelMeanHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
679  wheelMeanHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
680  wheelMeanHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
681  }
682 
683  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
684  if (wheelSigmaHistos.find(wh) == wheelSigmaHistos.end()) {
685  string histoName = "SigmaSummaryRes_testFailed_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") +
686  "_W" + wheel.str();
687 
688  wheelSigmaHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
689  wheelSigmaHistos[wh]->setBinLabel(1, "Sector1", 1);
690  wheelSigmaHistos[wh]->setBinLabel(2, "Sector2", 1);
691  wheelSigmaHistos[wh]->setBinLabel(3, "Sector3", 1);
692  wheelSigmaHistos[wh]->setBinLabel(4, "Sector4", 1);
693  wheelSigmaHistos[wh]->setBinLabel(5, "Sector5", 1);
694  wheelSigmaHistos[wh]->setBinLabel(6, "Sector6", 1);
695  wheelSigmaHistos[wh]->setBinLabel(7, "Sector7", 1);
696  wheelSigmaHistos[wh]->setBinLabel(8, "Sector8", 1);
697  wheelSigmaHistos[wh]->setBinLabel(9, "Sector9", 1);
698  wheelSigmaHistos[wh]->setBinLabel(10, "Sector10", 1);
699  wheelSigmaHistos[wh]->setBinLabel(11, "Sector11", 1);
700  wheelSigmaHistos[wh]->setBinLabel(12, "Sector12", 1);
701  wheelSigmaHistos[wh]->setBinLabel(13, "Sector13", 1);
702  wheelSigmaHistos[wh]->setBinLabel(14, "Sector14", 1);
703  wheelSigmaHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
704  wheelSigmaHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
705  wheelSigmaHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
706  wheelSigmaHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
707  wheelSigmaHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
708  wheelSigmaHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
709  wheelSigmaHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
710  wheelSigmaHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
711  wheelSigmaHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
712  wheelSigmaHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
713  wheelSigmaHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
714  }
715  }
716 
717  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
718  if (wheelSlopeHistos.find(wh) == wheelSlopeHistos.end()) {
719  string histoName = "SlopeSummaryRes_testFailed_" + parameters.getUntrackedParameter<string>("STEP", "STEP3") +
720  "_W" + wheel.str();
721 
722  wheelSlopeHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
723  wheelSlopeHistos[wh]->setBinLabel(1, "Sector1", 1);
724  wheelSlopeHistos[wh]->setBinLabel(2, "Sector2", 1);
725  wheelSlopeHistos[wh]->setBinLabel(3, "Sector3", 1);
726  wheelSlopeHistos[wh]->setBinLabel(4, "Sector4", 1);
727  wheelSlopeHistos[wh]->setBinLabel(5, "Sector5", 1);
728  wheelSlopeHistos[wh]->setBinLabel(6, "Sector6", 1);
729  wheelSlopeHistos[wh]->setBinLabel(7, "Sector7", 1);
730  wheelSlopeHistos[wh]->setBinLabel(8, "Sector8", 1);
731  wheelSlopeHistos[wh]->setBinLabel(9, "Sector9", 1);
732  wheelSlopeHistos[wh]->setBinLabel(10, "Sector10", 1);
733  wheelSlopeHistos[wh]->setBinLabel(11, "Sector11", 1);
734  wheelSlopeHistos[wh]->setBinLabel(12, "Sector12", 1);
735  wheelSlopeHistos[wh]->setBinLabel(13, "Sector13", 1);
736  wheelSlopeHistos[wh]->setBinLabel(14, "Sector14", 1);
737  wheelSlopeHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
738  wheelSlopeHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
739  wheelSlopeHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
740  wheelSlopeHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
741  wheelSlopeHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
742  wheelSlopeHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
743  wheelSlopeHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
744  wheelSlopeHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
745  wheelSlopeHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
746  wheelSlopeHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
747  wheelSlopeHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
748  }
749  }
750 }
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
std::map< int, MonitorElement * > wheelSlopeHistos
void DTResolutionTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Endjob.

Implements DQMEDHarvester.

Definition at line 385 of file DTResolutionTest.cc.

385  {
386  edm::LogVerbatim("resolution") << "[DTResolutionTest] endjob called!";
387 
388  //FR: no idea if this output file needs to be written!! comment it for now
389  //bool outputMEsInRootFile = parameters.getParameter<bool>("OutputMEsInRootFile");
390  //if(outputMEsInRootFile){
391  // std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");
392  // dbe->save(outputFileName,"DT/CalibrationSummary");
393  //}
394 }
void DTResolutionTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 60 of file DTResolutionTest.cc.

References funct::abs(), bookHistos(), relativeConstraints::chamber, chambers, mps_splice::entry, edm::EventSetup::get(), dqm::dqmstoreimpl::DQMStore::IGetter::get(), QReport::getBadChannels(), dqm::impl::MonitorElement::getQReport(), dqm::legacy::MonitorElement::getTH2F(), timingPdfMaker::histo, mps_fire::i, edm::LuminosityBlockBase::id(), dqmiolumiharvest::j, edm::LuminosityBlockID::luminosityBlock(), genParticles_cff::map, SiStripPI::mean, Skims_PDWG_cff::prescaleFactor, DTChamberId::sector(), slope, DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superLayer(), DTSuperLayerId::superlayer(), DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, photonAnalyzer_cfi::xBin, and photonAnalyzer_cfi::yBin.

63  {
64  // counts number of updates (online mode) or number of events (standalone mode)
65  //nevents++;
66  // if running in standalone perform diagnostic only after a reasonalbe amount of events
67  //if ( parameters.getUntrackedParameter<bool>("runningStandalone", false) &&
68  // nevents%parameters.getUntrackedParameter<int>("diagnosticPrescale", 1000) != 0 ) return;
69  //edm::LogVerbatim ("resolution") << "[DTResolutionTest]: "<<nevents<<" updates";
70 
71  if (!bookingdone) {
72  // Get the geometry
73  context.get<MuonGeometryRecord>().get(muonGeom);
74 
75  // book the histos
76  for (int wheel = -2; wheel < 3; wheel++) {
77  bookHistos(ibooker, wheel);
78  }
79  vector<const DTChamber*> chambers = muonGeom->chambers();
80  for (vector<const DTChamber*>::const_iterator chamber = chambers.begin(); chamber != chambers.end(); ++chamber) {
81  bookHistos(ibooker, (*chamber)->id());
82  }
83  }
84  bookingdone = true;
85 
86  edm::LogVerbatim("resolution") << "[DTResolutionTest]: End of LS transition, performing the DQM client operation";
87 
88  // counts number of lumiSegs
89  nLumiSegs = lumiSeg.id().luminosityBlock();
90 
91  // prescale factor
92  if (nLumiSegs % prescaleFactor != 0)
93  return;
94 
95  for (map<int, MonitorElement*>::const_iterator histo = wheelMeanHistos.begin(); histo != wheelMeanHistos.end();
96  histo++) {
97  (*histo).second->Reset();
98  }
99  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
100  for (map<int, MonitorElement*>::const_iterator histo = wheelSigmaHistos.begin(); histo != wheelSigmaHistos.end();
101  histo++) {
102  (*histo).second->Reset();
103  }
104  }
105  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
106  for (map<int, MonitorElement*>::const_iterator histo = wheelSlopeHistos.begin(); histo != wheelSlopeHistos.end();
107  histo++) {
108  (*histo).second->Reset();
109  }
110  }
111 
112  cmsMeanHistos.clear();
113  for (int i = -2; i < 3; i++) {
114  for (int j = 1; j < 15; j++) {
115  MeanFilled[make_pair(i, j)] = false;
116  }
117  }
118  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
119  cmsSigmaHistos.clear();
120  for (int i = -2; i < 3; i++) {
121  for (int j = 1; j < 15; j++) {
122  SigmaFilled[make_pair(i, j)] = false;
123  }
124  }
125  }
126  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
127  cmsSlopeHistos.clear();
128  for (int i = -2; i < 3; i++) {
129  for (int j = 1; j < 15; j++) {
130  SlopeFilled[make_pair(i, j)] = false;
131  }
132  }
133  }
134 
135  // summary histos initialization
136  for (int wh = -2; wh <= 3; wh++) {
137  if (wh != 3) {
138  for (int xBin = 0; xBin < 14; xBin++) {
139  for (int yBin = 0; yBin < 11; yBin++) {
140  wheelMeanHistos[wh]->setBinContent(xBin, yBin, 0);
141  if (parameters.getUntrackedParameter<bool>("sigmaTest"))
142  wheelSigmaHistos[wh]->setBinContent(xBin, yBin, 0);
143  if (parameters.getUntrackedParameter<bool>("slopeTest"))
144  wheelSlopeHistos[wh]->setBinContent(xBin, yBin, 0);
145  }
146  }
147  } else {
148  for (int xBin = 0; xBin < 14; xBin++) {
149  for (int yBin = -2; yBin < 3; yBin++) {
150  wheelMeanHistos[wh]->setBinContent(xBin, yBin, 0);
151  if (parameters.getUntrackedParameter<bool>("sigmaTest"))
152  wheelSigmaHistos[wh]->setBinContent(xBin, yBin, 0);
153  if (parameters.getUntrackedParameter<bool>("slopeTest"))
154  wheelSlopeHistos[wh]->setBinContent(xBin, yBin, 0);
155  }
156  }
157  }
158  }
159 
160  edm::LogVerbatim("resolution") << "[DTResolutionTest]: " << nLumiSegs << " updates";
161 
162  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
163  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
164 
165  edm::LogVerbatim("resolution") << "[DTResolutionTest]: Residual Distribution tests results";
166 
167  for (; ch_it != ch_end; ++ch_it) {
168  DTChamberId chID = (*ch_it)->id();
169 
170  // Fill the test histos
171  int entry = -1;
172  if (chID.station() == 1)
173  entry = 0;
174  if (chID.station() == 2)
175  entry = 3;
176  if (chID.station() == 3)
177  entry = 6;
178  if (chID.station() == 4)
179  entry = 9;
180 
181  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
182  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
183 
184  for (; sl_it != sl_end; ++sl_it) {
185  DTSuperLayerId slID = (*sl_it)->id();
186 
187  edm::LogVerbatim("resolution") << "[DTResolutionTest]: Superlayer: " << slID;
188 
189  stringstream wheel;
190  wheel << slID.wheel();
191  stringstream station;
192  station << slID.station();
193  stringstream sector;
194  sector << slID.sector();
195  stringstream superLayer;
196  superLayer << slID.superlayer();
197 
198  string HistoName = "W" + wheel.str() + "_Sec" + sector.str();
199  string supLayer = "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str();
200 
201  MonitorElement* res_histo = igetter.get(getMEName(slID));
202  if (res_histo) {
203  // gaussian test
204  string GaussianCriterionName =
205  parameters.getUntrackedParameter<string>("resDistributionTestName", "ResidualsDistributionGaussianTest");
206  const QReport* GaussianReport = res_histo->getQReport(GaussianCriterionName);
207  if (GaussianReport) {
208  // FIXE ME: if the quality test fails this cout returns a null pointer
209  //edm::LogWarning ("resolution") << "-------- SuperLayer : "<<supLayer<<" "
210  // <<GaussianReport->getMessage()<<" ------- "<<GaussianReport->getStatus();
211  }
212  int BinNumber = entry + slID.superLayer();
213  if (BinNumber == 12)
214  BinNumber = 11;
215  float mean = (*res_histo).getMean(1);
216  float sigma = (*res_histo).getRMS(1);
217  MeanHistos.find(make_pair(slID.wheel(), slID.sector()))->second->setBinContent(BinNumber, mean);
218  if (parameters.getUntrackedParameter<bool>("sigmaTest"))
219  SigmaHistos.find(make_pair(slID.wheel(), slID.sector()))->second->setBinContent(BinNumber, sigma);
220  }
221 
222  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
223  MonitorElement* res_histo_2D = igetter.get(getMEName2D(slID));
224  if (res_histo_2D) {
225  TH2F* res_histo_2D_root = res_histo_2D->getTH2F();
226  int BinNumber = entry + slID.superLayer();
227  if (BinNumber == 12)
228  BinNumber = 11;
229  TProfile* prof = res_histo_2D_root->ProfileX();
230  prof->GetXaxis()->SetRangeUser(0, 2);
231  //prof->Fit("pol1","Q0");
232  //need our own copy to avoid threading problems
233  TF1 fitting("mypol1", "pol1");
234  try {
235  prof->Fit(&fitting, "Q0");
236  } catch (cms::Exception& iException) {
237  edm::LogError("resolution") << "[DTResolutionTest]: Exception when fitting..."
238  << "SuperLayer : " << slID << "\n"
239  << " STEP : "
240  << parameters.getUntrackedParameter<string>("STEP", "STEP3") << "\n"
241  << "Filling slope histogram with standard value -99. for bin " << BinNumber;
242  SlopeHistos.find(make_pair(slID.wheel(), slID.sector()))->second->setBinContent(BinNumber, -99.);
243  continue;
244  }
245  double slope = fitting.GetParameter(1);
246  SlopeHistos.find(make_pair(slID.wheel(), slID.sector()))->second->setBinContent(BinNumber, slope);
247  }
248  }
249  }
250  }
251 
252  // Mean test
253  string MeanCriterionName = parameters.getUntrackedParameter<string>("meanTestName", "ResidualsMeanInRange");
254  for (map<pair<int, int>, MonitorElement*>::const_iterator hMean = MeanHistos.begin(); hMean != MeanHistos.end();
255  hMean++) {
256  const QReport* theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
257  stringstream wheel;
258  wheel << (*hMean).first.first;
259  stringstream sector;
260  sector << (*hMean).first.second;
261  // Report the channels failing the test on the mean
262  if (theMeanQReport) {
263  vector<dqm::me_util::Channel> badChannels = theMeanQReport->getBadChannels();
264  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
265  channel++) {
266  edm::LogError("resolution") << "Bad mean channel: wh: " << wheel.str()
267  << " st: " << stationFromBin((*channel).getBin()) << " sect: " << sector.str()
268  << " sl: " << slFromBin((*channel).getBin())
269  << " mean (cm): " << (*channel).getContents();
270  string HistoName = "W" + wheel.str() + "_Sec" + sector.str();
271  if (parameters.getUntrackedParameter<bool>("meanWrongHisto")) {
272  MeanHistosSetRange.find(HistoName)->second->Fill((*channel).getBin());
273  MeanHistosSetRange2D.find(HistoName)->second->Fill((*channel).getBin(), (*channel).getContents());
274  }
275  // fill the wheel summary histos if the SL has not passed the test
276  if (abs((*channel).getContents()) < parameters.getUntrackedParameter<double>("meanMaxLimit"))
277  wheelMeanHistos[(*hMean).first.first]->Fill(((*hMean).first.second) - 1, (*channel).getBin() - 1, 1);
278  else
279  wheelMeanHistos[(*hMean).first.first]->Fill(((*hMean).first.second) - 1, (*channel).getBin() - 1, 2);
280  // fill the cms summary histo if the percentual of SL which have not passed the test
281  // is more than a predefined treshold
282  if (abs((*channel).getContents()) > parameters.getUntrackedParameter<double>("meanMaxLimit")) {
283  cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]++;
284  if (((*hMean).first.second < 13 &&
285  double(cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]) / 11 >
286  double(percentual) / 100 &&
287  MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] == false) ||
288  ((*hMean).first.first >= 13 &&
289  double(cmsMeanHistos[make_pair((*hMean).first.first, (*hMean).first.second)]) / 2 >
290  double(percentual) / 100 &&
291  MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] == false)) {
292  MeanFilled[make_pair((*hMean).first.first, (*hMean).first.second)] = true;
293  wheelMeanHistos[3]->Fill(((*hMean).first.second) - 1, (*hMean).first.first);
294  }
295  }
296  }
297  }
298  }
299 
300  // Sigma test
301  if (parameters.getUntrackedParameter<bool>("sigmaTest")) {
302  string SigmaCriterionName = parameters.getUntrackedParameter<string>("sigmaTestName", "ResidualsSigmaInRange");
303  for (map<pair<int, int>, MonitorElement*>::const_iterator hSigma = SigmaHistos.begin(); hSigma != SigmaHistos.end();
304  hSigma++) {
305  const QReport* theSigmaQReport = (*hSigma).second->getQReport(SigmaCriterionName);
306  stringstream wheel;
307  wheel << (*hSigma).first.first;
308  stringstream sector;
309  sector << (*hSigma).first.second;
310  if (theSigmaQReport) {
311  vector<dqm::me_util::Channel> badChannels = theSigmaQReport->getBadChannels();
312  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
313  channel++) {
314  edm::LogError("resolution") << "Bad sigma: wh: " << wheel.str()
315  << " st: " << stationFromBin((*channel).getBin()) << " sect: " << sector.str()
316  << " sl: " << slFromBin((*channel).getBin())
317  << " sigma (cm): " << (*channel).getContents();
318  string HistoName = "W" + wheel.str() + "_Sec" + sector.str();
319  SigmaHistosSetRange.find(HistoName)->second->Fill((*channel).getBin());
320  SigmaHistosSetRange2D.find(HistoName)->second->Fill((*channel).getBin(), (*channel).getContents());
321  // fill the wheel summary histos if the SL has not passed the test
322  wheelSigmaHistos[(*hSigma).first.first]->Fill(((*hSigma).first.second) - 1, (*channel).getBin() - 1);
323  // fill the cms summary histo if the percentual of SL which have not passed the test
324  // is more than a predefined treshold
325  cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]++;
326  if (((*hSigma).first.second < 13 &&
327  double(cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]) / 11 >
328  double(percentual) / 100 &&
329  SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] == false) ||
330  ((*hSigma).first.first >= 13 &&
331  double(cmsSigmaHistos[make_pair((*hSigma).first.first, (*hSigma).first.second)]) / 2 >
332  double(percentual) / 100 &&
333  SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] == false)) {
334  SigmaFilled[make_pair((*hSigma).first.first, (*hSigma).first.second)] = true;
335  wheelSigmaHistos[3]->Fill((*hSigma).first.second - 1, (*hSigma).first.first);
336  }
337  }
338  }
339  }
340  }
341 
342  // Slope test
343  if (parameters.getUntrackedParameter<bool>("slopeTest")) {
344  string SlopeCriterionName = parameters.getUntrackedParameter<string>("slopeTestName", "ResidualsSlopeInRange");
345  for (map<pair<int, int>, MonitorElement*>::const_iterator hSlope = SlopeHistos.begin(); hSlope != SlopeHistos.end();
346  hSlope++) {
347  const QReport* theSlopeQReport = (*hSlope).second->getQReport(SlopeCriterionName);
348  stringstream wheel;
349  wheel << (*hSlope).first.first;
350  stringstream sector;
351  sector << (*hSlope).first.second;
352  if (theSlopeQReport) {
353  vector<dqm::me_util::Channel> badChannels = theSlopeQReport->getBadChannels();
354  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
355  channel++) {
356  edm::LogError("resolution") << "Bad slope: wh: " << wheel.str()
357  << " st: " << stationFromBin((*channel).getBin()) << " sect: " << sector.str()
358  << " sl: " << slFromBin((*channel).getBin())
359  << " slope: " << (*channel).getContents();
360  string HistoName = "W" + wheel.str() + "_Sec" + sector.str();
361  SlopeHistosSetRange.find(HistoName)->second->Fill((*channel).getBin());
362  SlopeHistosSetRange2D.find(HistoName)->second->Fill((*channel).getBin(), (*channel).getContents());
363  // fill the wheel summary histos if the SL has not passed the test
364  wheelSlopeHistos[(*hSlope).first.first]->Fill(((*hSlope).first.second) - 1, (*channel).getBin() - 1);
365  // fill the cms summary histo if the percentual of SL which have not passed the test
366  // is more than a predefined treshold
367  cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]++;
368  if (((*hSlope).first.second < 13 &&
369  double(cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]) / 11 >
370  double(percentual) / 100 &&
371  SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] == false) ||
372  ((*hSlope).first.first >= 13 &&
373  double(cmsSlopeHistos[make_pair((*hSlope).first.first, (*hSlope).first.second)]) / 2 >
374  double(percentual) / 100 &&
375  SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] == false)) {
376  SlopeFilled[make_pair((*hSlope).first.first, (*hSlope).first.second)] = true;
377  wheelSlopeHistos[3]->Fill((*hSlope).first.second - 1, (*hSlope).first.first);
378  }
379  }
380  }
381  }
382  }
383 }
std::map< std::pair< int, int >, int > cmsMeanHistos
std::map< std::string, MonitorElement * > MeanHistosSetRange
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
virtual TH2F * getTH2F() const
const std::vector< DQMChannel > & getBadChannels() const
Definition: QReport.h:37
static const double slope[3]
edm::ESHandle< DTGeometry > muonGeom
std::map< std::pair< int, int >, MonitorElement * > MeanHistos
std::map< std::pair< int, int >, MonitorElement * > SlopeHistos
std::map< std::pair< int, int >, bool > MeanFilled
std::map< std::string, MonitorElement * > SigmaHistosSetRange2D
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
std::string getMEName(const DTSuperLayerId &slID)
Get the ME name.
std::map< std::pair< int, int >, int > cmsSigmaHistos
std::map< std::pair< int, int >, MonitorElement * > SigmaHistos
void bookHistos(DQMStore::IBooker &, const DTChamberId &ch)
book the new ME
std::map< std::string, MonitorElement * > MeanHistosSetRange2D
unsigned int nLumiSegs
std::map< std::string, MonitorElement * > SlopeHistosSetRange2D
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int superLayer() const
Return the superlayer number.
std::map< std::pair< int, int >, int > cmsSlopeHistos
int superlayer() const
Return the superlayer number (deprecated method name)
std::map< std::string, MonitorElement * > SigmaHistosSetRange
std::string getMEName2D(const DTSuperLayerId &slID)
std::map< int, MonitorElement * > wheelMeanHistos
std::map< int, MonitorElement * > wheelSigmaHistos
std::map< std::pair< int, int >, bool > SigmaFilled
std::string HistoName
int slFromBin(int bin) const
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
std::map< std::string, MonitorElement * > SlopeHistosSetRange
std::map< int, MonitorElement * > wheelSlopeHistos
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int stationFromBin(int bin) const
std::map< std::pair< int, int >, bool > SlopeFilled
string DTResolutionTest::getMEName ( const DTSuperLayerId slID)
protected

Get the ME name.

Definition at line 396 of file DTResolutionTest.cc.

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, dtChamberEfficiencyTest_cfi::folderRoot, dtResolutionTest_cfi::histoTag, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

396  {
397  stringstream wheel;
398  wheel << slID.wheel();
399  stringstream station;
400  station << slID.station();
401  stringstream sector;
402  sector << slID.sector();
403  stringstream superLayer;
404  superLayer << slID.superlayer();
405 
406  string folderRoot = parameters.getUntrackedParameter<string>("folderRoot", "Collector/FU0/");
407  string folderName;
408 
409  if (parameters.getUntrackedParameter<bool>("calibModule", false)) {
410  folderName = folderRoot + "DT/DTCalibValidation/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
411  sector.str() + "/";
412  } else {
413  folderName = folderRoot + "DT/DTResolutionAnalysisTask/Wheel" + wheel.str() + "/Station" + station.str() +
414  "/Sector" + sector.str() + "/";
415  }
416 
417  string histoTag = parameters.getUntrackedParameter<string>("histoTag", "hResDist");
418 
419  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
420  "_SL" + superLayer.str();
421 
422  return histoname;
423 }
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
string DTResolutionTest::getMEName2D ( const DTSuperLayerId slID)
protected

Definition at line 425 of file DTResolutionTest.cc.

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, dtChamberEfficiencyTest_cfi::folderRoot, dtResolutionTest_cfi::histoTag2D, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

425  {
426  stringstream wheel;
427  wheel << slID.wheel();
428  stringstream station;
429  station << slID.station();
430  stringstream sector;
431  sector << slID.sector();
432  stringstream superLayer;
433  superLayer << slID.superlayer();
434 
435  string folderRoot = parameters.getUntrackedParameter<string>("folderRoot", "Collector/FU0/");
436  string folderName;
437 
438  if (parameters.getUntrackedParameter<bool>("calibModule", false)) {
439  folderName = folderRoot + "DT/DTCalibValidation/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
440  sector.str() + "/";
441  } else {
442  folderName = folderRoot + "DT/DTResolutionAnalysisTask/Wheel" + wheel.str() + "/Station" + station.str() +
443  "/Sector" + sector.str() + "/";
444  }
445 
446  string histoTag2D = parameters.getUntrackedParameter<string>("histoTag2D", "hResDistVsDist");
447 
448  string histoname = folderName + histoTag2D + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
449  "_SL" + superLayer.str();
450 
451  return histoname;
452 }
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
int DTResolutionTest::slFromBin ( int  bin) const
private

Definition at line 754 of file DTResolutionTest.cc.

References runTheMatrix::ret.

754  {
755  int ret = bin % 3;
756  if (ret == 0 || bin == 11)
757  ret = 3;
758 
759  return ret;
760 }
ret
prodAgent to be discontinued
int DTResolutionTest::stationFromBin ( int  bin) const
private

Definition at line 752 of file DTResolutionTest.cc.

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

Member Data Documentation

bool DTResolutionTest::bookingdone
private

Definition at line 75 of file DTResolutionTest.h.

std::map<std::pair<int, int>, int> DTResolutionTest::cmsMeanHistos
private

Definition at line 97 of file DTResolutionTest.h.

std::map<std::pair<int, int>, int> DTResolutionTest::cmsSigmaHistos
private

Definition at line 99 of file DTResolutionTest.h.

std::map<std::pair<int, int>, int> DTResolutionTest::cmsSlopeHistos
private

Definition at line 101 of file DTResolutionTest.h.

std::map<std::pair<int, int>, bool> DTResolutionTest::MeanFilled
private

Definition at line 98 of file DTResolutionTest.h.

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

Definition at line 81 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::MeanHistosSetRange
private

Definition at line 84 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::MeanHistosSetRange2D
private

Definition at line 87 of file DTResolutionTest.h.

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

Definition at line 78 of file DTResolutionTest.h.

int DTResolutionTest::nevents
private

Definition at line 69 of file DTResolutionTest.h.

unsigned int DTResolutionTest::nLumiSegs
private

Definition at line 70 of file DTResolutionTest.h.

edm::ParameterSet DTResolutionTest::parameters
private
int DTResolutionTest::percentual
private

Definition at line 73 of file DTResolutionTest.h.

int DTResolutionTest::prescaleFactor
private

Definition at line 71 of file DTResolutionTest.h.

int DTResolutionTest::run
private
std::map<std::pair<int, int>, bool> DTResolutionTest::SigmaFilled
private

Definition at line 100 of file DTResolutionTest.h.

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

Definition at line 82 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::SigmaHistosSetRange
private

Definition at line 85 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::SigmaHistosSetRange2D
private

Definition at line 88 of file DTResolutionTest.h.

std::map<std::pair<int, int>, bool> DTResolutionTest::SlopeFilled
private

Definition at line 102 of file DTResolutionTest.h.

std::map<std::pair<int, int>, MonitorElement*> DTResolutionTest::SlopeHistos
private

Definition at line 83 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::SlopeHistosSetRange
private

Definition at line 86 of file DTResolutionTest.h.

std::map<std::string, MonitorElement*> DTResolutionTest::SlopeHistosSetRange2D
private

Definition at line 89 of file DTResolutionTest.h.

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

Definition at line 92 of file DTResolutionTest.h.

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

Definition at line 93 of file DTResolutionTest.h.

std::map<int, MonitorElement*> DTResolutionTest::wheelSlopeHistos
private

Definition at line 94 of file DTResolutionTest.h.