CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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::TkOfflineVariables ( std::string  fileName,
std::string  baseDir,
std::string  legName = "",
int  color = 1,
int  style = 1 
)

Definition at line 47 of file PlotAlignmentValidation.h.

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 }

References cms::cuda::assert(), ALCARECODTCalibSynchDQM_cff::baseDir, gather_cfg::cout, ztail::d, file, MillePedeFileConverter_cfg::fileName, createfilelist::int, legendName, lineColor, lineStyle, and phase.

◆ ~TkOfflineVariables()

TkOfflineVariables::~TkOfflineVariables ( )

Definition at line 81 of file PlotAlignmentValidation.h.

81 { delete file; }

References file.

Member Function Documentation

◆ getFile()

TFile* TkOfflineVariables::getFile ( )
inline

Definition at line 35 of file PlotAlignmentValidation.h.

35 { return file; }

References file.

◆ getLineColor()

int TkOfflineVariables::getLineColor ( )
inline

Definition at line 31 of file PlotAlignmentValidation.h.

31 { return lineColor; }

References lineColor.

◆ getLineStyle()

int TkOfflineVariables::getLineStyle ( )
inline

Definition at line 32 of file PlotAlignmentValidation.h.

32 { return lineStyle; }

References lineStyle.

◆ getName()

std::string TkOfflineVariables::getName ( )
inline

Definition at line 33 of file PlotAlignmentValidation.h.

33 { return legendName; }

References legendName.

Referenced by plotting.Plot::draw().

◆ getPhase()

int TkOfflineVariables::getPhase ( )
inline

Definition at line 36 of file PlotAlignmentValidation.h.

36 { return phase; }

References phase.

◆ getTree()

TTree* TkOfflineVariables::getTree ( )
inline

Definition at line 34 of file PlotAlignmentValidation.h.

34 { return tree; }

References tree.

Member Data Documentation

◆ file

TFile* TkOfflineVariables::file
private

◆ legendName

std::string TkOfflineVariables::legendName
private

Definition at line 44 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

◆ lineColor

int TkOfflineVariables::lineColor
private

Definition at line 41 of file PlotAlignmentValidation.h.

Referenced by getLineColor(), and TkOfflineVariables().

◆ lineStyle

int TkOfflineVariables::lineStyle
private

Definition at line 42 of file PlotAlignmentValidation.h.

Referenced by getLineStyle(), and TkOfflineVariables().

◆ phase

int TkOfflineVariables::phase
private

Definition at line 43 of file PlotAlignmentValidation.h.

Referenced by getPhase(), and TkOfflineVariables().

◆ tree

TTree* TkOfflineVariables::tree
private
start
Definition: start.py:1
tree
Definition: tree.py:1
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
TkOfflineVariables::file
TFile * file
Definition: PlotAlignmentValidation.h:39
ALCARECODTCalibSynchDQM_cff.baseDir
baseDir
Definition: ALCARECODTCalibSynchDQM_cff.py:16
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
TkOfflineVariables::legendName
std::string legendName
Definition: PlotAlignmentValidation.h:44
TkOfflineVariables::lineColor
int lineColor
Definition: PlotAlignmentValidation.h:41
TkOfflineVariables::tree
TTree * tree
Definition: PlotAlignmentValidation.h:40
createfilelist.int
int
Definition: createfilelist.py:10
TkOfflineVariables::phase
int phase
Definition: PlotAlignmentValidation.h:43
ztail.d
d
Definition: ztail.py:151
TkOfflineVariables::lineStyle
int lineStyle
Definition: PlotAlignmentValidation.h:42