1 #ifndef PLOTALIGNNMENTVALIDATION_H_ 2 #define PLOTALIGNNMENTVALIDATION_H_ 16 #include "TDirectory.h" 19 #include "TDirectoryFile.h" 53 if (fileName.find(
'/') ) start =fileName.find_last_of(
'/')+1;
54 int stop = fileName.find_last_of(
'.');
55 legendName = fileName.substr(start,stop-start);
61 file = TFile::Open( fileName.c_str() );
62 TDirectoryFile *
d = 0;
63 if (
file->Get( baseDir.c_str() ) ) {
64 d = (TDirectoryFile*)
file->Get( baseDir.c_str() );
65 if ((*d).Get(
"TkOffVal")) {
66 tree = (TTree*)(*d).Get(
"TkOffVal");
68 std::cout<<
"no tree named TkOffVal"<<std::endl;
71 TDirectoryFile *d2 = (TDirectoryFile*)d->Get(
"Pixel");
73 phase = (
int)((
bool)d2->Get(
"P1PXBBarrel_1"));
75 std::cout<<
"no directory named "<<baseDir.c_str()<<std::endl;
91 void useFitForDMRplots(
bool usefit =
false);
92 void legendOptions(TString
options);
94 void plotSubDetResiduals(
bool plotNormHisto=
false,
unsigned int subDetId=7);
97 void plotChi2(
const char *inputFile);
101 void setTreeBaseDir(
std::string dir =
"TrackerOfflineValidationStandalone");
103 int maxNumberOfLayers(
int subdetector);
105 THStack* addHists(
const TString&
selection,
const TString &residType =
"xPrime", TLegend **myLegend = 0,
bool printModuleIds =
false,
bool validforphase0 =
false);
127 TList* getTreeList();
141 bool openedsummaryfile =
false;
143 std::vector<double> vmean, vdeltamean,
vrms, vmeanerror, vPValueEqualSplitMeans, vPValueMeanEqualIdeal, vPValueRMSEqualIdeal, vAlignmentUncertainty;
144 double resampleTestOfEqualMeans(TH1F* h1, TH1F* h2,
int numSamples);
145 double resampleTestOfEqualRMS(TH1F* h1, TH1F* h2,
int numSamples);
153 void setHistStyle( TH1&
hist,
const char* titleX,
const char* titleY,
int color);
154 void setTitleStyle( TNamed&
h,
const char* titleX,
const char* titleY,
int subDetId,
bool isSurfaceDeformation=
false, TString secondline=
"");
159 TObject* findObjectFromCanvas(TCanvas* canv,
const char*
className, Int_t
n=1);
172 void setDMRHistStyleAndLegend(TH1F*
h,
DMRPlotInfo& plotinfo,
int direction = 0,
int layer = 0);
173 void plotDMRHistogram(
DMRPlotInfo& plotinfo,
int direction = 0,
int layer = 0);
174 void modifySSHistAndLegend(THStack* hs, TLegend*
legend);
175 void openSummaryFile();
178 #endif // PLOTALIGNNMENTVALIDATION_H_
std::vector< double > vrms
TkOfflineVariables * vars
static const TString summaryfilename
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)