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 49 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 
)
inline

Definition at line 69 of file PlotAlignmentValidation.h.

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

70  {
71  lineColor = lColor;
72  lineStyle = lStyle % 100;
73  if (legName.empty()) {
74  int start = 0;
75  if (fileName.find('/'))
76  start = fileName.find_last_of('/') + 1;
77  int stop = fileName.find_last_of('.');
78  legendName = fileName.substr(start, stop - start);
79  } else {
80  legendName = legName;
81  }
82 
83  //fill the tree pointer
84  file = TFile::Open(fileName.c_str());
85  TDirectoryFile* d = nullptr;
86  if (file->Get(baseDir.c_str())) {
87  d = (TDirectoryFile*)file->Get(baseDir.c_str());
88  if ((*d).Get("TkOffVal")) {
89  tree = (TTree*)(*d).Get("TkOffVal");
90  } else {
91  std::cout << "no tree named TkOffVal" << std::endl;
92  assert(false);
93  }
94  TDirectoryFile* d2 = (TDirectoryFile*)d->Get("Pixel");
95  assert(d2);
96  phase = (int)((bool)d2->Get("P1PXBBarrel_1"));
97  } else {
98  std::cout << "no directory named " << baseDir.c_str() << std::endl;
99  assert(false);
100  }
101 }
Definition: start.py:1
assert(be >=bs)
d
Definition: ztail.py:151
Definition: tree.py:1

◆ ~TkOfflineVariables()

TkOfflineVariables::~TkOfflineVariables ( )
inline

Definition at line 103 of file PlotAlignmentValidation.h.

References file.

103 { delete file; }

Member Function Documentation

◆ getFile()

TFile* TkOfflineVariables::getFile ( )
inline

Definition at line 57 of file PlotAlignmentValidation.h.

References file.

57 { return file; }

◆ getLineColor()

int TkOfflineVariables::getLineColor ( )
inline

Definition at line 53 of file PlotAlignmentValidation.h.

References lineColor.

Referenced by PlotAlignmentValidation::setDMRHistStyleAndLegend().

◆ getLineStyle()

int TkOfflineVariables::getLineStyle ( )
inline

Definition at line 54 of file PlotAlignmentValidation.h.

References lineStyle.

Referenced by PlotAlignmentValidation::setDMRHistStyleAndLegend().

◆ getName()

std::string TkOfflineVariables::getName ( )
inline

◆ getPhase()

int TkOfflineVariables::getPhase ( )
inline

Definition at line 58 of file PlotAlignmentValidation.h.

References phase.

Referenced by PlotAlignmentValidation::plotDMR().

58 { return phase; }

◆ getTree()

TTree* TkOfflineVariables::getTree ( )
inline

Definition at line 56 of file PlotAlignmentValidation.h.

References tree.

Referenced by PlotAlignmentValidation::plotDMRHistogram().

56 { return tree; }

Member Data Documentation

◆ file

TFile* TkOfflineVariables::file
private

◆ legendName

std::string TkOfflineVariables::legendName
private

Definition at line 66 of file PlotAlignmentValidation.h.

Referenced by getName(), and TkOfflineVariables().

◆ lineColor

int TkOfflineVariables::lineColor
private

Definition at line 63 of file PlotAlignmentValidation.h.

Referenced by getLineColor(), and TkOfflineVariables().

◆ lineStyle

int TkOfflineVariables::lineStyle
private

Definition at line 64 of file PlotAlignmentValidation.h.

Referenced by getLineStyle(), and TkOfflineVariables().

◆ phase

int TkOfflineVariables::phase
private

Definition at line 65 of file PlotAlignmentValidation.h.

Referenced by getPhase(), and TkOfflineVariables().

◆ tree

TTree* TkOfflineVariables::tree
private