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
MuonRecoTest Class Reference

#include <MuonRecoTest.h>

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

Public Member Functions

 MuonRecoTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~MuonRecoTest ()
 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
 Endjob. More...
 
- 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 EfficiencyCriterionName
 
int etaBin
 
MonitorElementetaEfficiency
 
double etaMax
 
double etaMin
 
std::vector< MonitorElement * > globalRotation
 
std::string metname
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int phiBin
 
MonitorElementphiEfficiency
 
double phiMax
 
double phiMin
 
int prescaleFactor
 
int run
 

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 MuonRecoTest.h.

Constructor & Destructor Documentation

MuonRecoTest::MuonRecoTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 35 of file MuonRecoTest.cc.

References Parameters::parameters, and dtDQMClient_cfg::prescaleFactor.

35  {
36 
37  parameters = ps;
38 
39  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
40 
41  // Parameters
42  etaBin = parameters.getParameter<int>("etaBin");
43  etaMin = parameters.getParameter<double>("etaMin");
44  etaMax = parameters.getParameter<double>("etaMax");
45 
46  phiBin = parameters.getParameter<int>("phiBin");
47  phiMin = parameters.getParameter<double>("phiMin");
48  phiMax = parameters.getParameter<double>("phiMax");
49 
50  EfficiencyCriterionName = parameters.getUntrackedParameter<string>("efficiencyTestName","EfficiencyInRange");
51 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string EfficiencyCriterionName
Definition: MuonRecoTest.h:63
double etaMin
Definition: MuonRecoTest.h:65
double etaMax
Definition: MuonRecoTest.h:66
double phiMax
Definition: MuonRecoTest.h:70
edm::ParameterSet parameters
Definition: MuonRecoTest.h:60
double phiMin
Definition: MuonRecoTest.h:69
int prescaleFactor
Definition: MuonRecoTest.h:56
virtual MuonRecoTest::~MuonRecoTest ( )
inlinevirtual

Destructor.

Definition at line 44 of file MuonRecoTest.h.

44 {};

Member Function Documentation

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

Endjob.

BOOKING NEW HISTOGRAMS

GETTING PREVIOUS HISTOS AND DO SOME OPERATIONS

Implements DQMEDHarvester.

Definition at line 52 of file MuonRecoTest.cc.

References DQMStore::IBooker::book1D(), postValidation_cfi::efficiency, DQMStore::IGetter::get(), QReport::getBadChannels(), QReport::getMessage(), QReport::getStatus(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), i, LogTrace, metname, cmsHarvester::path, DQMStore::IBooker::setCurrentFolder(), mathSSE::sqrt(), and x.

52  {
53 
55  ibooker.setCurrentFolder("Muons/Tests/muonRecoTest");
56  // efficiency plot
57  etaEfficiency = ibooker.book1D("etaEfficiency_staMuon", "#eta_{STA} efficiency", etaBin, etaMin, etaMax);
58  phiEfficiency = ibooker.book1D("phiEfficiency_staMuon", "#phi_{STA} efficiency", phiBin, phiMin, phiMax);
59 
60  // alignment plots
61  globalRotation.push_back(ibooker.book1D("muVStkSytemRotation_posMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}",50,0,200));
62  globalRotation.push_back(ibooker.book1D("muVStkSytemRotation_negMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{-}",50,0,200));
63  globalRotation.push_back(ibooker.book1D("muVStkSytemRotation_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}-#mu^{-}",50,0,200));
64 
65 
67  string path = "Muons/MuonRecoAnalyzer/StaEta_ifCombinedAlso";
68  MonitorElement * staEtaIfComb_histo = igetter.get(path);
69  path = "Muons/MuonRecoAnalyzer/StaEta";
70  MonitorElement * staEta_histo = igetter.get(path);
71 
72  if(staEtaIfComb_histo && staEta_histo){
73  TH1F * staEtaIfComb_root = staEtaIfComb_histo->getTH1F();
74  TH1F * staEta_root = staEta_histo->getTH1F();
75 
76  if(staEtaIfComb_root->GetXaxis()->GetNbins()!=etaBin
77  || staEtaIfComb_root->GetXaxis()->GetXmax()!=etaMax
78  || staEtaIfComb_root->GetXaxis()->GetXmin()!=etaMin){
79  LogTrace(metname)<<"[MuonRecoTest] wrong histo binning on eta histograms";
80  return;
81  }
82 
83  for(int i=1; i<=etaBin; i++){
84  if(staEta_root->GetBinContent(i)!=0){
85  double efficiency = double(staEtaIfComb_root->GetBinContent(i))/double(staEta_root->GetBinContent(i));
86  etaEfficiency->setBinContent(i,efficiency);
87  }
88  }
89  }
90 
91  path = "Muons/MuonRecoAnalyzer/StaPhi_ifCombinedAlso";
92  MonitorElement * staPhiIfComb_histo = igetter.get(path);
93  path = "Muons/MuonRecoAnalyzer/StaPhi";
94  MonitorElement * staPhi_histo = igetter.get(path);
95 
96  if(staPhiIfComb_histo && staPhi_histo){
97 
98  TH1F * staPhiIfComb_root = staPhiIfComb_histo->getTH1F();
99  TH1F * staPhi_root = staPhi_histo->getTH1F();
100 
101  if(staPhiIfComb_root->GetXaxis()->GetNbins()!=phiBin
102  || staPhiIfComb_root->GetXaxis()->GetXmax()!=phiMax
103  || staPhiIfComb_root->GetXaxis()->GetXmin()!=phiMin){
104  LogTrace(metname)<<"[MuonRecoTest] wrong histo binning on phi histograms";
105  return;
106  }
107 
108  for(int i=1; i<=etaBin; i++){
109  if(staPhi_root->GetBinContent(i)!=0){
110  double efficiency = double(staPhiIfComb_root->GetBinContent(i))/double(staPhi_root->GetBinContent(i));
111  phiEfficiency->setBinContent(i,efficiency);
112  }
113  }
114  }
115 
116 
117  // efficiency test
118 
119 
120  // eta efficiency
121  const QReport * theEtaQReport = etaEfficiency->getQReport(EfficiencyCriterionName);
122  if(theEtaQReport) {
123  vector<dqm::me_util::Channel> badChannels = theEtaQReport->getBadChannels();
124  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
125  channel != badChannels.end(); channel++) {
126  LogTrace(metname)<<"[etaEfficiency test] bad ranges: "<<(*channel).getBin()<<" Contents : "<<(*channel).getContents()<<endl;
127  }
128  LogTrace(metname)<< "-------- type: [etaEfficiency] "<<theEtaQReport->getMessage()<<" ------- "<<theEtaQReport->getStatus()<<endl;
129  }
130  // phi efficiency
131  const QReport * thePhiQReport = phiEfficiency->getQReport(EfficiencyCriterionName);
132  if(thePhiQReport) {
133  vector<dqm::me_util::Channel> badChannels = thePhiQReport->getBadChannels();
134  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
135  channel != badChannels.end(); channel++) {
136  LogTrace(metname)<< "[phiEfficiency test] bad ranges: "<<(*channel).getBin()<<" Contents : "<<(*channel).getContents()<<endl;
137  }
138  LogTrace(metname)<<"-------- type: [phiEfficiency] "<<thePhiQReport->getMessage()<<" ------- "<<thePhiQReport->getStatus()<<endl;
139  }
140 
141  //alignment plot
142  string pathPos = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_posMu";
143  MonitorElement * muVStkSytemRotation_posMu_histo = igetter.get(pathPos);
144  string pathNeg = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_negMu";
145  MonitorElement * muVStkSytemRotation_negMu_histo = igetter.get(pathNeg);
146  if(muVStkSytemRotation_posMu_histo && muVStkSytemRotation_negMu_histo){
147 
148  TH2F * muVStkSytemRotation_posMu_root = muVStkSytemRotation_posMu_histo->getTH2F();
149  TProfile * muVStkSytemRotation_posMu_profile = muVStkSytemRotation_posMu_root->ProfileX("",1,100);
150  TH2F * muVStkSytemRotation_negMu_root = muVStkSytemRotation_negMu_histo->getTH2F();
151  TProfile * muVStkSytemRotation_negMu_profile = muVStkSytemRotation_negMu_root->ProfileX("",1,100);
152 
153  for(int x=1; x<50; x++){
154  globalRotation[0]->Fill((x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(x));
155  globalRotation[0]->setBinError(x,muVStkSytemRotation_posMu_profile->GetBinError(x));
156  globalRotation[1]->Fill((x*4)-1,muVStkSytemRotation_negMu_profile->GetBinContent(x));
157  globalRotation[1]->setBinError(x,muVStkSytemRotation_negMu_profile->GetBinError(x));
158  globalRotation[2]->Fill((x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(x)-muVStkSytemRotation_negMu_profile->GetBinContent(x));
159  globalRotation[2]->setBinError(x,sqrt((muVStkSytemRotation_posMu_profile->GetBinError(x)*muVStkSytemRotation_posMu_profile->GetBinError(x))
160  + (muVStkSytemRotation_negMu_profile->GetBinError(x)*muVStkSytemRotation_negMu_profile->GetBinError(x))));
161  }
162  }
163 
164 }
int i
Definition: DBlmapReader.cc:9
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
void setBinContent(int binx, double content)
set content of bin (1-D)
std::string EfficiencyCriterionName
Definition: MuonRecoTest.h:63
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
const std::string & getMessage(void) const
get message attached to test
Definition: QReport.h:24
double etaMin
Definition: MuonRecoTest.h:65
tuple path
else: Piece not in the list, fine.
std::vector< MonitorElement * > globalRotation
Definition: MuonRecoTest.h:76
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
Definition: QReport.h:16
std::string metname
Definition: MuonRecoTest.h:59
const std::vector< DQMChannel > & getBadChannels(void) const
Definition: QReport.h:33
#define LogTrace(id)
double etaMax
Definition: MuonRecoTest.h:66
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * phiEfficiency
Definition: MuonRecoTest.h:74
double phiMax
Definition: MuonRecoTest.h:70
TH1F * getTH1F(void) const
Definition: DDAxes.h:10
TH2F * getTH2F(void) const
double phiMin
Definition: MuonRecoTest.h:69
MonitorElement * etaEfficiency
Definition: MuonRecoTest.h:73

Member Data Documentation

std::string MuonRecoTest::EfficiencyCriterionName
private

Definition at line 63 of file MuonRecoTest.h.

int MuonRecoTest::etaBin
private

Definition at line 64 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::etaEfficiency
private

Definition at line 73 of file MuonRecoTest.h.

double MuonRecoTest::etaMax
private

Definition at line 66 of file MuonRecoTest.h.

double MuonRecoTest::etaMin
private

Definition at line 65 of file MuonRecoTest.h.

std::vector<MonitorElement*> MuonRecoTest::globalRotation
private

Definition at line 76 of file MuonRecoTest.h.

std::string MuonRecoTest::metname
private

Definition at line 59 of file MuonRecoTest.h.

int MuonRecoTest::nevents
private

Definition at line 54 of file MuonRecoTest.h.

unsigned int MuonRecoTest::nLumiSegs
private

Definition at line 55 of file MuonRecoTest.h.

edm::ParameterSet MuonRecoTest::parameters
private
int MuonRecoTest::phiBin
private

Definition at line 68 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::phiEfficiency
private

Definition at line 74 of file MuonRecoTest.h.

double MuonRecoTest::phiMax
private

Definition at line 70 of file MuonRecoTest.h.

double MuonRecoTest::phiMin
private

Definition at line 69 of file MuonRecoTest.h.

int MuonRecoTest::prescaleFactor
private

Definition at line 56 of file MuonRecoTest.h.

int MuonRecoTest::run
private