1 #ifndef PLOTALIGNNMENTVALIDATION_H_ 2 #define PLOTALIGNNMENTVALIDATION_H_ 16 #include "TDirectory.h" 19 #include "TDirectoryFile.h" 52 if (fileName.find(
'/') ) start =fileName.find_last_of(
'/')+1;
53 int stop = fileName.find_last_of(
'.');
54 legendName = fileName.substr(start,stop-start);
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");
67 std::cout<<
"no tree named TkOffVal"<<std::endl;
70 TDirectoryFile *d2 = (TDirectoryFile*)d->Get(
"Pixel");
72 phase = (
int)((
bool)d2->Get(
"P1PXBBarrel_1"));
74 std::cout<<
"no directory named "<<baseDir.c_str()<<std::endl;
86 void useFitForDMRplots(
bool usefit =
false);
87 void legendOptions(TString
options);
88 void plotOutlierModules(
const char *
outputFileName=
"OutlierModules.ps",
std::string plotVariable =
"chi2PerDofX" ,
float chi2_cut = 10,
unsigned int minHits = 50);
89 void plotSubDetResiduals(
bool plotNormHisto=
false,
unsigned int subDetId=7);
92 void plotChi2(
const char *inputFile);
96 void setTreeBaseDir(
std::string dir =
"TrackerOfflineValidationStandalone");
98 int maxNumberOfLayers(
int subdetector);
100 THStack* addHists(
const TString&
selection,
const TString &residType =
"xPrime", TLegend **myLegend = 0,
bool printModuleIds =
false,
bool validforphase0 =
false);
122 TList* getTreeList();
141 void setHistStyle( TH1&
hist,
const char* titleX,
const char* titleY,
int color);
142 void setTitleStyle( TNamed&
h,
const char* titleX,
const char* titleY,
int subDetId,
bool isSurfaceDeformation=
false, TString secondline=
"");
147 TObject* findObjectFromCanvas(TCanvas* canv,
const char*
className, Int_t
n=1);
160 void setDMRHistStyleAndLegend(TH1F*
h,
DMRPlotInfo& plotinfo,
int direction = 0,
int layer = 0);
161 void plotDMRHistogram(
DMRPlotInfo& plotinfo,
int direction = 0,
int layer = 0);
162 void modifySSHistAndLegend(THStack* hs, TLegend*
legend);
165 #endif // PLOTALIGNNMENTVALIDATION_H_
TkOfflineVariables * vars
PlotAlignmentValidation()
unsigned int subDetId[21]
void setCanvasStyle(TCanvas *c, const bool logScale)
TkOfflineVariables(std::string fileName, std::string baseDir, std::string legName="", int color=1, int style=1)
void setLegendStyle(TLegend *l, const unsigned int nColumns)
std::vector< TkOfflineVariables * > sourceList
std::string className(const T &t)