CMS 3D CMS Logo

Public Member Functions | Private Attributes

TkOfflineVariables Class Reference

#include <PlotAlignmentValidation.h>

List of all members.

Public Member Functions

TFile * getFile ()
int getLineColor ()
int getLineStyle ()
std::string getName ()
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
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 44 of file PlotAlignmentValidation.h.

References gather_cfg::cout, file, legendName, lineColor, lineStyle, dqm_diff::start, and tree.

{
  lineColor = lColor;
  lineStyle = lStyle;
  if (legName=="") {
    int start = 0;
    if (fileName.find('/') ) start =fileName.find_last_of('/')+1;
    int stop = fileName.find_last_of('.');
    legendName = fileName.substr(start,stop-start);
  } else { 
    legendName = legName;
  }

  //fill the tree pointer
  file = TFile::Open( fileName.c_str() );
  TDirectoryFile *d = 0;
  if (file->Get( baseDir.c_str() ) )  {
    d = (TDirectoryFile*)file->Get( baseDir.c_str() );
    if ((*d).Get("TkOffVal")) {
      tree = (TTree*)(*d).Get("TkOffVal");
    } else {
      std::cout<<"no tree named TkOffVal"<<std::endl;
    }
  } else {
    std::cout<<"no directory named "<<baseDir.c_str()<<std::endl;
  }
}

Member Function Documentation

TFile* TkOfflineVariables::getFile ( ) [inline]

Definition at line 34 of file PlotAlignmentValidation.h.

References file.

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

Definition at line 30 of file PlotAlignmentValidation.h.

References lineColor.

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

Definition at line 31 of file PlotAlignmentValidation.h.

References lineStyle.

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

Definition at line 32 of file PlotAlignmentValidation.h.

References legendName.

{ return legendName; }
TTree* TkOfflineVariables::getTree ( ) [inline]

Definition at line 33 of file PlotAlignmentValidation.h.

References tree.

{ return tree; };

Member Data Documentation

TFile* TkOfflineVariables::file [private]

Definition at line 34 of file PlotAlignmentValidation.h.

Referenced by getFile(), and TkOfflineVariables().

std::string TkOfflineVariables::legendName [private]

Definition at line 40 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

Definition at line 38 of file PlotAlignmentValidation.h.

Referenced by getLineColor(), and TkOfflineVariables().

Definition at line 39 of file PlotAlignmentValidation.h.

Referenced by getLineStyle(), and TkOfflineVariables().

TTree* TkOfflineVariables::tree [private]

Definition at line 37 of file PlotAlignmentValidation.h.

Referenced by getTree(), and TkOfflineVariables().