CMS 3D CMS Logo

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

#include <MuonTrackResidualsTest.h>

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

Public Member Functions

 MuonTrackResidualsTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~MuonTrackResidualsTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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

Detailed Description

Definition at line 36 of file MuonTrackResidualsTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file MuonTrackResidualsTest.cc.

References Parameters::parameters, and dtDQMClient_cfg::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 }
T getUntrackedParameter(std::string const &, T const &) const
virtual MuonTrackResidualsTest::~MuonTrackResidualsTest ( )
inlinevirtual

Destructor.

Definition at line 44 of file MuonTrackResidualsTest.h.

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(), timingPdfMaker::histo, python.multivaluedict::map(), timingPdfMaker::mean, cmsHarvester::path, and DQMStore::IBooker::setCurrentFolder().

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
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
tuple path
else: Piece not in the list, fine.
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
const std::vector< DQMChannel > & getBadChannels(void) const
Definition: QReport.h:33
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.