CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ConversionPostprocessing Class Reference

#include <ConversionPostprocessing.h>

Inheritance diagram for ConversionPostprocessing:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
 ConversionPostprocessing (const edm::ParameterSet &pset)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
virtual ~ConversionPostprocessing ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void dividePlots (MonitorElement *dividend, MonitorElement *numerator, MonitorElement *denominator, std::string type)
 
void dividePlots (MonitorElement *dividend, MonitorElement *numerator, double denominator)
 
virtual void runPostprocessing ()
 

Private Attributes

bool batch_
 
MonitorElementconvEffEtaTwoTracks_
 
MonitorElementconvEffEtaTwoTracksAndVtxProbGT0005_
 
MonitorElementconvEffEtaTwoTracksAndVtxProbGT0_
 
MonitorElementconvEffEtTwoTracks_
 
MonitorElementconvEffPhiTwoTracks_
 
MonitorElementconvEffRTwoTracks_
 
MonitorElementconvEffRTwoTracksAndVtxProbGT0005_
 
MonitorElementconvEffRTwoTracksAndVtxProbGT0_
 
MonitorElementconvEffZTwoTracks_
 
MonitorElementconvFakeRateEtaTwoTracks_
 
MonitorElementconvFakeRateEtTwoTracks_
 
MonitorElementconvFakeRatePhiTwoTracks_
 
MonitorElementconvFakeRateRTwoTracks_
 
MonitorElementconvFakeRateZTwoTracks_
 
std::stringstream currentFolder_
 
DQMStoredbe_
 
int etaBin
 
int etaBin2
 
double etaMax
 
double etaMin
 
int etBin
 
double etMax
 
double etMin
 
std::string inputFileName_
 
std::string outputFileName_
 
edm::ParameterSet parameters_
 
int phiBin
 
double phiMax
 
double phiMin
 
int rBin
 
double rMax
 
double rMin
 
bool standAlone_
 
int verbosity_
 
int zBin
 
double zMax
 
double zMin
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

$Id: ConversionPostprocessing

Date:
2012/10/09 15:20:54

author: Nancy Marinelli, U. of Notre Dame, US

$Id: ConversionPostprocessing

Date:
2011/05/20 13:55:42

authors: Nancy Marinelli, U. of Notre Dame, US

Definition at line 53 of file ConversionPostprocessing.h.

Constructor & Destructor Documentation

ConversionPostprocessing::ConversionPostprocessing ( const edm::ParameterSet pset)
explicit

Definition at line 24 of file ConversionPostprocessing.cc.

References dbe_, jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, reco::tau::qcuts::etMin(), edm::ParameterSet::getParameter(), cppFunctionSkipper::operator, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, and DQMStore::setVerbose().

25 {
26 
27  dbe_ = 0;
29  dbe_->setVerbose(0);
30  parameters_ = pset;
31 
32 
33  standAlone_ = pset.getParameter<bool>("standAlone");
34  batch_ = pset.getParameter<bool>("batch");
35  outputFileName_ = pset.getParameter<string>("OutputFileName");
36  inputFileName_ = pset.getParameter<std::string>("InputFileName");
37 
38 
39  etMin = parameters_.getParameter<double>("etMin");
40  etMax = parameters_.getParameter<double>("etMax");
41  etBin = parameters_.getParameter<int>("etBin");
42 
43  etaMin = parameters_.getParameter<double>("etaMin");
44  etaMax = parameters_.getParameter<double>("etaMax");
45  etaBin = parameters_.getParameter<int>("etaBin");
46  etaBin2 = parameters_.getParameter<int>("etaBin2");
47 
48  phiMin = parameters_.getParameter<double>("phiMin");
49  phiMax = parameters_.getParameter<double>("phiMax");
50  phiBin = parameters_.getParameter<int>("phiBin");
51 
52  rMin = parameters_.getParameter<double>("rMin");
53  rMax = parameters_.getParameter<double>("rMax");
54  rBin = parameters_.getParameter<int>("rBin");
55 
56  zMin = parameters_.getParameter<double>("zMin");
57  zMax = parameters_.getParameter<double>("zMax");
58  zBin = parameters_.getParameter<int>("zBin");
59 
60 
61 
62 }
T getParameter(std::string const &) const
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
ConversionPostprocessing::~ConversionPostprocessing ( )
virtual

Definition at line 66 of file ConversionPostprocessing.cc.

67 {}

Member Function Documentation

void ConversionPostprocessing::analyze ( const edm::Event e,
const edm::EventSetup esup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 74 of file ConversionPostprocessing.cc.

75 {}
void ConversionPostprocessing::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file ConversionPostprocessing.cc.

70 {
71 
72 }
void ConversionPostprocessing::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
MonitorElement denominator,
std::string  type 
)
private

Definition at line 176 of file ConversionPostprocessing.cc.

References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.

176  {
177  double value,err;
178 
179  //quick fix to avoid seg. faults due to null pointers.
180  if (dividend==0 || numerator==0 || denominator==0)return;
181 
182  for (int j=1; j<=numerator->getNbinsX(); j++){
183 
184  if (denominator->getBinContent(j)!=0){
185  if (type=="effic")
186  value = ((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j));
187  else if (type=="fakerate")
188  value = 1-((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j));
189  else return;
190  err = sqrt( value*(1-value) / ((double) denominator->getBinContent(j)) );
191  dividend->setBinContent(j, value);
192  if ( err !=0 ) dividend->setBinError(j,err);
193  }
194  else {
195  dividend->setBinContent(j, 0);
196  dividend->setBinError(j,0);
197  }
198 
199  }
200 
201 
202 }
type
Definition: HCALResponse.h:22
void setBinContent(int binx, double content)
set content of bin (1-D)
T sqrt(T t)
Definition: SSEVec.h:46
int j
Definition: DBlmapReader.cc:9
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void ConversionPostprocessing::dividePlots ( MonitorElement dividend,
MonitorElement numerator,
double  denominator 
)
private

Definition at line 205 of file ConversionPostprocessing.cc.

References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.

205  {
206  double value,err;
207 
208  //quick fix to avoid seg. faults due to null pointers.
209  if (dividend==0 || numerator==0 )return;
210 
211  for (int j=1; j<=numerator->getNbinsX(); j++){
212  if (denominator!=0){
213  value = ((double) numerator->getBinContent(j))/denominator;
214  err = sqrt( value*(1-value) / denominator);
215  dividend->setBinContent(j, value);
216  dividend->setBinError(j,err);
217  }
218  else {
219  dividend->setBinContent(j, 0);
220  }
221  }
222 
223 }
void setBinContent(int binx, double content)
set content of bin (1-D)
T sqrt(T t)
Definition: SSEVec.h:46
int j
Definition: DBlmapReader.cc:9
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void ConversionPostprocessing::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file ConversionPostprocessing.cc.

void ConversionPostprocessing::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file ConversionPostprocessing.cc.

169 {
170 
171 
172 }
void ConversionPostprocessing::endRun ( const edm::Run run,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file ConversionPostprocessing.cc.

84  {
85 
87 
88 }
void ConversionPostprocessing::runPostprocessing ( )
privatevirtual

Definition at line 92 of file ConversionPostprocessing.cc.

References DQMStore::book1D(), dbe_, jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, jptDQMConfig_cff::etMax, reco::tau::qcuts::etMin(), DQMStore::get(), DQMStore::open(), jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, DQMStore::save(), and DQMStore::setCurrentFolder().

93 {
94 
95 
96 
97  std::string simInfoPathName = "EgammaV/ConversionValidator/SimulationInfo/";
98  std::string convPathName = "EgammaV/ConversionValidator/ConversionInfo/";
99  std::string effPathName = "EgammaV/ConversionValidator/EfficienciesAndFakeRate/";
100 
101 
103 
104  dbe_->setCurrentFolder(effPathName);
105  // Conversion reconstruction efficiency
106  std::string histname = "convEffVsEtaTwoTracks";
107  convEffEtaTwoTracks_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax);
108 
109  histname = "convEffVsPhiTwoTracks";
110  convEffPhiTwoTracks_ = dbe_->book1D(histname,histname,phiBin,phiMin,phiMax);
111 
112  histname = "convEffVsRTwoTracks";
113  convEffRTwoTracks_ = dbe_->book1D(histname,histname,rBin,rMin, rMax);
114 
115  histname = "convEffVsZTwoTracks";
116  convEffZTwoTracks_ = dbe_->book1D(histname,histname,zBin,zMin,zMax);
117 
118  histname = "convEffVsEtTwoTracks";
119  convEffEtTwoTracks_ = dbe_->book1D(histname,histname,etBin,etMin, etMax);
120  //
121  histname = "convEffVsEtaTwoTracksAndVtxProbGT0";
123  histname = "convEffVsEtaTwoTracksAndVtxProbGT0005";
125  histname = "convEffVsRTwoTracksAndVtxProbGT0";
127  histname = "convEffVsRTwoTracksAndVtxProbGT0005";
129  //
130  // Fake rate
131  histname = "convFakeRateVsEtaTwoTracks";
132  convFakeRateEtaTwoTracks_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax);
133  histname = "convFakeRateVsPhiTwoTracks";
135  histname = "convFakeRateVsRTwoTracks";
136  convFakeRateRTwoTracks_ = dbe_->book1D(histname,histname,rBin,rMin, rMax);
137  histname = "convFakeRateVsZTwoTracks";
138  convFakeRateZTwoTracks_ = dbe_->book1D(histname,histname,zBin,zMin,zMax);
139  histname = "convFakeRateVsEtTwoTracks";
140  convFakeRateEtTwoTracks_ = dbe_->book1D(histname,histname,etBin,etMin, etMax);
141 
142  // efficiencies
143  dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),dbe_->get(simInfoPathName+"h_VisSimConvEta"),"effic");
144  dividePlots(dbe_->get(effPathName+"convEffVsPhiTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksPhi"),dbe_->get(simInfoPathName+"h_VisSimConvPhi"),"effic");
145  dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),dbe_->get(simInfoPathName+"h_VisSimConvR"),"effic");
146  dividePlots(dbe_->get(effPathName+"convEffVsZTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksZ"),dbe_->get(simInfoPathName+"h_VisSimConvZ"),"effic");
147  dividePlots(dbe_->get(effPathName+"convEffVsEtTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEt"),dbe_->get(simInfoPathName+"h_VisSimConvEt"),"effic");
148  dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracksAndVtxProbGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEtaAndVtxPGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),"effic");
149  dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracksAndVtxProbGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEtaAndVtxPGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),"effic");
150  dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracksAndVtxProbGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksRAndVtxPGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),"effic");
151  dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracksAndVtxProbGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksRAndVtxPGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),"effic");
152 
153 
154  // fake rate
155  dividePlots(dbe_->get(effPathName+"convFakeRateVsEtaTwoTracks"),dbe_->get(convPathName+"convEtaAss2"),dbe_->get(convPathName+"convEta2"),"fakerate");
156  dividePlots(dbe_->get(effPathName+"convFakeRateVsPhiTwoTracks"),dbe_->get(convPathName+"convPhiAss"),dbe_->get(convPathName+"convPhi"),"fakerate");
157  dividePlots(dbe_->get(effPathName+"convFakeRateVsRTwoTracks"),dbe_->get(convPathName+"convRAss"),dbe_->get(convPathName+"convR"),"fakerate");
158  dividePlots(dbe_->get(effPathName+"convFakeRateVsZTwoTracks"),dbe_->get(convPathName+"convZAss"),dbe_->get(convPathName+"convZ"),"fakerate");
159  dividePlots(dbe_->get(effPathName+"convFakeRateVsEtTwoTracks"),dbe_->get(convPathName+"convPtAss"),dbe_->get(convPathName+"convPt"),"fakerate");
160 
161 
162 
164  else if(batch_) dbe_->save(inputFileName_);
165 }
MonitorElement * convFakeRateEtaTwoTracks_
MonitorElement * convEffRTwoTracksAndVtxProbGT0005_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
void dividePlots(MonitorElement *dividend, MonitorElement *numerator, MonitorElement *denominator, std::string type)
MonitorElement * convEffRTwoTracksAndVtxProbGT0_
MonitorElement * convEffEtaTwoTracksAndVtxProbGT0005_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
MonitorElement * convFakeRatePhiTwoTracks_
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2432
MonitorElement * convEffEtaTwoTracksAndVtxProbGT0_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

bool ConversionPostprocessing::batch_
private

Definition at line 84 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffEtaTwoTracks_
private

Definition at line 110 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffEtaTwoTracksAndVtxProbGT0005_
private

Definition at line 117 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffEtaTwoTracksAndVtxProbGT0_
private

Definition at line 116 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffEtTwoTracks_
private

Definition at line 114 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffPhiTwoTracks_
private

Definition at line 111 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffRTwoTracks_
private

Definition at line 112 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffRTwoTracksAndVtxProbGT0005_
private

Definition at line 119 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffRTwoTracksAndVtxProbGT0_
private

Definition at line 118 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convEffZTwoTracks_
private

Definition at line 113 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convFakeRateEtaTwoTracks_
private

Definition at line 122 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convFakeRateEtTwoTracks_
private

Definition at line 126 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convFakeRatePhiTwoTracks_
private

Definition at line 123 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convFakeRateRTwoTracks_
private

Definition at line 124 of file ConversionPostprocessing.h.

MonitorElement* ConversionPostprocessing::convFakeRateZTwoTracks_
private

Definition at line 125 of file ConversionPostprocessing.h.

std::stringstream ConversionPostprocessing::currentFolder_
private

Definition at line 88 of file ConversionPostprocessing.h.

DQMStore* ConversionPostprocessing::dbe_
private

Definition at line 78 of file ConversionPostprocessing.h.

int ConversionPostprocessing::etaBin
private

Definition at line 96 of file ConversionPostprocessing.h.

int ConversionPostprocessing::etaBin2
private

Definition at line 97 of file ConversionPostprocessing.h.

double ConversionPostprocessing::etaMax
private

Definition at line 95 of file ConversionPostprocessing.h.

double ConversionPostprocessing::etaMin
private

Definition at line 94 of file ConversionPostprocessing.h.

int ConversionPostprocessing::etBin
private

Definition at line 93 of file ConversionPostprocessing.h.

double ConversionPostprocessing::etMax
private

Definition at line 92 of file ConversionPostprocessing.h.

double ConversionPostprocessing::etMin
private

Definition at line 91 of file ConversionPostprocessing.h.

std::string ConversionPostprocessing::inputFileName_
private

Definition at line 86 of file ConversionPostprocessing.h.

std::string ConversionPostprocessing::outputFileName_
private

Definition at line 85 of file ConversionPostprocessing.h.

edm::ParameterSet ConversionPostprocessing::parameters_
private
int ConversionPostprocessing::phiBin
private

Definition at line 100 of file ConversionPostprocessing.h.

double ConversionPostprocessing::phiMax
private

Definition at line 99 of file ConversionPostprocessing.h.

double ConversionPostprocessing::phiMin
private

Definition at line 98 of file ConversionPostprocessing.h.

int ConversionPostprocessing::rBin
private

Definition at line 103 of file ConversionPostprocessing.h.

double ConversionPostprocessing::rMax
private

Definition at line 102 of file ConversionPostprocessing.h.

double ConversionPostprocessing::rMin
private

Definition at line 101 of file ConversionPostprocessing.h.

bool ConversionPostprocessing::standAlone_
private

Definition at line 83 of file ConversionPostprocessing.h.

int ConversionPostprocessing::verbosity_
private

Definition at line 79 of file ConversionPostprocessing.h.

int ConversionPostprocessing::zBin
private

Definition at line 106 of file ConversionPostprocessing.h.

double ConversionPostprocessing::zMax
private

Definition at line 105 of file ConversionPostprocessing.h.

double ConversionPostprocessing::zMin
private

Definition at line 104 of file ConversionPostprocessing.h.