CMS 3D CMS Logo

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::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

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

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 Endjob. More...
 
- 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 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 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 32 of file MuonRecoTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 31 of file MuonRecoTest.cc.

References muonRecoAnalyzer_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, BeamMonitor_cff::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, and Skims_PDWG_cff::prescaleFactor.

31  {
32  parameters = ps;
33 
34  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
35 
36  // Parameters
37  etaBin = parameters.getParameter<int>("etaBin");
38  etaMin = parameters.getParameter<double>("etaMin");
39  etaMax = parameters.getParameter<double>("etaMax");
40 
41  phiBin = parameters.getParameter<int>("phiBin");
42  phiMin = parameters.getParameter<double>("phiMin");
43  phiMax = parameters.getParameter<double>("phiMax");
44 
45  EfficiencyCriterionName = parameters.getUntrackedParameter<string>("efficiencyTestName", "EfficiencyInRange");
46 }
std::string EfficiencyCriterionName
Definition: MuonRecoTest.h:55
double etaMin
Definition: MuonRecoTest.h:57
double etaMax
Definition: MuonRecoTest.h:58
double phiMax
Definition: MuonRecoTest.h:62
double phiMin
Definition: MuonRecoTest.h:61
int prescaleFactor
Definition: MuonRecoTest.h:48
MuonRecoTest::~MuonRecoTest ( )
inlineoverride

Destructor.

Definition at line 38 of file MuonRecoTest.h.

References dqmEndJob().

38 {};

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 47 of file MuonRecoTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), L1TObjectsTimingClient_cff::efficiency, muonRecoAnalyzer_cfi::etaBin, ALCARECOTkAlBeamHalo_cff::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, dqm::dqmstoreimpl::DQMStore::IGetter::get(), QReport::getBadChannels(), QReport::getMessage(), QReport::getStatus(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, LogTrace, metname, castor_dqm_sourceclient_file_cfg::path, BeamMonitor_cff::phiBin, AlignmentTrackSelector_cfi::phiMax, AlignmentTrackSelector_cfi::phiMin, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and mathSSE::sqrt().

Referenced by ~MuonRecoTest().

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

Member Data Documentation

std::string MuonRecoTest::EfficiencyCriterionName
private

Definition at line 55 of file MuonRecoTest.h.

int MuonRecoTest::etaBin
private

Definition at line 56 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::etaEfficiency
private

Definition at line 65 of file MuonRecoTest.h.

double MuonRecoTest::etaMax
private

Definition at line 58 of file MuonRecoTest.h.

double MuonRecoTest::etaMin
private

Definition at line 57 of file MuonRecoTest.h.

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

Definition at line 68 of file MuonRecoTest.h.

std::string MuonRecoTest::metname
private

Definition at line 51 of file MuonRecoTest.h.

int MuonRecoTest::nevents
private

Definition at line 46 of file MuonRecoTest.h.

unsigned int MuonRecoTest::nLumiSegs
private

Definition at line 47 of file MuonRecoTest.h.

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

Definition at line 60 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::phiEfficiency
private

Definition at line 66 of file MuonRecoTest.h.

double MuonRecoTest::phiMax
private

Definition at line 62 of file MuonRecoTest.h.

double MuonRecoTest::phiMin
private

Definition at line 61 of file MuonRecoTest.h.

int MuonRecoTest::prescaleFactor
private

Definition at line 48 of file MuonRecoTest.h.

int MuonRecoTest::run
private