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

#include <PFMETMonitor.h>

Inheritance diagram for PFMETMonitor:
Benchmark

Public Member Functions

void fillOne (const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
 
 PFMETMonitor (Benchmark::Mode mode=Benchmark::DEFAULT)
 
void setDirectory (TDirectory *dir)
 set directory (to use in ROOT) More...
 
void setParameters (Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool metSpHistos)
 set the parameters locally More...
 
void setParameters (const edm::ParameterSet &parameterSet)
 set the parameters accessing them from ParameterSet More...
 
void setup ()
 book histograms More...
 
void setup (const edm::ParameterSet &parameterSet)
 book histograms More...
 
virtual ~PFMETMonitor ()
 
- Public Member Functions inherited from Benchmark
 Benchmark (Mode mode=DEFAULT)
 
bool isInRange (float pt, float eta, float phi) const
 
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

CandidateBenchmark candBench_
 
bool createMETSpecificHistos_
 
TH1F * delta_ex_
 
TH2F * delta_ex_VS_set_
 
TH2F * delta_set_Over_set_VS_set_
 
TH2F * delta_set_VS_set_
 
bool histogramBooked_
 
MatchCandidateBenchmark matchCandBench_
 
TH1F * px_
 
TH1F * sumEt_
 
- 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

Definition at line 11 of file PFMETMonitor.h.

Constructor & Destructor Documentation

PFMETMonitor::PFMETMonitor ( Benchmark::Mode  mode = Benchmark::DEFAULT)

Definition at line 15 of file PFMETMonitor.cc.

References createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, histogramBooked_, px_, Benchmark::setRange(), and sumEt_.

15  :
16  Benchmark(mode),
17  candBench_(mode),
19 
20  setRange( 0.0, 10e10, -10.0, 10.0, -3.14, 3.14);
21 
22  px_ = 0;
23  sumEt_ = 0;
24  delta_ex_ = 0;
25  delta_ex_VS_set_ = 0;
28 
30  histogramBooked_ = false;
31 }
TH1F * sumEt_
Definition: PFMETMonitor.h:40
TH2F * delta_ex_VS_set_
Definition: PFMETMonitor.h:42
TH2F * delta_set_VS_set_
Definition: PFMETMonitor.h:43
bool histogramBooked_
Definition: PFMETMonitor.h:50
TH1F * delta_ex_
Definition: PFMETMonitor.h:41
Benchmark(Mode mode=DEFAULT)
Definition: Benchmark.h:41
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
TH2F * delta_set_Over_set_VS_set_
Definition: PFMETMonitor.h:44
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
PFMETMonitor::~PFMETMonitor ( )
virtual

Definition at line 35 of file PFMETMonitor.cc.

35 {}

Member Function Documentation

void PFMETMonitor::fillOne ( const reco::MET met,
const reco::MET matchedMet,
float &  minVal,
float &  maxVal 
)

Definition at line 182 of file PFMETMonitor.cc.

References candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, reco::LeafCandidate::eta(), CandidateBenchmark::fillOne(), MatchCandidateBenchmark::fillOne(), histogramBooked_, Benchmark::isInRange(), matchCandBench_, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), px_, reco::LeafCandidate::py(), reco::MET::sumEt(), and sumEt_.

Referenced by PFMETDQMAnalyzer::analyze(), and PFRootEventManager::processEntry().

183  {
184  candBench_.fillOne(met);
185  matchCandBench_.fillOne(met, matchedMet);
187  if( !isInRange(met.pt(), met.eta(), met.phi() ) ) return;
188 
189  if (px_) px_->Fill(met.px());
190  if (delta_ex_) {
191  delta_ex_->Fill(met.px()-matchedMet.px());
192  delta_ex_->Fill(met.py()-matchedMet.py());
193  }
194  if (sumEt_) sumEt_->Fill( met.sumEt());
195 
196  if (delta_ex_VS_set_) {
197  delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.px()-matchedMet.px());
198  delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.py()-matchedMet.py());
199  }
200  if (delta_set_VS_set_) delta_set_VS_set_->Fill(matchedMet.sumEt(),met.sumEt()-matchedMet.sumEt());
201  if (delta_set_Over_set_VS_set_ && matchedMet.sumEt()>0.001 ) {
202  float setRes = (met.sumEt() - matchedMet.sumEt())/matchedMet.sumEt();
203  if (setRes > maxVal) maxVal = setRes;
204  if (setRes < minVal) minVal = setRes;
205  delta_set_Over_set_VS_set_->Fill(matchedMet.sumEt(),setRes);
206  }
207  }
208 }
TH1F * sumEt_
Definition: PFMETMonitor.h:40
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
TH2F * delta_ex_VS_set_
Definition: PFMETMonitor.h:42
TH2F * delta_set_VS_set_
Definition: PFMETMonitor.h:43
void fillOne(const reco::Candidate &candidate)
fill histograms with a given particle
bool histogramBooked_
Definition: PFMETMonitor.h:50
TH1F * delta_ex_
Definition: PFMETMonitor.h:41
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double sumEt() const
Definition: MET.h:48
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
TH2F * delta_set_Over_set_VS_set_
Definition: PFMETMonitor.h:44
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
virtual float pt() const GCC11_FINAL
transverse momentum
bool isInRange(float pt, float eta, float phi) const
Definition: Benchmark.h:58
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
void PFMETMonitor::setDirectory ( TDirectory *  dir)
virtual

set directory (to use in ROOT)

Reimplemented from Benchmark.

Definition at line 175 of file PFMETMonitor.cc.

References candBench_, matchCandBench_, and Benchmark::setDirectory().

Referenced by PFRootEventManager::readOptions().

175  {
177 
180 }
virtual void setDirectory(TDirectory *dir)
Definition: Benchmark.cc:19
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
dbl *** dir
Definition: mlp_gen.cc:35
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
void PFMETMonitor::setParameters ( Benchmark::Mode  mode,
float  ptmin,
float  ptmax,
float  etamin,
float  etamax,
float  phimin,
float  phimax,
bool  metSpHistos 
)

set the parameters locally

Definition at line 58 of file PFMETMonitor.cc.

References candBench_, createMETSpecificHistos_, matchCandBench_, alignBH_cfg::mode, Benchmark::mode_, Benchmark::setParameters(), and Benchmark::setRange().

Referenced by PFMETDQMAnalyzer::PFMETDQMAnalyzer(), and PFRootEventManager::readOptions().

60  {
61  mode_ = mode;
62  createMETSpecificHistos_ = metSpHistos;
63 
64  setRange( ptmin, ptmax, etamin, etamax, phimin, phimax);
65 
68 }
void setParameters(Mode mode)
Definition: Benchmark.h:49
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
double ptmin
Definition: HydjetWrapper.h:86
Mode mode_
Definition: Benchmark.h:86
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
void PFMETMonitor::setParameters ( const edm::ParameterSet parameterSet)

set the parameters accessing them from ParameterSet

Definition at line 40 of file PFMETMonitor.cc.

References candBench_, createMETSpecificHistos_, edm::ParameterSet::getParameter(), matchCandBench_, Benchmark::mode_, Benchmark::setParameters(), and Benchmark::setRange().

40  {
41 
42  mode_ = (Benchmark::Mode) parameterSet.getParameter<int>( "mode" );
43  createMETSpecificHistos_ = parameterSet.getParameter<bool>( "CreateMETSpecificHistos" );
44  setRange( parameterSet.getParameter<double>("ptMin"),
45  parameterSet.getParameter<double>("ptMax"),
46  parameterSet.getParameter<double>("etaMin"),
47  parameterSet.getParameter<double>("etaMax"),
48  parameterSet.getParameter<double>("phiMin"),
49  parameterSet.getParameter<double>("phiMax") );
50 
51 
54 }
T getParameter(std::string const &) const
void setParameters(Mode mode)
Definition: Benchmark.h:49
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
Mode mode_
Definition: Benchmark.h:86
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
void PFMETMonitor::setup ( void  )

book histograms

Definition at line 140 of file PFMETMonitor.cc.

References Benchmark::book1D(), Benchmark::book2D(), candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, histogramBooked_, Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, matchCandBench_, Benchmark::PhaseSpace::n, px_, CandidateBenchmark::setup(), MatchCandidateBenchmark::setup(), and sumEt_.

Referenced by PFMETDQMAnalyzer::beginJob(), and PFRootEventManager::readOptions().

140  {
141  candBench_.setup();
143 
145 
146  PhaseSpace pxPS = PhaseSpace( 50, 0, 200);
147  PhaseSpace dpxPS = PhaseSpace( 50, -500, 500);
148  PhaseSpace setPS = PhaseSpace( 50, 0.0, 3000);
149  PhaseSpace dsetPS = PhaseSpace( 50, -1000.0, 1000);
150  PhaseSpace setOvsetPS = PhaseSpace( 100,0., 2.);
151 
152  px_ = book1D("px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M);
153 
154  sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", setPS.n, setPS.m, setPS.M);
155 
156  delta_ex_ = book1D("delta_ex_", "#DeltaME_{X}", dpxPS.n, dpxPS.m, dpxPS.M);
157 
158  delta_ex_VS_set_ = book2D("delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}",
159  setPS.n, setPS.m, setPS.M,
160  dpxPS.n, dpxPS.m, dpxPS.M );
161 
162  delta_set_VS_set_ = book2D("delta_set_VS_set_",
163  ";SE_{T, true} (GeV);#DeltaSE_{T}",
164  setPS.n, setPS.m, setPS.M,
165  dsetPS.n, dsetPS.m, dsetPS.M );
166 
167  delta_set_Over_set_VS_set_ = book2D("delta_set_Over_set_VS_set_",
168  ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
169  setPS.n, setPS.m, setPS.M,
170  setOvsetPS.n, setOvsetPS.m, setOvsetPS.M );
171  histogramBooked_ = true;
172  }
173 }
TH1F * sumEt_
Definition: PFMETMonitor.h:40
TH2F * delta_ex_VS_set_
Definition: PFMETMonitor.h:42
TH2F * delta_set_VS_set_
Definition: PFMETMonitor.h:43
void setup()
book histograms
void setup()
book histograms
bool histogramBooked_
Definition: PFMETMonitor.h:50
TH1F * delta_ex_
Definition: PFMETMonitor.h:41
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
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
TH2F * delta_set_Over_set_VS_set_
Definition: PFMETMonitor.h:44
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
TH1F * book1D(const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root.
Definition: Benchmark.cc:25
void PFMETMonitor::setup ( const edm::ParameterSet parameterSet)

book histograms

Definition at line 72 of file PFMETMonitor.cc.

References Benchmark::book1D(), Benchmark::book2D(), candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, edm::ParameterSet::getParameter(), histogramBooked_, matchCandBench_, px_, CandidateBenchmark::setup(), MatchCandidateBenchmark::setup(), and sumEt_.

72  {
73  candBench_.setup(parameterSet);
74  matchCandBench_.setup(parameterSet);
75 
77 
78  edm::ParameterSet pxPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPxHistoParameter");
79  edm::ParameterSet dpxPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPxHistoParameter");
80  edm::ParameterSet dptPS = parameterSet.getParameter<edm::ParameterSet>("DeltaPtHistoParameter");
81  edm::ParameterSet setPS = parameterSet.getParameter<edm::ParameterSet>("SumEtHistoParameter");
82  edm::ParameterSet dsetPS = parameterSet.getParameter<edm::ParameterSet>("DeltaSumEtHistoParameter");
83  edm::ParameterSet setOvsetPS = parameterSet.getParameter<edm::ParameterSet>("DeltaSumEtOvSumEtHistoParameter");
84 
85  if (pxPS.getParameter<bool>("switchOn")) {
86  px_ = book1D("px_", "px_;p_{X} (GeV)",
87  pxPS.getParameter<int32_t>("nBin"),
88  pxPS.getParameter<double>("xMin"),
89  pxPS.getParameter<double>("xMax"));
90  }
91  if (setPS.getParameter<bool>("switchOn")) {
92  sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}",
93  setPS.getParameter<int32_t>("nBin"),
94  setPS.getParameter<double>("xMin"),
95  setPS.getParameter<double>("xMax"));
96  }
97  if (dpxPS.getParameter<bool>("switchOn")) {
98  delta_ex_ = book1D("delta_ex_", "#DeltaME_{X}",
99  dpxPS.getParameter<int32_t>("nBin"),
100  dpxPS.getParameter<double>("xMin"),
101  dpxPS.getParameter<double>("xMax"));
102  }
103 
104  if (dpxPS.getParameter<bool>("switchOn")) {
105  delta_ex_VS_set_ = book2D("delta_ex_VS_set_",
106  ";SE_{T, true} (GeV);#DeltaE_{X}",
107  setPS.getParameter<int32_t>("nBin"),
108  setPS.getParameter<double>("xMin"),
109  setPS.getParameter<double>("xMax"),
110  dptPS.getParameter<int32_t>("nBin"),
111  dptPS.getParameter<double>("xMin"),
112  dptPS.getParameter<double>("xMax"));
113  }
114  if (dsetPS.getParameter<bool>("switchOn")) {
115  delta_set_VS_set_ = book2D("delta_set_VS_set_",
116  ";SE_{T, true} (GeV);#DeltaSE_{T}",
117  setPS.getParameter<int32_t>("nBin"),
118  setPS.getParameter<double>("xMin"),
119  setPS.getParameter<double>("xMax"),
120  dsetPS.getParameter<int32_t>("nBin"),
121  dsetPS.getParameter<double>("xMin"),
122  dsetPS.getParameter<double>("xMax"));
123  }
124  if (setOvsetPS.getParameter<bool>("switchOn")) {
125  delta_set_Over_set_VS_set_ = book2D("delta_set_Over_set_VS_set_",
126  ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
127  setPS.getParameter<int32_t>("nBin"),
128  setPS.getParameter<double>("xMin"),
129  setPS.getParameter<double>("xMax"),
130  setOvsetPS.getParameter<int32_t>("nBin"),
131  setOvsetPS.getParameter<double>("xMin"),
132  setOvsetPS.getParameter<double>("xMax"));
133  }
134  histogramBooked_ = true;
135  }
136 }
TH1F * sumEt_
Definition: PFMETMonitor.h:40
T getParameter(std::string const &) const
TH2F * delta_ex_VS_set_
Definition: PFMETMonitor.h:42
TH2F * delta_set_VS_set_
Definition: PFMETMonitor.h:43
void setup()
book histograms
void setup()
book histograms
bool histogramBooked_
Definition: PFMETMonitor.h:50
TH1F * delta_ex_
Definition: PFMETMonitor.h:41
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
CandidateBenchmark candBench_
Definition: PFMETMonitor.h:46
TH2F * delta_set_Over_set_VS_set_
Definition: PFMETMonitor.h:44
bool createMETSpecificHistos_
Definition: PFMETMonitor.h:49
MatchCandidateBenchmark matchCandBench_
Definition: PFMETMonitor.h:47
TH1F * book1D(const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root.
Definition: Benchmark.cc:25

Member Data Documentation

CandidateBenchmark PFMETMonitor::candBench_
protected

Definition at line 46 of file PFMETMonitor.h.

Referenced by fillOne(), setDirectory(), setParameters(), and setup().

bool PFMETMonitor::createMETSpecificHistos_
protected

Definition at line 49 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), setParameters(), and setup().

TH1F* PFMETMonitor::delta_ex_
protected

Definition at line 41 of file PFMETMonitor.h.

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

TH2F* PFMETMonitor::delta_ex_VS_set_
protected

Definition at line 42 of file PFMETMonitor.h.

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

TH2F* PFMETMonitor::delta_set_Over_set_VS_set_
protected

Definition at line 44 of file PFMETMonitor.h.

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

TH2F* PFMETMonitor::delta_set_VS_set_
protected

Definition at line 43 of file PFMETMonitor.h.

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

bool PFMETMonitor::histogramBooked_
protected

Definition at line 50 of file PFMETMonitor.h.

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

MatchCandidateBenchmark PFMETMonitor::matchCandBench_
protected

Definition at line 47 of file PFMETMonitor.h.

Referenced by fillOne(), setDirectory(), setParameters(), and setup().

TH1F* PFMETMonitor::px_
protected

Definition at line 39 of file PFMETMonitor.h.

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

TH1F* PFMETMonitor::sumEt_
protected

Definition at line 40 of file PFMETMonitor.h.

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