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 Attributes
MatchCandidateBenchmark Class Reference

To plot Candidate quantities. More...

#include <MatchCandidateBenchmark.h>

Inheritance diagram for MatchCandidateBenchmark:
Benchmark

Public Member Functions

void fillOne (const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
 fill histograms with a given particle More...
 
 MatchCandidateBenchmark (Mode mode)
 
void setup ()
 book histograms More...
 
void setup (const edm::ParameterSet &parameterSet)
 book histograms More...
 
virtual ~MatchCandidateBenchmark ()
 
- Public Member Functions inherited from Benchmark
 Benchmark (Mode mode=DEFAULT)
 
bool isInRange (float pt, float eta, float phi) const
 
virtual void setDirectory (TDirectory *dir)
 
void setParameters (Mode mode)
 
void setRange (float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
 
void write ()
 write to the TFile, in plain ROOT mode. No need to call this function in DQM mode More...
 
virtual ~Benchmark ()
 

Protected Attributes

TH2F * delta_et_Over_et_VS_et_
 
TH2F * delta_et_VS_et_
 
TH2F * delta_eta_VS_et_
 
TH2F * delta_phi_VS_et_
 
bool histogramBooked_
 
- Protected Attributes inherited from Benchmark
TDirectory * dir_
 
float etaMax_
 
float etaMin_
 
Mode mode_
 
float phiMax_
 
float phiMin_
 
float ptMax_
 
float ptMin_
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum  Mode { DEFAULT, DQMOFFLINE, VALIDATION }
 
- Static Public Attributes inherited from Benchmark
static DQMStoreDQM_ = 0
 
- Protected Member Functions inherited from Benchmark
TH1F * book1D (const char *histname, const char *title, int nbins, float xmin, float xmax)
 book a 1D histogram, either with DQM or plain root. More...
 
TH2F * book2D (const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
 book a 2D histogram, either with DQM or plain root. More...
 
TH2F * book2D (const char *histname, const char *title, int nbinsx, float *xbins, int nbinsy, float ymin, float ymax)
 book a 2D histogram, either with DQM or plain root. More...
 

Detailed Description

To plot Candidate quantities.

Definition at line 13 of file MatchCandidateBenchmark.h.

Constructor & Destructor Documentation

MatchCandidateBenchmark::MatchCandidateBenchmark ( Mode  mode)
MatchCandidateBenchmark::~MatchCandidateBenchmark ( )
virtual

Definition at line 26 of file MatchCandidateBenchmark.cc.

26 {}

Member Function Documentation

void MatchCandidateBenchmark::fillOne ( const reco::Candidate candidate,
const reco::Candidate matchedCandidate 
)

fill histograms with a given particle

Definition at line 133 of file MatchCandidateBenchmark.cc.

References delta_et_Over_et_VS_et_, delta_et_VS_et_, delta_eta_VS_et_, delta_phi_VS_et_, reco::Candidate::eta(), histogramBooked_, Benchmark::isInRange(), reco::Candidate::phi(), and reco::Candidate::pt().

Referenced by PFCandidateMonitor::fill(), PFJetMonitor::fill(), PFCandidateManager::fill(), and PFMETMonitor::fillOne().

134  {
135 
136  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
137 
138  if (histogramBooked_) {
139  if (delta_et_Over_et_VS_et_) delta_et_Over_et_VS_et_->Fill( matchedCand.pt(), (cand.pt() - matchedCand.pt())/matchedCand.pt() );
140  if (delta_et_VS_et_) delta_et_VS_et_->Fill( matchedCand.pt(), cand.pt() - matchedCand.pt() );
141  if (delta_eta_VS_et_) delta_eta_VS_et_->Fill( matchedCand.pt(), cand.eta() - matchedCand.eta() );
142  if (delta_phi_VS_et_) delta_phi_VS_et_->Fill( matchedCand.pt(), cand.phi() - matchedCand.phi() );
143  }
144 
145 }
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
void MatchCandidateBenchmark::setup ( void  )

book histograms

Definition at line 29 of file MatchCandidateBenchmark.cc.

References Benchmark::book2D(), delta_et_Over_et_VS_et_, delta_et_VS_et_, delta_eta_VS_et_, delta_phi_VS_et_, Benchmark::DQMOFFLINE, histogramBooked_, Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, Benchmark::mode_, Benchmark::PhaseSpace::n, jptDQMConfig_cff::ptBins, and Benchmark::VALIDATION.

Referenced by PFMETMonitor::setup(), PFCandidateMonitor::setup(), and PFJetMonitor::setup().

29  {
30  if (!histogramBooked_) {
31  PhaseSpace ptPS;
32  PhaseSpace dptOvptPS;
33  PhaseSpace dptPS;
34  PhaseSpace detaPS;
35  PhaseSpace dphiPS;
36  switch(mode_) {
37  case VALIDATION:
38  ptPS = PhaseSpace(100,0,1000);
39  dptOvptPS = PhaseSpace( 200, -1, 1);
40  dphiPS = PhaseSpace( 200, -1, 1);
41  detaPS = PhaseSpace( 200, -1, 1);
42  dptPS = PhaseSpace( 100, -100, 100);
43  break;
44  case DQMOFFLINE:
45  default:
46  ptPS = PhaseSpace(50,0,100);
47  dptOvptPS = PhaseSpace( 50, -1, 1);
48  dphiPS = PhaseSpace( 50, -1, 1);
49  detaPS = PhaseSpace( 50, -1, 1);
50  dptPS = PhaseSpace( 50, -50, 50);
51  break;
52  }
53  float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000};
54 
55  delta_et_Over_et_VS_et_ = book2D("delta_et_Over_et_VS_et_",
56  ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}",
57  10, ptBins,
58  dptOvptPS.n, dptOvptPS.m, dptOvptPS.M );
59 
60 
61  delta_et_VS_et_ = book2D("delta_et_VS_et_",
62  ";E_{T, true} (GeV);#DeltaE_{T}",
63  10, ptBins,
64  dptPS.n, dptPS.m, dptPS.M );
65 
66  delta_eta_VS_et_ = book2D("delta_eta_VS_et_",
67  ";#E_{T, true} (GeV);#Delta#eta",
68  10, ptBins,
69  detaPS.n, detaPS.m, detaPS.M );
70 
71  delta_phi_VS_et_ = book2D("delta_phi_VS_et_",
72  ";E_{T, true} (GeV);#Delta#phi",
73  10, ptBins,
74  dphiPS.n, dphiPS.m, dphiPS.M );
75  histogramBooked_ = true;
76  }
77 }
TH2F * book2D(const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
book a 2D histogram, either with DQM or plain root.
Definition: Benchmark.cc:43
Mode mode_
Definition: Benchmark.h:86
void MatchCandidateBenchmark::setup ( const edm::ParameterSet parameterSet)

book histograms

Definition at line 78 of file MatchCandidateBenchmark.cc.

References Benchmark::book2D(), delta_et_Over_et_VS_et_, delta_et_VS_et_, delta_eta_VS_et_, delta_phi_VS_et_, edm::ParameterSet::getParameter(), histogramBooked_, i, and jptDQMConfig_cff::ptBins.

78  {
79 
80  if (!histogramBooked_) {
81 
82  edm::ParameterSet dptPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPtHistoParameter");
83  edm::ParameterSet dptOvptPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPtOvPtHistoParameter");
84  edm::ParameterSet detaPS = parameterSet.getParameter<edm::ParameterSet>("DeltaEtaHistoParameter");
85  edm::ParameterSet dphiPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPhiHistoParameter");
86 
87  std::vector<double> ptBinsPS = parameterSet.getParameter< std::vector<double> >( "VariablePtBins" );
88  float* ptBins = new float[ptBinsPS.size()];
89  for (size_t i = 0; i < ptBinsPS.size(); i++) {
90  ptBins[i] = ptBinsPS[i];
91  }
92 
93  if (dptOvptPS.getParameter<bool>("switchOn")) {
94  delta_et_Over_et_VS_et_ = book2D("delta_et_Over_et_VS_et_",
95  ";E_{T, true} (GeV);#DeltaE_{T}/E_{T}",
96  ptBinsPS.size()-1, ptBins,
97  dptOvptPS.getParameter<int32_t>("nBin"),
98  dptOvptPS.getParameter<double>("xMin"),
99  dptOvptPS.getParameter<double>("xMax"));
100  }
101 
102  if (dptPS.getParameter<bool>("switchOn")) {
103  delta_et_VS_et_ = book2D("delta_et_VS_et_",
104  ";E_{T, true} (GeV);#DeltaE_{T}",
105  ptBinsPS.size()-1, ptBins,
106  dptPS.getParameter<int32_t>("nBin"),
107  dptPS.getParameter<double>("xMin"),
108  dptPS.getParameter<double>("xMax"));
109  }
110 
111  if (detaPS.getParameter<bool>("switchOn")) {
112  delta_eta_VS_et_ = book2D("delta_eta_VS_et_",
113  ";#E_{T, true} (GeV);#Delta#eta",
114  ptBinsPS.size()-1, ptBins,
115  detaPS.getParameter<int32_t>("nBin"),
116  detaPS.getParameter<double>("xMin"),
117  detaPS.getParameter<double>("xMax"));
118  }
119 
120  if (dphiPS.getParameter<bool>("switchOn")) {
121  delta_phi_VS_et_ = book2D("delta_phi_VS_et_",
122  ";E_{T, true} (GeV);#Delta#phi",
123  ptBinsPS.size()-1, ptBins,
124  dphiPS.getParameter<int32_t>("nBin"),
125  dphiPS.getParameter<double>("xMin"),
126  dphiPS.getParameter<double>("xMax"));
127  }
128  histogramBooked_ = true;
129  delete ptBins;
130  }
131 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
TH2F * book2D(const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
book a 2D histogram, either with DQM or plain root.
Definition: Benchmark.cc:43

Member Data Documentation

TH2F* MatchCandidateBenchmark::delta_et_Over_et_VS_et_
protected

Definition at line 33 of file MatchCandidateBenchmark.h.

Referenced by fillOne(), MatchCandidateBenchmark(), and setup().

TH2F* MatchCandidateBenchmark::delta_et_VS_et_
protected

Definition at line 34 of file MatchCandidateBenchmark.h.

Referenced by fillOne(), MatchCandidateBenchmark(), and setup().

TH2F* MatchCandidateBenchmark::delta_eta_VS_et_
protected

Definition at line 35 of file MatchCandidateBenchmark.h.

Referenced by fillOne(), MatchCandidateBenchmark(), and setup().

TH2F* MatchCandidateBenchmark::delta_phi_VS_et_
protected

Definition at line 36 of file MatchCandidateBenchmark.h.

Referenced by fillOne(), MatchCandidateBenchmark(), and setup().

bool MatchCandidateBenchmark::histogramBooked_
protected

Definition at line 38 of file MatchCandidateBenchmark.h.

Referenced by fillOne(), MatchCandidateBenchmark(), and setup().