CMS 3D CMS Logo

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

#include <MuonTrackResidualsTest.h>

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

 MuonTrackResidualsTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~MuonTrackResidualsTest () 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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- 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 Attributes

std::string GaussianCriterionName
 
std::map< std::string, std::vector< std::string > > histoNames
 
std::string MeanCriterionName
 
std::map< std::string, MonitorElement * > MeanHistos
 
std::string metname
 
edm::ParameterSet parameters
 
int prescaleFactor
 
std::string SigmaCriterionName
 
std::map< std::string,MonitorElement * > SigmaHistos
 

Additional Inherited Members

- 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 36 of file MuonTrackResidualsTest.h.

Constructor & Destructor Documentation

MuonTrackResidualsTest::MuonTrackResidualsTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 35 of file MuonTrackResidualsTest.cc.

References nanoDQM_cff::prescaleFactor.

35  {
36  parameters = ps;
37 
38  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
39 
40  GaussianCriterionName = parameters.getUntrackedParameter<string>("resDistributionTestName","ResidualsDistributionGaussianTest");
41  SigmaCriterionName = parameters.getUntrackedParameter<string>("sigmaTestName","ResidualsSigmaInRange");
42  MeanCriterionName = parameters.getUntrackedParameter<string>("meanTestName","ResidualsMeanInRange");
43 }
MuonTrackResidualsTest::~MuonTrackResidualsTest ( )
inlineoverride

Destructor.

Definition at line 44 of file MuonTrackResidualsTest.h.

References dqmEndJob().

44 {};

Member Function Documentation

void MuonTrackResidualsTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 44 of file MuonTrackResidualsTest.cc.

References DQMStore::IBooker::book1D(), EnergyCorrector::c, DQMStore::IGetter::get(), QReport::getBadChannels(), trackerHits::histo, genParticles_cff::map, SiStripPI::mean, callgraph::path, and DQMStore::IBooker::setCurrentFolder().

Referenced by ~MuonTrackResidualsTest().

44  {
45 
49  ibooker.setCurrentFolder("Muons/Tests/trackResidualsTest");
50 
51  string histName, MeanHistoName, SigmaHistoName, MeanHistoTitle, SigmaHistoTitle;
52  vector<string> type;
53  type.push_back("eta");
54  type.push_back("theta");
55  type.push_back("phi");
56 
57 
58  for(unsigned int c=0; c<type.size(); c++){
59 
60  MeanHistoName = "MeanTest_" + type[c];
61  SigmaHistoName = "SigmaTest_" + type[c];
62 
63  MeanHistoTitle = "Mean of the #" + type[c] + " residuals distribution";
64  SigmaHistoTitle = "Sigma of the #" + type[c] + " residuals distribution";
65 
66  histName = "Res_GlbSta_"+type[c];
67  histoNames[type[c]].push_back(histName);
68  histName = "Res_TkGlb_"+type[c];
69  histoNames[type[c]].push_back(histName);
70  histName = "Res_TkSta_"+type[c];
71  histoNames[type[c]].push_back(histName);
72 
73 
74  MeanHistos[type[c]] = ibooker.book1D(MeanHistoName.c_str(),MeanHistoTitle.c_str(),3,0.5,3.5);
75  (MeanHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1);
76  (MeanHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1);
77  (MeanHistos[type[c]])->setBinLabel(3,"Res_TkSta",1);
78 
79 
80  SigmaHistos[type[c]] = ibooker.book1D(SigmaHistoName.c_str(),SigmaHistoTitle.c_str(),3,0.5,3.5);
81  (SigmaHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1);
82  (SigmaHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1);
83  (SigmaHistos[type[c]])->setBinLabel(3,"Res_TkSta",1);
84 
85  }
86 
90  for(map<string, vector<string> > ::const_iterator histo = histoNames.begin();
91  histo != histoNames.end();
92  histo++) {
93 
94  for (unsigned int type=0; type< (*histo).second.size(); type++){
95 
96  string path = "Muons/MuonRecoAnalyzer/" + (*histo).second[type];
97  MonitorElement * res_histo = igetter.get(path);
98  if (res_histo) {
99 
100  // gaussian test
101  // const QReport *GaussianReport = res_histo->getQReport(GaussianCriterionName);
102  int BinNumber = type+1;
103  float mean = (*res_histo).getMean(1);
104  float sigma = (*res_histo).getRMS(1);
105  MeanHistos.find((*histo).first)->second->setBinContent(BinNumber, mean);
106  SigmaHistos.find((*histo).first)->second->setBinContent(BinNumber, sigma);
107  }
108  }
109  }
110 
111 
112  // Mean test
113  for(map<string, MonitorElement*>::const_iterator hMean = MeanHistos.begin();
114  hMean != MeanHistos.end();
115  hMean++) {
116  const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
117  if(theMeanQReport) {
118  vector<dqm::me_util::Channel> badChannels = theMeanQReport->getBadChannels();
119  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
120  channel != badChannels.end(); channel++) {
121  }
122  }
123  }
124 
125  // Sigma test
126  for(map<string, MonitorElement*>::const_iterator hSigma = SigmaHistos.begin();
127  hSigma != SigmaHistos.end();
128  hSigma++) {
129  const QReport * theSigmaQReport = (*hSigma).second->getQReport(SigmaCriterionName);
130  if(theSigmaQReport) {
131  vector<dqm::me_util::Channel> badChannels = theSigmaQReport->getBadChannels();
132  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
133  channel != badChannels.end(); channel++) {
134  }
135  }
136  }
137 }
type
Definition: HCALResponse.h:21
const std::vector< DQMChannel > & getBadChannels() const
Definition: QReport.h:33
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< std::string, MonitorElement * > MeanHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::map< std::string, std::vector< std::string > > histoNames
std::map< std::string,MonitorElement * > SigmaHistos

Member Data Documentation

std::string MuonTrackResidualsTest::GaussianCriterionName
private

Definition at line 58 of file MuonTrackResidualsTest.h.

std::map< std::string, std::vector<std::string> > MuonTrackResidualsTest::histoNames
private

Definition at line 62 of file MuonTrackResidualsTest.h.

std::string MuonTrackResidualsTest::MeanCriterionName
private

Definition at line 59 of file MuonTrackResidualsTest.h.

std::map< std::string, MonitorElement* > MuonTrackResidualsTest::MeanHistos
private

Definition at line 65 of file MuonTrackResidualsTest.h.

std::string MuonTrackResidualsTest::metname
private

Definition at line 53 of file MuonTrackResidualsTest.h.

edm::ParameterSet MuonTrackResidualsTest::parameters
private
int MuonTrackResidualsTest::prescaleFactor
private

Definition at line 57 of file MuonTrackResidualsTest.h.

std::string MuonTrackResidualsTest::SigmaCriterionName
private

Definition at line 60 of file MuonTrackResidualsTest.h.

std::map< std::string ,MonitorElement* > MuonTrackResidualsTest::SigmaHistos
private

Definition at line 66 of file MuonTrackResidualsTest.h.