diff --git a/macros/CCEScan/landauFit b/macros/CCEScan/landauFit index 19b97f3..7f86419 100755 --- a/macros/CCEScan/landauFit +++ b/macros/CCEScan/landauFit Binary files differ diff --git a/macros/CCEScan/landauFit.C b/macros/CCEScan/landauFit.C index 35e8bbc..c8c1b3a 100755 --- a/macros/CCEScan/landauFit.C +++ b/macros/CCEScan/landauFit.C @@ -175,11 +175,12 @@ // Name if it is not directly written into the main file if (temSave) { - fn_output= TString(Form("%s/temp_%s_%s_%d_%d_r%d.root", + fn_output= TString(Form("%s/temp_%s_%s_%d_%d_r%d_step%d.root", dn_output.Data(),det.Data(),lay.Data(), - sector,fill,(int)radius)); + sector,fill,(int)radius, (int)caliStep)); } + // Printf("ci so, 0"); // Set the radius to an irrelevant value if (radius<0.0) { @@ -215,9 +216,13 @@ lay.Data())); + // Printf("ci so, 1"); + TFile* f_data = TFile::Open(fn_data.Data()); + // Printf("ci so, 2"); + if (!f_data) { Error("landauFit","Data file does not exist!"); Printf("=========================================\n"); @@ -237,6 +242,9 @@ Printf("=========================================\n"); return EXIT_FAILURE; } + + // Printf("ci so, 3"); + TH1F* h_sig = new TH1F("h_sig","Signal histo", 208,-32.0,176.0); @@ -261,6 +269,8 @@ // Get full selection for signal tracks/hits including radius TCut cu_sig = cu_bkg && cu_sel && TCut(Form("(TMath::Sqrt(xHit*xHit+yHit*yHit)<%f)",radius)); + // Printf("ci so, 4"); + // Fill Histograms t_sig->Draw(Form("val%d>>h_sig",val),cu_sig,"goff"); t_bkg->Draw(Form("val%d>>h_bkg",val),cu_bkg,"goff"); @@ -299,6 +309,9 @@ RooAddPdf* nPDF = new RooAddPdf("nPDF","Total distribution of raw noise", RooArgList(*nG1,*nG2), RooArgList(*nFrac)); + + Printf("ci so, 5"); + // Fit and plot noise sample RooFitResult* nRes = nPDF->fitTo(*hr_bkg,RooFit::Save());