Updating macros for hadronic et
authorcnattras <christine.nattrass@cern.ch>
Sat, 8 Feb 2014 20:07:05 +0000 (15:07 -0500)
committercnattras <christine.nattrass@cern.ch>
Sat, 8 Feb 2014 20:07:05 +0000 (15:07 -0500)
PWGLF/totEt/macros/hadEt/CorrBkgdErrors.C
PWGLF/totEt/macros/hadEt/CorrNeutral.C
PWGLF/totEt/macros/hadEt/CorrPtCut.C
PWGLF/totEt/macros/hadEt/GetCorrections.C
PWGLF/totEt/macros/hadEt/dEdx.C

index 939ace3..e8a9a69 100644 (file)
@@ -8,6 +8,7 @@ TH1D *GetHisto(float etacut = 0.12, bool eta = true, char *name, bool TPC,bool I
     if(ITS) myname = "TPCITS";
     else{    myname = "TPC";}
   }
+  //cout<<"Using "<<myname<<" tracks"<<endl;
   TH2F *signal = ((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiPlus",myname)))->Clone("signal");
   signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiMinus",myname)));
   signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKMinus",myname)),kaonFactor);
@@ -28,9 +29,14 @@ TH1D *GetHisto(float etacut = 0.12, bool eta = true, char *name, bool TPC,bool I
     bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiXiDaughters",myname)),baryonEnhancement);
     bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sOmegaDaughters",myname)),baryonEnhancement);
     bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiOmegaDaughters",myname)),baryonEnhancement);
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sConversionElectrons",myname)) );
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryMuons",myname)) );
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryPions",myname)) );
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryProtons",myname)) );
     break;
   case 1:
     bkgd = (TH2F*)((TH2F*) out2->FindObject(Form("EtReconstructed%sMisidentifiedElectrons",myname)))->Clone("bkgd");
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sConversionElectrons",myname)) );
     break;
   case 2:
     bkgd = (TH2F*)((TH2F*) out2->FindObject(Form("EtReconstructed%sLambdaDaughters%s",myname,reweightname)))->Clone("bkgd");
@@ -72,23 +78,29 @@ TH1D *GetHisto(float etacut = 0.12, bool eta = true, char *name, bool TPC,bool I
     bkgd = (TH2F*)((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiLambdaDaughters%s",myname,reweightname)))->Clone("bkgd");
     bkgd->Scale(baryonEnhancement*lambdaFactor);
     break;
+  case 10:
+    bkgd = (TH2F*) ((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryMuons",myname)) )->Clone("bkgdOther");
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryPions",myname)) );
+    bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryProtons",myname)) );
+    break;
   }
   TH1D *denominator;
   TH1D *numerator;
   if(eta){
     int lowbin = bkgd->GetXaxis()->FindBin(etacut+.001);//make sure we don't accidentally get the wrong bin
     int highbin = bkgd->GetXaxis()->GetNbins();
-    cout<<"Projecting from "<<bkgd->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<bkgd->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
+    //cout<<"Projecting from "<<bkgd->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<bkgd->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
     denominator = signal->ProjectionY("name",lowbin,highbin);
     numerator = bkgd->ProjectionY(name,lowbin,highbin);
   }
   else{
     int lowbin = bkgd->GetYaxis()->FindBin(-etacut+.001);//make sure we don't accidentally get the wrong bin
     int highbin = bkgd->GetYaxis()->FindBin(etacut-.001);
-    cout<<"Projecting from "<<bkgd->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<bkgd->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
+    //cout<<"Projecting from "<<bkgd->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<bkgd->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
     denominator = signal->ProjectionX("name",lowbin,highbin);
     numerator = bkgd->ProjectionX(name,lowbin,highbin);
   }
+  denominator->Add(numerator);
   numerator->Divide(denominator);
   numerator->SetYTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
   numerator->GetYaxis()->SetTitleOffset(1.2);
@@ -99,7 +111,7 @@ TH1D *GetHisto(float etacut = 0.12, bool eta = true, char *name, bool TPC,bool I
 
 }
 
-void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float kaonFactor=1.0, float lambdaFactor = 1.0, float baryonEnhancement = 1.0){
+void CorrBkgdErrors(char *prodname = "LHC11a4_bis HIJING 2.76 TeV Pb+Pb",char *shortprodname= "LHC11a4_bis", char *filename = "rootFiles/LHC11a10a_bis/Et.ESD.sim.LHC11a10a_bis.Run139465.root",bool alt = false,bool TPC = true, bool ITS=true, bool reweight = false, int scale = -1,float kaonFactor=1.0, float lambdaFactor = 1.0, float baryonEnhancement = 1.0){
   gStyle->SetOptTitle(0);
   gStyle->SetOptStat(0);
   gStyle->SetOptFit(0);
@@ -113,7 +125,11 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   c->SetFrameFillColor(0);
   c->SetFrameBorderMode(0);
   c->SetLeftMargin(0.159091);
-  char * filename = "Et.ESD.new.sim.LHC10d4.pp.merged.root";
+  //char * filename = "Et.ESD.new.sim.LHC10d4.pp.merged.root";
+  //  char * filename = "rootFiles/LHC11a4_bis/Et.ESD.new.sim.LHC11a4_bis.root";
+  //char *filename = "rootFiles/LHC11a4_bis/Et.ESD.new.sim.LHC11a4_bis.root";
+  //char *filename = "rootFiles/LHC11a4_bis/Et.ESD.new.sim.LHC11a4_bis.effFromPtReco.root";
+  //char *filename = "rootFiles/LHC11a4_bis23Apr11/Et.ESD.new.sim.LHC11a4_bis.root";
   TH1D *All = GetHisto(0.1,true,"All",TPC,ITS,0,1,20,filename,reweight,kaonFactor,lambdaFactor,baryonEnhancement);
   TH1D *Electrons = GetHisto(0.1,true,"Electrons",TPC,ITS,1,2,21,filename,reweight,kaonFactor,lambdaFactor,baryonEnhancement);
   TH1D *V0s = GetHisto(0.1,true,"V0s",TPC,ITS,4,4,22,filename,reweight,kaonFactor,lambdaFactor,baryonEnhancement);
@@ -131,7 +147,8 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   TH1D *AntiLambdapt = GetHisto(0.1,false,"K0S",TPC,ITS,9,TColor::kMagenta+3,30,filename,reweight,kaonFactor,lambdaFactor,baryonEnhancement);
   TH1D *Multistrangept = GetHisto(0.7,false,"Multistrangept",TPC,ITS,7,TColor::kGreen+2,23,filename,reweight,kaonFactor,lambdaFactor,baryonEnhancement);
   if(ITS){
-    All->SetMaximum(0.025);
+    if(TPC) All->SetMaximum(0.15);
+    else{All->SetMaximum(0.025);}
   }
   else{
     All->SetMaximum(0.2);
@@ -150,10 +167,58 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   TF1 *funcK0 = new TF1("funcK0","[0]",-.7,.7);
   funcK0->SetParameter(0,0.013);
   funcK0->SetLineColor(K0S->GetMarkerColor());
+  TF1 *funcElectrons = new TF1("funcElectrons","[0]",-.7,.7);
+  funcElectrons->SetParameter(0,0.013);
+  funcElectrons->SetLineColor(Electrons->GetMarkerColor());
   All->Fit(func);
   Lambda->Fit(funcLam);
   AntiLambda->Fit(funcAlam);
   K0S->Fit(funcK0);
+  Electrons->Fit(funcElectrons);
+  float k0Err900 = 0.07/0.184;
+  float lamErr900 = 0.005/0.048;
+  float alamErr900 = 0.006/0.047;
+  float k0Err7 = 0.03/0.347;
+  float lamErr7 = 0.02/0.182;
+  float alamErr7 = lamErr7;
+
+  float lambda = funcLam->GetParameter(0);
+  cout<<"Lambda contribution 900: ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",lambda*100.0,lambda*lamErr900*100.0)<<endl;
+  cout<<"Lambda contribution 7 ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",lambda*100.0,lambda*lamErr7*100.0)<<endl;
+
+  float antilambda = funcAlam->GetParameter(0);
+  cout<<"AntiLambda contribution 900: ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",antilambda*100.0,antilambda*alamErr900*100.0)<<endl;
+  cout<<"AntiLambda contribution 7 ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",antilambda*100.0,antilambda*alamErr7*100.0)<<endl;
+
+  float k0 = funcK0->GetParameter(0);
+  cout<<"K0 contribution 900: ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",k0*100.0,k0*k0Err900*100.0)<<endl;
+  cout<<"K0 contribution 7 ";
+  cout<<Form("%2.2f $\\pm$ %2.2f",k0*100.0,k0*k0Err7*100.0)<<endl;
+
+  cout<<"Total 900: ";
+  float totalerr900 = 100.0*TMath::Sqrt(lambda*lamErr900*lambda*lamErr900+antilambda*alamErr900*antilambda*alamErr900+k0*k0Err900*k0*k0Err900);
+  float total900 = lambda*100.0+antilambda*100.0+k0*100.0;
+  cout<<Form("%2.2f $\\pm$ %2.2f",total900,totalerr900)<<endl;
+  cout<<"Total 7: ";
+  float totalerr7 = 100.0*TMath::Sqrt(lambda*lamErr7*lambda*lamErr7+antilambda*alamErr7*antilambda*alamErr7+k0*k0Err7*k0*k0Err7);
+  float total7 = lambda*100.0+antilambda*100.0+k0*100.0;
+  cout<<Form("%2.2f $\\pm$ %2.2f",total7,totalerr7)<<endl;
+
+
+  //cout<<funcLam->GetParameter(0)<<" +/- "<<funcLam->GetParError(0)<<endl;
+  cout<<"AntiLambda contribution ";
+  //cout<<funcAlam->GetParameter(0)<<" +/- "<<funcAlam->GetParError(0)<<endl;
+  cout<<"K0 contribution ";
+  //cout<<funcK0->GetParameter(0)<<" +/- "<<funcK0->GetParError(0)<<endl;
+
+
+  cout<<"Electron contribution ";
+  //cout<<funcElectrons->GetParameter(0)<<" +/- "<<funcElectrons->GetParError(0)<<endl;
   All->Draw();
   Electrons->Draw("same");
   V0s->Draw("same");
@@ -187,6 +252,8 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   TLatex *texK0 = new TLatex(-0.711139,0.008,Form("%2.5f#pm%2.5f",funcK0->GetParameter(0),funcK0->GetParError(0)));
   texK0->SetTextColor(K0S->GetMarkerColor());
   texK0->Draw();
+
   TCanvas *c1 = new TCanvas("c1","c1",600,400);
   c1->SetTopMargin(0.04);
   c1->SetRightMargin(0.04);
@@ -196,14 +263,13 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   c1->SetBorderMode(0);
   c1->SetFrameFillColor(0);
   c1->SetFrameBorderMode(0);
-  if(ITS){
-    Allpt->SetMaximum(0.04);
+  if(TPC && ITS){  
+    Allpt->SetMaximum(0.15);
+    Allpt->GetXaxis()->SetRange(Allpt->GetXaxis()->FindBin(0.15),Allpt->GetXaxis()->FindBin(1.));
   }
   else{
-    Allpt->SetMaximum(0.2);
+    Allpt->GetXaxis()->SetRange(Allpt->GetXaxis()->FindBin(0.1),Allpt->GetXaxis()->FindBin(0.3));
   }
-  if(TPC)  Allpt->GetXaxis()->SetRange(Allpt->GetXaxis()->FindBin(0.0),Allpt->GetXaxis()->FindBin(4.));
-  else{  Allpt->GetXaxis()->SetRange(Allpt->GetXaxis()->FindBin(0.0),Allpt->GetXaxis()->FindBin(1.));}
   Allpt->SetMinimum(0.0);
   Allpt->SetMarkerStyle(20);
   Allpt->Draw();
@@ -228,7 +294,21 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   legpt->SetFillColor(0);
   legpt->SetBorderSize(0);
   legpt->Draw();
-
+  float x = 0.399919;
+  if(reweight) x = 0.18332;
+  TLatex *texprod = new TLatex(x,0.140566,prodname);
+  texprod->SetTextSize(0.0537634);
+  texprod->Draw();
+  if(scale!=-1){
+    TString scale900 = "Using scaling from 900 GeV p+p";
+    TString scale7 = "Using scaling from 7 TeV p+p";
+    TString scaleString;
+    if(scale==2009) scaleString = scale900;
+    else{scaleString = scale7;}
+    TLatex *texscale = new TLatex(0.190421,0.129782,scaleString.Data());
+    texscale->SetTextSize(0.0537634);
+    texscale->Draw();
+  }
 
   char TPCnameeps[200];
   char TPCnamepng[200];
@@ -239,25 +319,52 @@ void CorrBkgdErrors(bool TPC = true, bool ITS=true, bool reweight = true,float k
   if(kaonFactor!=1.0||lambdaFactor!=1.0||baryonEnhancement!=1.0){
     Factors = new TString(Form("Lambda%2.1fKaon%2.1fBaryon%2.1f",lambdaFactor,kaonFactor,baryonEnhancement));
   }
-  if(TPC){
-    sprintf(TPCnameeps,"pics/bkgdComponentsErrorsTPC%s.eps",Factors->Data());
-    sprintf(TPCnamepng,"pics/bkgdComponentsErrorsTPC%s.png",Factors->Data());
-    c->SaveAs(TPCnameeps);
-    c->SaveAs(TPCnamepng);
-    sprintf(TPCnameeps,"pics/bkgdComponentsTPC%s.eps",Factors->Data());
-    sprintf(TPCnamepng,"pics/bkgdComponentsTPC%s.png",Factors->Data());
-    c1->SaveAs(TPCnameeps);
-    c1->SaveAs(TPCnamepng);
-  }
-  else{
-    sprintf(ITSnameeps,"pics/bkgdComponentsErrorsITS%s.eps",Factors->Data());
-    sprintf(ITSnamepng,"pics/bkgdComponentsErrorsITS%s.png",Factors->Data());
-    c->SaveAs(ITSnameeps);
-    c->SaveAs(ITSnamepng);
-    sprintf(ITSnameeps,"pics/bkgdComponentsITS%s.eps",Factors->Data());
-    sprintf(ITSnamepng,"pics/bkgdComponentsITS%s.png",Factors->Data());
-    c1->SaveAs(ITSnameeps);
-    c1->SaveAs(ITSnamepng);
-  }
+  TString dir = "/home/madscientistgirl/UTK/Et/aliceet/AN/pics/hadEt";
+  TString detector = "TPC";
+  if(!TPC) detector = "ITS";
+  TString altName = "";
+  if(alt) altName = "Alt";
+  TString bary = "";
+  if(reweight) bary = "Enhanced";
+  gSystem->MakeDirectory(Form("%s/%s",dir.Data(),shortprodname));
+  sprintf(TPCnameeps,"%s/%s/bkgdComponentsErrors%s%s%s%s.eps",dir.Data(),shortprodname,detector.Data(),Factors->Data(),altName.Data(),bary.Data());
+  sprintf(TPCnamepng,"%s/%s/bkgdComponentsErrors%s%s%s%s.png",dir.Data(),shortprodname,detector.Data(),Factors->Data(),altName.Data(),bary.Data());
+  c->SaveAs(TPCnameeps);
+  //c->SaveAs(TPCnamepng);
+  sprintf(TPCnameeps,"%s/%s/bkgdComponents%s%s%s%s.eps",dir.Data(),shortprodname,detector.Data(),Factors->Data(),altName.Data(),bary.Data());
+  sprintf(TPCnamepng,"%s/%s/bkgdComponents%s%s%s%s.png",dir.Data(),shortprodname,detector.Data(),Factors->Data(),altName.Data(),bary.Data());
+  c1->SaveAs(TPCnameeps);
+  //c1->SaveAs(TPCnamepng);
+//   if(TPC){
+//     sprintf(TPCnameeps,"pics/bkgdComponentsErrorsTPC%s.eps",Factors->Data());
+//     sprintf(TPCnamepng,"pics/bkgdComponentsErrorsTPC%s.png",Factors->Data());
+//     c->SaveAs(TPCnameeps);
+//     c->SaveAs(TPCnamepng);
+//     sprintf(TPCnameeps,"pics/bkgdComponentsTPC%s.eps",Factors->Data());
+//     sprintf(TPCnamepng,"pics/bkgdComponentsTPC%s.png",Factors->Data());
+//     c1->SaveAs(TPCnameeps);
+//     c1->SaveAs(TPCnamepng);
+//   }
+//   else{
+//     sprintf(ITSnameeps,"pics/bkgdComponentsErrorsITS%s.eps",Factors->Data());
+//     sprintf(ITSnamepng,"pics/bkgdComponentsErrorsITS%s.png",Factors->Data());
+//     c->SaveAs(ITSnameeps);
+//     c->SaveAs(ITSnamepng);
+//     sprintf(ITSnameeps,"pics/bkgdComponentsITS%s.eps",Factors->Data());
+//     sprintf(ITSnamepng,"pics/bkgdComponentsITS%s.png",Factors->Data());
+//     c1->SaveAs(ITSnameeps);
+//     c1->SaveAs(ITSnamepng);
+//  }
 
+//   TCanvas *c4 = new TCanvas("c4","c4",600,400);
+//   c4->SetTopMargin(0.04);
+//   c4->SetRightMargin(0.04);
+//   c4->SetBorderSize(0);
+//   c4->SetFillColor(0);
+//   c4->SetFillColor(0);
+//   c4->SetBorderMode(0);
+//   c4->SetFrameFillColor(0);
+//   c4->SetFrameBorderMode(0);
+//   Allpt->Draw();
+//   c4->SaveAs("pics/bkgd276ppV07TeVITS.C");
 }
index 7b1e99c..466eb99 100644 (file)
@@ -6,23 +6,28 @@
 //This is not actually what gets used in the correction class AliAnalysisHadEtCorrections - that is done in the macro GetCorrections.C - but this is useful for making plots and playing around with different options
 
 
+//TFile *file = new TFile("rootFiles/LHC11a4_bis/Et.ESD.new.sim.LHC11a4_bis.root");//PbPb
+TFile *file;// = new TFile("rootFiles/LHC11b10a/Et.ESD.new.sim.LHC11b10a.root");//2.76 TeV pp
+//TFile *file = new TFile("rootFiles/LHC10e20/Et.ESD.new.sim.LHC10e20.root");
+TString *empty = new TString("");
+TString *reweighted = new TString("Reweighted");
 
 TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, int marker, bool hadronic, bool reweight,float kaonFactor=1.0, float lambdaFactor = 1.0, float baryonEnhancement = 1.0){
   //TFile *file = new TFile("Et.ESD.new.sim.merged.root");
-  TFile *file = new TFile("Et.ESD.new.sim.LHC10d4.pp.merged.root");
+  //TFile *file = new TFile("Et.ESD.new.sim.LHC10d4.pp.merged.root");
   TList *list = file->FindObject("out2");
-  char *reweightname = "";
-  if(reweight) reweightname = "Reweighted";
+  TString *reweightname = empty;
+  if(reweight) reweightname = reweighted;
   TH2F *numeratorParent; 
   switch(mycase){
   case 0:
-    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda",reweightname)))->Clone("v0");
+    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda",reweightname->Data())))->Clone("v0");
     numeratorParent->Scale(lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda",reweightname)),lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda",reweightname->Data())),lambdaFactor*baryonEnhancement);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname->Data())),kaonFactor);
     break;
   case 1:
-    numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)))->Clone("Knnbar");
+    numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname->Data())))->Clone("Knnbar");
     numeratorParent->Scale(kaonFactor);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"),baryonEnhancement);
@@ -39,20 +44,20 @@ TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, in
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"),baryonEnhancement);
     break;
   case 3:
-    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
+    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname->Data())))->Clone("allneutral");
     numeratorParent->Scale(lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)),lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)),kaonFactor);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname->Data())),lambdaFactor*baryonEnhancement);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname->Data())),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname->Data())),kaonFactor);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"),baryonEnhancement);
     break;
   case 4:
-    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
+    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname->Data())))->Clone("allneutral");
     numeratorParent->Scale(lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)),lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)),kaonFactor);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname->Data())),lambdaFactor*baryonEnhancement);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname->Data())),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname->Data())),kaonFactor);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega"),baryonEnhancement);
@@ -81,12 +86,12 @@ TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, in
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiSigma"),baryonEnhancement);
     break;
   case 8:
-    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
+    numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname->Data())))->Clone("allneutral");
     numeratorParent->Scale(baryonEnhancement);
     numeratorParent->Scale(lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)),lambdaFactor*baryonEnhancement);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)),kaonFactor);
-    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname->Data())),lambdaFactor*baryonEnhancement);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname->Data())),kaonFactor);
+    numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname->Data())),kaonFactor);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"),baryonEnhancement);
     numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega"),baryonEnhancement);
@@ -139,10 +144,10 @@ TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, in
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedKPlus"),kaonFactor);
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedProton"),baryonEnhancement);
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiProton"),baryonEnhancement);
-  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)),lambdaFactor*baryonEnhancement);
-  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)),lambdaFactor*baryonEnhancement);
-  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)),kaonFactor);
-  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)),kaonFactor);
+  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname->Data())),lambdaFactor*baryonEnhancement);
+  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname->Data())),lambdaFactor*baryonEnhancement);
+  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname->Data())),kaonFactor);
+  allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname->Data())),kaonFactor);
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"),baryonEnhancement);
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"),baryonEnhancement);
   allhad->Add((TH2F*) out2->FindObject("EtSimulatedEPlus"));
@@ -165,8 +170,8 @@ TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, in
     allhad->Add((TH2F*) out2->FindObject("EtSimulatedEMinus"));
   }
 
-  numeratorParent->Sumw2();
-  allhad->Sumw2();
+  // numeratorParent->Sumw2();
+  //allhad->Sumw2();
   TH1D *denominator;
   TH1D *numerator;
   if(eta){
@@ -195,11 +200,16 @@ TH1D *GetHisto(float cut = 0.12, char *name, int mycase, bool eta, int color, in
   numerator->SetLineColor(color);
   numerator->SetMarkerStyle(marker);
   //numerator->Draw("e");
+  delete numeratorParent;
+  delete allhad;
+  delete denominator;
+  numerator->SetName(name);
   return numerator;
 
 }
 
-void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4", bool hadronic = false, bool reweighted = false, float kaonFactor=1.0, float lambdaFactor = 1.0, float baryonEnhancement = 1.0){
+void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4",TString filename = "rootFiles/LHC11b10a/Et.ESD.new.sim.LHC11b10a.root", bool hadronic = true, bool reweighted = false, float kaonFactor=1.0, float lambdaFactor = 1.0, float baryonEnhancement = 1.0){
+  file = new TFile(filename.Data());
   gStyle->SetOptTitle(0);
   gStyle->SetOptStat(0);
   gStyle->SetOptFit(0);
@@ -229,6 +239,7 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   int emcalmarker = 24;
   float ptcut1 = 0.05;
   float ptcut2 = 0.1;
+  float ptcut3 = 0.0;
 
   int colortotal = 1;
   int casetotal = 4;
@@ -268,6 +279,8 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   TH1D *pt1em = GetHisto(ptcut2,"pt1em",9,false,colorem,phosmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);
   TH1D *pt2em = GetHisto(ptcut1,"pt2em",9,false,colorem,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);
 
+  TH1D *pt3em = GetHisto(ptcut3,"pt3em",9,false,colorem,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);
+
   PHOStotal->SetMaximum(0.5);
   PHOStotal->SetMinimum(0.0);
   if(hadronic){
@@ -378,7 +391,8 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   }
   TLatex *tex = new TLatex(-.65,.23,Form("%2.5f#pm%2.5f",func->GetParameter(0),func->GetParError(0)));
   tex->Draw();
-
+  cout<<"corr fac "<<Form("%2.5f\$\\pm\$%2.5f",func->GetParameter(0),func->GetParError(0))<<endl;
+  cout<<"factor "<<Form("%2.5f",1- func->GetParameter(0))<<endl;
   TLegend *leg3 = new TLegend(0.539259,0.801734,0.79575,0.949857);
   leg3->AddEntry(pt1total,"p_{T} cut = 0.1");
   leg3->AddEntry(pt2total,"p_{T} cut = 0.05");
@@ -425,18 +439,19 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   sprintf(ptnamepng,"pics/f%spt%s.png",Cut->Data(),Factors->Data());
   sprintf(ptnamepdf,"pics/f%spt%s.pdf",Cut->Data(),Factors->Data());
   sprintf(ptnameC,"pics/f%spt%s.C",Cut->Data(),Factors->Data());
-  sprintf(etanameeps,"pics/f%seta%s.eps",Cut->Data(),Factors->Data());
-  sprintf(etanamepng,"pics/f%seta%s.png",Cut->Data(),Factors->Data());
+  sprintf(etanameeps,"pics/%s/f%seta%s.eps",shortprodname,Cut->Data(),Factors->Data());
+  sprintf(etanamepng,"pics/%s/f%seta%s.png",shortprodname,Cut->Data(),Factors->Data());
   sprintf(etanamepdf,"pics/f%seta%s.pdf",Cut->Data(),Factors->Data());
   sprintf(etanameC,"pics/f%seta%s.C",Cut->Data(),Factors->Data());
-  ptpad->SaveAs(ptnameeps);
-  ptpad->SaveAs(ptnamepng);
-  ptpad->SaveAs(ptnamepdf);
-  ptpad->SaveAs(ptnameC);
+//   ptpad->SaveAs(ptnameeps);
+//   ptpad->SaveAs(ptnamepng);
+//   ptpad->SaveAs(ptnamepdf);
+//   ptpad->SaveAs(ptnameC);
   etapad->SaveAs(etanameeps);
   etapad->SaveAs(etanamepng);
-  etapad->SaveAs(etanamepdf);
-  etapad->SaveAs(etanameC);
+//   etapad->SaveAs(etanamepdf);
+//   etapad->SaveAs(etanameC);
+  return;
 
   TCanvas *c2 = new TCanvas("c2","c2",500,400);
   c2->SetTopMargin(0.03);
@@ -495,6 +510,11 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   TH1D *EMCALEta = GetHisto(ptcut2,"EMCALEta",12,false,TColor::kViolet-3,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//1.7%
   TH1D *EMCALOmega = GetHisto(ptcut2,"EMCALOmega",13,false,TColor::kCyan,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//0.24%
   TH1D *EMCALElectron = GetHisto(ptcut2,"EMCALElectronFrog",14,false,TColor::kGreen+2,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//0.25%
+  TH1D *EMCALGammaptcut3 = GetHisto(ptcut3,"EMCALGamma",10,false,4,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//0.2%
+  TH1D *EMCALPi0ptcut3 = GetHisto(ptcut3,"EMCALPi0",11,false,2,phosmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//24%
+  TH1D *EMCALEtaptcut3 = GetHisto(ptcut3,"EMCALEta3",12,false,TColor::kViolet-3,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//1.7%
+  TH1D *EMCALOmegaptcut3 = GetHisto(ptcut3,"EMCALOmega3",13,false,TColor::kCyan,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//0.24%
+  TH1D *EMCALElectronptcut3 = GetHisto(ptcut3,"EMCALElectron3",14,false,TColor::kGreen+2,emcalmarker,hadronic,reweighted,kaonFactor,lambdaFactor,baryonEnhancement);//0.25%
   //EMCALElectron->Draw();return;
   //EMCALPi0->Draw();return;
   pt1em->SetMinimum(0.0);
@@ -512,7 +532,7 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
   leg20->AddEntry(pt1em,"#gamma#eta#pi^{0}#omega e^{#pm}");
   //leg20->AddEntry(EMCALGamma,"#gamma");
   leg20->AddEntry(EMCALEta,"#eta");
-  //leg20->AddEntry(EMCALOmega,"#omega");
+  leg20->AddEntry(EMCALOmega,"#omega");
   leg20->AddEntry(EMCALPi0,"#pi^{0}");
   leg20->AddEntry(EMCALPiCh,"#pi^{#pm}/2");
   leg20->AddEntry(EMCALElectron,"e^{#pm}");
@@ -546,4 +566,69 @@ void CorrNeutral(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortpro
 
   percentage->Draw();
   percentagepad->SaveAs("pics/ftotalpercentage.eps");
+  TCanvas *omegapad = new TCanvas("omegapad","omegapad",400,400);
+  omegapad->SetTopMargin(0.04);
+  omegapad->SetRightMargin(0.04);
+  omegapad->SetLeftMargin(0.149288);
+  omegapad->SetBorderSize(0);
+  omegapad->SetFillColor(0);
+  omegapad->SetFillColor(0);
+  omegapad->SetBorderMode(0);
+  omegapad->SetFrameFillColor(0);
+  omegapad->SetFrameBorderMode(0);
+  //Virtually all electrons are from Dalitz decays of pi0s.  Some are from Dalitz decays of etas so this is not 100% correct but etas are about 7% of pi0s and Dalitz decays are about 2% of all pi0s, so we have a sub-.2% correction.
+  //EMCALPi0ptcut3->Add(EMCALElectronptcut3);
+  EMCALOmegaptcut3->Divide(pt3em);
+  EMCALPi0ptcut3->Divide(pt3em);
+  EMCALEtaptcut3->Divide(pt3em);
+  EMCALGammaptcut3->Divide(pt3em);
+  EMCALElectronptcut3->Divide(pt3em);
+
+//   EMCALOmegaptcut3->Divide(EMCALPi0ptcut3);
+//   EMCALPi0ptcut3->Divide(EMCALPi0ptcut3);
+//   EMCALEtaptcut3->Divide(EMCALPi0ptcut3);
+//   EMCALGammaptcut3->Divide(EMCALPi0ptcut3);
+//   EMCALElectronptcut3->Divide(EMCALPi0ptcut3);
+
+  //EMCALGammaptcut3->Scale(10);
+  //EMCALOmegaptcut3->Scale(10);
+  //EMCALElectronptcut3->Scale(100);
+  EMCALOmegaptcut3->SetMinimum(0.0);
+  EMCALOmegaptcut3->SetMaximum(2.0);
+  TF1 *omegapercent = new TF1("omegapercent","[0]",-0.6,0.6);
+  TF1 *pi0percent = new TF1("omegapercent","[0]",-0.6,0.6);
+  TF1 *etapercent = new TF1("omegapercent","[0]",-0.6,0.6);
+  TF1 *gammapercent = new TF1("omegapercent","[0]",-0.6,0.6);
+  TF1 *electronpercent = new TF1("omegapercent","[0]",-0.6,0.6);
+  cout<<"Gammas x10"<<endl;
+  EMCALGammaptcut3->Fit(gammapercent,"","",-0.6,0.6);
+  cout<<"Electrons x100"<<endl;
+  EMCALElectronptcut3->Fit(electronpercent,"","",-0.6,0.6);
+  cout<<"Omega x10"<<endl;
+  EMCALOmegaptcut3->Fit(omegapercent,"","",-0.6,0.6);
+  cout<<"Eta"<<endl;
+  EMCALEtaptcut3->Fit(etapercent,"","",-0.6,0.6);
+  cout<<"Pi0"<<endl;
+  EMCALPi0ptcut3->Fit(pi0percent,"","",-0.6,0.6);
+  EMCALOmegaptcut3->Draw();
+  EMCALPi0ptcut3->Draw("same");
+  EMCALEtaptcut3->Draw("same");
+  EMCALGammaptcut3->Draw("same");
+  EMCALElectronptcut3->Draw("same");
+
+  TLegend *leg20 = new TLegend(0.194444,0.215054,0.449495,0.430108);
+  leg20->AddEntry(EMCALPi0ptcut3,"#pi^{0}");
+  leg20->AddEntry(EMCALEtaptcut3,"#eta");
+  leg20->AddEntry(EMCALOmegaptcut3,"#omega");
+  leg20->AddEntry(EMCALGammaptcut3,"#gamma");
+//   leg20->AddEntry(EMCALOmegaptcut3,"#omega x10");
+//   leg20->AddEntry(EMCALGammaptcut3,"#gamma x10");
+//   leg20->AddEntry(EMCALElectronptcut3,"e^{#pm} x100");
+  leg20->SetFillStyle(0);
+  leg20->SetFillColor(0);
+  leg20->SetBorderSize(0);
+  leg20->SetTextSize(0.0548607);
+  leg20->Draw();
+
+
 }
index 9e3b25d..8681d3c 100644 (file)
@@ -1,6 +1,12 @@
+//Christine Nattrass, University of Tennessee at Knoxville
+//This macro is for calculating the correction for the pT cut-off and its systematic error
+//Uses the output of AliAnalysisTaskHadEt
+//This is not actually what gets used in the correction class AliAnalysisHadEtCorrections - that is done in the macro GetCorrections.C - but this is useful for making plots and playing around with different options
+
 float mean=0;
 float highbound=0;
 float lowbound=0;
+float syserr = 0;
 
 TH1D *GetHisto(float ptcut = 0.15, char *name, char *filename, float etacut){
   TFile *file = new TFile(filename);
@@ -54,7 +60,11 @@ TH1D *GetHisto(float ptcut = 0.15, char *name, char *filename, float etacut){
   cout<<"fpTcut = "<<mean<<","<<lowbound<<","<<highbound<<endl;
   cout<<"1/fpTcut = "<<1.0/mean<<","<<1.0/lowbound<<","<<1.0/highbound<<endl;
   //cout<<"fpTcut = "<<mean<<"-"<<mean-lowbound<<"+"<<highbound-mean<<endl;
-  cout<<Form("%2.5f_{+%2.5f}_{-%2.5f}",mean,highbound-mean,mean-lowbound)<<endl;
+  syserr = highbound-mean;
+  if(mean-lowbound>syserr) syserr = mean-lowbound;
+  cout<<Form("%2.4f^{+%2.4f}_{-%2.4f}",mean,highbound-mean,mean-lowbound)<<endl;
+  cout<<"latex here ";
+  cout<<Form("%2.4f \\pm %2.4f",mean,syserr)<<endl;
   cout<<"1/fpTcut = "<<1.0/mean<<"+"<<1.0/lowbound-1.0/mean<<"-"<<1.0/mean-1.0/highbound<<endl;
   numerator->SetYTitle("E_{T}^{had, p_{T}<cut-off}/E_{T}^{had, all p_{T}}");
   numerator->GetYaxis()->SetTitleOffset(1.);
@@ -69,11 +79,6 @@ TH1D *GetHisto(float ptcut = 0.15, char *name, char *filename, float etacut){
   return numerator;
 
 }
-//Christine Nattrass, University of Tennessee at Knoxville
-//This macro is for calculating the correction for the pT cut-off and its systematic error
-//Uses the output of AliAnalysisTaskHadEt
-//This is not actually what gets used in the correction class AliAnalysisHadEtCorrections - that is done in the macro GetCorrections.C - but this is useful for making plots and playing around with different options
-
 void CorrPtCut(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4", char *filename="Et.ESD.new.sim.LHC10d4.pp.merged.root"){
 
   gStyle->SetOptTitle(0);
@@ -91,22 +96,33 @@ void CorrPtCut(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodn
   c->SetFrameFillColor(0);
   c->SetFrameBorderMode(0);
   float etacut = 0.7;
+  cout<<"Pt cut = 150 MeV/c"<<endl;
   TH1D *High = GetHisto(0.15-.001,"High",filename,etacut);
   float tpcHigh=highbound;
   float tpcLow=lowbound;
+  float tpcsyserr = syserr;
+  float tpcmean = mean;
   float x1 = High->GetXaxis()->GetBinLowEdge(1);
-  TBox *tpcBox = new TBox(-x1*.99,1.0-tpcLow,x1*.99,1.0-tpcHigh);
+  //TBox *tpcBox = new TBox(-x1*.99,1.0-tpcLow,x1*.99,1.0-tpcHigh);
+  TBox *tpcBox = new TBox(-x1*.99,1.0-(mean-syserr),x1*.99,1.0-(mean+syserr));
   tpcBox->SetFillColor(5);
   tpcBox->SetLineColor(0);
   tpcBox->SetFillStyle(1001);
+  cout<<"Pt cut = 100 MeV/c"<<endl;
   TH1D *Low = GetHisto(0.1-.001,"Low",filename,etacut);
   float itsHigh=highbound;
   float itsLow=lowbound;
+  float itssyserr = syserr;
+  float itsmean = mean;
+
+  cout<<Form("dataset & %2.4f \\pm %2.4f &  %2.4f \\pm %2.4f \\",itsmean,itssyserr,tpcmean,tpcsyserr)<<endl;
   float x = Low->GetXaxis()->GetBinLowEdge(1);
-  TBox *itsBox = new TBox(-x*.99,1.0-itsLow,x*.99,1.0-itsHigh);
+  //TBox *itsBox = new TBox(-x*.99,1.0-itsLow,x*.99,1.0-itsHigh);
+  TBox *itsBox = new TBox(-x1*.99,1.0-(mean-syserr),x1*.99,1.0-(mean+syserr));
   itsBox->SetFillColor(5);
   itsBox->SetLineColor(0);
   itsBox->SetFillStyle(1001);
+  cout<<"Pt cut = 50 MeV/c"<<endl;
   TH1D *Lowest = GetHisto(0.05-.001,"Lowest",filename,etacut);
   TF1 *funcLow = new TF1("funcLow","[0]",-.7,.7);
   funcLow->SetParameter(0,0.01);
@@ -114,7 +130,7 @@ void CorrPtCut(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodn
   TF1 *funcHigh = new TF1("funcHigh","[0]",-.7,.7);
   funcHigh->SetParameter(0,0.02);
   High->Fit(funcLow);
-  High->SetMaximum(0.04);
+  High->SetMaximum(0.06);
   High->SetMinimum(0.0);
   High->SetMarkerColor(2);
   Low->SetMarkerColor(4);
@@ -131,7 +147,7 @@ void CorrPtCut(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodn
   //return;
   Low->Draw("same");
   //Lowest->Draw("same");
-  TLatex *tex = new TLatex(-0.723444,0.0373593,prodname);
+  TLatex *tex = new TLatex(-0.723444,0.0373593+0.019,prodname);
   tex->SetTextSize(0.0537634);
   tex->Draw();
   TLegend *leg = new TLegend(0.217742,0.696237,0.477823,0.873656);
index 623c140..707bdc8 100644 (file)
@@ -18,7 +18,7 @@ TH1D *PbPb276ITSBkgd();
    Double_t xAxis1[112] = {0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.22, 0.24, 0.26, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.52, 0.54, 0.56, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.7, 0.72, 0.74, 0.76, 0.78, 0.8, 0.82, 0.84, 0.86, 0.88, 0.9, 0.92, 0.94, 0.96, 0.98, 1, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45, 1.5, 1.55, 1.6, 1.65, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 12, 14, 16, 18, 20, 25}; 
    
 
-Float_t CorrNeutral(float ptcut, char *prodname, char *shortprodname, bool ispp = true, bool forSim = true, bool TPC, bool hadronic = false, float etacut = 0.7);
+Float_t CorrNeutral(float ptcut, char *prodname, char *shortprodname, bool ispp = true, bool forSim = true, bool TPC, bool hadronic = false, float etacut = 0.7, int dataset);
 TH1D *GetHistoCorrNeutral(float cut, char *name, bool ispp, bool forSim, int mycase, bool eta, int color, int marker, bool hadronic = false);
 
 Float_t CorrPtCut(float ptcut, char *prodname = "Enter Production Name", char *shortprodname = "EnterProductionName", bool ispp = true, bool forSim = true, int mycase = 0);
@@ -79,7 +79,10 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
    char *sim = "ForData";
    if(forSim) sim = "ForSimulations";
    char *system = "PbPb";
-   if(ispp) system = "pp";
+   if(ispp){
+     system = "pp";
+     if(dataset==2013) system = "pPb";
+   }
    sprintf(outfilename,"rootFiles/corrections/corrections.%s.%s.%s.root",shortprodname,system,sim);
    TFile *outfile = new TFile(outfilename,"RECREATE");
    AliAnalysisHadEtCorrections *hadCorrectionEMCAL = new AliAnalysisHadEtCorrections();
@@ -99,7 +102,7 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
    hadCorrectionEMCAL->SetAcceptanceCorrectionEMCAL(360.0/60.0);
 
    float ptcut = 0.1;
-   float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut);
+   float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut,dataset);
    hadCorrectionEMCAL->SetNeutralCorrection(neutralCorr);
    //Using error from data, see analysis note for details
    if(ispp){
@@ -111,7 +114,7 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
      hadCorrectionEMCAL->SetNeutralCorrectionHighBound(neutralCorr*(1.0+0.049));
    }
 
-   float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut);
+   float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut,dataset);
    hadCorrectionEMCAL->SetNotHadronicCorrection(hadronicCorr);
    if(ispp){
      hadCorrectionEMCAL->SetNotHadronicCorrectionLowBound(hadronicCorr*(1.0-0.008));
@@ -286,6 +289,8 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
      bkgdpcterror = 0.38;
      break;
    case 2010:
+   case 2012:
+   case 2013:
      bkgdpcterror = 0.13;
      break;
    case 20100:
@@ -323,7 +328,7 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
    hadCorrectionPHOS->SetAcceptanceCorrectionEMCAL(360.0/60.0);
 
    float ptcut = 0.1;
-   float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut);
+   float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut,dataset);
    hadCorrectionPHOS->SetNeutralCorrection(neutralCorr);
    //Using error from data, see analysis note for details
    if(ispp){
@@ -335,7 +340,7 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
      hadCorrectionPHOS->SetNeutralCorrectionHighBound(neutralCorr*(1.0+0.049));
    }
 
-   float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut);
+   float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut,dataset);
    hadCorrectionPHOS->SetNotHadronicCorrection(hadronicCorr);
    if(ispp){
      hadCorrectionPHOS->SetNotHadronicCorrectionLowBound(neutralCorr*(1.0-0.008));
@@ -518,22 +523,17 @@ void GetCorrections(char *prodname = "Enter Production Name", char *shortprodnam
 }
 
 //==================================CorrNeutral==============================================
-Float_t CorrNeutral(float ptcut, char *prodname, char *shortprodname, bool ispp, bool forSim, bool TPC, bool hadronic, float etacut){
+Float_t CorrNeutral(float ptcut, char *prodname, char *shortprodname, bool ispp, bool forSim, bool TPC, bool hadronic, float etacut, int dataset){
   if(!forSim){//for data we have evaluated the neutral correction from ALICE data
     if(hadronic){//for tot et from had et
-      if(ispp){
-       return 1.0/0.571;
-      }
-      else{
-       return 1.0/0.549;
-      }
+      return 0.581;
     }
     else{//for had et only
-      if(ispp){
-       return 1.0/0.736;
+      if(dataset==2009){
+       return 1.0/0.7571;
       }
       else{
-       return 1.0/0.689;
+       return 1.0/0.755;
       }
     }
   }
@@ -1097,7 +1097,7 @@ Float_t CorrNotIDConst(float ptcut, float etacut,char *name, char *prodname, cha
       return 0.996;
     }
     else{
-      return 0.976;
+      return 0.992;
     }
   }
   gStyle->SetOptTitle(0);
index 4f09e57..cd862c2 100644 (file)
@@ -2,8 +2,13 @@
 //This macro is for  plotting the dE/dx from the TPC as used for particle identification for the transverse energy analysis
 //Particles identified are colored
 //Uses the output of AliAnalysisTaskHadEt
+void Rebin(TH2F *histo){
+  //cout<<"Nbins x "<<histo->GetNbinsX()<<" y "<<histo->GetNbinsY()<<endl;
+  histo->Rebin2D(1,5);
+  //histo->SetAxisRange(0.1,1.5);
+}
 
-void dEdx(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4",bool TPC = true, char *filename="Et.ESD.new.sim.LHC10d4.pp.merged.root"){
+void dEdx(char *prodname = "LHC11b1a PYTHIA 7 TeV p+p", char *shortprodname = "LHC11b1a",bool TPC = true, char *filename="rootFiles/LHC11b1a/Et.ESD.new.sim.LHC11b1a.root",bool data = true){
   TFile *file =  new TFile(filename);
   if(!file){
     cerr<<"Error, no file found"<<endl;
@@ -11,12 +16,15 @@ void dEdx(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname =
   }
 
   char *myname = "ITS";
-  if(TPC) myname = "TPC";
-  TH2F *all = out2->FindObject(Form("dEdxAll%s",myname));
-  TH2F *pi = out2->FindObject(Form("dEdxPion%s",myname));
-  TH2F *k = out2->FindObject(Form("dEdxKaon%s",myname));
-  TH2F *p = out2->FindObject(Form("dEdxProton%s",myname));
-  TH2F *e = out2->FindObject(Form("dEdxElectron%s",myname));
+  if(TPC) myname = "TPCITS";
+  cout<<"Using "<<Form("dEdxAll%s",myname)<<endl;
+  TString datastring = "";
+  if(data) datastring = "Data";
+  TH2F *all = out2->FindObject(Form("dEdx%sAll%s",datastring.Data(),myname));
+  TH2F *pi = out2->FindObject(Form("dEdx%sPion%s",datastring.Data(),myname));
+  TH2F *k = out2->FindObject(Form("dEdx%sKaon%s",datastring.Data(),myname));
+  TH2F *p = out2->FindObject(Form("dEdx%sProton%s",datastring.Data(),myname));
+  TH2F *e = out2->FindObject(Form("dEdx%sElectron%s",datastring.Data(),myname));
   gStyle->SetPalette(1);
   pi->SetMarkerColor(2);
   k->SetMarkerColor(3);
@@ -51,10 +59,10 @@ void dEdx(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname =
   c->SetFrameBorderMode(0);
   c->SetLogx();
   all->Draw();
+  //e->Draw("same");
   pi->Draw("same");
   k->Draw("same");
   p->Draw("same");
-  e->Draw("same");
   TLegend *leg = new  TLegend(0.825503,0.768817,0.963087,0.954301);
  leg->AddEntry(pi,"#pi^{#pm}","F");
  leg->AddEntry(k,"K^{#pm}","F");
@@ -65,15 +73,34 @@ void dEdx(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname =
   leg->SetBorderSize(0);
  leg->Draw();
 
+  Rebin(all);
+  Rebin(pi);
+  Rebin(k);
+  Rebin(p);
+  Rebin(e);
+  //all->SetAxisRange(0.12,1.5);
+  if(!TPC){all->GetXaxis()->SetRange(all->GetXaxis()->FindBin(0.05));}
+  else{all->GetXaxis()->SetRange(all->GetXaxis()->FindBin(0.1));}
 
  float y = 141.021;
  if(!TPC) y = 463.693;
  TLatex *tex = new TLatex(0.119617,y,prodname);
   tex->SetTextSize(0.0537634);
   tex->Draw();
+  TString dir = "pics";
+  TString detector = "";
+  if(!TPC) detector = "ITS";
+  gSystem->MakeDirectory(Form("%s/%s",dir.Data(),shortprodname));
+  c->Print(Form("%s/%s/dEdx%s.pdf",dir.Data(),shortprodname,detector.Data()));
+  c->Print(Form("%s/%s/dEdx%s.png",dir.Data(),shortprodname,detector.Data()));
+  c->Print(Form("%s/%s/dEdx%s.eps",dir.Data(),shortprodname,detector.Data()));
+  c->Print(Form("%s/%s/dEdx%s.jpg",dir.Data(),shortprodname,detector.Data()));
+  return;
+
   if(TPC){
     c->SaveAs(Form("pics/%s/dEdx.eps",shortprodname));
     c->SaveAs(Form("pics/%s/dEdx.png",shortprodname));
+    c->SaveAs(Form("pics/%s/dEdx.C",shortprodname));
   }
   else{
     c->SaveAs(Form("pics/%s/dEdxITS.eps",shortprodname));