CMS 3D CMS Logo

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 gather_cfg::cout, edmIntegrityCheck::d, file, createfilelist::int, legendName, lineColor, lineStyle, and phase.

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

Definition at line 80 of file PlotAlignmentValidation.h.

References file.

80  {
81  delete file;
82 }

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.

int TkOfflineVariables::getLineStyle ( )
inline

Definition at line 32 of file PlotAlignmentValidation.h.

References 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 43 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

int TkOfflineVariables::lineColor
private

Definition at line 40 of file PlotAlignmentValidation.h.

Referenced by getLineColor(), and TkOfflineVariables().

int TkOfflineVariables::lineStyle
private

Definition at line 41 of file PlotAlignmentValidation.h.

Referenced by getLineStyle(), and TkOfflineVariables().

int TkOfflineVariables::phase
private

Definition at line 42 of file PlotAlignmentValidation.h.

Referenced by getPhase(), and TkOfflineVariables().

TTree* TkOfflineVariables::tree
private