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 | Static Private Attributes
SoftLeptonTagPlotter Class Reference

#include <SoftLeptonTagPlotter.h>

Inheritance diagram for SoftLeptonTagPlotter:
BaseTagInfoPlotter BaseBTagPlotter

Public Member Functions

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

Private Attributes

FlavourHistograms< double > * m_deltaR [s_leptons]
 
FlavourHistograms< double > * m_etaRel [s_leptons]
 
FlavourHistograms< double > * m_leptonId [s_leptons]
 
FlavourHistograms< double > * m_leptonPt [s_leptons]
 
FlavourHistograms< double > * m_p0Par [s_leptons]
 
FlavourHistograms< double > * m_ptRel [s_leptons]
 
FlavourHistograms< double > * m_ratio [s_leptons]
 
FlavourHistograms< double > * m_ratioRel [s_leptons]
 
FlavourHistograms< double > * m_sip2d [s_leptons]
 
FlavourHistograms< double > * m_sip2dsig [s_leptons]
 
FlavourHistograms< double > * m_sip3d [s_leptons]
 
FlavourHistograms< double > * m_sip3dsig [s_leptons]
 
unsigned int mcPlots_
 
bool willFinalize_
 

Static Private Attributes

static const int s_leptons = 2
 

Additional Inherited Members

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

Detailed Description

Definition at line 10 of file SoftLeptonTagPlotter.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file SoftLeptonTagPlotter.cc.

References i, m_deltaR, m_etaRel, m_leptonId, m_leptonPt, m_p0Par, m_ptRel, m_ratio, m_ratioRel, m_sip2d, m_sip2dsig, m_sip3d, m_sip3dsig, mcPlots_, ordinal, alignCSCRings::s, s_leptons, AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, and willFinalize_.

15  :
16  BaseTagInfoPlotter(tagName, etaPtBin), mcPlots_(mc), willFinalize_(wf)
17 {
18  const std::string softLepDir(theExtensionString.substr(1));
19 
20  if(willFinalize_) return;
21 
22  for (int i = 0; i < s_leptons; i++) {
23  std::ostringstream s("");
24  s << ordinal[i] << " lepton ";
26  s.str() + "id",
27  "Lepton identification discriminaint",
28  60, -0.1, 1.1, false, false, true, "b", softLepDir,mcPlots_, ibook);
30  s.str() + "pT",
31  "Lepton transverse moementum",
32  100, 0.0, 20.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
34  s.str() + "sip2dsig",
35  "Lepton signed 2D impact parameter significance",
36  100, -20.0, 30.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
38  s.str() + "sip3dsig",
39  "Lepton signed 3D impact parameter significance",
40  100, -20.0, 30.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
42  s.str() + "sip2d",
43  "Lepton signed 2D impact parameter",
44  100, -20.0, 30.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
46  s.str() + "sip3d",
47  "Lepton signed 3D impact parameter",
48  100, -20.0, 30.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
50  s.str() + "pT rel",
51  "Lepton transverse moementum relative to jet axis",
52  100, 0.0, 10.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
54  s.str() + "p0 par",
55  "Lepton moementum along jet axis in the B rest frame",
56  100, 0.0, 10.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
58  s.str() + "eta rel",
59  "Lepton pseudorapidity relative to jet axis",
60  100, -5.0, 25.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
62  s.str() + "delta R",
63  "Lepton pseudoangular distance from jet axis",
64  100, 0.0, 0.6, false, false, true, "b", softLepDir,mcPlots_, ibook);
66  s.str() + "energy ratio",
67  "Ratio of lepton momentum to jet energy",
68  100, 0.0, 2.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
70  s.str() + "parallel energy ratio",
71  "Ratio of lepton momentum along the jet axis to jet energy",
72  100, 0.0, 2.0, false, false, true, "b", softLepDir,mcPlots_, ibook);
73  }
74 }
int i
Definition: DBlmapReader.cc:9
FlavourHistograms< double > * m_leptonPt[s_leptons]
FlavourHistograms< double > * m_sip3d[s_leptons]
FlavourHistograms< double > * m_ratio[s_leptons]
const std::string theExtensionString
FlavourHistograms< double > * m_leptonId[s_leptons]
FlavourHistograms< double > * m_ratioRel[s_leptons]
FlavourHistograms< double > * m_sip2dsig[s_leptons]
static const string ordinal[9]
FlavourHistograms< double > * m_ptRel[s_leptons]
FlavourHistograms< double > * m_p0Par[s_leptons]
FlavourHistograms< double > * m_etaRel[s_leptons]
FlavourHistograms< double > * m_sip2d[s_leptons]
BaseTagInfoPlotter(const std::string &tagName, const EtaPtBin &etaPtBin)
static const int s_leptons
FlavourHistograms< double > * m_sip3dsig[s_leptons]
FlavourHistograms< double > * m_deltaR[s_leptons]
SoftLeptonTagPlotter::~SoftLeptonTagPlotter ( void  )

Definition at line 76 of file SoftLeptonTagPlotter.cc.

References i, m_deltaR, m_etaRel, m_leptonId, m_leptonPt, m_p0Par, m_ptRel, m_ratio, m_ratioRel, m_sip2d, m_sip2dsig, m_sip3d, m_sip3dsig, s_leptons, and willFinalize_.

77 {
78  if(willFinalize_) return;
79 
80  for (int i = 0; i != s_leptons; ++i) {
81  delete m_leptonId[i];
82  delete m_leptonPt[i];
83  delete m_sip2dsig[i];
84  delete m_sip3dsig[i];
85  delete m_sip2d[i];
86  delete m_sip3d[i];
87  delete m_ptRel[i];
88  delete m_p0Par[i];
89  delete m_etaRel[i];
90  delete m_deltaR[i];
91  delete m_ratio[i];
92  delete m_ratioRel[i];
93  }
94 }
int i
Definition: DBlmapReader.cc:9
FlavourHistograms< double > * m_leptonPt[s_leptons]
FlavourHistograms< double > * m_sip3d[s_leptons]
FlavourHistograms< double > * m_ratio[s_leptons]
FlavourHistograms< double > * m_leptonId[s_leptons]
FlavourHistograms< double > * m_ratioRel[s_leptons]
FlavourHistograms< double > * m_sip2dsig[s_leptons]
FlavourHistograms< double > * m_ptRel[s_leptons]
FlavourHistograms< double > * m_p0Par[s_leptons]
FlavourHistograms< double > * m_etaRel[s_leptons]
FlavourHistograms< double > * m_sip2d[s_leptons]
static const int s_leptons
FlavourHistograms< double > * m_sip3dsig[s_leptons]
FlavourHistograms< double > * m_deltaR[s_leptons]

Member Function Documentation

void SoftLeptonTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
const double &  jec,
const int &  jetFlavour 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 96 of file SoftLeptonTagPlotter.cc.

98 {
99  analyzeTag(baseTagInfo,jetFlavour,1.);
100 }
void analyzeTag(const reco::BaseTagInfo *baseTagInfo, const double &jec, const int &jetFlavour)
void SoftLeptonTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
const double &  jec,
const int &  jetFlavour,
const float &  w 
)
virtual

Reimplemented from BaseTagInfoPlotter.

Definition at line 102 of file SoftLeptonTagPlotter.cc.

References reco::SoftLeptonProperties::deltaR, reco::SoftLeptonProperties::etaRel, Exception, FlavourHistograms< T >::fill(), i, reco::TemplatedSoftLeptonTagInfo< REF >::lepton(), reco::TemplatedSoftLeptonTagInfo< REF >::leptons(), m_deltaR, m_etaRel, m_leptonId, m_leptonPt, m_p0Par, m_ptRel, m_ratio, m_ratioRel, m_sip2d, m_sip2dsig, m_sip3d, m_sip3dsig, reco::SoftLeptonProperties::p0Par, reco::TemplatedSoftLeptonTagInfo< REF >::properties(), reco::SoftLeptonProperties::ptRel, reco::SoftLeptonProperties::quality(), reco::SoftLeptonProperties::ratio, reco::SoftLeptonProperties::ratioRel, s_leptons, reco::SoftLeptonProperties::sip2d, reco::SoftLeptonProperties::sip2dsig, reco::SoftLeptonProperties::sip3d, reco::SoftLeptonProperties::sip3dsig, dumpRecoGeometry_cfg::tagInfo, and w.

106 {
107 
109  dynamic_cast<const reco::SoftLeptonTagInfo *>(baseTagInfo);
110 
111  if (!tagInfo) {
112  throw cms::Exception("Configuration")
113  << "BTagPerformanceAnalyzer: Extended TagInfo not of type SoftLeptonTagInfo. " << endl;
114  }
115 
116  int n_leptons = tagInfo->leptons();
117 
118  for (int i = 0; i != n_leptons && i != s_leptons; ++i) {
119  const reco::SoftLeptonProperties& properties = tagInfo->properties(i);
120  m_leptonPt[i]->fill( jetFlavour, tagInfo->lepton(i)->pt() ,w);
121  m_leptonId[i]->fill( jetFlavour, properties.quality() ,w);
122  m_sip2dsig[i]->fill( jetFlavour, properties.sip2dsig ,w);
123  m_sip3dsig[i]->fill( jetFlavour, properties.sip3dsig ,w);
124  m_sip2d[i]->fill( jetFlavour, properties.sip2d ,w);
125  m_sip3d[i]->fill( jetFlavour, properties.sip3d ,w);
126  m_ptRel[i]->fill( jetFlavour, properties.ptRel ,w);
127  m_p0Par[i]->fill( jetFlavour, properties.p0Par ,w);
128  m_etaRel[i]->fill( jetFlavour, properties.etaRel ,w);
129  m_deltaR[i]->fill( jetFlavour, properties.deltaR ,w);
130  m_ratio[i]->fill( jetFlavour, properties.ratio ,w);
131  m_ratioRel[i]->fill( jetFlavour, properties.ratioRel ,w);
132  }
133 }
int i
Definition: DBlmapReader.cc:9
FlavourHistograms< double > * m_leptonPt[s_leptons]
FlavourHistograms< double > * m_sip3d[s_leptons]
float quality(Quality::Generic qual, bool throwIfUndefined=true) const
FlavourHistograms< double > * m_ratio[s_leptons]
const double w
Definition: UKUtility.cc:23
FlavourHistograms< double > * m_leptonId[s_leptons]
void fill(const int &flavour, const T &variable) const
FlavourHistograms< double > * m_ratioRel[s_leptons]
const SoftLeptonProperties & properties(size_t i) const
FlavourHistograms< double > * m_sip2dsig[s_leptons]
FlavourHistograms< double > * m_ptRel[s_leptons]
FlavourHistograms< double > * m_p0Par[s_leptons]
FlavourHistograms< double > * m_etaRel[s_leptons]
FlavourHistograms< double > * m_sip2d[s_leptons]
static const int s_leptons
FlavourHistograms< double > * m_sip3dsig[s_leptons]
FlavourHistograms< double > * m_deltaR[s_leptons]
void SoftLeptonTagPlotter::epsPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 178 of file SoftLeptonTagPlotter.cc.

References FlavourHistograms< T >::epsPlot(), i, m_deltaR, m_etaRel, m_leptonId, m_leptonPt, m_p0Par, m_ptRel, m_ratio, m_ratioRel, m_sip2d, m_sip2dsig, m_sip3d, m_sip3dsig, s_leptons, and willFinalize_.

179 {
180  if(willFinalize_) return;
181 
182  for (int i=0; i != s_leptons; ++i) {
183  m_leptonId[i]->epsPlot( name );
184  m_leptonPt[i]->epsPlot( name );
185  m_sip2d[i]->epsPlot( name );
186  m_sip3d[i]->epsPlot( name );
187  m_sip2dsig[i]->epsPlot( name );
188  m_sip3dsig[i]->epsPlot( name );
189  m_ptRel[i]->epsPlot( name );
190  m_p0Par[i]->epsPlot( name );
191  m_etaRel[i]->epsPlot( name );
192  m_deltaR[i]->epsPlot( name );
193  m_ratio[i]->epsPlot( name );
194  m_ratioRel[i]->epsPlot( name );
195  }
196 }
int i
Definition: DBlmapReader.cc:9
FlavourHistograms< double > * m_leptonPt[s_leptons]
FlavourHistograms< double > * m_sip3d[s_leptons]
FlavourHistograms< double > * m_ratio[s_leptons]
FlavourHistograms< double > * m_leptonId[s_leptons]
FlavourHistograms< double > * m_ratioRel[s_leptons]
void epsPlot(const std::string &name)
FlavourHistograms< double > * m_sip2dsig[s_leptons]
FlavourHistograms< double > * m_ptRel[s_leptons]
FlavourHistograms< double > * m_p0Par[s_leptons]
FlavourHistograms< double > * m_etaRel[s_leptons]
FlavourHistograms< double > * m_sip2d[s_leptons]
static const int s_leptons
FlavourHistograms< double > * m_sip3dsig[s_leptons]
FlavourHistograms< double > * m_deltaR[s_leptons]
virtual void SoftLeptonTagPlotter::finalize ( DQMStore::IBooker ibook_,
DQMStore::IGetter igetter_ 
)
inlinevirtual

Implements BaseBTagPlotter.

Definition at line 22 of file SoftLeptonTagPlotter.h.

22 {}
void SoftLeptonTagPlotter::psPlot ( const std::string &  name)
virtual

Implements BaseBTagPlotter.

Definition at line 135 of file SoftLeptonTagPlotter.cc.

References svgfig::canvas(), i, m_deltaR, m_etaRel, m_leptonId, m_leptonPt, m_p0Par, m_ptRel, m_ratio, m_ratioRel, m_sip2d, m_sip2dsig, m_sip3d, m_sip3dsig, FlavourHistograms< T >::plot(), s_leptons, setTDRStyle(), AlCaHLTBitMon_QueryRunRegistry::string, BaseBTagPlotter::theExtensionString, and willFinalize_.

136 {
137  if(willFinalize_) return;
138 
139  const std::string cName("SoftLeptonPlots" + theExtensionString);
140  setTDRStyle()->cd();
141  TCanvas canvas(cName.c_str(), cName.c_str(), 600, 900);
142  canvas.UseCurrentStyle();
143  canvas.Divide(2,3);
144  canvas.Print((name + cName + ".ps[").c_str());
145  for (int i = 0; i < s_leptons; i++) {
146  canvas.cd(1)->Clear();
147  m_leptonId[i]->plot();
148  canvas.cd(2)->Clear();
149  m_leptonPt[i]->plot();
150  canvas.cd(3)->Clear();
151  m_sip2d[i]->plot();
152  canvas.cd(4)->Clear();
153  m_sip3d[i]->plot();
154  canvas.cd(5)->Clear();
155  m_sip2dsig[i]->plot();
156  canvas.cd(6)->Clear();
157  m_sip3dsig[i]->plot();
158  canvas.Print((name + cName + ".ps").c_str());
159 
160  canvas.cd(1)->Clear();
161  m_etaRel[i]->plot();
162  canvas.cd(2)->Clear();
163  m_deltaR[i]->plot();
164  canvas.cd(3)->Clear();
165  m_ratio[i]->plot();
166  canvas.cd(4)->Clear();
167  m_ratioRel[i]->plot();
168  canvas.cd(5)->Clear();
169  m_ptRel[i]->plot();
170  canvas.cd(6)->Clear();
171  m_p0Par[i]->plot();
172  canvas.Print((name + cName + ".ps").c_str());
173  }
174  canvas.Print((name + cName + ".ps]").c_str());
175 }
int i
Definition: DBlmapReader.cc:9
void plot(TPad *theCanvas=0)
FlavourHistograms< double > * m_leptonPt[s_leptons]
FlavourHistograms< double > * m_sip3d[s_leptons]
FlavourHistograms< double > * m_ratio[s_leptons]
const std::string theExtensionString
FlavourHistograms< double > * m_leptonId[s_leptons]
FlavourHistograms< double > * m_ratioRel[s_leptons]
def canvas
Definition: svgfig.py:481
FlavourHistograms< double > * m_sip2dsig[s_leptons]
FlavourHistograms< double > * m_ptRel[s_leptons]
FlavourHistograms< double > * m_p0Par[s_leptons]
FlavourHistograms< double > * m_etaRel[s_leptons]
FlavourHistograms< double > * m_sip2d[s_leptons]
static const int s_leptons
void setTDRStyle()
Definition: plotscripts.py:87
FlavourHistograms< double > * m_sip3dsig[s_leptons]
FlavourHistograms< double > * m_deltaR[s_leptons]

Member Data Documentation

FlavourHistograms<double>* SoftLeptonTagPlotter::m_deltaR[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_etaRel[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_leptonId[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_leptonPt[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_p0Par[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_ptRel[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_ratio[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_ratioRel[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_sip2d[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_sip2dsig[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_sip3d[s_leptons]
private
FlavourHistograms<double>* SoftLeptonTagPlotter::m_sip3dsig[s_leptons]
private
unsigned int SoftLeptonTagPlotter::mcPlots_
private

Definition at line 29 of file SoftLeptonTagPlotter.h.

Referenced by SoftLeptonTagPlotter().

const int SoftLeptonTagPlotter::s_leptons = 2
staticprivate
bool SoftLeptonTagPlotter::willFinalize_
private