CMS 3D CMS Logo

Functions
RecoBTag Namespace Reference

Functions

int checkCreateDirectory (const std::string &)
 
int findBinClosestYValue (const TH1F *, const float &yVal, const float &yLow, const float &yHigh)
 
std::vector< int > findBinClosestYValueAtFixedZ (const TH2F *, const float &yVal, const float &yLow, const float &yHigh, const TH2F *, const std::vector< double > &zVal)
 
void fixOverlay ()
 
std::string flavour (const int &flav)
 
bool flavourIsB (const int &flav)
 
bool flavourIsC (const int &flav)
 
bool flavourIsD (const int &flav)
 
bool flavourIsDUS (const int &flav)
 
bool flavourIsDUSG (const int &flav)
 
bool flavourIsG (const int &flav)
 
bool flavourIsNI (const int &flav)
 
bool flavourIsS (const int &flav)
 
bool flavourIsU (const int &flav)
 
TObjArray getHistArray (TFile *histoFile, const std::string &baseName)
 
double HistoBinWidth (const TH1F *theHisto, const int &iBin)
 
void HistoToNormalizedArrays (const TH1F *theHisto, TArrayF &theNormalizedArray, TArrayF &theLeftOfBinArray, TArrayF &theBinWidthArray)
 
double IntegrateArray (const TArrayF &theArray, const TArrayF &theBinWidth)
 
double IntegrateHistogram (const TH1F *theHisto)
 
std::string itos (const int &i)
 
void PrintCanvasHistos (TCanvas *canvas, const std::string &psFile, const std::string &epsFile, const std::string &gifFile)
 
void PrintHistos (const std::string &psFile, const std::string &epsFile, const std::string &gifFile)
 
TStyle * setTDRStyle ()
 
void tdrGrid (const bool &gridOn)
 

Function Documentation

int RecoBTag::checkCreateDirectory ( const std::string &  directory)

Definition at line 205 of file Tools.cc.

References gather_cfg::cout, and beamerCreator::create().

205  {
206  cout << "====>>>> ToolsC:checkCreateDirectory() : " << endl ;
207  int exists = gSystem->Exec ( ("ls -d " + directory).c_str() ) ;
208  // create it if it doesn't exist
209  if ( exists != 0 ) {
210  cout << "====>>>> ToolsC:checkCreateDirectory() : The directory does not exist : " << directory << endl ;
211  cout << "====>>>> ToolsC:checkCreateDirectory() : I'll try to create it" << endl ;
212  const int& create = gSystem->Exec ( ("mkdir " + directory).c_str() ) ;
213  if ( create != 0 ) {
214  cout << "====>>>> ToolsC:checkCreateDirectory() : Creation of directory failed : " << directory << endl
215  << "====>>>> ToolsC:checkCreateDirectory() : Please check your write permissions!" << endl ;
216  }
217  else {
218  cout << "====>>>> ToolsC:checkCreateDirectory() : Creation of directory successful!" << endl ;
219  // check again if it exists now
220  cout << "====>>>> ToolsC:checkCreateDirectory() : " << endl ;
221  exists = gSystem->Exec ( ("ls -d " + directory).c_str() ) ;
222  if ( exists != 0 ) cout << "ToolsC:checkCreateDirectory() : However, it still doesn't exist!?" << endl ;
223  }
224  }
225  cout << endl ;
226  return exists ;
227 }
def create(alignables, pedeDump, additionalData, outputFile, config)
int RecoBTag::findBinClosestYValue ( const TH1F *  histo,
const float &  yVal,
const float &  yLow,
const float &  yHigh 
)

Definition at line 233 of file Tools.cc.

References gather_cfg::cout, cuy::iBinClosest, cuy::iBinClosestInit, cuy::maxInHisto, cuy::minInHisto, cuy::yBin, cuy::yClosest, and cuy::yClosestInit.

Referenced by EffPurFromHistos::compute().

233  {
234  //
235  // Find the bin in a 1-dim. histogram which has its y-value closest to
236  // the given value yVal where the value yVal has to be in the range yLow < yVal < yHigh.
237  // If it is outside this range the corresponding bin number is returned as negative value.
238  // Currently, there is no protection if there are many bins with the same value!
239  // The user has to take care to interpret the output correctly.
240  //
241 
242  // init
243  const int& nBins = histo->GetNbinsX() - 2 ; // -2 because we don't include under/overflow alos in this loop
244  int iBinClosestInit = 0 ;
245  // init start value properly: must avoid that the real one is not filled
246  float yClosestInit ;
247  //
248  const float& maxInHisto = histo->GetMaximum() ;
249  const float& minInHisto = histo->GetMinimum() ;
250  //
251  // if yVal is smaller than max -> take any value well above the maximum
252  if ( yVal <= maxInHisto ) {
253  yClosestInit = maxInHisto + 1 ; }
254  else {
255  // if yVal is greater than max value -> take a value < minimum
256  yClosestInit = minInHisto - 1.0 ;
257  }
258 
260  float yClosest = yClosestInit ;
261 
262  // loop over bins of histogram
263  for ( int iBin = 1 ; iBin <= nBins ; ++iBin ) {
264  const float& yBin = histo->GetBinContent(iBin) ;
265  if ( fabs(yBin-yVal) < fabs(yClosest-yVal) ) {
266  yClosest = yBin ;
267  iBinClosest = iBin ;
268  }
269  }
270 
271  // check if in interval
272  if ( yClosest < yLow || yClosest > yHigh ) {
273  iBinClosest *= -1 ;
274  }
275 
276  // check that not the initialization bin (would mean that init value was the closest)
277  if ( iBinClosest == iBinClosestInit ) {
278  cout << "====>>>> ToolsC=>findBinClosestYValue() : WARNING: returned bin is the initialization bin!!" << endl ;
279  }
280 
281  return iBinClosest ;
282 }
iBinClosestInit
Definition: cuy.py:887
iBinClosest
Definition: cuy.py:890
yClosestInit
Definition: cuy.py:886
minInHisto
Definition: cuy.py:884
yClosest
Definition: cuy.py:891
yBin
Definition: cuy.py:893
maxInHisto
Definition: cuy.py:883
vector< int > RecoBTag::findBinClosestYValueAtFixedZ ( const TH2F *  histoY,
const float &  yVal,
const float &  yLow,
const float &  yHigh,
const TH2F *  histoZ,
const std::vector< double > &  zVal 
)

Definition at line 286 of file Tools.cc.

References mps_fire::i, cuy::iBinClosest, cuy::iBinClosestInit, cuy::maxInHisto, cuy::minInHisto, cuy::yBin, cuy::yClosest, cuy::yClosestInit, and conversionPostprocessing_cfi::zBin.

Referenced by EffPurFromHistos2D::compute().

286  {
287  //
288  // Find the bin in a 2-dim. histogram which has its y-value closest to
289  // the given value yVal where the value yVal has to be in the range yLow < yVal < yHigh.
290  // If it is outside this range the corresponding bin number is returned as negative value.
291  // The bin should also correspond to a value of z=zVal within the same precision as yVal.
292  // Currently, there is no protection if there are many bins with the same value!
293  // The user has to take care to interpret the output correctly.
294  //
295 
296  // init
297  const int& nBinsX = histoY->GetNbinsX() - 2 ; // -2 because we don't include under/overflow alos in this loop
298  const int& nBinsY = histoY->GetNbinsY() - 2 ; // -2 because we don't include under/overflow alos in this loop
299  int iBinClosestInit = 0 ;
300  // init start value properly: must avoid that the real one is not filled
301  vector<float> yClosestInit(zVal.size()) ;
302  //
303  const float& maxInHisto = histoY->GetMaximum() ;
304  const float& minInHisto = histoY->GetMinimum() ;
305  //
306  // if yVal is smaller than max -> take any value well above the maximum
307  for (unsigned int i=0; i<yClosestInit.size(); i++){
308  if ( yVal <= maxInHisto ) {
309  yClosestInit[i] = maxInHisto + 1 ; }
310  else {
311  // if yVal is greater than max value -> take a value < minimum
312  yClosestInit[i] = minInHisto - 1.0 ;
313  }
314  }
315 
316  vector<int> iBinClosest(zVal.size(), iBinClosestInit);
317  vector<float> yClosest(yClosestInit);
318 
319  // loop over bins of histogram
320  for ( int iBinX = 1 ; iBinX <= nBinsX ; ++iBinX ) {
321  for ( int iBinY = 1 ; iBinY <= nBinsY ; ++iBinY ) {
322  const float& yBin = histoY->GetBinContent(iBinX,iBinY);
323  for (unsigned int i = 0; i < zVal.size(); i++){
324  if ( fabs(yBin-yVal) < fabs(yClosest[i]-yVal) ) {
325  const float& zLow = zVal[i] - (yVal - yLow);
326  const float& zHigh = zVal[i] + (yHigh - yVal);
327  const float& zBin = histoZ->GetBinContent(iBinX,iBinY) ;
328  if(zBin < zLow || zBin > zHigh) continue;
329  yClosest[i] = yBin ;
330  iBinClosest[i] = histoY->GetBin(iBinX,iBinY) ;
331  }
332  }
333  }
334  }
335  // check if in interval
336  for (unsigned int i = 0; i < yClosest.size(); i++){
337  if ( yClosest[i] < yLow || yClosest[i] > yHigh )
338  iBinClosest[i] *= -1 ;
339  }
340 
341  return iBinClosest ;
342 }
iBinClosestInit
Definition: cuy.py:887
iBinClosest
Definition: cuy.py:890
yClosestInit
Definition: cuy.py:886
minInHisto
Definition: cuy.py:884
yClosest
Definition: cuy.py:891
yBin
Definition: cuy.py:893
maxInHisto
Definition: cuy.py:883
void RecoBTag::fixOverlay ( )

Definition at line 502 of file Tools.cc.

502  {
503  gPad->RedrawAxis();
504 }
std::string RecoBTag::flavour ( const int &  flav)

Definition at line 168 of file Tools.cc.

168  {
169  switch(flav) {
170  case 1 :
171  return "d";
172  case 2 :
173  return "u";
174  case 3 :
175  return "s";
176  case 4 :
177  return "c";
178  case 5 :
179  return "b";
180  case 21 :
181  return "g";
182  default :
183  return "";
184  }
185 }
bool RecoBTag::flavourIsB ( const int &  flav)

Definition at line 194 of file Tools.cc.

Referenced by flavourIsNI().

194 { return flav == 5 ; }
bool RecoBTag::flavourIsC ( const int &  flav)

Definition at line 193 of file Tools.cc.

Referenced by flavourIsNI().

193 { return flav == 4 ; }
bool RecoBTag::flavourIsD ( const int &  flav)

Definition at line 190 of file Tools.cc.

Referenced by flavourIsDUS(), and flavourIsNI().

190 { return flav == 1 ; }
bool RecoBTag::flavourIsDUS ( const int &  flav)

Definition at line 197 of file Tools.cc.

References flavourIsD(), flavourIsS(), and flavourIsU().

Referenced by flavourIsDUSG().

197 { return ( flavourIsD(flav) || flavourIsU(flav) || flavourIsS(flav) ) ; }
bool flavourIsD(const int &flav)
Definition: Tools.cc:190
bool flavourIsU(const int &flav)
Definition: Tools.cc:191
bool flavourIsS(const int &flav)
Definition: Tools.cc:192
bool RecoBTag::flavourIsDUSG ( const int &  flav)

Definition at line 198 of file Tools.cc.

References flavourIsDUS(), and flavourIsG().

198 { return ( flavourIsDUS(flav) || flavourIsG(flav) ) ; }
bool flavourIsG(const int &flav)
Definition: Tools.cc:195
bool flavourIsDUS(const int &flav)
Definition: Tools.cc:197
bool RecoBTag::flavourIsG ( const int &  flav)

Definition at line 195 of file Tools.cc.

Referenced by flavourIsDUSG(), and flavourIsNI().

195 { return flav == 21 ; }
bool RecoBTag::flavourIsNI ( const int &  flav)

Definition at line 200 of file Tools.cc.

References flavourIsB(), flavourIsC(), flavourIsD(), flavourIsG(), flavourIsS(), and flavourIsU().

200  { return !( flavourIsD(flav) || flavourIsU(flav) || flavourIsS(flav) ||
201  flavourIsC(flav) || flavourIsB(flav) || flavourIsG(flav) ) ; }
bool flavourIsG(const int &flav)
Definition: Tools.cc:195
bool flavourIsD(const int &flav)
Definition: Tools.cc:190
bool flavourIsC(const int &flav)
Definition: Tools.cc:193
bool flavourIsU(const int &flav)
Definition: Tools.cc:191
bool flavourIsB(const int &flav)
Definition: Tools.cc:194
bool flavourIsS(const int &flav)
Definition: Tools.cc:192
bool RecoBTag::flavourIsS ( const int &  flav)

Definition at line 192 of file Tools.cc.

Referenced by flavourIsDUS(), and flavourIsNI().

192 { return flav == 3 ; }
bool RecoBTag::flavourIsU ( const int &  flav)

Definition at line 191 of file Tools.cc.

Referenced by flavourIsDUS(), and flavourIsNI().

191 { return flav == 2 ; }
TObjArray RecoBTag::getHistArray ( TFile *  histoFile,
const std::string &  baseName 
)

Definition at line 147 of file Tools.cc.

References plotFactory::histos, and AlCaHLTBitMon_QueryRunRegistry::string.

147  {
148  //
149  // return the TObjArray built from the basename
150  //
151  //
152  TObjArray histos (3) ; // reserve 3
153  //
154  const std::string nameB ( baseName + "B" ) ;
155  const std::string nameC ( baseName + "C" ) ;
156  const std::string nameDUSG ( baseName + "DUSG" ) ;
157  //
158  histos.Add ( (TH1F*)histoFile->Get( nameB.c_str() ) ) ;
159  histos.Add ( (TH1F*)histoFile->Get( nameC.c_str() ) ) ;
160  histos.Add ( (TH1F*)histoFile->Get( nameDUSG.c_str() ) ) ;
161  //
162  return histos ;
163 }
TFile * histoFile
Definition: hcalCalib.cc:43
double RecoBTag::HistoBinWidth ( const TH1F *  theHisto,
const int &  iBin 
)

Definition at line 19 of file Tools.cc.

Referenced by HistoToNormalizedArrays(), and IntegrateHistogram().

19  {
20  const int& nBins = theHisto->GetSize() ; // includes underflow/overflow
21  // return 0.0 , if invalid bin
22  if ( iBin < 0 || iBin >= nBins ) return 0.0 ;
23  // return first binwidth, if underflow bin
24  if ( iBin == 0 ) return theHisto->GetBinWidth ( 1 ) ;
25  // return last real binwidth, if overflow bin
26  if ( iBin == nBins - 1 ) return theHisto->GetBinWidth ( nBins - 2 ) ;
27  // return binwidth from histo, if within range
28  return theHisto->GetBinWidth ( iBin ) ;
29 }
void RecoBTag::HistoToNormalizedArrays ( const TH1F *  theHisto,
TArrayF &  theNormalizedArray,
TArrayF &  theLeftOfBinArray,
TArrayF &  theBinWidthArray 
)

Definition at line 57 of file Tools.cc.

References gather_cfg::cout, HistoBinWidth(), and IntegrateHistogram().

57  {
58 
59  const int& nBins = theHisto->GetSize() ;
60 
61  // check that all arrays/histo have the same size
62  if ( nBins == theNormalizedArray.GetSize() &&
63  nBins == theLeftOfBinArray .GetSize() &&
64  nBins == theBinWidthArray .GetSize() ) {
65 
66  const double& histoIntegral = IntegrateHistogram ( theHisto ) ;
67 
68  for ( int iBin = 0 ; iBin != nBins ; ++iBin ) {
69  theNormalizedArray[iBin] = (*theHisto)[iBin] / histoIntegral ;
70  theLeftOfBinArray [iBin] = theHisto->GetBinLowEdge(iBin) ;
71  theBinWidthArray [iBin] = HistoBinWidth ( theHisto , iBin ) ;
72  }
73 
74  }
75  else {
76  cout << "============>>>>>>>>>>>>>>>>" << endl
77  << "============>>>>>>>>>>>>>>>>" << endl
78  << "============>>>>>>>>>>>>>>>>" << endl
79  << "============>>>>>>>>>>>>>>>>" << endl
80  << "============>>>>>>>>>>>>>>>> HistoToNormalizedArrays failed: not equal sizes of all arrays!!" << endl
81  << "============>>>>>>>>>>>>>>>>" << endl
82  << "============>>>>>>>>>>>>>>>>" << endl
83  << "============>>>>>>>>>>>>>>>>" << endl
84  << "============>>>>>>>>>>>>>>>>" << endl ;
85  }
86 
87 }
double IntegrateHistogram(const TH1F *theHisto)
Definition: Tools.cc:34
double HistoBinWidth(const TH1F *theHisto, const int &iBin)
Definition: Tools.cc:19
double RecoBTag::IntegrateArray ( const TArrayF &  theArray,
const TArrayF &  theBinWidth 
)

Definition at line 93 of file Tools.cc.

93  {
94 
95  double arrayIntegral = 0.0 ;
96  const int& nBins = theArray.GetSize() ;
97  //
98  for ( int iBin = 0 ; iBin != nBins ; ++iBin ) {
99  arrayIntegral += theArray[iBin] * theBinWidth[iBin] ;
100  }
101  //
102  return arrayIntegral ;
103 }
double RecoBTag::IntegrateHistogram ( const TH1F *  theHisto)

Definition at line 34 of file Tools.cc.

References HistoBinWidth().

Referenced by HistoToNormalizedArrays().

34  {
35  // include underflow and overflow: assign binwidth of first/last bin to them!!
36  // integral = sum ( entry_i * binwidth_i )
37  //
38  double histoIntegral = 0.0 ;
39  const int& nBins = theHisto->GetSize() ;
40  //
41  // loop over bins:
42  // bin 0 : underflow
43  // bin nBins-1 : overflow
44  for ( int iBin = 0 ; iBin != nBins ; ++iBin ) {
45  const double& binWidth = HistoBinWidth ( theHisto , iBin ) ;
46  histoIntegral += (*theHisto)[iBin] * binWidth ;
47  }
48  //
49  return histoIntegral ;
50 }
double HistoBinWidth(const TH1F *theHisto, const int &iBin)
Definition: Tools.cc:19
string RecoBTag::itos ( const int &  i)

Definition at line 507 of file Tools.cc.

References mps_fire::i, and alignCSCRings::s.

508 {
509  ostringstream s;
510  s << i;
511  return s.str();
512 }
void RecoBTag::PrintCanvasHistos ( TCanvas *  canvas,
const std::string &  psFile,
const std::string &  epsFile,
const std::string &  gifFile 
)

Definition at line 109 of file Tools.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

109  {
110  //
111  //
112  // to create gif in 'batch mode' (non-interactive) see
113  // http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk00/0402.html?gifbatch#first_hit
114  //
115  // ROOT 4 can do it!!??
116  //
117  // if string = "" don't print to corresponding file
118  //
119  if ( psFile != "" ) canvas->Print ( psFile.c_str() ) ;
120  if ( epsFile != "" ) canvas->Print ( epsFile.c_str() , "eps" ) ;
121  // if in batch: use a converter tool
122  const std::string& rootVersion ( gROOT->GetVersion() ) ;
123  const bool& rootCanGif = rootVersion.find("4") == 0 || rootVersion.find("5") == 0 ;
124  if ( gifFile != "" ) {
125  if ( !(gROOT->IsBatch()) || rootCanGif ) { // to find out if running in batch mode
126  cout << "--> Print directly gif!" << endl ;
127  canvas->Print ( gifFile.c_str() , "gif" ) ;
128  }
129  else {
130  if ( epsFile != "" ) { // eps file must have been created before
131  cout << "--> Print gif via scripts!" << endl ;
132  const std::string& executeString1 = "pstopnm -ppm -xborder 0 -yborder 0 -portrait " + epsFile ;
133  gSystem->Exec(executeString1.c_str()) ;
134  const std::string& ppmFile = epsFile + "001.ppm" ;
135  const std::string& executeString2 = "ppmtogif " + ppmFile + " > " + gifFile ;
136  gSystem->Exec(executeString2.c_str()) ;
137  const std::string& executeString3 = "rm " + ppmFile ;
138  gSystem->Exec(executeString3.c_str()) ; // delete the intermediate file
139  }
140  }
141  }
142 }
def canvas(sub, attr)
Definition: svgfig.py:482
void RecoBTag::PrintHistos ( const std::string &  psFile,
const std::string &  epsFile,
const std::string &  gifFile 
)
TStyle * RecoBTag::setTDRStyle ( )
Function to setup a TDR-like style

Definition at line 346 of file Tools.cc.

References compare_using_db::dirname, and plotscripts::tdrStyle.

Referenced by BTagPerformanceAnalyzerOnData::bookHistograms(), BTagPerformanceAnalyzerMC::bookHistograms(), BDHadronTrackMonitoringAnalyzer::bookHistograms(), BTagPerformanceHarvester::dqmEndJob(), BDHadronTrackMonitoringHarvester::dqmEndJob(), LRHelpFunctions::LRHelpFunctions(), EffPurFromHistos2D::plot(), EffPurFromHistos::plot(), FlavourHistograms< T >::plot(), FlavourHistograms2D< T, G >::plot(), SoftLeptonTagPlotter::psPlot(), IPTagPlotter< Container, Base >::psPlot(), TrackCountingTagPlotter::psPlot(), TrackProbabilityTagPlotter::psPlot(), JetTagPlotter::psPlot(), and tdrGrid().

346  {
347  TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
348 
349 // For the canvas:
350  tdrStyle->SetCanvasBorderMode(0);
351  tdrStyle->SetCanvasColor(kWhite);
352  tdrStyle->SetCanvasDefH(600); //Height of canvas
353  tdrStyle->SetCanvasDefW(600); //Width of canvas
354  tdrStyle->SetCanvasDefX(0); //POsition on screen
355  tdrStyle->SetCanvasDefY(0);
356 
357 // For the Pad:
358  tdrStyle->SetPadBorderMode(0);
359  // tdrStyle->SetPadBorderSize(Width_t size = 1);
360  tdrStyle->SetPadColor(kWhite);
361  tdrStyle->SetPadGridX(false);
362  tdrStyle->SetPadGridY(false);
363  tdrStyle->SetGridColor(0);
364  tdrStyle->SetGridStyle(3);
365  tdrStyle->SetGridWidth(1);
366 
367 // For the frame:
368  tdrStyle->SetFrameBorderMode(0);
369  tdrStyle->SetFrameBorderSize(1);
370  tdrStyle->SetFrameFillColor(0);
371  tdrStyle->SetFrameFillStyle(0);
372  tdrStyle->SetFrameLineColor(1);
373  tdrStyle->SetFrameLineStyle(1);
374  tdrStyle->SetFrameLineWidth(1);
375 
376 // For the histo:
377  // tdrStyle->SetHistFillColor(1);
378  // tdrStyle->SetHistFillStyle(0);
379  tdrStyle->SetHistLineColor(1);
380  tdrStyle->SetHistLineStyle(0);
381  tdrStyle->SetHistLineWidth(1);
382  // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
383  // tdrStyle->SetNumberContours(Int_t number = 20);
384 
385  tdrStyle->SetEndErrorSize(15);
386 // tdrStyle->SetErrorMarker(20);
387  tdrStyle->SetErrorX(1);
388 
389  tdrStyle->SetMarkerStyle(21);
390  tdrStyle->SetMarkerSize(1.);
391 
392 //For the fit/function:
393  tdrStyle->SetOptFit(0);
394  tdrStyle->SetFitFormat("5.4g");
395  tdrStyle->SetFuncColor(2);
396  tdrStyle->SetFuncStyle(1);
397  tdrStyle->SetFuncWidth(1);
398 
399 //For the date:
400  tdrStyle->SetOptDate(0);
401  // tdrStyle->SetDateX(Float_t x = 0.01);
402  // tdrStyle->SetDateY(Float_t y = 0.01);
403 
404 // For the statistics box:
405  tdrStyle->SetOptFile(1111);
406  tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
407  tdrStyle->SetStatColor(kWhite);
408  tdrStyle->SetStatFont(42);
409  tdrStyle->SetStatFontSize(0.025);
410  tdrStyle->SetStatTextColor(1);
411  tdrStyle->SetStatFormat("6.4g");
412  tdrStyle->SetStatBorderSize(1);
413  tdrStyle->SetStatH(0.2);
414  tdrStyle->SetStatW(0.15);
415  // tdrStyle->SetStatStyle(Style_t style = 1001);
416  // tdrStyle->SetStatX(Float_t x = 0);
417  // tdrStyle->SetStatY(Float_t y = 0);
418 
419 // Margins:
420  tdrStyle->SetPadTopMargin(0.05);
421  tdrStyle->SetPadBottomMargin(0.13);
422  tdrStyle->SetPadLeftMargin(0.16);
423  tdrStyle->SetPadRightMargin(0.02);
424 
425 // For the Global title:
426 
427  tdrStyle->SetOptTitle(0);
428  tdrStyle->SetTitleW(0.8); // Set the width of the title box
429 
430  tdrStyle->SetTitleFont(42);
431  tdrStyle->SetTitleColor(1);
432  tdrStyle->SetTitleTextColor(1);
433  tdrStyle->SetTitleFillColor(10);
434  tdrStyle->SetTitleFontSize(0.05);
435  // tdrStyle->SetTitleH(0); // Set the height of the title box
436  // tdrStyle->SetTitleX(0); // Set the position of the title box
437  // tdrStyle->SetTitleY(0.985); // Set the position of the title box
438  // tdrStyle->SetTitleStyle(Style_t style = 1001);
439  // tdrStyle->SetTitleBorderSize(2);
440 
441 // For the axis titles:
442 
443  tdrStyle->SetTitleColor(1, "XYZ");
444  tdrStyle->SetTitleFont(42, "XYZ");
445  tdrStyle->SetTitleSize(0.06, "XYZ");
446  // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
447  // tdrStyle->SetTitleYSize(Float_t size = 0.02);
448  tdrStyle->SetTitleXOffset(0.75);
449  tdrStyle->SetTitleYOffset(0.75);
450  // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
451 
452 // For the axis labels:
453 
454  tdrStyle->SetLabelColor(1, "XYZ");
455  tdrStyle->SetLabelFont(42, "XYZ");
456  tdrStyle->SetLabelOffset(0.007, "XYZ");
457  tdrStyle->SetLabelSize(0.05, "XYZ");
458 
459 // For the axis:
460 
461  tdrStyle->SetAxisColor(1, "XYZ");
462  tdrStyle->SetStripDecimals(kTRUE);
463  tdrStyle->SetTickLength(0.03, "XYZ");
464  tdrStyle->SetNdivisions(510, "XYZ");
465  tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
466  tdrStyle->SetPadTickY(1);
467 
468 // Change for log plots:
469  tdrStyle->SetOptLogx(0);
470  tdrStyle->SetOptLogy(0);
471  tdrStyle->SetOptLogz(0);
472 
473 // Postscript options:
474  tdrStyle->SetPaperSize(21.,28.);
475 // tdrStyle->SetPaperSize(20.,20.);
476  // tdrStyle->SetLineScalePS(Float_t scale = 3);
477  // tdrStyle->SetLineStyleString(Int_t i, const char* text);
478  // tdrStyle->SetHeaderPS(const char* header);
479  // tdrStyle->SetTitlePS(const char* pstitle);
480 
481  // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
482  // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
483  // tdrStyle->SetPaintTextFormat(const char* format = "g");
484  // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
485  // tdrStyle->SetTimeOffset(Double_t toffset);
486  // tdrStyle->SetHistMinimumZero(kTRUE);
487 
488  tdrStyle->cd();
489  return tdrStyle;
490 }
void RecoBTag::tdrGrid ( const bool &  gridOn)

Definition at line 493 of file Tools.cc.

References plotscripts::setTDRStyle(), and plotscripts::tdrStyle.

493  {
494  TStyle *tdrStyle = setTDRStyle();
495  tdrStyle->SetPadGridX(gridOn);
496  tdrStyle->SetPadGridY(gridOn);
497  tdrStyle->cd();
498 }
def setTDRStyle()
Definition: plotscripts.py:89