Skip to content

Commit

Permalink
macros: include pT syserrs
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Dec 21, 2014
1 parent 35ccf34 commit ee299e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions macros/getAllCocktail.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
mkdir -v cocktail_contribs
root -b -x -q -l getCocktail.C\(200,\"rho\",\"cocktail_contribs/rho\",\"\"\)
#root -b -x -q -l getCocktail.C\(200,\"rho\",\"cocktail_contribs/rho\",\"\"\)
for i in 19 27 39 62; do
for p in pion eta etap rho omega phi jpsi; do
for p in pion eta etap rho omega phi jpsi ccbar; do
root -l -b -x -q getCocktail.C\($i,\"$p\",\"cocktail_contribs/$p\",\"\"\)
done
root -l -b -x -q getCocktail.C\($i,\"hCocktail\",\"cocktail\",\"\"\)
Expand All @@ -12,5 +12,4 @@ for i in 19 27 39 62; do
root -l -b -x -q getCocktail.C\($i,\"hCocktailPt_omega\",\"cocktail\",\"_omega_0.76-0.82\"\)
root -l -b -x -q getCocktail.C\($i,\"hCocktailPt_phi\",\"cocktail\",\"_phi_0.98-1.06\"\)
root -l -b -x -q getCocktail.C\($i,\"hCocktailPt_pi0\",\"cocktail\",\"_pi0_0-0.2\"\)
root -b -x -q -l getCocktail.C\($i,\"ccbar\",\"cocktail_contribs/ccbar\",\"\"\)
done
5 changes: 3 additions & 2 deletions macros/getCocktail.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ void write(TH1D* h, const char* name, const int& energy, const char* suffix, TH1
outData.open(Form("%s%d%s.dat", name, energy, suffix));
for ( Int_t b = 1; b <= h->GetNbinsX(); ++b ) {
Double_t bc = h->GetBinContent(b);
Double_t beSysErr = 0.3 * bc;
Double_t beSysErr = 0.;
if ( hSysErr != NULL ) { beSysErr = hSysErr->GetBinContent(b); }
if ( bc > 0. ) {
outData
Expand All @@ -20,7 +20,8 @@ void write(TH1D* h, const char* name, const int& energy, const char* suffix, TH1
void getCocktail(const Int_t& energy, const string& in, const string& out, const string& suffix) {
TFile* f = TFile::Open(Form("%d/cocktail.root", energy), "read");
TH1D* h = (TH1D*)f->Get(in.c_str());
TH1D* hSysErr = (TH1D*)f->Get((in+"SysErr").c_str());
string key = (in.find("Pt")!=std::string::npos) ? in+"_SysErr" : in+"SysErr";
TH1D* hSysErr = (TH1D*)f->Get(key.c_str());
if ( in == "ccbar" ) { h->Rebin(10)->Scale(1./10.); }
write(h, out.c_str(), energy, suffix.c_str(), hSysErr);
}

0 comments on commit ee299e7

Please sign in to comment.