CMS 3D CMS Logo

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

#include <BTagDifferentialPlot.h>

Public Types

enum  ConstVarType { constPT, constETA }
 

Public Member Functions

void addBinPlotter (JetTagPlotter *aPlotter)
 
 BTagDifferentialPlot (const double &bEff, const ConstVarType &constVariable, const std::string &tagName, const unsigned int &mc)
 
void epsPlot (const std::string &name)
 
TH1F * getDifferentialHistoB_b ()
 
TH1F * getDifferentialHistoB_c ()
 
TH1F * getDifferentialHistoB_d ()
 
TH1F * getDifferentialHistoB_dus ()
 
TH1F * getDifferentialHistoB_dusg ()
 
TH1F * getDifferentialHistoB_g ()
 
TH1F * getDifferentialHistoB_ni ()
 
TH1F * getDifferentialHistoB_pu ()
 
TH1F * getDifferentialHistoB_s ()
 
TH1F * getDifferentialHistoB_u ()
 
void plot (TCanvas &theCanvas)
 
void plot (const std::string &name, const std::string &ext)
 
void process (DQMStore::IBooker &ibook)
 
void psPlot (const std::string &name)
 
 ~BTagDifferentialPlot ()
 

Private Member Functions

void bookHisto (DQMStore::IBooker &ibook)
 
void fillHisto ()
 
std::pair< double, double > getMistag (const double &fixedBEfficiency, TH1F *effPurHist)
 
void setVariableName ()
 

Private Attributes

std::string commonName
 
ConstVarType constVar
 
std::string constVariableName
 
std::pair< double, double > constVariableValue
 
std::string diffVariableName
 
double fixedBEfficiency
 
unsigned int mcPlots_
 
bool noProcessing
 
bool processed
 
std::vector< JetTagPlotter * > theBinPlotters
 
MonitorElementtheDifferentialHistoB_b
 
MonitorElementtheDifferentialHistoB_c
 
MonitorElementtheDifferentialHistoB_d
 
MonitorElementtheDifferentialHistoB_dus
 
MonitorElementtheDifferentialHistoB_dusg
 
MonitorElementtheDifferentialHistoB_g
 
MonitorElementtheDifferentialHistoB_ni
 
MonitorElementtheDifferentialHistoB_pu
 
MonitorElementtheDifferentialHistoB_s
 
MonitorElementtheDifferentialHistoB_u
 

Detailed Description

Definition at line 16 of file BTagDifferentialPlot.h.

Member Enumeration Documentation

Enumerator
constPT 
constETA 

Definition at line 20 of file BTagDifferentialPlot.h.

Constructor & Destructor Documentation

BTagDifferentialPlot::BTagDifferentialPlot ( const double &  bEff,
const ConstVarType constVariable,
const std::string &  tagName,
const unsigned int &  mc 
)

Definition at line 20 of file BTagDifferentialPlot.cc.

21  :
22  fixedBEfficiency ( bEff ) ,
23  noProcessing ( false ) , processed(false), constVar(constVariable),
24  constVariableName ( "" ) , diffVariableName ( "" ) ,
25  constVariableValue ( 999.9 , 999.9 ) , commonName( "MisidForBEff_" + tagName+"_"),
36  mcPlots_ (mc)
37 {}
MonitorElement * theDifferentialHistoB_b
MonitorElement * theDifferentialHistoB_g
MonitorElement * theDifferentialHistoB_s
MonitorElement * theDifferentialHistoB_pu
MonitorElement * theDifferentialHistoB_dusg
MonitorElement * theDifferentialHistoB_dus
std::pair< double, double > constVariableValue
MonitorElement * theDifferentialHistoB_u
MonitorElement * theDifferentialHistoB_d
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni
BTagDifferentialPlot::~BTagDifferentialPlot ( )

Definition at line 40 of file BTagDifferentialPlot.cc.

40  {
41 }

Member Function Documentation

void BTagDifferentialPlot::addBinPlotter ( JetTagPlotter aPlotter)
inline

Definition at line 26 of file BTagDifferentialPlot.h.

References theBinPlotters.

26 { theBinPlotters.push_back ( aPlotter ) ; }
std::vector< JetTagPlotter * > theBinPlotters
void BTagDifferentialPlot::bookHisto ( DQMStore::IBooker ibook)
private

Definition at line 203 of file BTagDifferentialPlot.cc.

References HistoProviderDQM::book1D(), commonName, constVariableName, constVariableValue, diffVariableName, fixedBEfficiency, EtaPtBin::getEtaActive(), EtaPtBin::getEtaMax(), EtaPtBin::getEtaMin(), EtaPtBin::getPtActive(), EtaPtBin::getPtMax(), EtaPtBin::getPtMin(), diffTwoXMLs::label, mcPlots_, python.multivaluedict::remove(), python.rootplot.root2matplotlib::replace(), AlCaHLTBitMon_QueryRunRegistry::string, theBinPlotters, theDifferentialHistoB_b, theDifferentialHistoB_c, theDifferentialHistoB_d, theDifferentialHistoB_dus, theDifferentialHistoB_dusg, theDifferentialHistoB_g, theDifferentialHistoB_ni, theDifferentialHistoB_pu, theDifferentialHistoB_s, and theDifferentialHistoB_u.

Referenced by process().

203  {
204 
205  // vector with ranges
206  vector<float> variableRanges ;
207 
208  for ( vector<JetTagPlotter *>::const_iterator iP = theBinPlotters.begin() ;
209  iP != theBinPlotters.end() ; ++iP ) {
210  const EtaPtBin & currentBin = (*iP)->etaPtBin() ;
211  if ( diffVariableName == "eta" ) {
212  // only active bins in the variable on x-axis
213  if ( currentBin.getEtaActive() ) {
214  variableRanges.push_back ( currentBin.getEtaMin() ) ;
215  // also max if last one
216  if ( iP == --theBinPlotters.end() ) variableRanges.push_back ( currentBin.getEtaMax() ) ;
217  }
218  }
219  if ( diffVariableName == "pt" ) {
220  // only active bins in the variable on x-axis
221  if ( currentBin.getPtActive() ) {
222  variableRanges.push_back ( currentBin.getPtMin() ) ;
223  // also max if last one
224  if ( iP == --theBinPlotters.end() ) variableRanges.push_back ( currentBin.getPtMax() ) ;
225  }
226  }
227  }
228 
229  // to book histo with variable binning -> put into array
230  int nBins = variableRanges.size() - 1 ;
231  float * binArray = &variableRanges[0];
232 
233  // part of the name common to all flavours
234  std::stringstream stream("");
235  stream << fixedBEfficiency << "_Const_" << constVariableName << "_" << constVariableValue.first << "-" ;
236  stream << constVariableValue.second << "_" << "_Vs_" << diffVariableName ;
237  commonName += stream.str();
238  std::remove(commonName.begin(), commonName.end(), ' ') ;
239  std::replace(commonName.begin(), commonName.end(), '.' , 'v' ) ;
240 
242  HistoProviderDQM prov ("Btag",label,ibook);
243 
244  theDifferentialHistoB_b = (prov.book1D ( "B_" + commonName , "B_" + commonName , nBins , binArray )) ;
245  theDifferentialHistoB_c = (prov.book1D ( "C_" + commonName , "C_" + commonName , nBins , binArray )) ;
246  theDifferentialHistoB_dusg = (prov.book1D ( "DUSG_" + commonName , "DUSG_" + commonName , nBins , binArray )) ;
247  theDifferentialHistoB_ni = (prov.book1D ( "NI_" + commonName , "NI_" + commonName , nBins , binArray )) ;
248  theDifferentialHistoB_pu = (prov.book1D ( "PU_" + commonName , "PU_" + commonName , nBins , binArray )) ;
249 
250  if(mcPlots_>2){
251  theDifferentialHistoB_d = (prov.book1D ( "D_" + commonName , "D_" + commonName , nBins , binArray )) ;
252  theDifferentialHistoB_u = (prov.book1D ( "U_" + commonName , "U_" + commonName , nBins , binArray )) ;
253  theDifferentialHistoB_s = (prov.book1D ( "S_" + commonName , "S_" + commonName , nBins , binArray )) ;
254  theDifferentialHistoB_g = (prov.book1D ( "G_" + commonName , "G_" + commonName , nBins , binArray )) ;
255  theDifferentialHistoB_dus = (prov.book1D ( "DUS_" + commonName , "DUS_" + commonName , nBins , binArray )) ;
256  }
257 }
MonitorElement * theDifferentialHistoB_b
MonitorElement * theDifferentialHistoB_g
MonitorElement * theDifferentialHistoB_s
MonitorElement * theDifferentialHistoB_pu
MonitorElement * theDifferentialHistoB_dusg
double getEtaMax() const
Definition: EtaPtBin.h:37
double getEtaMin() const
Definition: EtaPtBin.h:36
double getPtMin() const
Definition: EtaPtBin.h:40
bool getEtaActive() const
Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
Definition: EtaPtBin.h:35
MonitorElement * theDifferentialHistoB_dus
bool getPtActive() const
Definition: EtaPtBin.h:39
std::pair< double, double > constVariableValue
double getPtMax() const
Definition: EtaPtBin.h:41
std::vector< JetTagPlotter * > theBinPlotters
MonitorElement * theDifferentialHistoB_u
MonitorElement * theDifferentialHistoB_d
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni
void BTagDifferentialPlot::epsPlot ( const std::string &  name)

Definition at line 159 of file BTagDifferentialPlot.cc.

References plot().

160 {
161  plot(name, ".eps");
162 }
void plot(TCanvas &theCanvas)
void BTagDifferentialPlot::fillHisto ( )
private

Definition at line 260 of file BTagDifferentialPlot.cc.

References diffVariableName, Exception, fixedBEfficiency, EffPurFromHistos::getEffFlavVsBEff_b(), EffPurFromHistos::getEffFlavVsBEff_c(), EffPurFromHistos::getEffFlavVsBEff_d(), EffPurFromHistos::getEffFlavVsBEff_dus(), EffPurFromHistos::getEffFlavVsBEff_dusg(), EffPurFromHistos::getEffFlavVsBEff_g(), EffPurFromHistos::getEffFlavVsBEff_ni(), EffPurFromHistos::getEffFlavVsBEff_pu(), EffPurFromHistos::getEffFlavVsBEff_s(), EffPurFromHistos::getEffFlavVsBEff_u(), EtaPtBin::getEtaActive(), EtaPtBin::getEtaMax(), EtaPtBin::getEtaMin(), getMistag(), EtaPtBin::getPtActive(), EtaPtBin::getPtMax(), EtaPtBin::getPtMin(), MonitorElement::getTH1F(), mcPlots_, theBinPlotters, theDifferentialHistoB_b, theDifferentialHistoB_c, theDifferentialHistoB_d, theDifferentialHistoB_dus, theDifferentialHistoB_dusg, theDifferentialHistoB_g, theDifferentialHistoB_ni, theDifferentialHistoB_pu, theDifferentialHistoB_s, theDifferentialHistoB_u, and funct::true.

Referenced by process().

260  {
261  // loop over bins and find corresponding misid. in the MisIdVs..... histo
262  for ( vector<JetTagPlotter *>::const_iterator iP = theBinPlotters.begin() ;
263  iP != theBinPlotters.end() ; ++iP ) {
264  const EtaPtBin & currentBin = (*iP)->etaPtBin() ;
265  EffPurFromHistos * currentEffPurFromHistos = (*iP)->getEffPurFromHistos() ;
266  //
267  bool isActive = true ;
268  double valueXAxis = -999.99 ;
269  // find right bin based on middle of the interval
270  if ( diffVariableName == "eta" ) {
271  isActive = currentBin.getEtaActive() ;
272  valueXAxis = 0.5 * ( currentBin.getEtaMin() + currentBin.getEtaMax() ) ;
273  } else if ( diffVariableName == "pt" ) {
274  isActive = currentBin.getPtActive() ;
275  valueXAxis = 0.5 * ( currentBin.getPtMin() + currentBin.getPtMax() ) ;
276  } else {
277  throw cms::Exception("Configuration")
278  << "====>>>> BTagDifferentialPlot::fillHisto() : illegal diffVariableName = " << diffVariableName << endl;
279  }
280 
281  // for the moment: ignore inactive bins
282  // (maybe later: if a Bin is inactive -> set value to fill well below left edge of histogram to have it in the underflow)
283 
284  if ( !isActive ) continue ;
285 
286  // to have less lines of code ....
287  vector< pair<TH1F*,TH1F*> > effPurDifferentialPairs ;
288 
289  // all flavours (b is a good cross check! must be constant and = fixed b-efficiency)
290  // get histo; find the bin of the fixed b-efficiency in the histo and get misid; fill
291 
292 
293  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_b() , theDifferentialHistoB_b ->getTH1F() ) ) ;
294  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_c() , theDifferentialHistoB_c ->getTH1F() ) ) ;
295  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_dusg() , theDifferentialHistoB_dusg->getTH1F() ) ) ;
296  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_ni() , theDifferentialHistoB_ni ->getTH1F() ) ) ;
297  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_pu() , theDifferentialHistoB_pu->getTH1F() ) ) ;
298  if(mcPlots_>2){
299  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_d() , theDifferentialHistoB_d ->getTH1F() ) ) ;
300  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_u() , theDifferentialHistoB_u ->getTH1F() ) ) ;
301  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_s() , theDifferentialHistoB_s ->getTH1F() ) ) ;
302  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_g() , theDifferentialHistoB_g ->getTH1F() ) ) ;
303  effPurDifferentialPairs.push_back ( make_pair ( currentEffPurFromHistos->getEffFlavVsBEff_dus() , theDifferentialHistoB_dus->getTH1F() ) ) ;
304  }
305 
306  for ( vector< pair<TH1F*,TH1F*> >::const_iterator itP = effPurDifferentialPairs.begin() ;
307  itP != effPurDifferentialPairs.end() ; ++itP ) {
308  TH1F * effPurHist = itP->first ;
309  TH1F * diffHist = itP->second ;
310  pair<double, double> mistag = getMistag(fixedBEfficiency, effPurHist);
311  int iBinSet = diffHist->FindBin(valueXAxis) ;
312  diffHist->SetBinContent(iBinSet, mistag.first);
313  diffHist->SetBinError(iBinSet, mistag.second);
314  }
315  }
316 
317 }
MonitorElement * theDifferentialHistoB_b
MonitorElement * theDifferentialHistoB_g
TH1F * getEffFlavVsBEff_g()
MonitorElement * theDifferentialHistoB_s
TH1F * getEffFlavVsBEff_dusg()
TH1F * getEffFlavVsBEff_c()
MonitorElement * theDifferentialHistoB_pu
MonitorElement * theDifferentialHistoB_dusg
double getEtaMax() const
Definition: EtaPtBin.h:37
double getEtaMin() const
Definition: EtaPtBin.h:36
double getPtMin() const
Definition: EtaPtBin.h:40
bool getEtaActive() const
Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
Definition: EtaPtBin.h:35
MonitorElement * theDifferentialHistoB_dus
bool getPtActive() const
Definition: EtaPtBin.h:39
TH1F * getEffFlavVsBEff_u()
std::pair< double, double > getMistag(const double &fixedBEfficiency, TH1F *effPurHist)
double getPtMax() const
Definition: EtaPtBin.h:41
std::vector< JetTagPlotter * > theBinPlotters
TH1F * getEffFlavVsBEff_dus()
TH1F * getEffFlavVsBEff_d()
MonitorElement * theDifferentialHistoB_u
TH1F * getTH1F(void) const
TH1F * getEffFlavVsBEff_ni()
MonitorElement * theDifferentialHistoB_d
TH1F * getEffFlavVsBEff_pu()
TH1F * getEffFlavVsBEff_b()
TH1F * getEffFlavVsBEff_s()
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni
TH1F* BTagDifferentialPlot::getDifferentialHistoB_b ( )
inline

Definition at line 45 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_b.

45 { return theDifferentialHistoB_b ->getTH1F() ; }
MonitorElement * theDifferentialHistoB_b
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_c ( )
inline

Definition at line 44 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_c.

44 { return theDifferentialHistoB_c ->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theDifferentialHistoB_c
TH1F* BTagDifferentialPlot::getDifferentialHistoB_d ( )
inline

Definition at line 41 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_d.

41 { return theDifferentialHistoB_d ->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theDifferentialHistoB_d
TH1F* BTagDifferentialPlot::getDifferentialHistoB_dus ( )
inline

Definition at line 48 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_dus.

48 { return theDifferentialHistoB_dus->getTH1F() ; }
MonitorElement * theDifferentialHistoB_dus
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_dusg ( )
inline

Definition at line 49 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_dusg.

49 { return theDifferentialHistoB_dusg->getTH1F() ; }
MonitorElement * theDifferentialHistoB_dusg
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_g ( )
inline

Definition at line 46 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_g.

46 { return theDifferentialHistoB_g ->getTH1F() ; }
MonitorElement * theDifferentialHistoB_g
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_ni ( )
inline

Definition at line 47 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_ni.

47 { return theDifferentialHistoB_ni->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theDifferentialHistoB_ni
TH1F* BTagDifferentialPlot::getDifferentialHistoB_pu ( )
inline

Definition at line 50 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_pu.

50 { return theDifferentialHistoB_pu->getTH1F() ; }
MonitorElement * theDifferentialHistoB_pu
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_s ( )
inline

Definition at line 43 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_s.

43 { return theDifferentialHistoB_s ->getTH1F() ; }
MonitorElement * theDifferentialHistoB_s
TH1F * getTH1F(void) const
TH1F* BTagDifferentialPlot::getDifferentialHistoB_u ( )
inline

Definition at line 42 of file BTagDifferentialPlot.h.

References MonitorElement::getTH1F(), and theDifferentialHistoB_u.

42 { return theDifferentialHistoB_u ->getTH1F() ; }
MonitorElement * theDifferentialHistoB_u
TH1F * getTH1F(void) const
pair< double, double > BTagDifferentialPlot::getMistag ( const double &  fixedBEfficiency,
TH1F *  effPurHist 
)
private

Definition at line 320 of file BTagDifferentialPlot.cc.

References i.

Referenced by fillHisto().

321 {
322  int iBinGet = effPurHist->FindBin ( fixedBEfficiency ) ;
323  double effForBEff = effPurHist->GetBinContent ( iBinGet ) ;
324  double effForBEffErr = effPurHist->GetBinError ( iBinGet ) ;
325 
326  if (effForBEff==0. && effForBEffErr==0.) {
327  // The bin was empty. Could be that it was not filled, as the scan-plot
328  // did not have an entry at the requested value, or that the curve
329  // is above or below.
330  // Fit a plynomial, and evaluate the mistag at the requested value.
331  int fitStatus;
332  //need our own copy for thread safety
333  TF1 myfunc("myfunc","pol4");
334  try {
335  fitStatus = effPurHist->Fit(&myfunc, "q");
336  }catch (cms::Exception& iException){
337  return pair<double, double>(effForBEff, effForBEffErr);
338  }
339  if (fitStatus != 0) {
340  edm::LogWarning("BTagDifferentialPlot")<<"Fit failed to hisogram " << effPurHist->GetTitle() << " , perhaps because too few entries = " << effPurHist->GetEntries() <<". This bin will be missing in plots at fixed b efficiency.";
341  // } else {
342  // edm::LogInfo("BTagDifferentialPlot")<<"Fit OK to hisogram " << effPurHist->GetTitle() << " entries = " << effPurHist->GetEntries();
343  return pair<double, double>(effForBEff, effForBEffErr);
344  }
345  effForBEff = myfunc.Eval(fixedBEfficiency);
346  effPurHist->RecursiveRemove(&myfunc);
347  //Error: first non-empty bin on the right and take its error
348  for (int i = iBinGet+1; i< effPurHist->GetNbinsX(); ++i) {
349  if (effPurHist->GetBinContent(i)!=0) {
350  effForBEffErr = effPurHist->GetBinError(i);
351  break;
352  }
353  }
354  }
355 
356  return pair<double, double>(effForBEff, effForBEffErr);
357 }
int i
Definition: DBlmapReader.cc:9
void BTagDifferentialPlot::plot ( TCanvas &  theCanvas)

Definition at line 48 of file BTagDifferentialPlot.cc.

References alignCSCRings::e, MonitorElement::getTH1F(), mcPlots_, processed, theDifferentialHistoB_c, theDifferentialHistoB_dus, theDifferentialHistoB_g, and theDifferentialHistoB_ni.

Referenced by cuy.FindIssue::__init__(), epsPlot(), plot(), and psPlot().

48  {
49 
50 // thePlotCanvas = new TCanvas( commonName ,
51 // commonName ,
52 // btppXCanvas , btppYCanvas ) ;
53 //
54 // if ( !btppTitle ) gStyle->SetOptTitle ( 0 ) ;
55 
56  if (!processed) return;
57 //fixme:
58  bool btppNI = false;
59  bool btppColour = true;
60 
61  thePlotCanvas.SetFillColor ( 0 ) ;
62  thePlotCanvas.cd ( 1 ) ;
63  gPad->SetLogy ( 1 ) ;
64  gPad->SetGridx ( 1 ) ;
65  gPad->SetGridy ( 1 ) ;
66 
67 // int col_b ;
68  int col_c ;
69  int col_g ;
70  int col_dus ;
71  int col_ni ;
72 
73 // int mStyle_b ;
74  int mStyle_c ;
75  int mStyle_g ;
76  int mStyle_dus ;
77  int mStyle_ni ;
78 
79  // marker size (same for all)
80  float mSize = 1.5 ;
81 
82  if ( btppColour ) {
83 // col_b = 2 ;
84  col_c = 6 ;
85  col_g = 3 ;
86  col_dus = 4 ;
87  col_ni = 5 ;
88 // mStyle_b = 20 ;
89  mStyle_c = 20 ;
90  mStyle_g = 20 ;
91  mStyle_dus = 20 ;
92  mStyle_ni = 20 ;
93  }
94  else {
95 // col_b = 1 ;
96  col_c = 1 ;
97  col_g = 1 ;
98  col_dus = 1 ;
99  col_ni = 1 ;
100 // mStyle_b = 12 ;
101  mStyle_c = 22 ;
102  mStyle_g = 29 ;
103  mStyle_dus = 20 ;
104  mStyle_ni = 27 ;
105  }
106 
107  // for the moment: plot b (to see what the constant b-efficiency is), c, g, uds
108  // b in red
109  // No, do not plot b (because only visible for the soft leptons)
110  // theDifferentialHistoB_b -> GetXaxis()->SetTitle ( diffVariableName ) ;
111  // theDifferentialHistoB_b -> GetYaxis()->SetTitle ( "non b-jet efficiency" ) ;
112  // theDifferentialHistoB_b -> GetYaxis()->SetTitleOffset ( 1.25 ) ;
113  // theDifferentialHistoB_b -> SetMaximum ( 0.4 ) ;
114  // theDifferentialHistoB_b -> SetMinimum ( 1.e-4 ) ;
115  // theDifferentialHistoB_b -> SetMarkerColor ( col_b ) ;
116  // theDifferentialHistoB_b -> SetLineColor ( col_b ) ;
117  // theDifferentialHistoB_b -> SetMarkerSize ( mSize ) ;
118  // theDifferentialHistoB_b -> SetMarkerStyle ( mStyle_b ) ;
119  // theDifferentialHistoB_b -> SetStats ( false ) ;
120  // theDifferentialHistoB_b -> Draw ( "pe" ) ;
121  // c in magenta
122  theDifferentialHistoB_c ->getTH1F() -> SetMaximum ( 0.4 ) ;
123  theDifferentialHistoB_c ->getTH1F() -> SetMinimum ( 1.e-4 ) ;
124  theDifferentialHistoB_c ->getTH1F() -> SetMarkerColor ( col_c ) ;
125  theDifferentialHistoB_c ->getTH1F() -> SetLineColor ( col_c ) ;
126  theDifferentialHistoB_c ->getTH1F() -> SetMarkerSize ( mSize ) ;
127  theDifferentialHistoB_c ->getTH1F() -> SetMarkerStyle ( mStyle_c ) ;
128  theDifferentialHistoB_c ->getTH1F() -> SetStats ( false ) ;
129  // theDifferentialHistoB_c -> Draw("peSame") ;
130  theDifferentialHistoB_c ->getTH1F()-> Draw("pe") ;
131  if(mcPlots_>2){
132  // uds in blue
133  theDifferentialHistoB_dus ->getTH1F()-> SetMarkerColor ( col_dus ) ;
134  theDifferentialHistoB_dus ->getTH1F()-> SetLineColor ( col_dus ) ;
135  theDifferentialHistoB_dus ->getTH1F()-> SetMarkerSize ( mSize ) ;
136  theDifferentialHistoB_dus ->getTH1F()-> SetMarkerStyle ( mStyle_dus ) ;
137  theDifferentialHistoB_dus ->getTH1F()-> SetStats ( false ) ;
138  theDifferentialHistoB_dus ->getTH1F()-> Draw("peSame") ;
139  // g in green
140  // only uds not to confuse
141  theDifferentialHistoB_g ->getTH1F()-> SetMarkerColor ( col_g ) ;
142  theDifferentialHistoB_g ->getTH1F()-> SetLineColor ( col_g ) ;
143  theDifferentialHistoB_g ->getTH1F()-> SetMarkerSize ( mSize ) ;
144  theDifferentialHistoB_g ->getTH1F()-> SetMarkerStyle ( mStyle_g ) ;
145  theDifferentialHistoB_g ->getTH1F()-> SetStats ( false ) ;
146  theDifferentialHistoB_g ->getTH1F()-> Draw("peSame") ;
147  }
148  // NI if wanted
149  if ( btppNI ) {
150  theDifferentialHistoB_ni ->getTH1F()-> SetMarkerColor ( col_ni ) ;
151  theDifferentialHistoB_ni ->getTH1F()-> SetLineColor ( col_ni ) ;
152  theDifferentialHistoB_ni ->getTH1F()-> SetMarkerSize ( mSize ) ;
153  theDifferentialHistoB_ni ->getTH1F()-> SetMarkerStyle ( mStyle_ni ) ;
154  theDifferentialHistoB_ni ->getTH1F()-> SetStats ( false ) ;
155  theDifferentialHistoB_ni ->getTH1F()-> Draw("peSame") ;
156  }
157 }
MonitorElement * theDifferentialHistoB_g
MonitorElement * theDifferentialHistoB_dus
TH1F * getTH1F(void) const
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni
void BTagDifferentialPlot::plot ( const std::string &  name,
const std::string &  ext 
)

Definition at line 169 of file BTagDifferentialPlot.cc.

References commonName, plot(), and processed.

Referenced by cuy.FindIssue::__init__().

170 {
171  if (!processed) return;
172  TCanvas tc(commonName.c_str(), commonName.c_str());
173  plot(tc);
174  tc.Print((name + commonName + ext).c_str());
175 }
void plot(TCanvas &theCanvas)
void BTagDifferentialPlot::process ( DQMStore::IBooker ibook)

Definition at line 178 of file BTagDifferentialPlot.cc.

References bookHisto(), fillHisto(), noProcessing, processed, mathSSE::return(), and setVariableName().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

178  {
179  setVariableName () ; // also sets noProcessing if not OK
180  if ( noProcessing ) return ;
181  bookHisto (ibook) ;
182  fillHisto () ;
183  processed = true;
184 }
return((rh^lh)&mask)
void bookHisto(DQMStore::IBooker &ibook)
void BTagDifferentialPlot::psPlot ( const std::string &  name)

Definition at line 164 of file BTagDifferentialPlot.cc.

References plot().

165 {
166  plot(name, ".ps");
167 }
void plot(TCanvas &theCanvas)
void BTagDifferentialPlot::setVariableName ( )
private

Definition at line 187 of file BTagDifferentialPlot.cc.

References constETA, constPT, constVar, constVariableName, constVariableValue, diffVariableName, and theBinPlotters.

Referenced by process().

188 {
189  if ( constVar==constETA ) {
190  constVariableName = "eta" ;
191  diffVariableName = "pt" ;
192  constVariableValue = make_pair ( theBinPlotters[0]->etaPtBin().getEtaMin() , theBinPlotters[0]->etaPtBin().getEtaMax() ) ;
193  }
194  if ( constVar==constPT ) {
195  constVariableName = "pt" ;
196  diffVariableName = "eta" ;
197  constVariableValue = make_pair ( theBinPlotters[0]->etaPtBin().getPtMin() , theBinPlotters[0]->etaPtBin().getPtMax() ) ;
198  }
199 }
std::pair< double, double > constVariableValue
std::vector< JetTagPlotter * > theBinPlotters

Member Data Documentation

std::string BTagDifferentialPlot::commonName
private

Definition at line 80 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), and plot().

ConstVarType BTagDifferentialPlot::constVar
private

Definition at line 70 of file BTagDifferentialPlot.h.

Referenced by setVariableName().

std::string BTagDifferentialPlot::constVariableName
private

Definition at line 72 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), and setVariableName().

std::pair<double,double> BTagDifferentialPlot::constVariableValue
private

Definition at line 77 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), and setVariableName().

std::string BTagDifferentialPlot::diffVariableName
private

Definition at line 74 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and setVariableName().

double BTagDifferentialPlot::fixedBEfficiency
private

Definition at line 64 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), and fillHisto().

unsigned int BTagDifferentialPlot::mcPlots_
private

Definition at line 98 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and plot().

bool BTagDifferentialPlot::noProcessing
private

Definition at line 67 of file BTagDifferentialPlot.h.

Referenced by process().

bool BTagDifferentialPlot::processed
private

Definition at line 68 of file BTagDifferentialPlot.h.

Referenced by plot(), and process().

std::vector<JetTagPlotter *> BTagDifferentialPlot::theBinPlotters
private

Definition at line 83 of file BTagDifferentialPlot.h.

Referenced by addBinPlotter(), bookHisto(), fillHisto(), and setVariableName().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_b
private

Definition at line 90 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_b().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_c
private

Definition at line 89 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), getDifferentialHistoB_c(), and plot().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_d
private

Definition at line 86 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_d().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_dus
private

Definition at line 93 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), getDifferentialHistoB_dus(), and plot().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_dusg
private

Definition at line 94 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_dusg().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_g
private

Definition at line 91 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), getDifferentialHistoB_g(), and plot().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_ni
private

Definition at line 92 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), getDifferentialHistoB_ni(), and plot().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_pu
private

Definition at line 95 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_pu().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_s
private

Definition at line 88 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_s().

MonitorElement* BTagDifferentialPlot::theDifferentialHistoB_u
private

Definition at line 87 of file BTagDifferentialPlot.h.

Referenced by bookHisto(), fillHisto(), and getDifferentialHistoB_u().