CMS 3D CMS Logo

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

#include <PlotAlignmentValidation.h>

Public Member Functions

TFile * getFile ()
 
int getLineColor ()
 
int getLineStyle ()
 
std::string getName ()
 
int getPhase ()
 
TTree * getTree ()
 
 TkOfflineVariables (std::string fileName, std::string baseDir, std::string legName="", int color=1, int style=1)
 
 ~TkOfflineVariables ()
 

Private Attributes

TFile * file
 
std::string legendName
 
int lineColor
 
int lineStyle
 
int phase
 
TTree * tree
 

Detailed Description

Definition at line 27 of file PlotAlignmentValidation.h.

Constructor & Destructor Documentation

TkOfflineVariables::TkOfflineVariables ( std::string  fileName,
std::string  baseDir,
std::string  legName = "",
int  color = 1,
int  style = 1 
)

Definition at line 47 of file PlotAlignmentValidation.h.

References cms::cuda::assert(), gather_cfg::cout, ztail::d, file, legendName, lineColor, lineStyle, phase, command_line::start, and tree.

48  {
49  lineColor = lColor;
50  lineStyle = lStyle % 100;
51  if (legName == "") {
52  int start = 0;
53  if (fileName.find('/'))
54  start = fileName.find_last_of('/') + 1;
55  int stop = fileName.find_last_of('.');
56  legendName = fileName.substr(start, stop - start);
57  } else {
58  legendName = legName;
59  }
60 
61  //fill the tree pointer
62  file = TFile::Open(fileName.c_str());
63  TDirectoryFile* d = 0;
64  if (file->Get(baseDir.c_str())) {
65  d = (TDirectoryFile*)file->Get(baseDir.c_str());
66  if ((*d).Get("TkOffVal")) {
67  tree = (TTree*)(*d).Get("TkOffVal");
68  } else {
69  std::cout << "no tree named TkOffVal" << std::endl;
70  assert(false);
71  }
72  TDirectoryFile* d2 = (TDirectoryFile*)d->Get("Pixel");
73  assert(d2);
74  phase = (int)((bool)d2->Get("P1PXBBarrel_1"));
75  } else {
76  std::cout << "no directory named " << baseDir.c_str() << std::endl;
77  assert(false);
78  }
79 }
assert(be >=bs)
tuple d
Definition: ztail.py:151
tuple cout
Definition: gather_cfg.py:144
TkOfflineVariables::~TkOfflineVariables ( )

Definition at line 81 of file PlotAlignmentValidation.h.

References file.

81 { delete file; }

Member Function Documentation

TFile* TkOfflineVariables::getFile ( )
inline

Definition at line 35 of file PlotAlignmentValidation.h.

References file.

35 { return file; }
int TkOfflineVariables::getLineColor ( )
inline

Definition at line 31 of file PlotAlignmentValidation.h.

References lineColor.

31 { return lineColor; }
int TkOfflineVariables::getLineStyle ( )
inline

Definition at line 32 of file PlotAlignmentValidation.h.

References lineStyle.

32 { return lineStyle; }
std::string TkOfflineVariables::getName ( )
inline

Definition at line 33 of file PlotAlignmentValidation.h.

References legendName.

Referenced by plotting.Plot::draw().

33 { return legendName; }
int TkOfflineVariables::getPhase ( )
inline

Definition at line 36 of file PlotAlignmentValidation.h.

References phase.

36 { return phase; }
TTree* TkOfflineVariables::getTree ( )
inline

Definition at line 34 of file PlotAlignmentValidation.h.

References tree.

34 { return tree; }

Member Data Documentation

TFile* TkOfflineVariables::file
private
std::string TkOfflineVariables::legendName
private

Definition at line 44 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

int TkOfflineVariables::lineColor
private

Definition at line 41 of file PlotAlignmentValidation.h.

Referenced by getLineColor(), and TkOfflineVariables().

int TkOfflineVariables::lineStyle
private

Definition at line 42 of file PlotAlignmentValidation.h.

Referenced by getLineStyle(), and TkOfflineVariables().

int TkOfflineVariables::phase
private

Definition at line 43 of file PlotAlignmentValidation.h.

Referenced by getPhase(), and TkOfflineVariables().

TTree* TkOfflineVariables::tree
private