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 int &jetFlavour)
 
void epsPlot (const std::string &name)
 
virtual void finalize ()
 
 MVAJetTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, const std::string &folderName, const bool &update, const bool &mc)
 
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 int &jetFlavour)
 
 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 bool &  update,
const bool &  mc 
)

Definition at line 16 of file MVAJetTagPlotter.cc.

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

21  :
22  BaseTagInfoPlotter(folderName, etaPtBin),
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  } else
33  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], update,mc,
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
#define update(a, b)
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 int &  jetFlavour 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 64 of file MVAJetTagPlotter.cc.

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

66 {
67  // taggingVariables() should not need EventSetup
68  // computer->setEventSetup(es);
69 
70  const JetTagComputer::TagInfoHelper helper(baseTagInfos);
71  const TaggingVariableList& vars = computer->taggingVariables(helper);
72 
73  categoryPlotters.front()->analyzeTag(vars, jetFlavour);
75  unsigned int cat =
76  (unsigned int)(vars.get(categoryVariable, -1) + 1);
77  if (cat >= 1 && cat < categoryPlotters.size())
78  categoryPlotters[cat]->analyzeTag(vars, jetFlavour);
79  }
80 }
TaggingValue get(TaggingVariableName tag) const
virtual void analyzeTag(const std::vector< const reco::BaseTagInfo * > &baseTagInfos, const int &jetFlavour)
std::vector< TaggingVariablePlotter * > categoryPlotters
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 100 of file MVAJetTagPlotter.cc.

References categoryPlotters, and TaggingVariablePlotter::epsPlot().

101 {
102  for_each(categoryPlotters.begin(), categoryPlotters.end(),
103  boost::bind(&TaggingVariablePlotter::epsPlot, _1, boost::ref(name)));
104 }
void epsPlot(const std::string &name)
std::vector< TaggingVariablePlotter * > categoryPlotters
void MVAJetTagPlotter::finalize ( void  )
virtual

Implements BaseBTagPlotter.

Definition at line 82 of file MVAJetTagPlotter.cc.

References categoryPlotters, and TaggingVariablePlotter::finalize().

83 {
84  for_each(categoryPlotters.begin(), categoryPlotters.end(),
86 }
std::vector< TaggingVariablePlotter * > categoryPlotters
void MVAJetTagPlotter::psPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 88 of file MVAJetTagPlotter.cc.

References categoryPlotters, and TaggingVariablePlotter::psPlot().

89 {
90  for_each(categoryPlotters.begin(), categoryPlotters.end(),
91  boost::bind(&TaggingVariablePlotter::psPlot, _1, boost::ref(name)));
92 }
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, edm::hlt::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:55
T const * product() const
Definition: ESHandle.h:62
const GenericMVAJetTagComputer * computer
vector< string > MVAJetTagPlotter::tagInfoRequirements ( ) const
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 106 of file MVAJetTagPlotter.cc.

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

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

Member Data Documentation

std::vector<TaggingVariablePlotter*> MVAJetTagPlotter::categoryPlotters
private
reco::TaggingVariableName MVAJetTagPlotter::categoryVariable
private

Definition at line 42 of file MVAJetTagPlotter.h.

Referenced by analyzeTag(), and MVAJetTagPlotter().

const GenericMVAJetTagComputer* MVAJetTagPlotter::computer
private

Definition at line 40 of file MVAJetTagPlotter.h.

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

std::string MVAJetTagPlotter::jetTagComputer
private

Definition at line 39 of file MVAJetTagPlotter.h.

Referenced by setEventSetup().