CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
MuIsoValidation Class Reference

#include <MuIsoValidation.h>

Inheritance diagram for MuIsoValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 MuIsoValidation (const edm::ParameterSet &)
 
 ~MuIsoValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Private Types

enum  { NOAXIS, XAXIS, YAXIS, ZAXIS }
 
typedef edm::Handle< reco::IsoDepositMapMuIsoDepHandle
 
typedef const reco::IsoDeposit MuIsoDepRef
 
typedef edm::RefToBase< reco::MuonMuonBaseRef
 
typedef edm::View< reco::Muon >::const_iterator MuonIterator
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void FillHistos ()
 
void InitStatics ()
 
void MakeLogBinsForProfile (Double_t *bin_edges, const double min, const double max)
 
void RecordData (MuonIterator muon)
 

Private Attributes

std::vector< std::string > axis_titles
 
std::vector< MonitorElement * > cd_plots
 
std::vector< int > cdCompNeeded
 
std::string dirName
 
edm::InputTag ecalIsoDeposit_Tag
 
std::vector< MonitorElement * > h_1D
 
MonitorElementh_nMuons
 
edm::InputTag hcalIsoDeposit_Tag
 
edm::InputTag hoIsoDeposit_Tag
 
edm::ParameterSet iConfig
 
std::vector< int > isContinuous
 
double L_BIN_WIDTH
 
int LOG_BINNING_ENABLED
 
double LOG_BINNING_RATIO
 
std::vector< std::string > main_titles
 
edm::InputTag Muon_Tag
 
edm::EDGetTokenT< edm::View< reco::Muon > > Muon_Token
 
std::vector< std::string > names
 
int nEvents
 
int nIncMuons
 
int NUM_LOG_BINS
 
std::vector< std::vector< MonitorElement * > > p_2D
 
std::vector< std::vector< double > > param
 
bool requireCombinedMuon
 
std::string rootfilename
 
double S_BIN_WIDTH
 
std::string subDirName
 
std::string subsystemname_
 
double theData [NUM_VARS]
 
int theMuonData
 
std::string title_cd
 
std::string title_cone
 
std::string title_sam
 
edm::InputTag tkIsoDeposit_Tag
 

Static Private Attributes

static const int NUM_VARS = 21
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 55 of file MuIsoValidation.h.

Member Typedef Documentation

◆ MuIsoDepHandle

Definition at line 59 of file MuIsoValidation.h.

◆ MuIsoDepRef

Definition at line 60 of file MuIsoValidation.h.

◆ MuonBaseRef

Definition at line 58 of file MuIsoValidation.h.

◆ MuonIterator

typedef edm::View<reco::Muon>::const_iterator MuIsoValidation::MuonIterator
private

Definition at line 57 of file MuIsoValidation.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ MuIsoValidation()

MuIsoValidation::MuIsoValidation ( const edm::ParameterSet ps)
explicit

Definition at line 61 of file MuIsoValidation.cc.

References cd_plots, dirName, edm::ParameterSet::getUntrackedParameter(), h_1D, iConfig, InitStatics(), Muon_Tag, Muon_Token, nEvents, nIncMuons, NUM_VARS, p_2D, requireCombinedMuon, AlCaHLTBitMon_QueryRunRegistry::string, and subsystemname_.

61  {
62  iConfig = ps;
63 
64  // rootfilename = iConfig.getUntrackedParameter<string>("rootfilename"); // comment out for inclusion
65  requireCombinedMuon = iConfig.getUntrackedParameter<bool>("requireCombinedMuon");
67  //subDirName = iConfig.getParameter<std::string>("@module_label");
68 
69  //dirName += subDirName;
70 
71  //--------Initialize tags-------
72  Muon_Tag = iConfig.getUntrackedParameter<edm::InputTag>("Global_Muon_Label");
73  Muon_Token = consumes<edm::View<reco::Muon> >(Muon_Tag);
74 
75  //-------Initialize counters----------------
76  nEvents = 0;
77  nIncMuons = 0;
78  // nCombinedMuons = 0;
79 
80  InitStatics();
81 
82  //Set up DAQ
83  subsystemname_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem");
84 
85  //------"allocate" space for the data vectors-------
86  h_1D.resize(NUM_VARS);
87  cd_plots.resize(NUM_VARS);
88  p_2D.resize(NUM_VARS, vector<MonitorElement*>(NUM_VARS));
89 }
std::vector< std::vector< MonitorElement * > > p_2D
std::vector< MonitorElement * > h_1D
edm::EDGetTokenT< edm::View< reco::Muon > > Muon_Token
edm::ParameterSet iConfig
T getUntrackedParameter(std::string const &, T const &) const
std::vector< MonitorElement * > cd_plots
std::string dirName
static const int NUM_VARS
edm::InputTag Muon_Tag
std::string subsystemname_

◆ ~MuIsoValidation()

MuIsoValidation::~MuIsoValidation ( )
override

Definition at line 94 of file MuIsoValidation.cc.

94  {
95  //Deallocate memory
96 }

Member Function Documentation

◆ analyze()

void MuIsoValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 315 of file MuIsoValidation.cc.

References dqm::impl::MonitorElement::Fill(), FillHistos(), h_nMuons, iEvent, HLT_2022v12_cff::muon, Muon_Token, nEvents, nIncMuons, RecordData(), requireCombinedMuon, theMuonData, and parallelization::uint.

315  {
316  ++nEvents;
317  edm::LogInfo("Tutorial") << "\nInvestigating event #" << nEvents << "\n";
318 
319  // Get Muon Collection
320  edm::Handle<edm::View<reco::Muon> > muonsHandle; //
321  iEvent.getByToken(Muon_Token, muonsHandle);
322 
323  //Fill event entry in histogram of number of muons
324  edm::LogInfo("Tutorial") << "Number of Muons: " << muonsHandle->size();
325  theMuonData = muonsHandle->size();
327 
328  //Fill historgams concerning muon isolation
329  uint iMuon = 0;
330  for (MuonIterator muon = muonsHandle->begin(); muon != muonsHandle->end(); ++muon, ++iMuon) {
331  ++nIncMuons;
332  if (requireCombinedMuon) {
333  if (muon->combinedMuon().isNull())
334  continue;
335  }
336  RecordData(muon);
337  FillHistos();
338  }
339 }
void RecordData(MuonIterator muon)
edm::View< reco::Muon >::const_iterator MuonIterator
edm::EDGetTokenT< edm::View< reco::Muon > > Muon_Token
MonitorElement * h_nMuons
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
Log< level::Info, false > LogInfo

◆ bookHistograms()

void MuIsoValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 384 of file MuIsoValidation.cc.

References axis_titles, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), cd_plots, cdCompNeeded, dirName, h_1D, h_nMuons, isContinuous, LOG_BINNING_ENABLED, main_titles, MakeLogBinsForProfile(), names, NUM_LOG_BINS, NUM_VARS, p_2D, param, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), title_cd, title_cone, title_sam, trigObjTnPSource_cfi::var, XAXIS, and YAXIS.

384  {
385  ibooker.setCurrentFolder(dirName);
386  //---initialize number of muons histogram---
387  h_nMuons = ibooker.book1D("nMuons", title_sam + "Number of Muons", 20, 0., 20.);
388  h_nMuons->setAxisTitle("Number of Muons", XAXIS);
389  h_nMuons->setAxisTitle("Fraction of Events", YAXIS);
390 
391  //---Initialize 1D Histograms---
392  for (int var = 0; var < NUM_VARS; var++) {
393  h_1D[var] = ibooker.book1D(names[var],
395  (int)param[var][0],
396  param[var][1],
397  param[var][2],
398  [](TH1* th1) { th1->Sumw2(); });
399  h_1D[var]->setAxisTitle(axis_titles[var], XAXIS);
400  h_1D[var]->setAxisTitle("Fraction of Muons", YAXIS);
401 
402  if (cdCompNeeded[var]) {
403  cd_plots[var] = ibooker.book1D(names[var] + "_cd",
405  (int)param[var][0],
406  param[var][1],
407  param[var][2],
408  [](TH1* th1) { th1->Sumw2(); });
409  cd_plots[var]->setAxisTitle(axis_titles[var], XAXIS);
410  cd_plots[var]->setAxisTitle("Fraction of Muons", YAXIS);
411  }
412  } //Finish 1D
413 
414  //---Initialize 2D Histograms---
415  for (int var1 = 0; var1 < NUM_VARS; var1++) {
416  for (int var2 = 0; var2 < NUM_VARS; var2++) {
417  if (var1 == var2)
418  continue;
419 
420  //Monitor elements is weird and takes y axis parameters as well
421  //as x axis parameters for a 1D profile plot
422  p_2D[var1][var2] = ibooker.bookProfile(names[var1] + "_" + names[var2],
423  title_sam + main_titles[var2] + " <vs> " + main_titles[var1] + title_cone,
424  (int)param[var1][0],
425  param[var1][1],
426  param[var1][2],
427  (int)param[var2][0], //documentation says this is disregarded
428  param[var2][1], //does this do anything?
429  param[var2][2], //does this do anything?
430  " ", //profile errors = spread/sqrt(num_datums)
431  [&](TProfile* tprof) {
432  if (LOG_BINNING_ENABLED && isContinuous[var1]) {
433  Double_t* bin_edges = new Double_t[NUM_LOG_BINS + 1];
434  // nbins+1 because there is one more edge than there are bins
435  MakeLogBinsForProfile(bin_edges, param[var1][1], param[var1][2]);
436  tprof->SetBins(NUM_LOG_BINS, bin_edges);
437  delete[] bin_edges;
438  }
439  });
440 
441  p_2D[var1][var2]->setAxisTitle(axis_titles[var1], XAXIS);
442  p_2D[var1][var2]->setAxisTitle(axis_titles[var2], YAXIS);
443  }
444  } //Finish 2D
445 
446  //avg pT not defined for zero tracks.
447  //MonitorElement is inflxible and won't let me change the
448  //number of bins! I guess all I'm doing here is changing
449  //range of the x axis when it is printed, not the actual
450  //bins that are filled
451  p_2D[4][9]->setAxisRange(0.5, 15.5, XAXIS);
452 }
std::vector< int > isContinuous
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::vector< std::string > names
std::string title_cd
std::vector< std::string > main_titles
std::vector< std::vector< MonitorElement * > > p_2D
std::vector< MonitorElement * > h_1D
MonitorElement * h_nMuons
std::string title_sam
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
std::vector< MonitorElement * > cd_plots
std::string dirName
std::string title_cone
static const int NUM_VARS
std::vector< std::vector< double > > param
void MakeLogBinsForProfile(Double_t *bin_edges, const double min, const double max)
std::vector< std::string > axis_titles
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::vector< int > cdCompNeeded
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ FillHistos()

void MuIsoValidation::FillHistos ( )
private

Definition at line 470 of file MuIsoValidation.cc.

References cd_plots, cdCompNeeded, h_1D, NUM_VARS, p_2D, theData, and trigObjTnPSource_cfi::var.

Referenced by analyze().

470  {
471  //----------Fill 1D histograms---------------
472  for (int var = 0; var < NUM_VARS; var++) {
473  h_1D[var]->Fill(theData[var]);
474  if (cdCompNeeded[var])
475  cd_plots[var]->Fill(theData[var]); //right now, this is a regular PDF (just like h_1D)
476  } //Finish 1D
477 
478  //----------Fill 2D histograms---------------
479  for (int var1 = 0; var1 < NUM_VARS; ++var1) {
480  for (int var2 = 0; var2 < NUM_VARS; ++var2) {
481  if (var1 == var2)
482  continue;
483  //change below to regular int interating!
484  // h_2D[var1][var2]->Fill(theData[var1], theData[var2]);
485  p_2D[var1][var2]->Fill(theData[var1], theData[var2]);
486  }
487  } //Finish 2D
488 }
double theData[NUM_VARS]
std::vector< std::vector< MonitorElement * > > p_2D
std::vector< MonitorElement * > h_1D
std::vector< MonitorElement * > cd_plots
static const int NUM_VARS
std::vector< int > cdCompNeeded

◆ InitStatics()

void MuIsoValidation::InitStatics ( )
private

Definition at line 101 of file MuIsoValidation.cc.

References axis_titles, cdCompNeeded, createfilelist::int, isContinuous, L_BIN_WIDTH, LOG_BINNING_ENABLED, LOG_BINNING_RATIO, main_titles, names, NUM_LOG_BINS, NUM_VARS, param, S_BIN_WIDTH, title_cd, title_cone, and title_sam.

Referenced by MuIsoValidation().

101  {
102  //-----------Initialize primatives-----------
103  S_BIN_WIDTH = 1.0; //in GeV
104  L_BIN_WIDTH = 2.0; //in GeV
106  NUM_LOG_BINS = 15;
107  LOG_BINNING_RATIO = 1.1; //ratio by which each bin is wider than the last for log binning
108  //i.e. bin widths are (x), (r*x), (r^2*x), ..., (r^(nbins)*x)
109 
110  //-------Initialize Titles---------
111  title_sam = ""; //"[Sample b-jet events] ";
112  title_cone = ""; //" [in R=0.3 IsoDeposit Cone]";
113  //The above two pieces of info will be printed on the title of the whole page,
114  //not for each individual histogram
115  title_cd = "C.D. of ";
116 
117  //-------"Allocate" memory for vectors
118  main_titles.resize(NUM_VARS);
119  axis_titles.resize(NUM_VARS);
120  names.resize(NUM_VARS);
121  param.resize(NUM_VARS, vector<double>(3));
122  isContinuous.resize(NUM_VARS);
123  cdCompNeeded.resize(NUM_VARS);
124 
125  //-----Titles of the plots-----------
126  main_titles[0] = "Total Tracker Momentum";
127  main_titles[1] = "Total EM Cal Energy";
128  main_titles[2] = "Total Had Cal Energy";
129  main_titles[3] = "Total HO Cal Energy";
130  main_titles[4] = "Number of Tracker Tracks";
131  main_titles[5] = "Number of Jets around Muon";
132  main_titles[6] = "Tracker p_{T} within veto cone";
133  main_titles[7] = "EM E_{T} within veto cone";
134  main_titles[8] = "Had E_{T} within veto cone";
135  main_titles[9] = "HO E_{T} within veto cone";
136  main_titles[10] = "Muon p_{T}";
137  main_titles[11] = "Muon #eta";
138  main_titles[12] = "Muon #phi";
139  main_titles[13] = "Average Momentum per Track ";
140  main_titles[14] = "Weighted Energy";
141  main_titles[15] = "PF Sum of Charged Hadron Pt";
142  main_titles[16] = "PF Sum of Total Hadron Pt";
143  main_titles[17] = "PF Sum of E,Mu Pt";
144  main_titles[18] = "PF Sum of Neutral Hadron Et";
145  main_titles[19] = "PF Sum of Photon Et";
146  main_titles[20] = "PF Sum of Pt from non-PV";
147 
148  //------Titles on the X or Y axis------------
149  axis_titles[0] = "#Sigma p_{T} (GeV)";
150  axis_titles[1] = "#Sigma E_{T}^{EM} (GeV)";
151  axis_titles[2] = "#Sigma E_{T}^{Had} (GeV)";
152  axis_titles[3] = "#Sigma E_{T}^{HO} (GeV)";
153  axis_titles[4] = "N_{Tracks}";
154  axis_titles[5] = "N_{Jets}";
155  axis_titles[6] = "#Sigma p_{T,veto} (GeV)";
156  axis_titles[7] = "#Sigma E_{T,veto}^{EM} (GeV)";
157  axis_titles[8] = "#Sigma E_{T,veto}^{Had} (GeV)";
158  axis_titles[9] = "#Sigma E_{T,veto}^{HO} (GeV)";
159  axis_titles[10] = "p_{T,#mu} (GeV)";
160  axis_titles[11] = "#eta_{#mu}";
161  axis_titles[12] = "#phi_{#mu}";
162  axis_titles[13] = "#Sigma p_{T} / N_{Tracks} (GeV)";
163  axis_titles[14] = "(1.5) X #Sigma E_{T}^{EM} + #Sigma E_{T}^{Had}";
164  axis_titles[15] = "#Sigma p_{T}^{PFHadCha} (GeV)";
165  axis_titles[16] = "#Sigma p_{T}^{PFTotCha} (GeV)";
166  axis_titles[17] = "#Sigma p_{T}^{PFEMu} (GeV)";
167  axis_titles[18] = "#Sigma E_{T}^{PFHadNeu} (GeV)";
168  axis_titles[19] = "#Sigma E_{T}^{PFPhot} (GeV)";
169  axis_titles[20] = "#Sigma p_{T}^{PFPU} (GeV)";
170 
171  //-----------Names given for the root file----------
172  names[0] = "sumPt";
173  names[1] = "emEt";
174  names[2] = "hadEt";
175  names[3] = "hoEt";
176  names[4] = "nTracks";
177  names[5] = "nJets";
178  names[6] = "trackerVetoPt";
179  names[7] = "emVetoEt";
180  names[8] = "hadVetoEt";
181  names[9] = "hoVetoEt";
182  names[10] = "muonPt";
183  names[11] = "muonEta";
184  names[12] = "muonPhi";
185  names[13] = "avgPt";
186  names[14] = "weightedEt";
187  names[15] = "PFsumChargedHadronPt";
188  names[16] = "PFsumChargedTotalPt";
189  names[17] = "PFsumEMuPt";
190  names[18] = "PFsumNeutralHadronEt";
191  names[19] = "PFsumPhotonEt";
192  names[20] = "PFsumPUPt";
193 
194  //----------Parameters for binning of histograms---------
195  //param[var][0] is the number of bins
196  //param[var][1] is the low edge of the low bin
197  //param[var][2] is the high edge of the high bin
198  //
199  // maximum value------,
200  // |
201  // V
202  param[0][0] = (int)(20.0 / S_BIN_WIDTH);
203  param[0][1] = 0.0;
204  param[0][2] = param[0][0] * S_BIN_WIDTH;
205  param[1][0] = (int)(20.0 / S_BIN_WIDTH);
206  param[1][1] = 0.0;
207  param[1][2] = param[1][0] * S_BIN_WIDTH;
208  param[2][0] = (int)(20.0 / S_BIN_WIDTH);
209  param[2][1] = 0.0;
210  param[2][2] = param[2][0] * S_BIN_WIDTH;
211  param[3][0] = 20;
212  param[3][1] = 0.0;
213  param[3][2] = 2.0;
214  param[4][0] = 16;
215  param[4][1] = -0.5;
216  param[4][2] = param[4][0] - 0.5;
217  param[5][0] = 4;
218  param[5][1] = -0.5;
219  param[5][2] = param[5][0] - 0.5;
220  param[6][0] = (int)(40.0 / S_BIN_WIDTH);
221  param[6][1] = 0.0;
222  param[6][2] = param[6][0] * S_BIN_WIDTH;
223  param[7][0] = 20;
224  param[7][1] = 0.0;
225  param[7][2] = 10.0;
226  param[8][0] = (int)(20.0 / S_BIN_WIDTH);
227  param[8][1] = 0.0;
228  param[8][2] = param[8][0] * S_BIN_WIDTH;
229  param[9][0] = 20;
230  param[9][1] = 0.0;
231  param[9][2] = 5.0;
232  param[10][0] = (int)(40.0 / S_BIN_WIDTH);
233  param[10][1] = 0.0;
234  param[10][2] = param[10][0] * S_BIN_WIDTH;
235  param[11][0] = 24;
236  param[11][1] = -2.4;
237  param[11][2] = 2.4;
238  param[12][0] = 32;
239  param[12][1] = -3.2;
240  param[12][2] = 3.2;
241  param[13][0] = (int)(15.0 / S_BIN_WIDTH);
242  param[13][1] = 0.0;
243  param[13][2] = param[13][0] * S_BIN_WIDTH;
244  param[14][0] = (int)(20.0 / S_BIN_WIDTH);
245  param[14][1] = 0.0;
246  param[14][2] = param[14][0] * S_BIN_WIDTH;
247  param[15][0] = (int)(20.0 / S_BIN_WIDTH);
248  param[15][1] = 0.0;
249  param[15][2] = param[15][0] * S_BIN_WIDTH;
250  param[16][0] = (int)(20.0 / S_BIN_WIDTH);
251  param[15][1] = 0.0;
252  param[16][2] = param[16][0] * S_BIN_WIDTH;
253  param[17][0] = (int)(20.0 / S_BIN_WIDTH) + 1;
254  param[17][1] = -S_BIN_WIDTH;
255  param[17][2] = param[17][0] * S_BIN_WIDTH;
256  param[18][0] = (int)(20.0 / S_BIN_WIDTH);
257  param[18][1] = 0.0;
258  param[18][2] = param[18][0] * S_BIN_WIDTH;
259  param[19][0] = (int)(20.0 / S_BIN_WIDTH);
260  param[19][1] = 0.0;
261  param[19][2] = param[19][0] * S_BIN_WIDTH;
262  param[20][0] = (int)(20.0 / S_BIN_WIDTH);
263  param[20][1] = 0.0;
264  param[20][2] = param[20][0] * S_BIN_WIDTH;
265 
266  //--------------Is the variable continuous (i.e. non-integer)?-------------
267  //---------(Log binning will only be used for continuous variables)--------
268  isContinuous[0] = 1;
269  isContinuous[1] = 1;
270  isContinuous[2] = 1;
271  isContinuous[3] = 1;
272  isContinuous[4] = 0;
273  isContinuous[5] = 0;
274  isContinuous[6] = 1;
275  isContinuous[7] = 1;
276  isContinuous[8] = 1;
277  isContinuous[9] = 1;
278  isContinuous[10] = 1;
279  isContinuous[11] = 1;
280  isContinuous[12] = 1;
281  isContinuous[13] = 1;
282  isContinuous[14] = 1;
283  isContinuous[15] = 1;
284  isContinuous[16] = 1;
285  isContinuous[17] = 1;
286  isContinuous[18] = 1;
287  isContinuous[19] = 1;
288  isContinuous[20] = 1;
289 
290  //----Should the cumulative distribution be calculated for this variable?-----
291  cdCompNeeded[0] = 1;
292  cdCompNeeded[1] = 1;
293  cdCompNeeded[2] = 1;
294  cdCompNeeded[3] = 1;
295  cdCompNeeded[4] = 1;
296  cdCompNeeded[5] = 1;
297  cdCompNeeded[6] = 1;
298  cdCompNeeded[7] = 1;
299  cdCompNeeded[8] = 1;
300  cdCompNeeded[9] = 1;
301  cdCompNeeded[10] = 0;
302  cdCompNeeded[11] = 0;
303  cdCompNeeded[12] = 0;
304  cdCompNeeded[13] = 1;
305  cdCompNeeded[14] = 1;
306  cdCompNeeded[15] = 1;
307  cdCompNeeded[16] = 1;
308  cdCompNeeded[17] = 1;
309  cdCompNeeded[18] = 1;
310  cdCompNeeded[19] = 1;
311  cdCompNeeded[20] = 1;
312 }
std::vector< int > isContinuous
std::vector< std::string > names
std::string title_cd
std::vector< std::string > main_titles
std::string title_sam
std::string title_cone
static const int NUM_VARS
std::vector< std::vector< double > > param
std::vector< std::string > axis_titles
std::vector< int > cdCompNeeded

◆ MakeLogBinsForProfile()

void MuIsoValidation::MakeLogBinsForProfile ( Double_t *  bin_edges,
const double  min,
const double  max 
)
private

Definition at line 454 of file MuIsoValidation.cc.

References LOG_BINNING_RATIO, SiStripPI::max, SiStripPI::min, dqmiodumpmetadata::n, LaserClient_cfi::nbins, NUM_LOG_BINS, funct::pow(), and alignCSCRings::r.

Referenced by bookHistograms().

454  {
455  const double& r = LOG_BINNING_RATIO;
456  const int& nbins = NUM_LOG_BINS;
457 
458  const double first_bin_width = (r > 1.0) ? //so we don't divide by zero
459  (max - min) * (1 - r) / (1 - pow(r, nbins))
460  : (max - min) / nbins;
461 
462  bin_edges[0] = min;
463  bin_edges[1] = min + first_bin_width;
464  for (int n = 2; n < nbins; ++n) {
465  bin_edges[n] = bin_edges[n - 1] + (bin_edges[n - 1] - bin_edges[n - 2]) * r;
466  }
467  bin_edges[nbins] = max;
468 }
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ RecordData()

void MuIsoValidation::RecordData ( MuonIterator  muon)
private

Definition at line 342 of file MuIsoValidation.cc.

References theData.

Referenced by analyze().

342  {
343  theData[0] = muon->isolationR03().sumPt;
344  theData[1] = muon->isolationR03().emEt;
345  theData[2] = muon->isolationR03().hadEt;
346  theData[3] = muon->isolationR03().hoEt;
347 
348  theData[4] = muon->isolationR03().nTracks;
349  theData[5] = muon->isolationR03().nJets;
350  theData[6] = muon->isolationR03().trackerVetoPt;
351  theData[7] = muon->isolationR03().emVetoEt;
352  theData[8] = muon->isolationR03().hadVetoEt;
353  theData[9] = muon->isolationR03().hoVetoEt;
354 
355  theData[10] = muon->pt();
356  theData[11] = muon->eta();
357  theData[12] = muon->phi();
358 
359  // make sure nTracks != 0 before filling this one
360  if (theData[4] != 0)
361  theData[13] = (double)theData[0] / (double)theData[4];
362  else
363  theData[13] = -99;
364 
365  theData[14] = 1.5 * theData[1] + theData[2];
366 
367  // Now PF isolation
368  theData[15] = -99.;
369  theData[16] = -99.;
370  theData[17] = -99.;
371  theData[18] = -99.;
372  theData[19] = -99.;
373  theData[20] = -99.;
374  if (muon->isPFMuon() && muon->isPFIsolationValid()) {
375  theData[15] = muon->pfIsolationR03().sumChargedHadronPt;
376  theData[16] = muon->pfIsolationR03().sumChargedParticlePt;
377  theData[17] = muon->pfIsolationR03().sumChargedParticlePt - muon->pfIsolationR03().sumChargedHadronPt;
378  theData[18] = muon->pfIsolationR03().sumNeutralHadronEt;
379  theData[19] = muon->pfIsolationR03().sumPhotonEt;
380  theData[20] = muon->pfIsolationR03().sumPUPt;
381  }
382 }
double theData[NUM_VARS]

Member Data Documentation

◆ axis_titles

std::vector<std::string> MuIsoValidation::axis_titles
private

Definition at line 109 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ cd_plots

std::vector<MonitorElement*> MuIsoValidation::cd_plots
private

Definition at line 127 of file MuIsoValidation.h.

Referenced by bookHistograms(), FillHistos(), and MuIsoValidation().

◆ cdCompNeeded

std::vector<int> MuIsoValidation::cdCompNeeded
private

Definition at line 113 of file MuIsoValidation.h.

Referenced by bookHistograms(), FillHistos(), and InitStatics().

◆ dirName

std::string MuIsoValidation::dirName
private

◆ ecalIsoDeposit_Tag

edm::InputTag MuIsoValidation::ecalIsoDeposit_Tag
private

Definition at line 84 of file MuIsoValidation.h.

◆ h_1D

std::vector<MonitorElement*> MuIsoValidation::h_1D
private

Definition at line 126 of file MuIsoValidation.h.

Referenced by bookHistograms(), FillHistos(), and MuIsoValidation().

◆ h_nMuons

MonitorElement* MuIsoValidation::h_nMuons
private

Definition at line 125 of file MuIsoValidation.h.

Referenced by analyze(), and bookHistograms().

◆ hcalIsoDeposit_Tag

edm::InputTag MuIsoValidation::hcalIsoDeposit_Tag
private

Definition at line 83 of file MuIsoValidation.h.

◆ hoIsoDeposit_Tag

edm::InputTag MuIsoValidation::hoIsoDeposit_Tag
private

Definition at line 85 of file MuIsoValidation.h.

◆ iConfig

edm::ParameterSet MuIsoValidation::iConfig
private

Definition at line 119 of file MuIsoValidation.h.

Referenced by MuIsoValidation().

◆ isContinuous

std::vector<int> MuIsoValidation::isContinuous
private

Definition at line 112 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ L_BIN_WIDTH

double MuIsoValidation::L_BIN_WIDTH
private

Definition at line 97 of file MuIsoValidation.h.

Referenced by InitStatics().

◆ LOG_BINNING_ENABLED

int MuIsoValidation::LOG_BINNING_ENABLED
private

Definition at line 99 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ LOG_BINNING_RATIO

double MuIsoValidation::LOG_BINNING_RATIO
private

Definition at line 101 of file MuIsoValidation.h.

Referenced by InitStatics(), and MakeLogBinsForProfile().

◆ main_titles

std::vector<std::string> MuIsoValidation::main_titles
private

Definition at line 108 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ Muon_Tag

edm::InputTag MuIsoValidation::Muon_Tag
private

Definition at line 80 of file MuIsoValidation.h.

Referenced by MuIsoValidation().

◆ Muon_Token

edm::EDGetTokenT<edm::View<reco::Muon> > MuIsoValidation::Muon_Token
private

Definition at line 81 of file MuIsoValidation.h.

Referenced by analyze(), and MuIsoValidation().

◆ names

std::vector<std::string> MuIsoValidation::names
private

Definition at line 110 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ nEvents

int MuIsoValidation::nEvents
private

Definition at line 132 of file MuIsoValidation.h.

Referenced by analyze(), and MuIsoValidation().

◆ nIncMuons

int MuIsoValidation::nIncMuons
private

Definition at line 133 of file MuIsoValidation.h.

Referenced by analyze(), and MuIsoValidation().

◆ NUM_LOG_BINS

int MuIsoValidation::NUM_LOG_BINS
private

Definition at line 100 of file MuIsoValidation.h.

Referenced by bookHistograms(), InitStatics(), and MakeLogBinsForProfile().

◆ NUM_VARS

const int MuIsoValidation::NUM_VARS = 21
staticprivate

Definition at line 96 of file MuIsoValidation.h.

Referenced by bookHistograms(), FillHistos(), InitStatics(), and MuIsoValidation().

◆ p_2D

std::vector<std::vector<MonitorElement*> > MuIsoValidation::p_2D
private

Definition at line 129 of file MuIsoValidation.h.

Referenced by bookHistograms(), FillHistos(), and MuIsoValidation().

◆ param

std::vector<std::vector<double> > MuIsoValidation::param
private

Definition at line 111 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ requireCombinedMuon

bool MuIsoValidation::requireCombinedMuon
private

Definition at line 102 of file MuIsoValidation.h.

Referenced by analyze(), and MuIsoValidation().

◆ rootfilename

std::string MuIsoValidation::rootfilename
private

Definition at line 88 of file MuIsoValidation.h.

◆ S_BIN_WIDTH

double MuIsoValidation::S_BIN_WIDTH
private

Definition at line 98 of file MuIsoValidation.h.

Referenced by InitStatics().

◆ subDirName

std::string MuIsoValidation::subDirName
private

Definition at line 91 of file MuIsoValidation.h.

◆ subsystemname_

std::string MuIsoValidation::subsystemname_
private

Definition at line 93 of file MuIsoValidation.h.

Referenced by MuIsoValidation().

◆ theData

double MuIsoValidation::theData[NUM_VARS]
private

Definition at line 122 of file MuIsoValidation.h.

Referenced by FillHistos(), and RecordData().

◆ theMuonData

int MuIsoValidation::theMuonData
private

Definition at line 121 of file MuIsoValidation.h.

Referenced by analyze().

◆ title_cd

std::string MuIsoValidation::title_cd
private

Definition at line 106 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ title_cone

std::string MuIsoValidation::title_cone
private

Definition at line 105 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ title_sam

std::string MuIsoValidation::title_sam
private

Definition at line 104 of file MuIsoValidation.h.

Referenced by bookHistograms(), and InitStatics().

◆ tkIsoDeposit_Tag

edm::InputTag MuIsoValidation::tkIsoDeposit_Tag
private

Definition at line 82 of file MuIsoValidation.h.