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

#include <MVAJetTagPlotter.h>

Inheritance diagram for MVAJetTagPlotter:
BaseTagInfoPlotter BaseBTagPlotter

Public Member Functions

virtual void analyzeTag (const std::vector< const reco::BaseTagInfo * > &baseTagInfos, const double &jec, const int &jetFlavour)
 
virtual void analyzeTag (const std::vector< const reco::BaseTagInfo * > &baseTagInfos, const double &jec, const int &jetFlavour, const float &w)
 
void epsPlot (const std::string &name)
 
virtual void finalize (DQMStore::IBooker &ibook_, DQMStore::IGetter &igetter_)
 
 MVAJetTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, const std::string &folderName, const unsigned int &mc, const bool &willFinalize, DQMStore::IBooker &ibook)
 
void psPlot (const std::string &name)
 
virtual void setEventSetup (const edm::EventSetup &setup)
 
virtual std::vector< std::string > tagInfoRequirements () const
 
 ~MVAJetTagPlotter ()
 
- Public Member Functions inherited from BaseTagInfoPlotter
virtual void analyzeTag (const reco::BaseTagInfo *tagInfo, const double &jec, const int &jetFlavour)
 
virtual void analyzeTag (const reco::BaseTagInfo *tagInfo, const double &jec, const int &jetFlavour, const float &w)
 
 BaseTagInfoPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
virtual ~BaseTagInfoPlotter ()
 
- Public Member Functions inherited from BaseBTagPlotter
 BaseBTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin)
 
const EtaPtBinetaPtBin ()
 
virtual ~BaseBTagPlotter ()
 

Private Attributes

std::vector
< TaggingVariablePlotter * > 
categoryPlotters
 
reco::TaggingVariableName categoryVariable
 
const GenericMVAJetTagComputercomputer
 
std::string jetTagComputer
 

Additional Inherited Members

- Protected Attributes inherited from BaseBTagPlotter
const EtaPtBin etaPtBin_
 
const std::string tagName_
 
const std::string theExtensionString
 

Detailed Description

Definition at line 16 of file MVAJetTagPlotter.h.

Constructor & Destructor Documentation

MVAJetTagPlotter::MVAJetTagPlotter ( const std::string &  tagName,
const EtaPtBin etaPtBin,
const edm::ParameterSet pSet,
const std::string &  folderName,
const unsigned int &  mc,
const bool &  willFinalize,
DQMStore::IBooker ibook 
)

Definition at line 16 of file MVAJetTagPlotter.cc.

References categoryPlotters, categoryVariable, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), reco::getTaggingVariableName(), i, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

21  :
22  BaseTagInfoPlotter(folderName, etaPtBin),
23  jetTagComputer(tagName), computer(0),
25 {
26  typedef std::vector<ParameterSet> VParameterSet;
27  VParameterSet pSets;
28  if (pSet.exists("categoryVariable")) {
30  pSet.getParameter<string>("categoryVariable"));
31  pSets = pSet.getParameter<VParameterSet>("categories");
32  }
33  else pSets.push_back(pSet);
34 
35  for(unsigned int i = 0; i != pSets.size(); ++i) {
36  ostringstream ss;
37  ss << "CAT" << i;
38  categoryPlotters.push_back(
39  new TaggingVariablePlotter(folderName, etaPtBin,
40  pSets[i], mc, willFinalize, ibook,
41  i ? ss.str() : string()));
42  }
43 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string jetTagComputer
BaseTagInfoPlotter(const std::string &tagName, const EtaPtBin &etaPtBin)
std::vector< TaggingVariablePlotter * > categoryPlotters
TaggingVariableName getTaggingVariableName(const std::string &name)
const GenericMVAJetTagComputer * computer
reco::TaggingVariableName categoryVariable
MVAJetTagPlotter::~MVAJetTagPlotter ( )

Definition at line 45 of file MVAJetTagPlotter.cc.

References categoryPlotters.

46 {
47  for_each(categoryPlotters.begin(), categoryPlotters.end(),
48  bind(&::operator delete, _1));
49 }
std::vector< TaggingVariablePlotter * > categoryPlotters

Member Function Documentation

void MVAJetTagPlotter::analyzeTag ( const std::vector< const reco::BaseTagInfo * > &  baseTagInfos,
const double &  jec,
const int &  jetFlavour 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 64 of file MVAJetTagPlotter.cc.

Referenced by analyzeTag().

66 {
67  analyzeTag(baseTagInfos,jec,jetFlavour,1.);
68 }
virtual void analyzeTag(const std::vector< const reco::BaseTagInfo * > &baseTagInfos, const double &jec, const int &jetFlavour)
void MVAJetTagPlotter::analyzeTag ( const std::vector< const reco::BaseTagInfo * > &  baseTagInfos,
const double &  jec,
const int &  jetFlavour,
const float &  w 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 70 of file MVAJetTagPlotter.cc.

References analyzeTag(), eostools::cat(), categoryPlotters, categoryVariable, computer, reco::TaggingVariableList::get(), reco::btau::lastTaggingVariable, and GenericMVAJetTagComputer::taggingVariables().

74 {
75  const JetTagComputer::TagInfoHelper helper(baseTagInfos);
76  const TaggingVariableList& vars = computer->taggingVariables(helper);
77 
78  categoryPlotters.front()->analyzeTag(vars, jetFlavour,w);
80  unsigned int cat =
81  (unsigned int)(vars.get(categoryVariable, -1) + 1);
82  if (cat >= 1 && cat < categoryPlotters.size())
83  categoryPlotters[cat]->analyzeTag(vars, jetFlavour,w);
84  }
85 }
const double w
Definition: UKUtility.cc:23
def cat
Definition: eostools.py:400
TaggingValue get(TaggingVariableName tag) const
std::vector< TaggingVariablePlotter * > categoryPlotters
virtual void analyzeTag(const std::vector< const reco::BaseTagInfo * > &baseTagInfos, const double &jec, const int &jetFlavour)
const GenericMVAJetTagComputer * computer
reco::TaggingVariableName categoryVariable
virtual reco::TaggingVariableList taggingVariables(const reco::BaseTagInfo &tagInfo) const
void MVAJetTagPlotter::epsPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 102 of file MVAJetTagPlotter.cc.

References categoryPlotters, and TaggingVariablePlotter::epsPlot().

103 {
104  for_each(categoryPlotters.begin(), categoryPlotters.end(),
105  boost::bind(&TaggingVariablePlotter::epsPlot, _1, boost::ref(name)));
106 }
void epsPlot(const std::string &name)
std::vector< TaggingVariablePlotter * > categoryPlotters
void MVAJetTagPlotter::finalize ( DQMStore::IBooker ibook_,
DQMStore::IGetter igetter_ 
)
virtual

Implements BaseBTagPlotter.

Definition at line 87 of file MVAJetTagPlotter.cc.

88 {
89  //nothing done here in principle and function below does not work
90  /*
91  for_each(categoryPlotters.begin(), categoryPlotters.end(),
92  boost::bind(&TaggingVariablePlotter::finalize, _1, boost::ref(ibook_), _2, boost::ref(igetter_)));
93  */
94 }
void MVAJetTagPlotter::psPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 96 of file MVAJetTagPlotter.cc.

References categoryPlotters, and TaggingVariablePlotter::psPlot().

97 {
98  for_each(categoryPlotters.begin(), categoryPlotters.end(),
99  boost::bind(&TaggingVariablePlotter::psPlot, _1, boost::ref(name)));
100 }
std::vector< TaggingVariablePlotter * > categoryPlotters
void psPlot(const std::string &name)
void MVAJetTagPlotter::setEventSetup ( const edm::EventSetup setup)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 51 of file MVAJetTagPlotter.cc.

References computer, Exception, edm::EventSetup::get(), patZpeak::handle, jetTagComputer, and edm::ESHandle< class >::product().

52 {
54  setup.get<JetTagComputerRecord>().get(jetTagComputer, handle);
55  computer = dynamic_cast<const GenericMVAJetTagComputer*>(handle.product());
56 
57  if (!computer)
58  throw cms::Exception("Configuration")
59  << "JetTagComputer passed to "
60  "MVAJetTagPlotter::analyzeTag is not a "
61  "GenericMVAJetTagComputer." << endl;
62 }
std::string jetTagComputer
tuple handle
Definition: patZpeak.py:22
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const GenericMVAJetTagComputer * computer
vector< string > MVAJetTagPlotter::tagInfoRequirements ( ) const
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 108 of file MVAJetTagPlotter.cc.

References computer, JetTagComputer::getInputLabels(), and HLT_25ns14e33_v1_cff::labels.

109 {
110  vector<string> labels = computer->getInputLabels();
111  if (labels.empty())
112  labels.push_back("tagInfos");
113  return labels;
114 }
const std::vector< std::string > & getInputLabels() const
const GenericMVAJetTagComputer * computer

Member Data Documentation

std::vector<TaggingVariablePlotter*> MVAJetTagPlotter::categoryPlotters
private

Definition at line 44 of file MVAJetTagPlotter.h.

Referenced by analyzeTag(), epsPlot(), MVAJetTagPlotter(), psPlot(), and ~MVAJetTagPlotter().

reco::TaggingVariableName MVAJetTagPlotter::categoryVariable
private

Definition at line 43 of file MVAJetTagPlotter.h.

Referenced by analyzeTag(), and MVAJetTagPlotter().

const GenericMVAJetTagComputer* MVAJetTagPlotter::computer
private

Definition at line 41 of file MVAJetTagPlotter.h.

Referenced by analyzeTag(), setEventSetup(), and tagInfoRequirements().

std::string MVAJetTagPlotter::jetTagComputer
private

Definition at line 40 of file MVAJetTagPlotter.h.

Referenced by setEventSetup().