CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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::EDProducer< T > 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 beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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
 
void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &) 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
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 etaBin(), Puppi_cff::etaMax, Puppi_cff::etaMin, L1TMuonDQMOffline_cfi::phiMax, L1TMuonDQMOffline_cfi::phiMin, and dtDQMClient_cfg::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 }
T getUntrackedParameter(std::string const &, T const &) const
std::string EfficiencyCriterionName
Definition: MuonRecoTest.h:56
double etaMin
Definition: MuonRecoTest.h:58
double etaMax
Definition: MuonRecoTest.h:59
double phiMax
Definition: MuonRecoTest.h:63
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet parameters
Definition: MuonRecoTest.h:53
double phiMin
Definition: MuonRecoTest.h:62
int prescaleFactor
Definition: MuonRecoTest.h:49
MuonRecoTest::~MuonRecoTest ( )
inlineoverride

Destructor.

Definition at line 38 of file MuonRecoTest.h.

38 {};

Member Function Documentation

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

BOOKING NEW HISTOGRAMS

Implements DQMEDHarvester.

Definition at line 105 of file MuonRecoTest.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IGetter::get(), MonitorElementData::QReport::getBadChannels(), MonitorElementData::QReport::getMessage(), MonitorElementData::QReport::getStatus(), dqm::legacy::MonitorElement::getTH2F(), LogTrace, metname, dqm::implementation::NavigatorBase::setCurrentFolder(), and mathSSE::sqrt().

105  {
107  ibooker.setCurrentFolder("Muons/Tests/muonRecoTest");
108  // alignment plots
109  globalRotation.push_back(ibooker.book1D(
110  "muVStkSytemRotation_posMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}", 50, 0, 200));
111  globalRotation.push_back(ibooker.book1D(
112  "muVStkSytemRotation_negMu_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{-}", 50, 0, 200));
113  globalRotation.push_back(ibooker.book1D(
114  "muVStkSytemRotation_profile", "pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}-#mu^{-}", 50, 0, 200));
115 
116  // efficiency test
117 
118  // eta efficiency
119  const QReport* theEtaQReport = etaEfficiency->getQReport(EfficiencyCriterionName);
120  if (theEtaQReport) {
121  vector<dqm::me_util::Channel> badChannels = theEtaQReport->getBadChannels();
122  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
123  channel++) {
124  LogTrace(metname) << "[etaEfficiency test] bad ranges: " << (*channel).getBin()
125  << " Contents : " << (*channel).getContents() << endl;
126  }
127  LogTrace(metname) << "-------- type: [etaEfficiency] " << theEtaQReport->getMessage() << " ------- "
128  << 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(); channel != badChannels.end();
135  channel++) {
136  LogTrace(metname) << "[phiEfficiency test] bad ranges: " << (*channel).getBin()
137  << " Contents : " << (*channel).getContents() << endl;
138  }
139  LogTrace(metname) << "-------- type: [phiEfficiency] " << thePhiQReport->getMessage() << " ------- "
140  << thePhiQReport->getStatus() << endl;
141  }
142 
143  //alignment plot
144  string pathPos = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_posMu";
145  MonitorElement* muVStkSytemRotation_posMu_histo = igetter.get(pathPos);
146  string pathNeg = "Muons/MuonRecoAnalyzer/muVStkSytemRotation_negMu";
147  MonitorElement* muVStkSytemRotation_negMu_histo = igetter.get(pathNeg);
148  if (muVStkSytemRotation_posMu_histo && muVStkSytemRotation_negMu_histo) {
149  TH2F* muVStkSytemRotation_posMu_root = muVStkSytemRotation_posMu_histo->getTH2F();
150  TProfile* muVStkSytemRotation_posMu_profile = muVStkSytemRotation_posMu_root->ProfileX("", 1, 100);
151  TH2F* muVStkSytemRotation_negMu_root = muVStkSytemRotation_negMu_histo->getTH2F();
152  TProfile* muVStkSytemRotation_negMu_profile = muVStkSytemRotation_negMu_root->ProfileX("", 1, 100);
153 
154  for (int x = 1; x < 50; x++) {
155  globalRotation[0]->Fill((x * 4) - 1, muVStkSytemRotation_posMu_profile->GetBinContent(x));
156  globalRotation[0]->setBinError(x, muVStkSytemRotation_posMu_profile->GetBinError(x));
157  globalRotation[1]->Fill((x * 4) - 1, muVStkSytemRotation_negMu_profile->GetBinContent(x));
158  globalRotation[1]->setBinError(x, muVStkSytemRotation_negMu_profile->GetBinError(x));
159  globalRotation[2]->Fill(
160  (x * 4) - 1,
161  muVStkSytemRotation_posMu_profile->GetBinContent(x) - muVStkSytemRotation_negMu_profile->GetBinContent(x));
162  globalRotation[2]->setBinError(
163  x,
164  sqrt(
165  (muVStkSytemRotation_posMu_profile->GetBinError(x) * muVStkSytemRotation_posMu_profile->GetBinError(x)) +
166  (muVStkSytemRotation_negMu_profile->GetBinError(x) * muVStkSytemRotation_negMu_profile->GetBinError(x))));
167  }
168  }
169 }
virtual TH2F * getTH2F() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::string EfficiencyCriterionName
Definition: MuonRecoTest.h:56
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
#define LogTrace(id)
int getStatus() const
get test status
const std::string & getMessage() const
get message attached to test
std::vector< MonitorElement * > globalRotation
Definition: MuonRecoTest.h:69
T sqrt(T t)
Definition: SSEVec.h:19
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::string metname
Definition: MuonRecoTest.h:52
MonitorElement * phiEfficiency
Definition: MuonRecoTest.h:67
const std::vector< DQMChannel > & getBadChannels() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * etaEfficiency
Definition: MuonRecoTest.h:66
void MuonRecoTest::dqmEndRun ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Endjob.

GETTING PREVIOUS HISTOS AND DO SOME OPERATIONS

Reimplemented from DQMEDHarvester.

Definition at line 48 of file MuonRecoTest.cc.

References dqm::implementation::IBooker::book1D(), postValidation_cfi::efficiency, etaBin(), Puppi_cff::etaMax, Puppi_cff::etaMin, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), mps_fire::i, LogTrace, metname, fed_dqm_sourceclient-live_cfg::path, L1TMuonDQMOffline_cfi::phiMax, L1TMuonDQMOffline_cfi::phiMin, and dqm::implementation::NavigatorBase::setCurrentFolder().

51  {
52  // efficiency plot
53  ibooker.setCurrentFolder("Muons/Tests/muonRecoTest");
54  etaEfficiency = ibooker.book1D("etaEfficiency_staMuon", "#eta_{STA} efficiency", etaBin, etaMin, etaMax);
55  phiEfficiency = ibooker.book1D("phiEfficiency_staMuon", "#phi_{STA} efficiency", phiBin, phiMin, phiMax);
56 
58  string path = "Muons/MuonRecoAnalyzer/StaEta_ifCombinedAlso";
59  MonitorElement* staEtaIfComb_histo = igetter.get(path);
60  path = "Muons/MuonRecoAnalyzer/StaEta";
61  MonitorElement* staEta_histo = igetter.get(path);
62 
63  if (staEtaIfComb_histo && staEta_histo) {
64  TH1F* staEtaIfComb_root = staEtaIfComb_histo->getTH1F();
65  TH1F* staEta_root = staEta_histo->getTH1F();
66 
67  if (staEtaIfComb_root->GetXaxis()->GetNbins() != etaBin || staEtaIfComb_root->GetXaxis()->GetXmax() != etaMax ||
68  staEtaIfComb_root->GetXaxis()->GetXmin() != etaMin) {
69  LogTrace(metname) << "[MuonRecoTest] wrong histo binning on eta histograms";
70  return;
71  }
72 
73  for (int i = 1; i <= etaBin; i++) {
74  if (staEta_root->GetBinContent(i) != 0) {
75  double efficiency = double(staEtaIfComb_root->GetBinContent(i)) / double(staEta_root->GetBinContent(i));
76  etaEfficiency->setBinContent(i, efficiency);
77  }
78  }
79  }
80 
81  path = "Muons/MuonRecoAnalyzer/StaPhi_ifCombinedAlso";
82  MonitorElement* staPhiIfComb_histo = igetter.get(path);
83  path = "Muons/MuonRecoAnalyzer/StaPhi";
84  MonitorElement* staPhi_histo = igetter.get(path);
85 
86  if (staPhiIfComb_histo && staPhi_histo) {
87  TH1F* staPhiIfComb_root = staPhiIfComb_histo->getTH1F();
88  TH1F* staPhi_root = staPhi_histo->getTH1F();
89 
90  if (staPhiIfComb_root->GetXaxis()->GetNbins() != phiBin || staPhiIfComb_root->GetXaxis()->GetXmax() != phiMax ||
91  staPhiIfComb_root->GetXaxis()->GetXmin() != phiMin) {
92  LogTrace(metname) << "[MuonRecoTest] wrong histo binning on phi histograms";
93  return;
94  }
95 
96  for (int i = 1; i <= etaBin; i++) {
97  if (staPhi_root->GetBinContent(i) != 0) {
98  double efficiency = double(staPhiIfComb_root->GetBinContent(i)) / double(staPhi_root->GetBinContent(i));
99  phiEfficiency->setBinContent(i, efficiency);
100  }
101  }
102  }
103 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual TH1F * getTH1F() const
#define LogTrace(id)
double etaMin
Definition: MuonRecoTest.h:58
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::string metname
Definition: MuonRecoTest.h:52
double etaMax
Definition: MuonRecoTest.h:59
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * phiEfficiency
Definition: MuonRecoTest.h:67
double phiMax
Definition: MuonRecoTest.h:63
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
double phiMin
Definition: MuonRecoTest.h:62
MonitorElement * etaEfficiency
Definition: MuonRecoTest.h:66

Member Data Documentation

std::string MuonRecoTest::EfficiencyCriterionName
private

Definition at line 56 of file MuonRecoTest.h.

int MuonRecoTest::etaBin
private

Definition at line 57 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::etaEfficiency
private

Definition at line 66 of file MuonRecoTest.h.

double MuonRecoTest::etaMax
private

Definition at line 59 of file MuonRecoTest.h.

double MuonRecoTest::etaMin
private

Definition at line 58 of file MuonRecoTest.h.

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

Definition at line 69 of file MuonRecoTest.h.

std::string MuonRecoTest::metname
private

Definition at line 52 of file MuonRecoTest.h.

int MuonRecoTest::nevents
private

Definition at line 47 of file MuonRecoTest.h.

unsigned int MuonRecoTest::nLumiSegs
private

Definition at line 48 of file MuonRecoTest.h.

edm::ParameterSet MuonRecoTest::parameters
private

Definition at line 53 of file MuonRecoTest.h.

int MuonRecoTest::phiBin
private

Definition at line 61 of file MuonRecoTest.h.

MonitorElement* MuonRecoTest::phiEfficiency
private

Definition at line 67 of file MuonRecoTest.h.

double MuonRecoTest::phiMax
private

Definition at line 63 of file MuonRecoTest.h.

double MuonRecoTest::phiMin
private

Definition at line 62 of file MuonRecoTest.h.

int MuonRecoTest::prescaleFactor
private

Definition at line 49 of file MuonRecoTest.h.

int MuonRecoTest::run
private