35 |
|
// Output directory |
36 |
|
TString baseDir = "Results_2.88pb-1_NEW/"; |
37 |
|
// User defined parameters |
38 |
< |
bool useInv = false; // whether to use n-1 QCD template |
39 |
< |
bool realData = false; |
38 |
> |
bool useInv = false; // whether to use n-1 QCD template |
39 |
> |
bool realData = false; |
40 |
|
// Ntuples to use |
41 |
< |
TString suffix = "Sel0"; // Suffix of selection |
41 |
> |
TString suffix = "Sel0"; // Suffix of selection |
42 |
|
TString invNames[2] = {"RelIsogt0p1","D0gt0p02"}; |
43 |
|
map<TString,TCanvas*> cvs; // map of usual histogram |
44 |
|
bool debug_ = false; |
52 |
|
TLatex *latex = new TLatex(); |
53 |
|
latex->SetNDC(); |
54 |
|
|
55 |
+ |
struct stat stbDir; |
56 |
+ |
if (stat(baseDir,&stbDir)){ |
57 |
+ |
cout << "Creating folder : " << baseDir << endl; |
58 |
+ |
if (mkdir(baseDir,0755) == -1){ |
59 |
+ |
std::cerr << "Error creating folder" << endl; |
60 |
+ |
return; |
61 |
+ |
} |
62 |
+ |
} |
63 |
+ |
|
64 |
|
int size_ninv = (useInv ? 2 : 1); |
65 |
|
for (int ninv = 0;ninv < size_ninv; ++ninv) { |
66 |
|
TString invName = invNames[ninv]; |
67 |
|
TString desDir; |
68 |
+ |
// create output directory |
69 |
|
if (!useInv) { |
70 |
|
if (!realData) desDir = baseDir + "MC/"; |
71 |
|
else desDir = baseDir + "Data_MC/"; |
75 |
|
} |
76 |
|
struct stat stDir; |
77 |
|
if (!stat(desDir,&stDir)){ |
78 |
< |
cout << "Output folder exists! Continues? (enter to continue; 'q' for quit)" << endl; |
78 |
> |
cout << "Output folder exists! Continue to overwrite it? (enter to continue; 'q' for quit)" << endl; |
79 |
|
char incmd; |
80 |
|
cin.get(incmd); |
81 |
|
if (incmd == 'q') return; |
451 |
|
TString cvsName3 = "KStestValues"; |
452 |
|
if(useInv) cvsName3 = cvsName3 + "_" + invName; |
453 |
|
cvs[cvsName3] = new TCanvas(cvsName3,"",600,700); |
454 |
< |
if (!realData) hKSvalues_[0]->GetXaxis()->SetRangeUser(0.9,1.2); |
454 |
> |
if (!realData) hKSvalues_[0]->GetXaxis()->SetRangeUser(0.95,1.1); |
455 |
|
hKSvalues_[0]->GetYaxis()->SetRangeUser(1e-36,1.2); |
456 |
|
hKSvalues_[0]->Draw(); |
457 |
|
hKSvalues_[1]->Draw("same"); |