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)
 

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

References gather_cfg::cout, edmIntegrityCheck::d, file, createfilelist::int, legendName, lineColor, lineStyle, and phase.

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

Member Function Documentation

TFile* TkOfflineVariables::getFile ( )
inline

Definition at line 34 of file PlotAlignmentValidation.h.

References file.

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

Definition at line 30 of file PlotAlignmentValidation.h.

References lineColor.

int TkOfflineVariables::getLineStyle ( )
inline

Definition at line 31 of file PlotAlignmentValidation.h.

References lineStyle.

std::string TkOfflineVariables::getName ( )
inline

Definition at line 32 of file PlotAlignmentValidation.h.

References legendName.

Referenced by plotting.Plot::draw().

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

Definition at line 35 of file PlotAlignmentValidation.h.

References phase.

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

Definition at line 33 of file PlotAlignmentValidation.h.

References tree.

33 { return tree; }

Member Data Documentation

TFile* TkOfflineVariables::file
private

Definition at line 37 of file PlotAlignmentValidation.h.

Referenced by ztee.GZipLog::finish(), getFile(), and TkOfflineVariables().

std::string TkOfflineVariables::legendName
private

Definition at line 42 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

int TkOfflineVariables::lineColor
private
int TkOfflineVariables::lineStyle
private
int TkOfflineVariables::phase
private
TTree* TkOfflineVariables::tree
private