1 //Create by Christine Nattrass, Rebecca Scott, Irakli Martashvili
2 //University of Tennessee at Knoxville
3 //This macro takes an input file created by AliAnalysisHadEtMonteCarlo and creates an AliAnalysisHadEtCorrections for the determination of the corrected Et
6 // #include "AliAnalysisHadEtCorrections.h"
10 // #include <TSystem.h>
11 // #include "TStopwatch.h"
13 //Corrections added in by hand to deal with the inadequacies of PYTHIA and HIJING
16 TH1D *PbPb276TPCBkgd();
17 TH1D *PbPb276ITSBkgd();
18 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};
21 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);
22 TH1D *GetHistoCorrNeutral(float cut, char *name, bool ispp, bool forSim, int mycase, bool eta, int color, int marker, bool hadronic = false);
24 Float_t CorrPtCut(float ptcut, char *prodname = "Enter Production Name", char *shortprodname = "EnterProductionName", bool ispp = true, bool forSim = true, int mycase = 0);
25 TH1D *GetHistoCorrPtCut(float ptcut = 0.15, char *name, bool ispp = true, bool forSim = true, int mycase);
27 TH1D *GetHistoCorrNotID(float etacut,char *name, bool TPC, bool eta, bool ispp = true, bool forSim = true);
28 TH1D *CorrNotID(float etacut,char *name, char *prodname, char *shortprodname, bool TPC, bool ispp = true, bool forSim = true);
29 Float_t CorrNotIDConst(float ptcut, float etacut,char *name, char *prodname, char *shortprodname, bool TPC, bool ispp, bool forSim);
31 TH1D *GetHistoNoID(float etacut, char *name, bool eta, bool TPC, bool ispp, bool forSim);
32 TH1D *CorrNoID(float etacut,char *name, char *prodname, char *shortprodname, bool ispp, bool forSim);
33 Float_t CorrNoIDConst(float etacut, float ptcut,char *name, char *prodname, char *shortprodname, bool ispp, bool forSim);
35 TH1D* bayneseffdiv(TH1D* numerator, TH1D* denominator,Char_t* name);
36 TH1D *GetHistoEfficiency(float cut, char *name, int mycase, int color, int marker,bool TPC, bool ITS, int cb = -1, int cblast = -1);
37 void CorrEfficiencyPlots(bool TPC, char *prodname, char *shortprodname);
39 TH1D *GetHistoCorrBkgd(float etacut,char *name, bool TPC,bool ispp,bool forSim);
40 void CorrBkgdPlots(char *prodname, char *shortprodname, bool TPC,bool ispp,bool forSim);
42 //Some variables that we'll use multiple times. We'll declare them here since they don't seem to delete right in the functions
47 TFile *file = NULL;//initiated in main function
48 const char *mynameTPC = "TPC";
49 const char *mynameITS = "ITS";
50 const char *mynameTPCITS = "TPCITS";
51 const char *detectorEMCAL = "EMCAL";
52 const char *detectorPHOS = "PHOS";
53 const char *reweightedNo = "";
54 const char *reweightedYes = "Reweighted";
56 //===========================================================================================
58 void GetCorrections(char *prodname = "Enter Production Name", char *shortprodname = "EnterProductionName", bool ispp = true, bool forSim = true, bool TPC = true, char *infilename="Et.ESD.new.sim.merged.root", int dataset = 2009){
61 gSystem->Load("libTree.so");
62 gSystem->Load("libGeom.so");
63 gSystem->Load("libVMC.so");
64 gSystem->Load("libXMLIO.so");
66 gSystem->Load("libSTEERBase.so");
67 gSystem->Load("libESD.so");
68 gSystem->Load("libAOD.so");
70 gSystem->Load("libANALYSIS");
71 gSystem->Load("libANALYSISalice");
73 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
74 gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
75 gROOT->ProcessLine(".L AliAnalysisHadEtCorrections.cxx+g");
76 file = new TFile(infilename);
78 char outfilename[200];
79 char *sim = "ForData";
80 if(forSim) sim = "ForSimulations";
81 char *system = "PbPb";
84 if(dataset==2013) system = "pPb";
86 sprintf(outfilename,"rootFiles/corrections/corrections.%s.%s.%s.root",shortprodname,system,sim);
87 TFile *outfile = new TFile(outfilename,"RECREATE");
88 AliAnalysisHadEtCorrections *hadCorrectionEMCAL = new AliAnalysisHadEtCorrections();
89 hadCorrectionEMCAL->SetName("hadCorrectionEMCAL");
91 hadCorrectionEMCAL->SetEtaCut(etacut);
92 hadCorrectionEMCAL->IsData(!forSim);
93 hadCorrectionEMCAL->IsEMCal(kTRUE);
94 hadCorrectionEMCAL->SetProduction(shortprodname);
95 hadCorrectionEMCAL->SetProductionDescription(prodname);
96 hadCorrectionEMCAL->SetDataSet(dataset);
97 //float etacut = hadCorrectionEMCAL->GetEtaCut();
98 //cout<<"eta cut is "<<etacut<<endl;
99 hadCorrectionEMCAL->SetAcceptanceCorrectionFull(1.0);
100 cout<<"Warning: Acceptance corrections will have to be updated to include real acceptance maps of the EMCAL"<<endl;
101 hadCorrectionEMCAL->SetAcceptanceCorrectionPHOS(360.0/60.0);
102 hadCorrectionEMCAL->SetAcceptanceCorrectionEMCAL(360.0/60.0);
105 float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut,dataset);
106 hadCorrectionEMCAL->SetNeutralCorrection(neutralCorr);
107 //Using error from data, see analysis note for details
109 hadCorrectionEMCAL->SetNeutralCorrectionLowBound(neutralCorr*(1.0-0.014));
110 hadCorrectionEMCAL->SetNeutralCorrectionHighBound(neutralCorr*(1.0+0.014));
113 hadCorrectionEMCAL->SetNeutralCorrectionLowBound(neutralCorr*(1.0-0.049));
114 hadCorrectionEMCAL->SetNeutralCorrectionHighBound(neutralCorr*(1.0+0.049));
117 float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut,dataset);
118 hadCorrectionEMCAL->SetNotHadronicCorrection(hadronicCorr);
120 hadCorrectionEMCAL->SetNotHadronicCorrectionLowBound(hadronicCorr*(1.0-0.008));
121 hadCorrectionEMCAL->SetNotHadronicCorrectionHighBound(hadronicCorr*(1.0+0.008));
124 hadCorrectionEMCAL->SetNotHadronicCorrectionLowBound(hadronicCorr*(1.0-0.023));
125 hadCorrectionEMCAL->SetNotHadronicCorrectionHighBound(hadronicCorr*(1.0+0.023));
127 float ptcutITS = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim);
128 hadCorrectionEMCAL->SetpTCutCorrectionITS(ptcutITS);
129 float ptcutTPC = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim);
130 hadCorrectionEMCAL->SetpTCutCorrectionTPC(ptcutTPC);
131 float ptcutITSLow = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim,-1);
132 float ptcutTPCLow = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim,-1);
133 hadCorrectionEMCAL->SetpTCutCorrectionITSLowBound(ptcutITSLow);
134 hadCorrectionEMCAL->SetpTCutCorrectionTPCLowBound(ptcutTPCLow);
135 float ptcutITSHigh = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim,1);
136 float ptcutTPCHigh = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim,1);
137 hadCorrectionEMCAL->SetpTCutCorrectionITSHighBound(ptcutITSHigh);
138 hadCorrectionEMCAL->SetpTCutCorrectionTPCHighBound(ptcutTPCHigh);
140 TH1D *NotIDTPC = CorrNotID(etacut,"CorrNotIDEMCALTPC",prodname,shortprodname,true,ispp,forSim);
141 TH1D *NotIDITS = CorrNotID(etacut,"CorrNotIDEMCALITS",prodname,shortprodname,false,ispp,forSim);
142 hadCorrectionEMCAL->SetNotIDCorrectionTPC(NotIDTPC);
143 hadCorrectionEMCAL->SetNotIDCorrectionITS(NotIDITS);
145 Float_t NotIDConstTPC = CorrNotIDConst(0.15,etacut,"CorrNotIDEMCALTPC2",prodname,shortprodname,true,ispp,forSim);
146 Float_t NotIDConstITS = CorrNotIDConst(0.10,etacut,"CorrNotIDEMCALTPC2",prodname,shortprodname,true,ispp,forSim);
147 hadCorrectionEMCAL->SetNotIDConstCorrectionTPC(1.0/NotIDConstTPC);
148 hadCorrectionEMCAL->SetNotIDConstCorrectionITS(1.0/NotIDConstITS);
150 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCLowBound(1./NotIDConstTPC*(1.0-0.010));
151 hadCorrectionEMCAL->SetNotIDConstCorrectionITSLowBound(1./NotIDConstITS*(1.0-0.010));
152 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCHighBound(1./NotIDConstTPC*(1.0+0.010));
153 hadCorrectionEMCAL->SetNotIDConstCorrectionITSHighBound(1./NotIDConstITS*(1.0+0.010));
156 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCLowBound(1./NotIDConstTPC*(1.0-0.022));
157 hadCorrectionEMCAL->SetNotIDConstCorrectionITSLowBound(1./NotIDConstITS*(1.0-0.022));
158 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCHighBound(1./NotIDConstTPC*(1.0+0.022));
159 hadCorrectionEMCAL->SetNotIDConstCorrectionITSHighBound(1./NotIDConstITS*(1.0+0.022));
162 TH1D *NoID = CorrNoID(etacut,"CorrNoIDEMCAL",prodname,shortprodname,ispp,forSim);
163 hadCorrectionEMCAL->SetNotIDCorrectionNoPID(NoID);
165 Float_t NoIDTPC = CorrNoIDConst(etacut,0.15,"CorrNoIDEMCAL2",prodname,shortprodname,ispp,forSim);
166 Float_t NoIDITS = CorrNoIDConst(etacut,0.1,"CorrNoIDEMCAL2",prodname,shortprodname,ispp,forSim);
167 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCNoID(1./NoIDTPC);
168 hadCorrectionEMCAL->SetNotIDConstCorrectionITSNoID(1./NoIDITS);
169 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCNoIDLowBound(1./NoIDTPC*.98);
170 hadCorrectionEMCAL->SetNotIDConstCorrectionITSNoIDLowBound(1./NoIDITS*.98);
171 hadCorrectionEMCAL->SetNotIDConstCorrectionTPCNoIDHighBound(1./NoIDTPC*1.02);
172 hadCorrectionEMCAL->SetNotIDConstCorrectionITSNoIDHighBound(1./NoIDITS*1.02);
174 //Here we're going to do a bit of a cheat. We want the efficiency for ITS standalone tracks + TPC+ITS tracks. This is returned by the function for the efficiency function if I ask for ITS only efficiency. Had I known how this worked I probably would have written the code differently... but...
175 //anyhow I left a switch for changing it back.
176 bool useITSStandalone = false;
177 TH1D *efficiencyPionTPC = GetHistoEfficiency(etacut,"hEfficiencyPionTPC",1,1,20,useITSStandalone,true);
178 hadCorrectionEMCAL->SetEfficiencyPionTPC(efficiencyPionTPC);
179 TH1D *efficiencyKaonTPC = GetHistoEfficiency(etacut,"hEfficiencyKaonTPC",2,1,20,useITSStandalone,true);
180 hadCorrectionEMCAL->SetEfficiencyKaonTPC(efficiencyKaonTPC);
181 TH1D *efficiencyProtonTPC = GetHistoEfficiency(etacut,"hEfficiencyProtonTPC",3,1,20,useITSStandalone,true);
182 hadCorrectionEMCAL->SetEfficiencyProtonTPC(efficiencyProtonTPC);
183 TH1D *efficiencyHadronTPC = GetHistoEfficiency(etacut,"hEfficiencyHadronTPC",0,1,20,useITSStandalone,true);
184 hadCorrectionEMCAL->SetEfficiencyHadronTPC(efficiencyHadronTPC);
185 TH1D *efficiencyPionITS = GetHistoEfficiency(etacut,"hEfficiencyPionITS",1,1,20,false,true);
186 hadCorrectionEMCAL->SetEfficiencyPionITS(efficiencyPionITS);
187 TH1D *efficiencyKaonITS = GetHistoEfficiency(etacut,"hEfficiencyKaonITS",2,1,20,false,true);
188 hadCorrectionEMCAL->SetEfficiencyKaonITS(efficiencyKaonITS);
189 TH1D *efficiencyProtonITS = GetHistoEfficiency(etacut,"hEfficiencyProtonITS",3,1,20,false,true);
190 hadCorrectionEMCAL->SetEfficiencyProtonITS(efficiencyProtonITS);
191 TH1D *efficiencyHadronITS = GetHistoEfficiency(etacut,"hEfficiencyHadronITS",0,1,20,false,true);
192 hadCorrectionEMCAL->SetEfficiencyHadronITS(efficiencyHadronITS);
195 TH1D *efficiencyPionTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB0",1,1,20,useITSStandalone,true,0,4);
196 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB0->Clone(Form("Test%i",i)),i);
197 TH1D *efficiencyPionTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB5",1,1,20,useITSStandalone,true,5,9);
198 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB5->Clone(Form("Test%i",i)),i);
199 TH1D *efficiencyPionTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB10",1,1,20,useITSStandalone,true,10,15);
200 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB10->Clone(Form("Test%i",i)),i);
202 TH1D *efficiencyKaonTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB0",2,1,20,useITSStandalone,true,0,4);
203 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB0->Clone(Form("Test%i",i)),i);
204 TH1D *efficiencyKaonTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB5",2,1,20,useITSStandalone,true,5,9);
205 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB5->Clone(Form("Test%i",i)),i);
206 TH1D *efficiencyKaonTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB10",2,1,20,useITSStandalone,true,10,15);
207 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB10->Clone(Form("Test%i",i)),i);//Kaon
209 TH1D *efficiencyProtonTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB0",3,1,20,useITSStandalone,true,0,4);
210 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB0->Clone(Form("Test%i",i)),i);
211 TH1D *efficiencyProtonTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB5",3,1,20,useITSStandalone,true,5,9);
212 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB5->Clone(Form("Test%i",i)),i);
213 TH1D *efficiencyProtonTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB10",3,1,20,useITSStandalone,true,10,15);
214 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB10->Clone(Form("Test%i",i)),i);//Proton
216 TH1D *efficiencyHadronTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB0",0,1,20,useITSStandalone,true,0,4);
217 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB0->Clone(Form("Test%i",i)),i);
218 TH1D *efficiencyHadronTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB5",0,1,20,useITSStandalone,true,5,9);
219 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB5->Clone(Form("Test%i",i)),i);
220 TH1D *efficiencyHadronTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB10",0,1,20,useITSStandalone,true,10,15);
221 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB10->Clone(Form("Test%i",i)),i);//Hadron
224 TH1D *efficiencyPionITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB0",1,1,20,false,true,0,4);
225 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB0->Clone(Form("Test%i",i)),i);
226 TH1D *efficiencyPionITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB5",1,1,20,false,true,5,9);
227 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB5->Clone(Form("Test%i",i)),i);
228 TH1D *efficiencyPionITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB10",1,1,20,false,true,10,15);
229 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB10->Clone(Form("Test%i",i)),i);//Pion
231 TH1D *efficiencyKaonITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB0",2,1,20,false,true,0,4);
232 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB0->Clone(Form("Test%i",i)),i);
233 TH1D *efficiencyKaonITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB5",2,1,20,false,true,5,9);
234 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB5->Clone(Form("Test%i",i)),i);
235 TH1D *efficiencyKaonITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB10",2,1,20,false,true,10,15);
236 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB10->Clone(Form("Test%i",i)),i);//Kaon
238 TH1D *efficiencyProtonITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB0",3,1,20,false,true,0,4);
239 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB0->Clone(Form("Test%i",i)),i);
240 TH1D *efficiencyProtonITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB5",3,1,20,false,true,5,9);
241 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB5->Clone(Form("Test%i",i)),i);
242 TH1D *efficiencyProtonITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB10",3,1,20,false,true,10,15);
243 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB10->Clone(Form("Test%i",i)),i);//Proton
245 TH1D *efficiencyHadronITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB0",0,1,20,false,true,0,4);
246 for(int i=0;i<=4;i++) hadCorrectionEMCAL->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB0->Clone(Form("Test%i",i)),i);
247 TH1D *efficiencyHadronITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB5",0,1,20,false,true,5,9);
248 for(int i=5;i<=9;i++) hadCorrectionEMCAL->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB5->Clone(Form("Test%i",i)),i);
249 TH1D *efficiencyHadronITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB10",0,1,20,false,true,10,15);
250 for(int i=10;i<=20;i++) hadCorrectionEMCAL->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB10->Clone(Form("Test%i",i)),i);//Hadron
252 hadCorrectionEMCAL->SetEfficiencyErrorLowBound(0.95);
253 hadCorrectionEMCAL->SetEfficiencyErrorHighBound(1.05);
255 //CorrEfficiencyPlots(true,prodname,shortprodname);
256 //CorrEfficiencyPlots(false,prodname,shortprodname,infilename);
259 //hadCorrectionEMCAL->GetEfficiencyHadronTPC()->Draw();
262 if((dataset==20111 || dataset==20100|| dataset==2011) && !forSim){//2.76 TeV p+p or Pb+Pb
264 cout<<"Fixing 2.76 TeV p+p background to be average of 900 GeV and 7 TeV scaling"<<endl;
265 backgroundTPC = pp276TPCBkgd();
266 backgroundTPC->SetName("hBackgroundTPC");
267 backgroundITS = pp276ITSBkgd();
268 backgroundITS->SetName("hBackgroundITS");
271 cout<<"Fixing 2.76 TeV Pb+Pb background to be average of 900 GeV and 7 TeV scaling with baryon enhancement"<<endl;
272 backgroundTPC = pp276TPCBkgd();
273 backgroundTPC->SetName("hBackgroundTPC");
274 //ITS background is currently a placeholder
275 backgroundITS = GetHistoCorrBkgd(etacut,"hBackgroundITS",false,ispp,forSim);
279 backgroundTPC = GetHistoCorrBkgd(etacut,"hBackgroundTPC",true,ispp,forSim);
280 backgroundITS = GetHistoCorrBkgd(etacut,"hBackgroundITS",false,ispp,forSim);
282 float bkgdpcterror = 0.0;
300 hadCorrectionEMCAL->SetBackgroundCorrectionTPC(backgroundTPC);
301 hadCorrectionEMCAL->SetBackgroundCorrectionITS(backgroundITS);
302 hadCorrectionEMCAL->SetBackgroundErrorLowBound(1.0-bkgdpcterror/100.0);
303 hadCorrectionEMCAL->SetBackgroundErrorHighBound(1.0+bkgdpcterror/100.0);
304 //CorrBkgdPlots(prodname,shortprodname,true,ispp,forSim);
305 //CorrBkgdPlots(prodname,shortprodname,false,ispp,forSim);
307 hadCorrectionEMCAL->Report();
310 hadCorrectionEMCAL->Write();
312 delete hadCorrectionEMCAL;
314 AliAnalysisHadEtCorrections *hadCorrectionPHOS = new AliAnalysisHadEtCorrections();
315 hadCorrectionPHOS->SetName("hadCorrectionPHOS");
317 hadCorrectionPHOS->SetEtaCut(etacut);
318 hadCorrectionPHOS->IsData(!forSim);
319 hadCorrectionPHOS->IsEMCal(kTRUE);
320 hadCorrectionPHOS->SetProduction(shortprodname);
321 hadCorrectionPHOS->SetProductionDescription(prodname);
322 hadCorrectionPHOS->SetDataSet(dataset);
323 //float etacut = hadCorrectionPHOS->GetEtaCut();
324 //cout<<"eta cut is "<<etacut<<endl;
325 hadCorrectionPHOS->SetAcceptanceCorrectionFull(1.0);
326 cout<<"Warning: Acceptance corrections will have to be updated to include real acceptance maps of the PHOS"<<endl;
327 hadCorrectionPHOS->SetAcceptanceCorrectionPHOS(360.0/60.0);
328 hadCorrectionPHOS->SetAcceptanceCorrectionEMCAL(360.0/60.0);
331 float neutralCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,false,etacut,dataset);
332 hadCorrectionPHOS->SetNeutralCorrection(neutralCorr);
333 //Using error from data, see analysis note for details
335 hadCorrectionPHOS->SetNeutralCorrectionLowBound(neutralCorr*(1.0-.014));
336 hadCorrectionPHOS->SetNeutralCorrectionHighBound(neutralCorr*(1.0+.014));
339 hadCorrectionPHOS->SetNeutralCorrectionLowBound(neutralCorr*(1.0-0.049));
340 hadCorrectionPHOS->SetNeutralCorrectionHighBound(neutralCorr*(1.0+0.049));
343 float hadronicCorr = CorrNeutral(ptcut,prodname,shortprodname,ispp,forSim,TPC,true,etacut,dataset);
344 hadCorrectionPHOS->SetNotHadronicCorrection(hadronicCorr);
346 hadCorrectionPHOS->SetNotHadronicCorrectionLowBound(neutralCorr*(1.0-0.008));
347 hadCorrectionPHOS->SetNotHadronicCorrectionHighBound(neutralCorr*(1.0+0.008));
350 hadCorrectionPHOS->SetNotHadronicCorrectionLowBound(neutralCorr*(1.0-0.023));
351 hadCorrectionPHOS->SetNotHadronicCorrectionHighBound(neutralCorr*(1.0+0.023));
354 float ptcutITS = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim);
355 hadCorrectionPHOS->SetpTCutCorrectionITS(ptcutITS);
356 float ptcutTPC = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim);
357 hadCorrectionPHOS->SetpTCutCorrectionTPC(ptcutTPC);
359 float ptcutITSLow = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim,-1);
360 float ptcutTPCLow = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim,-1);
361 hadCorrectionPHOS->SetpTCutCorrectionITSLowBound(ptcutITSLow);
362 hadCorrectionPHOS->SetpTCutCorrectionTPCLowBound(ptcutTPCLow);
363 float ptcutITSHigh = CorrPtCut(0.1,prodname,shortprodname,ispp,forSim,1);
364 float ptcutTPCHigh = CorrPtCut(0.15,prodname,shortprodname,ispp,forSim,1);
365 hadCorrectionPHOS->SetpTCutCorrectionITSHighBound(ptcutITSHigh);
366 hadCorrectionPHOS->SetpTCutCorrectionTPCHighBound(ptcutTPCHigh);
368 TH1D *NotIDTPC = CorrNotID(etacut,"CorrNotIDPHOSTPC",prodname,shortprodname,true,ispp,forSim);
369 TH1D *NotIDITS = CorrNotID(etacut,"CorrNotIDPHOSITS",prodname,shortprodname,false,ispp,forSim);
370 hadCorrectionPHOS->SetNotIDCorrectionTPC(NotIDTPC);
371 hadCorrectionPHOS->SetNotIDCorrectionITS(NotIDITS);
373 Float_t NotIDConstTPC = CorrNotIDConst(0.15,etacut,"CorrNotIDPHOSTPC2",prodname,shortprodname,true,ispp,forSim);
374 Float_t NotIDConstITS = CorrNotIDConst(0.10,etacut,"CorrNotIDPHOSTPC2",prodname,shortprodname,true,ispp,forSim);
375 hadCorrectionPHOS->SetNotIDConstCorrectionTPC(1./NotIDConstTPC);
376 hadCorrectionPHOS->SetNotIDConstCorrectionITS(1./NotIDConstITS);
378 hadCorrectionPHOS->SetNotIDConstCorrectionTPCLowBound(1./NotIDConstTPC*(1.0-0.010));
379 hadCorrectionPHOS->SetNotIDConstCorrectionITSLowBound(1./NotIDConstITS*(1.0-0.010));
380 hadCorrectionPHOS->SetNotIDConstCorrectionTPCHighBound(1./NotIDConstTPC*(1.0+0.010));
381 hadCorrectionPHOS->SetNotIDConstCorrectionITSHighBound(1./NotIDConstITS*(1.0+0.010));
384 hadCorrectionPHOS->SetNotIDConstCorrectionTPCLowBound(1./NotIDConstTPC*(1.0-0.022));
385 hadCorrectionPHOS->SetNotIDConstCorrectionITSLowBound(1./NotIDConstITS*(1.0-0.022));
386 hadCorrectionPHOS->SetNotIDConstCorrectionTPCHighBound(1./NotIDConstTPC*(1.0+0.022));
387 hadCorrectionPHOS->SetNotIDConstCorrectionITSHighBound(1./NotIDConstITS*(1.0+0.022));
391 TH1D *NoID = CorrNoID(etacut,"CorrNoIDPHOS",prodname,shortprodname,ispp,forSim);
392 hadCorrectionPHOS->SetNotIDCorrectionNoPID(NoID);
395 Float_t NoIDTPC = CorrNoIDConst(etacut,0.15,"CorrNoIDPHOS2",prodname,shortprodname,ispp,forSim);
396 Float_t NoIDITS = CorrNoIDConst(etacut,0.1,"CorrNoIDPHOS2",prodname,shortprodname,ispp,forSim);
397 hadCorrectionPHOS->SetNotIDConstCorrectionTPCNoID(1./NoIDTPC);
398 hadCorrectionPHOS->SetNotIDConstCorrectionITSNoID(1./NoIDITS);
399 hadCorrectionPHOS->SetNotIDConstCorrectionTPCNoIDLowBound(1./NoIDTPC*.98);
400 hadCorrectionPHOS->SetNotIDConstCorrectionITSNoIDLowBound(1./NoIDITS*.98);
401 hadCorrectionPHOS->SetNotIDConstCorrectionTPCNoIDHighBound(1./NoIDTPC*1.02);
402 hadCorrectionPHOS->SetNotIDConstCorrectionITSNoIDHighBound(1./NoIDITS*1.02);
404 TH1D *efficiencyPionTPC = GetHistoEfficiency(etacut,"hEfficiencyPionTPC",1,1,20,useITSStandalone,true);
405 TH1D *efficiencyKaonTPC = GetHistoEfficiency(etacut,"hEfficiencyKaonTPC",2,1,20,useITSStandalone,true);
406 TH1D *efficiencyProtonTPC = GetHistoEfficiency(etacut,"hEfficiencyProtonTPC",3,1,20,useITSStandalone,true);
407 TH1D *efficiencyHadronTPC = GetHistoEfficiency(etacut,"hEfficiencyHadronTPC",0,1,20,useITSStandalone,true);
408 TH1D *efficiencyPionITS = GetHistoEfficiency(etacut,"hEfficiencyPionITS",1,1,20,false,true);
409 TH1D *efficiencyKaonITS = GetHistoEfficiency(etacut,"hEfficiencyKaonITS",2,1,20,false,true);
410 TH1D *efficiencyProtonITS = GetHistoEfficiency(etacut,"hEfficiencyProtonITS",3,1,20,false,true);
411 TH1D *efficiencyHadronITS = GetHistoEfficiency(etacut,"hEfficiencyHadronITS",0,1,20,false,true);
412 //CorrEfficiencyPlots(true,prodname,shortprodname);
413 //CorrEfficiencyPlots(false,prodname,shortprodname);
414 hadCorrectionPHOS->SetEfficiencyPionTPC(efficiencyPionTPC);
415 hadCorrectionPHOS->SetEfficiencyKaonTPC(efficiencyKaonTPC);
416 hadCorrectionPHOS->SetEfficiencyProtonTPC(efficiencyProtonTPC);
417 hadCorrectionPHOS->SetEfficiencyHadronTPC(efficiencyHadronTPC);
418 hadCorrectionPHOS->SetEfficiencyPionITS(efficiencyPionITS);
419 hadCorrectionPHOS->SetEfficiencyKaonITS(efficiencyKaonITS);
420 hadCorrectionPHOS->SetEfficiencyProtonITS(efficiencyProtonITS);
421 hadCorrectionPHOS->SetEfficiencyHadronITS(efficiencyHadronITS);
425 TH1D *efficiencyPionTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB0",1,1,20,useITSStandalone,true,0,4);
426 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB0->Clone(Form("Test%i",i)),i);
427 TH1D *efficiencyPionTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB5",1,1,20,useITSStandalone,true,5,9);
428 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB5->Clone(Form("Test%i",i)),i);
429 TH1D *efficiencyPionTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyPionTPCCB10",1,1,20,useITSStandalone,true,10,15);
430 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyPionTPC((TH1D*)efficiencyPionTPCCB10->Clone(Form("Test%i",i)),i);
432 TH1D *efficiencyKaonTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB0",2,1,20,useITSStandalone,true,0,4);
433 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB0->Clone(Form("Test%i",i)),i);
434 TH1D *efficiencyKaonTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB5",2,1,20,useITSStandalone,true,5,9);
435 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB5->Clone(Form("Test%i",i)),i);
436 TH1D *efficiencyKaonTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyKaonTPCCB10",2,1,20,useITSStandalone,true,10,15);
437 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyKaonTPC((TH1D*)efficiencyKaonTPCCB10->Clone(Form("Test%i",i)),i);//Kaon
439 TH1D *efficiencyProtonTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB0",3,1,20,useITSStandalone,true,0,4);
440 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB0->Clone(Form("Test%i",i)),i);
441 TH1D *efficiencyProtonTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB5",3,1,20,useITSStandalone,true,5,9);
442 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB5->Clone(Form("Test%i",i)),i);
443 TH1D *efficiencyProtonTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyProtonTPCCB10",3,1,20,useITSStandalone,true,10,15);
444 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyProtonTPC((TH1D*)efficiencyProtonTPCCB10->Clone(Form("Test%i",i)),i);//Proton
446 TH1D *efficiencyHadronTPCCB0 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB0",0,1,20,useITSStandalone,true,0,4);
447 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB0->Clone(Form("Test%i",i)),i);
448 TH1D *efficiencyHadronTPCCB5 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB5",0,1,20,useITSStandalone,true,5,9);
449 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB5->Clone(Form("Test%i",i)),i);
450 TH1D *efficiencyHadronTPCCB10 = GetHistoEfficiency(etacut,"hEfficiencyHadronTPCCB10",0,1,20,useITSStandalone,true,10,15);
451 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyHadronTPC((TH1D*)efficiencyHadronTPCCB10->Clone(Form("Test%i",i)),i);//Hadron
454 TH1D *efficiencyPionITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB0",1,1,20,false,true,0,4);
455 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB0->Clone(Form("Test%i",i)),i);
456 TH1D *efficiencyPionITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB5",1,1,20,false,true,5,9);
457 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB5->Clone(Form("Test%i",i)),i);
458 TH1D *efficiencyPionITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyPionITSCB10",1,1,20,false,true,10,15);
459 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyPionITS((TH1D*)efficiencyPionITSCB10->Clone(Form("Test%i",i)),i);//Pion
461 TH1D *efficiencyKaonITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB0",2,1,20,false,true,0,4);
462 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB0->Clone(Form("Test%i",i)),i);
463 TH1D *efficiencyKaonITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB5",2,1,20,false,true,5,9);
464 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB5->Clone(Form("Test%i",i)),i);
465 TH1D *efficiencyKaonITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyKaonITSCB10",2,1,20,false,true,10,15);
466 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyKaonITS((TH1D*)efficiencyKaonITSCB10->Clone(Form("Test%i",i)),i);//Kaon
468 TH1D *efficiencyProtonITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB0",3,1,20,false,true,0,4);
469 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB0->Clone(Form("Test%i",i)),i);
470 TH1D *efficiencyProtonITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB5",3,1,20,false,true,5,9);
471 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB5->Clone(Form("Test%i",i)),i);
472 TH1D *efficiencyProtonITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyProtonITSCB10",3,1,20,false,true,10,15);
473 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyProtonITS((TH1D*)efficiencyProtonITSCB10->Clone(Form("Test%i",i)),i);//Proton
475 TH1D *efficiencyHadronITSCB0 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB0",0,1,20,false,true,0,4);
476 for(int i=0;i<=4;i++) hadCorrectionPHOS->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB0->Clone(Form("Test%i",i)),i);
477 TH1D *efficiencyHadronITSCB5 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB5",0,1,20,false,true,5,9);
478 for(int i=5;i<=9;i++) hadCorrectionPHOS->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB5->Clone(Form("Test%i",i)),i);
479 TH1D *efficiencyHadronITSCB10 = GetHistoEfficiency(etacut,"hEfficiencyHadronITSCB10",0,1,20,false,true,10,15);
480 for(int i=10;i<=20;i++) hadCorrectionPHOS->SetEfficiencyHadronITS((TH1D*)efficiencyHadronITSCB10->Clone(Form("Test%i",i)),i);//Hadron
482 hadCorrectionPHOS->SetEfficiencyErrorLowBound(0.95);
483 hadCorrectionPHOS->SetEfficiencyErrorHighBound(1.05);
488 if((dataset==20111 || dataset==20100|| dataset==2011) && !forSim){//2.76 TeV p+p or Pb+Pb
490 cout<<"Fixing 2.76 TeV p+p background to be average of 900 GeV and 7 TeV scaling"<<endl;
491 backgroundTPC = pp276TPCBkgd();
492 backgroundTPC->SetName("hBackgroundTPCPHOS");
493 backgroundITS = pp276ITSBkgd();
494 backgroundITS->SetName("hBackgroundITSPHOS");
497 cout<<"Fixing 2.76 TeV Pb+Pb background to be average of 900 GeV and 7 TeV scaling with baryon enhancement"<<endl;
498 backgroundTPC = pp276TPCBkgd();
499 backgroundTPC->SetName("hBackgroundTPCPHOS");
500 //ITS background is currently a placeholder
501 backgroundITS = GetHistoCorrBkgd(etacut,"hBackgroundITS",false,ispp,forSim);
505 backgroundTPC = GetHistoCorrBkgd(etacut,"hBackgroundTPC",true,ispp,forSim);
506 backgroundITS = GetHistoCorrBkgd(etacut,"hBackgroundITS",false,ispp,forSim);
508 hadCorrectionPHOS->SetBackgroundCorrectionTPC(backgroundTPC);
509 hadCorrectionPHOS->SetBackgroundCorrectionITS(backgroundITS);
510 hadCorrectionPHOS->SetBackgroundErrorLowBound(1.0-0.001);
511 hadCorrectionPHOS->SetBackgroundErrorHighBound(1.0+0.001);
512 //CorrBkgdPlots(prodname,shortprodname,true,ispp,forSim);
513 //CorrBkgdPlots(prodname,shortprodname,false,ispp,forSim);
515 hadCorrectionPHOS->Report();
518 hadCorrectionPHOS->Write();
527 //==================================CorrNeutral==============================================
528 Float_t CorrNeutral(float ptcut, char *prodname, char *shortprodname, bool ispp, bool forSim, bool TPC, bool hadronic, float etacut, int dataset){
529 if(!forSim){//for data we have evaluated the neutral correction from ALICE data
530 if(hadronic){//for tot et from had et
531 return 1/0.5665;//0.5665 0.0145 <-- Correct - what should be applied
533 else{//for had et only
542 gStyle->SetOptTitle(0);
543 gStyle->SetOptStat(0);
544 gStyle->SetOptFit(0);
545 TCanvas *c = new TCanvas("c","c",400,400);
546 c->SetTopMargin(0.0);
547 c->SetRightMargin(0.0);
552 c->SetFrameFillColor(0);
553 c->SetFrameBorderMode(0);
555 TPad *ptpad = c->cd(1);
556 ptpad->SetTopMargin(0.04);
557 ptpad->SetRightMargin(0.04);
558 ptpad->SetLeftMargin(0.149288);
559 ptpad->SetBorderSize(0);
560 ptpad->SetFillColor(0);
561 ptpad->SetFillColor(0);
562 ptpad->SetBorderMode(0);
563 ptpad->SetFrameFillColor(0);
564 ptpad->SetFrameBorderMode(0);
568 sprintf(prefix,"%s%2.1f",shortprodname,ptcut);
570 sprintf(histoname,"%stotal",histoname);
573 if(hadronic) casetotal = 8;
574 TH1D *total = GetHistoCorrNeutral(ptcut,histoname,ispp,forSim,casetotal,false,colortotal,phosmarker,hadronic);
576 int colorallneutral = 2;
577 TH1D *allneutral = GetHistoCorrNeutral(ptcut,"allneutral",ispp,forSim,3,false,colorallneutral,phosmarker,hadronic);
579 int colorchargedsecondary = TColor::kViolet-3;
580 TH1D *chargedsecondary = GetHistoCorrNeutral(ptcut,"chargedsecondary",ispp,forSim,2,false,colorchargedsecondary,phosmarker,hadronic);
582 int colorneutralUndet = 4;
583 TH1D *neutralUndet = GetHistoCorrNeutral(ptcut,"neutralUndet",ispp,forSim,1,false,colorneutralUndet,phosmarker,hadronic);
585 int colorv0 = TColor::kGreen+2;
586 TH1D *v0 = GetHistoCorrNeutral(ptcut,"v0",ispp,forSim,0,false,colorv0,phosmarker,hadronic);
588 int colorem = TColor::kCyan;
589 TH1D *em = GetHistoCorrNeutral(ptcut,"em",ispp,forSim,9,false,colorem,phosmarker,hadronic);
591 TF1 *func = new TF1("func","[0]",-.7,.7);
592 func->SetParameter(0,0.2);
593 total->Fit(func,"","",-etacut,etacut);
595 //total->SetAxisRange(0.0,4);
596 total->GetXaxis()->SetLabelSize(0.05);
597 total->GetYaxis()->SetLabelSize(0.045);
598 total->GetXaxis()->SetTitleSize(0.05);
599 total->GetYaxis()->SetTitleSize(0.06);
601 total->SetMaximum(0.6);
602 total->SetMinimum(0.0);
605 total->SetMaximum(0.3);
606 total->SetMinimum(0.0);
609 allneutral->Draw("same");
610 chargedsecondary->Draw("same");
611 neutralUndet->Draw("same");
613 if(hadronic) em->Draw("same");
615 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
616 tex->SetTextSize(0.0537634);
618 TLegend *leg2 = new TLegend(0.518321,0.746873,0.774812,0.955343);
619 leg2->AddEntry(total,"Total");
620 leg2->AddEntry(allneutral,"#Lambda,#bar{#Lambda},K^{0}_{S},K^{0}_{L},n,#bar{n}");
621 leg2->AddEntry(neutralUndet,"K^{0}_{L},n,#bar{n}");
622 if(hadronic) leg2->AddEntry(em,"e^{#pm},#gamma,#eta,#pi^{0},#omega");
623 leg2->SetFillStyle(0);
624 leg2->SetFillColor(0);
625 leg2->SetBorderSize(0);
626 leg2->SetTextSize(0.0548607);
629 sprintf(epsname,"pics/%s/fhadronic.eps",shortprodname);
630 sprintf(pngname,"pics/%s/fhadronic.png",shortprodname);
633 sprintf(epsname,"pics/%s/fneutral.eps",shortprodname);
634 sprintf(pngname,"pics/%s/fneutral.png",shortprodname);
641 delete chargedsecondary;
646 float corr = func->GetParameter(0);
650 return 1.0/(1.0-corr);
653 TH1D *GetHistoCorrNeutral(float cut, char *name, bool ispp, bool forSim, int mycase, bool eta, int color, int marker, bool hadronic){
655 char *reweightname = "";
656 if(!forSim) reweightname = "Reweighted";
657 TH2F *numeratorParent;
660 numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("v0");
661 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)));
662 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)));
665 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)))->Clone("Knnbar");
666 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"));
667 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"));
670 numeratorParent = (TH2F*)((TH2F*) out2->FindObject("EtSimulatedOmega"))->Clone("ch2ndary");
671 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiOmega"));
672 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi"));
673 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi"));
674 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi0"));
675 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"));
678 numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
679 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)));
680 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)));
681 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)));
682 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"));
683 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"));
686 numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
687 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)));
688 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)));
689 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)));
690 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"));
691 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"));
692 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega"));
693 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiOmega"));
694 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi"));
695 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi"));
696 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi0"));
697 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"));
700 numeratorParent= (TH2F*)((TH2F*) out2->FindObject("EtSimulatedXi"))->Clone("allxi");
701 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi"));
702 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi0"));
703 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"));
706 numeratorParent = (TH2F*)((TH2F*) out2->FindObject("EtSimulatedOmega"))->Clone("allomega");
707 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiOmega"));
710 numeratorParent = (TH2F*)((TH2F*) out2->FindObject("EtSimulatedSigma"))->Clone("allsigma");
711 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiSigma"));
714 numeratorParent= (TH2F*)((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)))->Clone("allneutral");
715 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)));
716 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)));
717 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)));
718 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"));
719 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"));
720 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega"));
721 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiOmega"));
722 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi"));
723 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi"));
724 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedXi0"));
725 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"));
726 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedGamma"));
727 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEta"));
728 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedPi0"));
729 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega0"));
730 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEPlus"));
731 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEMinus"));
734 numeratorParent= (TH2F*)((TH2F*) out2->FindObject("EtSimulatedGamma"))->Clone("allem");
735 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEta"));
736 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedPi0"));
737 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedOmega0"));
738 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEPlus"));
739 numeratorParent->Add((TH2F*) out2->FindObject("EtSimulatedEMinus"));
744 //allhad=(TH2F*) ((TH2F*) out2->FindObject("EtSimulatedAllHadron"))->Clone("id");
745 allhad=(TH2F*) ((TH2F*) out2->FindObject("EtSimulatedPiPlus"))->Clone("id");
746 allhad->Add((TH2F*) out2->FindObject("EtSimulatedPiMinus"));
747 allhad->Add((TH2F*) out2->FindObject("EtSimulatedKMinus"));
748 allhad->Add((TH2F*) out2->FindObject("EtSimulatedKPlus"));
749 allhad->Add((TH2F*) out2->FindObject("EtSimulatedProton"));
750 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiProton"));
751 allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedLambda%s",reweightname)));
752 allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedAntiLambda%s",reweightname)));
753 allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0S%s",reweightname)));
754 allhad->Add((TH2F*) out2->FindObject(Form("EtSimulatedK0L%s",reweightname)));
755 allhad->Add((TH2F*) out2->FindObject("EtSimulatedNeutron"));
756 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiNeutron"));
757 allhad->Add((TH2F*) out2->FindObject("EtSimulatedEPlus"));
758 allhad->Add((TH2F*) out2->FindObject("EtSimulatedEMinus"));
759 allhad->Add((TH2F*) out2->FindObject("EtSimulatedOmega"));
760 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiOmega"));
761 allhad->Add((TH2F*) out2->FindObject("EtSimulatedXi"));
762 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi"));
763 allhad->Add((TH2F*) out2->FindObject("EtSimulatedSigma"));
764 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiSigma"));
765 allhad->Add((TH2F*) out2->FindObject("EtSimulatedXi0"));
766 allhad->Add((TH2F*) out2->FindObject("EtSimulatedAntiXi0"));
768 if(hadronic){//if we are getting the correction for the hadronic only case...
769 allhad->Add((TH2F*) out2->FindObject("EtSimulatedGamma"));
770 allhad->Add((TH2F*) out2->FindObject("EtSimulatedEta"));
771 allhad->Add((TH2F*) out2->FindObject("EtSimulatedPi0"));
772 allhad->Add((TH2F*) out2->FindObject("EtSimulatedOmega0"));
773 allhad->Add((TH2F*) out2->FindObject("EtSimulatedEPlus"));
774 allhad->Add((TH2F*) out2->FindObject("EtSimulatedEMinus"));
780 int lowbin = numeratorParent->GetYaxis()->FindBin(-cut+.001);//make sure we don't accv0entally get the wrong bin
781 int highbin = numeratorParent->GetYaxis()->FindBin(cut-.001);
782 //cout<<"Projecting from "<<numeratorParent->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<numeratorParent->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
783 denominator = allhad->ProjectionX("name",lowbin,highbin);
784 numerator = numeratorParent->ProjectionX("numerator",lowbin,highbin);
787 int lowbin = allhad->GetXaxis()->FindBin(cut);//make sure we don't accidentally get the wrong bin
788 int highbin = allhad->GetXaxis()->GetNbins();
789 //cout<<"Projecting from "<<allhad->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<allhad->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
790 numerator = numeratorParent->ProjectionY("name",lowbin,highbin);
791 denominator = allhad->ProjectionY("denominator",lowbin,highbin);
793 numerator->Divide(denominator);
794 //numerator->Rebin(2);
795 //numerator->Scale(0.5);
796 numerator->SetYTitle("E_{T}^{had,sample}/E_{T}^{had,total}");
797 numerator->GetYaxis()->SetTitleOffset(1.2);
798 numerator->SetMarkerColor(color);
799 numerator->SetLineColor(color);
800 numerator->SetMarkerStyle(marker);
802 delete numeratorParent;
805 numerator->SetName(name);
810 //===============================CorrPtCut=========================================
811 TH1D *GetHistoCorrPtCut(float ptcut, char *name, bool ispp, bool forSim, int mycase){
813 TH2F *allhad = ((TH2F*) out2->FindObject("EtSimulatedAllHadron"))->Clone("allhad");
814 TH2F *ptlow = ((TH2F*) out2->FindObject("EtSimulatedChargedHadronAssumingNoPt"))->Clone("ptlow");
816 if(ptcut>0.14){//TPC cut off
817 (TH2F*)pthigh =(TH2F*) ((TH2F*) out2->FindObject("EtSimulatedChargedHadronAssumingPtTPCCut"))->Clone("pthigh");
820 (TH2F*)pthigh =(TH2F*) ((TH2F*) out2->FindObject("EtSimulatedChargedHadronAssumingPtITSCut"))->Clone("pthigh");
823 int lowbin = allhad->GetXaxis()->FindBin(0.0);//make sure we don't accidentally get the wrong bin
824 int highbin = allhad->GetXaxis()->FindBin(ptcut);
825 int nbins = allhad->GetXaxis()->GetNbins();
826 //cout<<"Projecting from "<<allhad->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<allhad->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
827 //cout<<"Projecting from "<<allhad->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<allhad->GetXaxis()->GetBinLowEdge(nbins)<<endl;
833 numerator = ptlow->ProjectionY("nameLow",lowbin,highbin);
834 denominator = allhad->ProjectionY("denominatorLow",highbin,nbins);
835 denominator->Add(numerator);
838 numerator = pthigh->ProjectionY("nameHigh",lowbin,highbin);
839 denominator = allhad->ProjectionY("denominatorHigh",highbin,nbins);
840 denominator->Add(numerator);
843 numerator = allhad->ProjectionY("name",lowbin,highbin);
844 denominator = allhad->ProjectionY("denominator",lowbin,nbins);
846 numerator->Divide(denominator);
847 numerator->SetYTitle("E_{T}^{had, p_{T}<cut-off}/E_{T}^{had, all p_{T}}");
848 numerator->GetYaxis()->SetTitleOffset(1.);
849 numerator->GetYaxis()->SetTitleSize(0.08);
850 numerator->GetYaxis()->SetLabelSize(0.05);
851 numerator->GetXaxis()->SetTitleSize(0.08);
852 numerator->GetXaxis()->SetLabelSize(0.05);
853 numerator->GetXaxis()->SetTitleOffset(.6);
854 //numerator->Rebin(2);
855 //numerator->Scale(0.5);
856 //numerator->Draw("e");
861 numerator->SetName(name);
866 Float_t CorrPtCut(float ptcut, char *prodname, char *shortprodname, bool ispp, bool forSim, int mycase){
868 gStyle->SetOptTitle(0);
869 gStyle->SetOptStat(0);
870 gStyle->SetOptFit(0);
871 TCanvas *c = new TCanvas("c","c",500,400);
872 c->SetTopMargin(0.04);
873 c->SetRightMargin(0.04);
874 c->SetLeftMargin(0.181452);
875 c->SetBottomMargin(0.134409);
880 c->SetFrameFillColor(0);
881 c->SetFrameBorderMode(0);
885 TH1D *High = GetHistoCorrPtCut(0.15-.001,"High",ispp,forSim,mycase);
886 TH1D *Low = GetHistoCorrPtCut(0.1-.001,"Low",ispp,forSim,mycase);
887 TH1D *Lowest = GetHistoCorrPtCut(0.05-.001,"Lowest",ispp,forSim,mycase);
889 TF1 *func = new TF1("func","[0]",-.7,.7);
890 func->SetParameter(0,0.2);
891 if(ptcut<.125){//its cuts
898 High->SetMaximum(0.04);
899 High->SetMinimum(0.0);
900 High->SetMarkerColor(2);
901 Low->SetMarkerColor(4);
902 High->SetLineColor(2);
903 Low->SetLineColor(4);
904 High->SetMinimum(0.0);
905 High->SetMarkerStyle(20);
906 Low->SetMarkerStyle(21);
907 Lowest->SetMarkerStyle(22);
910 Lowest->Draw("same");
914 TLatex *tex = new TLatex(-0.723444,0.0373593,prodname);
915 tex->SetTextSize(0.0537634);
917 TLegend *leg = new TLegend(0.217742,0.66129,0.477823,0.873656);
918 leg->AddEntry(High,"p_{T} cut-off = 0.15 GeV/c");
919 leg->AddEntry(Low,"p_{T} cut-off = 0.1 GeV/c");
920 leg->AddEntry(Lowest,"p_{T} cut-off = 0.05 GeV/c");
921 leg->SetFillStyle(0);
922 leg->SetFillColor(0);
923 leg->SetBorderSize(0);
924 leg->SetTextSize(0.0537634);
927 if(ptcut<.125){//its cuts
928 c->SaveAs(Form("pics/%s/fptcutITS.eps",shortprodname));
929 c->SaveAs(Form("pics/%s/fptcutITS.png",shortprodname));
932 c->SaveAs(Form("pics/%s/fptcutTPC.eps",shortprodname));
933 c->SaveAs(Form("pics/%s/fptcutTPC.png",shortprodname));
936 float corr = func->GetParameter(0);
937 //cout<<"Pt cut correction: "<<1.0/(1.0-corr)<<endl;
945 return 1.0/(1.0-corr);
950 //==================================CorrNotID=================================================
951 TH1D *GetHistoCorrNotID(float etacut,char *name, bool TPC, bool eta, bool ispp, bool forSim){
953 char *myname = mynameITS;
954 if(TPC) myname = mynameTPCITS;
955 TH2F *notid = ((TH2F*) out2->FindObject(Form("EtReconstructed%sUnidentifiedAssumingPion",myname)))->Clone("notid");
956 TH2F *nNotid = ((TH2F*) out2->FindObject(Form("EtNReconstructed%sUnidentified",myname)))->Clone("nNotid");
958 //cout<<"Correction determined for all charged hadrons"<<endl;
959 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiPlus",myname)));
960 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiMinus",myname)));
961 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKPlus",myname)));
962 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKMinus",myname)));
963 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedProton",myname)));
964 notid->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedAntiProton",myname)));
965 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sPiPlus",myname)));
966 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sPiMinus",myname)));
967 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sKPlus",myname)));
968 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sKMinus",myname)));
969 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sProton",myname)));
970 nNotid->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%sAntiProton",myname)));
973 TH2F *id = ((TH2F*) out2->FindObject(Form("EtReconstructed%sUnidentified",myname)))->Clone("id");
975 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiPlus",myname)));
976 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiMinus",myname)));
977 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKPlus",myname)));
978 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKMinus",myname)));
979 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedProton",myname)));
980 id->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedAntiProton",myname)));
987 int lowbin = notid->GetYaxis()->FindBin(-etacut+.001);//make sure we don't accv0entally get the wrong bin
988 int highbin = notid->GetYaxis()->FindBin(etacut-.001);
989 //cout<<"Projecting from "<<notid->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<notid->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
990 denominator = id->ProjectionX("name",lowbin,highbin);
991 numerator = notid->ProjectionX("numerator",lowbin,highbin);
992 nNotidProj = nNotid->ProjectionX("nNotidProj",lowbin,highbin);
995 //cout<<"Getting eta dependence"<<endl;
996 int lowbin = id->GetXaxis()->FindBin(etacut);//make sure we don't accidentally get the wrong bin
998 if(etacut<0.15){//then we actually have ITS standalone tracks and we only want this to run from 0.1 to 0.15 because this will be used only for ITS standalone tracks
999 highbin = id->GetXaxis()->FindBin(0.15);
1002 highbin = id->GetXaxis()->GetNbins();
1004 //cout<<"Projecting from "<<id->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<id->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
1005 numerator = notid->ProjectionY("name",lowbin,highbin);
1006 denominator = id->ProjectionY("denominator",lowbin,highbin);
1007 nNotidProj = nNotid->ProjectionY("nNotidProj",lowbin,highbin);
1009 TH1D *result = numerator;
1011 cerr<<"Uh-oh! Can't find denominator!!";
1014 else{result->Divide(denominator);}
1015 if(result->GetNbinsX() != nNotidProj->GetNbinsX()){
1016 cerr<<"Uh-oh! Can't rescale errors! "<<result->GetNbinsX()<<"!="<<nNotidProj->GetNbinsX()<<endl;
1020 cerr<<"Uh-oh! Can't find histogram!!";
1024 for(int i=1;i<=result->GetNbinsX();i++){
1025 Float_t value = result->GetBinContent(i);
1026 Float_t valueerr = result->GetBinError(i);
1027 Float_t n = nNotidProj->GetBinContent(i);
1030 else{err= value/TMath::Power(n,0.5);}
1031 result->SetBinError(i,err);
1032 //cout<<"Was "<<valueerr<<", setting to "<<err<<endl;
1034 result->SetYTitle("Ratio of E_{T}^{assuming pion}/E_{T}^{real}");
1035 result->GetYaxis()->SetTitleOffset(1.2);
1041 result->SetName(name);
1046 TH1D *CorrNotID(float etacut,char *name, char *prodname, char *shortprodname, bool TPC, bool ispp, bool forSim){
1047 gStyle->SetOptTitle(0);
1048 gStyle->SetOptStat(0);
1049 gStyle->SetOptFit(0);
1050 TCanvas *c = new TCanvas("c","c",500,400);
1051 c->SetTopMargin(0.04);
1052 c->SetRightMargin(0.04);
1053 c->SetBorderSize(0);
1056 c->SetBorderMode(0);
1057 c->SetFrameFillColor(0);
1058 c->SetFrameBorderMode(0);
1060 TH1D *PHOS = GetHistoCorrNotID(etacut,name,TPC,true,ispp,forSim);
1061 PHOS->SetMarkerColor(2);
1062 PHOS->SetLineColor(2);
1063 PHOS->SetAxisRange(0.0,4);
1065 PHOS->SetMaximum(1.1);
1066 PHOS->SetMinimum(0.85);
1069 PHOS->SetAxisRange(0.0,0.5);
1071 PHOS->SetMarkerStyle(20);
1073 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
1074 tex->SetTextSize(0.0537634);
1076 char *detector = detectorEMCAL;
1077 if(etacut<0.2) detector = detectorPHOS;
1079 sprintf(epsname,"pics/%s/fnotidTPC%s.eps",shortprodname,detector);
1080 sprintf(pngname,"pics/%s/fnotidTPC%s.png",shortprodname,detector);
1083 sprintf(epsname,"pics/%s/fnotidITS%s.eps",shortprodname,detector);
1084 sprintf(pngname,"pics/%s/fnotidITS%s.png",shortprodname,detector);
1091 PHOS->SetName(name);
1095 Float_t CorrNotIDConst(float ptcut, float etacut,char *name, char *prodname, char *shortprodname, bool TPC, bool ispp, bool forSim){
1104 gStyle->SetOptTitle(0);
1105 gStyle->SetOptStat(0);
1106 gStyle->SetOptFit(0);
1107 TCanvas *c = new TCanvas("c","c",500,400);
1108 c->SetTopMargin(0.04);
1109 c->SetRightMargin(0.04);
1110 c->SetBorderSize(0);
1113 c->SetBorderMode(0);
1114 c->SetFrameFillColor(0);
1115 c->SetFrameBorderMode(0);
1117 TH1D *PHOS = GetHistoCorrNotID(ptcut,name,TPC,false,ispp,forSim);
1118 PHOS->SetMarkerColor(2);
1119 PHOS->SetLineColor(2);
1120 PHOS->SetMaximum(1.01);
1121 PHOS->SetMinimum(0.98);
1122 TF1 *func = new TF1("func","[0]",-etacut,etacut);
1123 PHOS->Fit(func,"","",-etacut,etacut);
1124 PHOS->SetMarkerStyle(20);
1126 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
1127 tex->SetTextSize(0.0537634);
1129 char *detector = detectorEMCAL;
1130 if(etacut<0.2) detector = detectorPHOS;
1132 sprintf(epsname,"pics/%s/fnotidConstTPC%s.eps",shortprodname,detector);
1133 sprintf(pngname,"pics/%s/fnotidConstTPC%s.png",shortprodname,detector);
1136 sprintf(epsname,"pics/%s/fnotidConstITS%s.eps",shortprodname,detector);
1137 sprintf(pngname,"pics/%s/fnotidConstITS%s.png",shortprodname,detector);
1144 float value = func->GetParameter(0);
1150 //==================================CorrNoID=================================================
1151 TH1D *GetHistoNoID(float etacut, char *name, bool eta, bool TPC, bool ispp, bool forSim){
1153 char *myname = mynameITS;
1154 if(TPC) myname = mynameTPCITS;
1155 TH2F *notid = ((TH2F*) out2->FindObject(Form("EtReconstructed%sChargedHadronAssumingPion",myname)))->Clone("notid");
1156 TH2F *nNotid = ((TH2F*) out2->FindObject(Form("EtNReconstructed%sChargedHadron",myname)))->Clone("nNotid");
1158 TH2F *id = ((TH2F*) out2->FindObject(Form("EtReconstructed%sChargedHadron",myname)))->Clone("id");
1159 int lowbin = id->GetYaxis()->FindBin(-etacut+.001);//make sure we don't accidentally get the wrong bin
1160 int highbin = id->GetYaxis()->FindBin(etacut-.001);
1166 int lowbin = notid->GetYaxis()->FindBin(-etacut+.001);//make sure we don't accv0entally get the wrong bin
1167 int highbin = notid->GetYaxis()->FindBin(etacut-.001);
1168 //cout<<"Projecting from "<<notid->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<notid->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
1169 denominator = id->ProjectionX("name",lowbin,highbin);
1170 numerator = notid->ProjectionX("numerator",lowbin,highbin);
1171 nNotidProj = nNotid->ProjectionX("nNotidProj",lowbin,highbin);
1174 //cout<<"Getting eta dependence"<<endl;
1175 int lowbin = id->GetXaxis()->FindBin(etacut);//make sure we don't accidentally get the wrong bin
1177 if(etacut<0.15){//then we actually have ITS standalone tracks and we only want this to run from 0.1 to 0.15 because this will be used only for ITS standalone tracks
1178 highbin = id->GetXaxis()->FindBin(0.15);
1181 highbin = id->GetXaxis()->GetNbins();
1183 //cout<<"Projecting from "<<id->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<id->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
1184 numerator = notid->ProjectionY("name",lowbin,highbin);
1185 denominator = id->ProjectionY("denominator",lowbin,highbin);
1186 nNotidProj = nNotid->ProjectionY("nNotidProj",lowbin,highbin);
1188 if(denominator) numerator->Divide(denominator);
1190 if(numerator->GetNbinsX() != nNotidProj->GetNbinsX()){
1191 cerr<<"Uh-oh! Can't rescale errors! "<<numerator->GetNbinsX()<<"!="<<nNotidProj->GetNbinsX()<<endl;
1195 for(int i=1;i<=numerator->GetNbinsX();i++){
1196 Float_t value = numerator->GetBinContent(i);
1197 Float_t valueerr = numerator->GetBinError(i);
1198 Float_t n = nNotidProj->GetBinContent(i);
1201 err = value/TMath::Power(n,0.5);
1203 numerator->SetBinError(i,err);;
1205 numerator->SetYTitle("Ratio of E_{T}^{assuming pion}/E_{T}^{real}");
1206 numerator->GetYaxis()->SetTitleOffset(1.2);
1212 numerator->SetName(name);
1217 TH1D *CorrNoID(float etacut,char *name, char *prodname, char *shortprodname, bool ispp, bool forSim){
1218 gStyle->SetOptTitle(0);
1219 gStyle->SetOptStat(0);
1220 gStyle->SetOptFit(0);
1221 TCanvas *c = new TCanvas("c","c",500,400);
1222 c->SetTopMargin(0.04);
1223 c->SetRightMargin(0.04);
1224 c->SetBorderSize(0);
1227 c->SetBorderMode(0);
1228 c->SetFrameFillColor(0);
1229 c->SetFrameBorderMode(0);
1231 TH1D *PHOS = GetHistoNoID(etacut,name,true,true,ispp,forSim);
1232 PHOS->SetMarkerColor(2);
1233 PHOS->SetLineColor(2);
1234 PHOS->SetAxisRange(0.0,4);
1235 PHOS->SetMaximum(1.1);
1236 PHOS->SetMinimum(0.85);
1237 PHOS->SetMarkerStyle(20);;
1239 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
1240 tex->SetTextSize(0.0537634);
1244 char *detector = detectorEMCAL;
1245 if(etacut<0.2) detector = detectorPHOS;
1246 sprintf(epsname,"pics/%s/fnoid%s.eps",shortprodname,detector);
1247 sprintf(pngname,"pics/%s/fnoid%s.png",shortprodname,detector);
1253 PHOS->SetName(name);
1258 Float_t CorrNoIDConst(float etacut, float ptcut,char *name, char *prodname, char *shortprodname, bool ispp, bool forSim){
1259 gStyle->SetOptTitle(0);
1260 gStyle->SetOptStat(0);
1261 gStyle->SetOptFit(0);
1262 TCanvas *c = new TCanvas("c","c",500,400);
1263 c->SetTopMargin(0.04);
1264 c->SetRightMargin(0.04);
1265 c->SetBorderSize(0);
1268 c->SetBorderMode(0);
1269 c->SetFrameFillColor(0);
1270 c->SetFrameBorderMode(0);
1273 if(ptcut<.15) TPC = false;
1274 TH1D *PHOS = GetHistoNoID(ptcut,name,false,TPC,ispp,forSim);
1275 TF1 *func = new TF1("func","[0]",-etacut,etacut);
1276 PHOS->Fit(func,"","",-etacut,etacut);
1277 PHOS->SetMarkerColor(2);
1278 PHOS->SetLineColor(2);
1279 PHOS->SetMaximum(1.1);
1280 PHOS->SetMinimum(0.85);
1281 PHOS->SetMarkerStyle(20);;
1283 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
1284 tex->SetTextSize(0.0537634);
1288 char *detector = detectorEMCAL;
1289 if(etacut<0.2) detector = detectorPHOS;
1291 sprintf(epsname,"pics/%s/fnoid%sTPC.eps",shortprodname,detector);
1292 sprintf(pngname,"pics/%s/fnoid%sTPC.png",shortprodname,detector);
1295 sprintf(epsname,"pics/%s/fnoid%sITS.eps",shortprodname,detector);
1296 sprintf(pngname,"pics/%s/fnoid%sITS.png",shortprodname,detector);
1303 float value = func->GetParameter(0);
1309 //==================================Efficiency=================================================
1310 TH1D* bayneseffdiv(TH1D* numerator, TH1D* denominator,Char_t* name)
1313 cerr<<"Error: numerator does not exist!"<<endl;
1317 cerr<<"Error: denominator does not exist!"<<endl;
1320 TH1D* result = (TH1D*)numerator->Clone(name);
1321 Int_t nbins = numerator->GetNbinsX();
1322 for (Int_t ibin=0; ibin<= nbins+1; ++ibin) {
1323 Double_t numeratorVal = numerator->GetBinContent(ibin);
1324 Double_t denominatorVal = denominator->GetBinContent(ibin);
1325 // Check if the errors are right or the thing is scaled
1326 Double_t numeratorValErr = numerator->GetBinError(ibin);
1327 if (!(numeratorValErr==0. || numeratorVal ==0.) ) {
1328 Double_t rescale = numeratorValErr*numeratorValErr/numeratorVal;
1329 numeratorVal /= rescale;
1331 Double_t denominatorValErr = denominator->GetBinError(ibin);
1332 if (!(denominatorValErr==0. || denominatorVal==0. )) {
1333 Double_t rescale = denominatorValErr*denominatorValErr/denominatorVal;
1334 denominatorVal /= rescale;
1336 Double_t quotient = 0.;
1337 if (denominatorVal!=0.) {
1338 quotient = numeratorVal/denominatorVal;
1340 Double_t quotientErr=0;
1341 if(numeratorVal>0.0 && denominatorVal>0.0 && (denominatorVal+2.0)>0.0 && (denominatorVal+3.0) >0.0){
1342 double argument = (numeratorVal+1.0)/(denominatorVal+2.0)*
1343 ((numeratorVal+2.0)/(denominatorVal+3.0)-(numeratorVal+1.0)/(denominatorVal+2.0));
1344 double test = TMath::Power(TMath::Abs(argument),0.5);
1345 quotientErr = TMath::Sqrt( TMath::Abs(
1346 (numeratorVal+1.0)/(denominatorVal+2.0)*
1347 ((numeratorVal+2.0)/(denominatorVal+3.0)-(numeratorVal+1.0)/(denominatorVal+2.0))));
1349 result->SetBinContent(ibin,quotient);
1350 result->SetBinError(ibin,quotientErr);
1351 //cout<<"Setting bin "<<ibin<<" to "<<quotient<<" "<<numeratorVal<<"/"<<denominatorVal<<endl;
1358 TH1D *GetHistoEfficiency(float cut, char *name, int mycase, int color, int marker,bool TPC,bool ITS, int cb, int cblast){
1361 char *myname = mynameITS;
1362 if(TPC && !ITS){ myname = mynameTPCITS;cout<<"I was here I should not be called"<<endl;}
1363 if(TPC&&ITS) myname = mynameTPCITS;
1364 char *mynamealt = mynameTPCITS;
1365 TH2F *numeratorParent;
1368 if(cblast != -1){//add more centrality bins
1369 for(int i=cb;i<=cblast;i++){
1370 if(i==cb) numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiPlus",i)))->Clone("RecoHadron");
1371 else{numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiPlus",i)));}
1372 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiMinus",i)));
1373 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"KMinus",i)));
1374 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"KPlus",i)));
1375 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"Proton",i)));
1376 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"AntiProton",i)));
1377 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1378 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"PiPlus",i)));
1379 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"PiMinus",i)));
1380 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"KMinus",i)));
1381 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"KPlus",i)));
1382 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"Proton",i)));
1383 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"AntiProton",i)));
1388 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"PiPlus")))->Clone("RecoHadron");
1389 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"PiMinus")));
1390 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"KMinus")));
1391 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"KPlus")));
1392 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"Proton")));
1393 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"AntiProton")));
1394 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1395 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"PiPlus")));
1396 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"PiMinus")));
1397 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"KMinus")));
1398 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"KPlus")));
1399 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"Proton")));
1400 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"AntiProton")));
1405 if(cblast != -1){//add more centrality bins
1406 for(int i=cb;i<=cblast;i++){
1407 if(i==cb) numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiPlus",i)))->Clone("RecoPion");
1408 else{numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiPlus",i)));}
1409 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"PiMinus",i)));
1410 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1411 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"PiMinus",i)));
1412 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"PiPlus",i)));
1417 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"PiPlus")))->Clone("RecoPion");
1418 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"PiMinus")));
1419 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1420 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"PiPlus")));
1421 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"PiMinus")));
1426 if(cblast != -1){//add more centrality bins
1427 for(int i=cb;i<=cblast;i++){
1428 if(i==cb) numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"KPlus",i)))->Clone("RecoKaon");
1429 else{numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"KPlus",i)));}
1430 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"KMinus",i)));
1431 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1432 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"KPlus",i)));
1433 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"KMinus",i)));
1438 // cout<<"I am kaoning here !"<<endl;
1439 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"KPlus")))->Clone("RecoKaon");
1440 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"KMinus")));
1441 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1442 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"KPlus")));
1443 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"KMinus")));
1445 //cout<<"Numerator "<<numeratorParent->GetEntries()<<endl;
1449 if(cblast != -1){//add more centrality bins
1450 for(int i=cb;i<=cblast;i++){
1451 if(i==cb) numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"Proton",i)))->Clone("RecoProton");
1452 else{numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"Proton",i)));}
1453 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",myname,"AntiProton",i)));
1454 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1455 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"Proton",i)));
1456 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%sCB%i",mynamealt,"AntiProton",i)));
1461 //cout<<"I am protoning here !"<<endl;
1462 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"Proton")))->Clone("RecoProton");
1463 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",myname,"AntiProton")));
1464 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1465 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"Proton")));
1466 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s",mynamealt,"AntiProton")));
1468 //cout<<"Numerator "<<numeratorParent->GetEntries()<<endl;
1472 numeratorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s%s",myname,"EPlus",cbname)))->Clone("RecoElectron");
1473 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s%s",myname,"EMinus",cbname)));
1474 if(!TPC&&ITS){//ITS Standalone tracks - from leftover hits, don't want to double count
1475 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s%s",mynamealt,"EPlus",cbname)));
1476 numeratorParent->Add((TH2F*) out2->FindObject(Form("EtNReconstructed%s%s%s",mynamealt,"EMinus",cbname)));
1480 TH2F *denominatorParent;
1483 if(cblast != -1){//add more centrality bins
1484 denominatorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNSimulatedChargedHadronCB%i",cb)))->Clone("RecoHadron");
1485 for(int i=cb+1;i<=cblast;i++){
1486 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedChargedHadronCB%i",i)));
1490 denominatorParent = (TH2F*)((TH2F*) out2->FindObject("EtNSimulatedChargedHadron"))->Clone("RecoHadron");
1494 if(cblast != -1){//add more centrality bins
1495 denominatorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNSimulatedPiPlusCB%i",cb)))->Clone("RecoPion");
1496 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedPiMinusCB%i",cb)));
1497 for(int i=cb+1;i<=cblast;i++){
1498 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedPiPlusCB%i",i)));
1499 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedPiMinusCB%i",i)));
1503 denominatorParent = (TH2F*)((TH2F*) out2->FindObject("EtNSimulatedPiPlus"))->Clone("RecoPion");
1504 denominatorParent->Add((TH2F*) out2->FindObject("EtNSimulatedPiMinus"));
1508 if(cblast != -1){//add more centrality bins
1509 denominatorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNSimulatedKPlusCB%i",cb)))->Clone("RecoKaon");
1510 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedKMinusCB%i",cb)));
1511 for(int i=cb+1;i<=cblast;i++){
1512 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedKPlusCB%i",i)));
1513 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedKMinusCB%i",i)));
1517 denominatorParent = (TH2F*)((TH2F*) out2->FindObject("EtNSimulatedKPlus"))->Clone("RecoKaon");
1518 denominatorParent->Add((TH2F*) out2->FindObject("EtNSimulatedKMinus"));
1522 if(cblast != -1){//add more centrality bins
1523 for(int i=cb;i<=cblast;i++){
1524 if(cb==i)denominatorParent = (TH2F*)((TH2F*) out2->FindObject(Form("EtNSimulatedProtonCB%i",i)))->Clone("RecoProton");
1525 else{denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedProtonCB%i",i)));}
1526 denominatorParent->Add((TH2F*) out2->FindObject(Form("EtNSimulatedAntiProtonCB%i",i)));
1530 denominatorParent = (TH2F*)((TH2F*) out2->FindObject("EtNSimulatedProton"))->Clone("RecoProton");
1531 denominatorParent->Add((TH2F*) out2->FindObject("EtNSimulatedAntiProton"));
1535 denominatorParent = (TH2F*)((TH2F*) out2->FindObject("EtNSimulatedEPlus"))->Clone("RecoElectron");
1536 denominatorParent->Add((TH2F*) out2->FindObject("EtNSimulatedEMinus"));
1542 int lowbin = numeratorParent->GetYaxis()->FindBin(-cut+.001);//make sure we don't accv0entally get the wrong bin
1543 int highbin = numeratorParent->GetYaxis()->FindBin(cut-.001);
1544 //cout<<"Projecting from "<<numeratorParent->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<numeratorParent->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
1545 denominator = denominatorParent->ProjectionX(Form("garbage%s",name),lowbin,highbin);
1546 numerator = numeratorParent->ProjectionX(name,lowbin,highbin);
1549 int lowbin = denominatorParent->GetXaxis()->FindBin(cut);//make sure we don't accidentally get the wrong bin
1550 int highbin = denominatorParent->GetXaxis()->GetNbins();
1551 //cout<<"Projecting from "<<denominatorParent->GetXaxis()->GetBinLowEdge(lowbin)<<" to "<<denominatorParent->GetXaxis()->GetBinLowEdge(highbin+1)<<endl;
1552 numerator = numeratorParent->ProjectionY(name,lowbin,highbin);
1553 denominator = denominatorParent->ProjectionY(Form("denominator%s",name),lowbin,highbin);
1555 delete numeratorParent;
1556 delete denominatorParent;
1557 //numerator->Divide(denominator);
1558 TH1D *result = bayneseffdiv((TH1D*) numerator,(TH1D*)denominator,name);
1560 //result->Scale(0.5);
1561 result->SetYTitle("Efficiency");
1562 result->GetYaxis()->SetTitleOffset(0.8);
1563 result->GetXaxis()->SetTitleOffset(0.8);
1564 result->GetYaxis()->SetLabelSize(0.05);
1565 result->GetXaxis()->SetLabelSize(0.05);
1566 result->GetYaxis()->SetTitleSize(0.05);
1567 result->GetXaxis()->SetTitleSize(0.05);
1568 result->SetMarkerColor(color);
1569 result->SetLineColor(color);
1570 result->SetMarkerStyle(marker);
1571 //result->SetName(name);
1572 //result->Draw("e");
1575 delete numeratorParent;
1576 delete denominatorParent;
1577 result->SetName(name);
1582 void CorrEfficiencyPlots(bool TPC, char *prodname, char *shortprodname){
1584 gStyle->SetOptTitle(0);
1585 gStyle->SetOptStat(0);
1586 gStyle->SetOptFit(0);
1587 TCanvas *c = new TCanvas("c","c",600,400);
1588 c->SetTopMargin(0.02);
1589 c->SetRightMargin(0.02);
1590 c->SetBorderSize(0);
1593 c->SetBorderMode(0);
1594 c->SetFrameFillColor(0);
1595 c->SetFrameBorderMode(0);
1602 int phosmarker = 20;
1603 int emcalmarker = 24;
1604 float ptcut1 = 0.05;
1606 TH1D *PHOStotal = GetHistoEfficiency(0.12,"PHOStotal",0,colortotal,phosmarker,TPC,ITS);
1607 TH1D *PHOSpi = GetHistoEfficiency(0.12,"PHOSpi",1,colorpi,phosmarker,TPC,ITS);
1608 TH1D *PHOSp = GetHistoEfficiency(0.12,"PHOSp",2,colork,phosmarker,TPC,ITS);
1609 TH1D *PHOSk = GetHistoEfficiency(0.12,"PHOSk",3,colorp,phosmarker,TPC,ITS);
1610 if(!TPC){PHOStotal->GetXaxis()->SetRange(PHOStotal->GetXaxis()->FindBin(0.05),PHOStotal->GetXaxis()->FindBin(1.0));}
1611 else{PHOStotal->GetXaxis()->SetRange(PHOStotal->GetXaxis()->FindBin(0.15),PHOStotal->GetXaxis()->FindBin(3.0));}
1612 PHOStotal->SetMinimum(0.0);
1613 PHOStotal->SetMaximum(1.0);
1615 PHOSpi->Draw("same");
1616 PHOSp->Draw("same");
1617 PHOSk->Draw("same");
1618 TH1D *EMCALtotal = GetHistoEfficiency(0.7,"EMCALtotal",0,colortotal,emcalmarker,TPC,ITS);
1619 TH1D *EMCALpi = GetHistoEfficiency(0.7,"EMCALpi",1,colorpi,emcalmarker,TPC,ITS);
1620 TH1D *EMCALp = GetHistoEfficiency(0.7,"EMCALp",2,colork,emcalmarker,TPC,ITS);
1621 TH1D *EMCALk = GetHistoEfficiency(0.7,"EMCALk",3,colorp,emcalmarker,TPC,ITS);
1622 EMCALtotal->Draw("same");
1623 EMCALpi->Draw("same");
1624 EMCALp->Draw("same");
1625 EMCALk->Draw("same");
1628 TLegend *leg = new TLegend(0.22651,0.247312,0.370805,0.438172);
1629 leg->AddEntry(PHOStotal,"#pi,K,p");
1630 leg->AddEntry(PHOSpi,"#pi^{#pm}");
1631 leg->AddEntry(PHOSk,"K^{#pm}");
1632 leg->AddEntry(PHOSp,"p,#bar{p}");
1633 leg->SetFillStyle(0);
1634 leg->SetFillColor(0);
1635 leg->SetBorderSize(0);
1636 leg->SetTextSize(0.06);
1639 TLine *line = new TLine(0.2,0.0,0.2,1.0);
1641 line->SetLineWidth(3.0);
1642 //line->SetLineColor(TColor::kYellow);
1643 line->SetLineStyle(2);
1644 TLatex *tex = new TLatex(0.497269,0.0513196,prodname);
1645 tex->SetTextSize(0.0537634);
1647 TLatex *tex3 = new TLatex(1.16186,0.28348,"Closed symbols |#eta|<0.12 (PHOS)");
1648 tex3->SetTextSize(0.0537634);
1650 TLatex *tex4 = new TLatex(1.16186,0.213221,"Open symbols |#eta|<0.70 (EMCal)");
1651 tex4->SetTextSize(0.0537634);
1653 TLatex *tex2 = new TLatex(0.241937,0.448436,"Likely TPC cut-off 200 MeV/c");
1654 tex2->SetTextSize(0.0537634);
1658 sprintf(epsname,"pics/%s/CorrEfficiencyITSTPC.eps",shortprodname);
1659 sprintf(pngname,"pics/%s/CorrEfficiencyITSTPC.png",shortprodname);
1662 sprintf(epsname,"pics/%s/CorrEfficiencyTPC.eps",shortprodname);
1663 sprintf(pngname,"pics/%s/CorrEfficiencyTPC.png",shortprodname);
1667 sprintf(epsname,"pics/%s/CorrEfficiencyITS.eps",shortprodname);
1668 sprintf(pngname,"pics/%s/CorrEfficiencyITS.png",shortprodname);
1687 //==================================CorrBkgd=================================================
1688 TH1D *GetHistoCorrBkgd(float etacut,char *name, bool TPC,bool ispp,bool forSim){
1690 char *reweightname = reweightedNo;
1691 if(!forSim) reweightname = reweightedYes;
1692 char *myname = mynameITS;
1693 if(TPC) myname = mynameTPCITS;
1694 TH2F *signal = ((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiPlus",myname)))->Clone("signal");
1695 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedPiMinus",myname)));
1696 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKMinus",myname)));
1697 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedKPlus",myname)));
1698 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedProton",myname)));
1699 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sIdentifiedAntiProton",myname)));
1700 signal->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sUnidentifiedAssumingPion",myname)));
1702 //Et of all unidentified hadrons (plus hadrons identified as pions) calculated assuming their true mass
1703 TH2F *bkgd = ((TH2F*) out2->FindObject(Form("EtReconstructed%sMisidentifiedElectrons",myname)))->Clone("bkgd");
1704 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sLambdaDaughters%s",myname,reweightname)));
1705 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiLambdaDaughters%s",myname,reweightname)));
1706 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sK0SDaughters%s",myname,reweightname)));
1707 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sXiDaughters",myname)));
1708 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiXiDaughters",myname)));
1709 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sOmegaDaughters",myname)));
1710 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sAntiOmegaDaughters",myname)));
1711 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sConversionElectrons",myname)) );
1712 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryMuons",myname)) );
1713 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryPions",myname)) );
1714 bkgd->Add((TH2F*) out2->FindObject(Form("EtReconstructed%sSecondaryProtons",myname)) );
1715 int lowbin = bkgd->GetYaxis()->FindBin(-etacut+.001);//make sure we don't accidentally get the wrong bin
1716 int highbin = bkgd->GetYaxis()->FindBin(etacut-.001);
1717 //cout<<"Projecting from "<<bkgd->GetYaxis()->GetBinLowEdge(lowbin)<<" to "<<bkgd->GetYaxis()->GetBinLowEdge(highbin+1)<<endl;
1720 TH1D *denominator = signal->ProjectionX(name,lowbin,highbin);
1721 TH1D *numerator = bkgd->ProjectionX("numerator",lowbin,highbin);
1722 denominator->Add(numerator);
1723 numerator->Divide(denominator);
1724 numerator->SetYTitle("Ratio of E_{T}^{background}/E_{T}^{real}");
1725 numerator->GetYaxis()->SetTitleOffset(1.2);
1729 numerator->SetName(name);
1734 void CorrBkgdPlots(char *prodname, char *shortprodname, bool TPC,bool ispp,bool forSim){
1735 gStyle->SetOptTitle(0);
1736 gStyle->SetOptStat(0);
1737 gStyle->SetOptFit(0);
1738 TCanvas *c = new TCanvas("c","c",500,400);
1739 c->SetTopMargin(0.04);
1740 c->SetRightMargin(0.04);
1741 c->SetBorderSize(0);
1744 c->SetBorderMode(0);
1745 c->SetFrameFillColor(0);
1746 c->SetFrameBorderMode(0);
1748 TH1D *PHOS = GetHistoCorrBkgd(0.12,"PHOS2",TPC,ispp,forSim);
1749 TH1D *EMCAL = GetHistoCorrBkgd(0.7,"EMCAL2",TPC,ispp,forSim);
1750 PHOS->SetMarkerColor(2);
1751 EMCAL->SetMarkerColor(4);
1752 PHOS->SetLineColor(2);
1753 EMCAL->SetLineColor(4);
1754 //EMCAL->SetLineWidth(2);
1755 //PHOS->SetAxisRange(0.0,4);
1756 PHOS->SetMaximum(0.2);
1757 PHOS->SetMinimum(0.0);
1758 PHOS->SetMarkerStyle(20);;
1759 EMCAL->SetMarkerStyle(21);
1760 // TF1 *funcEMCAL = new TF1("funcEMCAL","[0]+0.0*x",0.05,4);
1761 // funcEMCAL->SetParameter(0,0.95);
1762 // funcEMCAL->SetParLimits(0,0.9,1.1);
1763 //EMCAL->Fit(funcEMCAL);//,"","",0.05,3.0);
1764 // TF1 *funcPHOS = new TF1("funcPHOS","[0]+0.0*x",0.05,4);
1765 // funcPHOS->SetParameter(0,1.0);
1766 //PHOS->Fit(funcPHOS);
1767 if(TPC) PHOS->GetXaxis()->SetRange(PHOS->GetXaxis()->FindBin(0.0),PHOS->GetXaxis()->FindBin(4.));
1768 else{ PHOS->GetXaxis()->SetRange(PHOS->GetXaxis()->FindBin(0.0),PHOS->GetXaxis()->FindBin(1.));}
1770 EMCAL->Draw("same");
1771 TLatex *tex = new TLatex(0.161478,1.0835,prodname);
1772 tex->SetTextSize(0.0537634);
1774 TLegend *leg = new TLegend(0.145161,0.604839,0.40121,0.860215);
1775 leg->AddEntry(PHOS,"|#eta|<0.12");
1776 leg->AddEntry(EMCAL,"|#eta|<0.70");
1777 leg->SetFillStyle(0);
1778 leg->SetFillColor(0);
1779 leg->SetBorderSize(0);
1782 c->SaveAs(Form("pics/%s/bkgdTPC.eps",shortprodname));
1783 c->SaveAs(Form("pics/%s/bkgdTPC.png",shortprodname));
1786 c->SaveAs(Form("pics/%s/bkgdITS.eps",shortprodname));
1787 c->SaveAs(Form("pics/%s/bkgdITS.png",shortprodname));
1798 TH1D *pp276TPCBkgd(){
1799 //=========Macro generated from canvas: c4/c4
1800 //========= (Thu May 5 23:07:14 2011) by ROOT version5.28/00c
1801 TH1D *Allpt7TeVScaling = new TH1D("Allpt7TeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
1802 Allpt7TeVScaling->SetBinContent(13,0.1673787);
1803 Allpt7TeVScaling->SetBinContent(14,0.1548408);
1804 Allpt7TeVScaling->SetBinContent(15,0.1328529);
1805 Allpt7TeVScaling->SetBinContent(16,0.1220669);
1806 Allpt7TeVScaling->SetBinContent(17,0.1109226);
1807 Allpt7TeVScaling->SetBinContent(18,0.0981996);
1808 Allpt7TeVScaling->SetBinContent(19,0.09152354);
1809 Allpt7TeVScaling->SetBinContent(20,0.07937801);
1810 Allpt7TeVScaling->SetBinContent(21,0.07163593);
1811 Allpt7TeVScaling->SetBinContent(22,0.0562236);
1812 Allpt7TeVScaling->SetBinContent(23,0.04398756);
1813 Allpt7TeVScaling->SetBinContent(24,0.039459);
1814 Allpt7TeVScaling->SetBinContent(25,0.03618901);
1815 Allpt7TeVScaling->SetBinContent(26,0.0322147);
1816 Allpt7TeVScaling->SetBinContent(27,0.03294796);
1817 Allpt7TeVScaling->SetBinContent(28,0.03114461);
1818 Allpt7TeVScaling->SetBinContent(29,0.03039579);
1819 Allpt7TeVScaling->SetBinContent(30,0.03261539);
1820 Allpt7TeVScaling->SetBinContent(31,0.03239832);
1821 Allpt7TeVScaling->SetBinContent(32,0.03055859);
1822 Allpt7TeVScaling->SetBinContent(33,0.03181271);
1823 Allpt7TeVScaling->SetBinContent(34,0.02882665);
1824 Allpt7TeVScaling->SetBinContent(35,0.03102149);
1825 Allpt7TeVScaling->SetBinContent(36,0.0272696);
1826 Allpt7TeVScaling->SetBinContent(37,0.02783727);
1827 Allpt7TeVScaling->SetBinContent(38,0.02334413);
1828 Allpt7TeVScaling->SetBinContent(39,0.02357657);
1829 Allpt7TeVScaling->SetBinContent(40,0.02630686);
1830 Allpt7TeVScaling->SetBinContent(41,0.02372341);
1831 Allpt7TeVScaling->SetBinContent(42,0.02279457);
1832 Allpt7TeVScaling->SetBinContent(43,0.01999143);
1833 Allpt7TeVScaling->SetBinContent(44,0.02019579);
1834 Allpt7TeVScaling->SetBinContent(45,0.02029719);
1835 Allpt7TeVScaling->SetBinContent(46,0.0166231);
1836 Allpt7TeVScaling->SetBinContent(47,0.01824842);
1837 Allpt7TeVScaling->SetBinContent(48,0.0188995);
1838 Allpt7TeVScaling->SetBinContent(49,0.01836067);
1839 Allpt7TeVScaling->SetBinContent(50,0.02113978);
1840 Allpt7TeVScaling->SetBinContent(51,0.02236854);
1841 Allpt7TeVScaling->SetBinContent(52,0.0204874);
1842 Allpt7TeVScaling->SetBinContent(53,0.02236788);
1843 Allpt7TeVScaling->SetBinContent(54,0.01862457);
1844 Allpt7TeVScaling->SetBinContent(55,0.0215448);
1845 Allpt7TeVScaling->SetBinContent(56,0.01757402);
1846 Allpt7TeVScaling->SetBinContent(57,0.01899477);
1847 Allpt7TeVScaling->SetBinContent(58,0.01766989);
1848 Allpt7TeVScaling->SetBinContent(59,0.01984435);
1849 Allpt7TeVScaling->SetBinContent(60,0.01842092);
1850 Allpt7TeVScaling->SetBinContent(61,0.01668053);
1851 Allpt7TeVScaling->SetBinContent(62,0.01708603);
1852 Allpt7TeVScaling->SetBinContent(63,0.01557306);
1853 Allpt7TeVScaling->SetBinContent(64,0.01878942);
1854 Allpt7TeVScaling->SetBinContent(65,0.01458043);
1855 Allpt7TeVScaling->SetBinContent(66,0.0151346);
1856 Allpt7TeVScaling->SetBinContent(67,0.01565407);
1857 Allpt7TeVScaling->SetBinContent(68,0.01327014);
1858 Allpt7TeVScaling->SetBinContent(69,0.01284378);
1859 Allpt7TeVScaling->SetBinContent(70,0.01046102);
1860 Allpt7TeVScaling->SetBinContent(71,0.009963117);
1861 Allpt7TeVScaling->SetBinContent(72,0.01359609);
1862 Allpt7TeVScaling->SetBinContent(73,0.01088263);
1863 Allpt7TeVScaling->SetBinContent(74,0.01317689);
1864 Allpt7TeVScaling->SetBinContent(75,0.01433201);
1865 Allpt7TeVScaling->SetBinContent(76,0.01215939);
1866 Allpt7TeVScaling->SetBinContent(77,0.01380766);
1867 Allpt7TeVScaling->SetBinContent(78,0.01499505);
1868 Allpt7TeVScaling->SetBinContent(79,0.015013);
1869 Allpt7TeVScaling->SetBinContent(80,0.01140629);
1870 Allpt7TeVScaling->SetBinContent(81,0.009461979);
1871 Allpt7TeVScaling->SetBinContent(82,0.007775343);
1872 Allpt7TeVScaling->SetBinContent(83,0.01092198);
1873 Allpt7TeVScaling->SetBinContent(84,0.009924767);
1874 Allpt7TeVScaling->SetBinContent(85,0.006399066);
1875 Allpt7TeVScaling->SetBinContent(86,0.008370865);
1876 Allpt7TeVScaling->SetBinContent(87,0.01115192);
1877 Allpt7TeVScaling->SetBinContent(88,0.003781796);
1878 Allpt7TeVScaling->SetBinContent(89,0.01596916);
1879 Allpt7TeVScaling->SetBinContent(90,0.005959723);
1880 Allpt7TeVScaling->SetBinContent(91,0.006885685);
1881 Allpt7TeVScaling->SetBinContent(93,0.006011974);
1882 Allpt7TeVScaling->SetBinContent(94,0.008862645);
1883 Allpt7TeVScaling->SetBinContent(95,0.009963223);
1884 Allpt7TeVScaling->SetBinContent(96,0.01457121);
1885 Allpt7TeVScaling->SetBinContent(97,0.007500135);
1886 Allpt7TeVScaling->SetBinContent(98,0.02636933);
1887 Allpt7TeVScaling->SetBinContent(103,0.06353767);
1888 Allpt7TeVScaling->SetBinError(13,0.02859277);
1889 Allpt7TeVScaling->SetBinError(14,0.006796474);
1890 Allpt7TeVScaling->SetBinError(15,0.004234415);
1891 Allpt7TeVScaling->SetBinError(16,0.0036414);
1892 Allpt7TeVScaling->SetBinError(17,0.003333835);
1893 Allpt7TeVScaling->SetBinError(18,0.003009034);
1894 Allpt7TeVScaling->SetBinError(19,0.002839933);
1895 Allpt7TeVScaling->SetBinError(20,0.002588262);
1896 Allpt7TeVScaling->SetBinError(21,0.001703954);
1897 Allpt7TeVScaling->SetBinError(22,0.001495734);
1898 Allpt7TeVScaling->SetBinError(23,0.001297475);
1899 Allpt7TeVScaling->SetBinError(24,0.001213434);
1900 Allpt7TeVScaling->SetBinError(25,0.001162398);
1901 Allpt7TeVScaling->SetBinError(26,0.001137158);
1902 Allpt7TeVScaling->SetBinError(27,0.001208358);
1903 Allpt7TeVScaling->SetBinError(28,0.001183675);
1904 Allpt7TeVScaling->SetBinError(29,0.001263691);
1905 Allpt7TeVScaling->SetBinError(30,0.001320041);
1906 Allpt7TeVScaling->SetBinError(31,0.001362399);
1907 Allpt7TeVScaling->SetBinError(32,0.001338259);
1908 Allpt7TeVScaling->SetBinError(33,0.001369813);
1909 Allpt7TeVScaling->SetBinError(34,0.001358652);
1910 Allpt7TeVScaling->SetBinError(35,0.00142864);
1911 Allpt7TeVScaling->SetBinError(36,0.001378454);
1912 Allpt7TeVScaling->SetBinError(37,0.001384729);
1913 Allpt7TeVScaling->SetBinError(38,0.001257903);
1914 Allpt7TeVScaling->SetBinError(39,0.001295459);
1915 Allpt7TeVScaling->SetBinError(40,0.001546992);
1916 Allpt7TeVScaling->SetBinError(41,0.001496938);
1917 Allpt7TeVScaling->SetBinError(42,0.001486813);
1918 Allpt7TeVScaling->SetBinError(43,0.00140119);
1919 Allpt7TeVScaling->SetBinError(44,0.001478331);
1920 Allpt7TeVScaling->SetBinError(45,0.001566594);
1921 Allpt7TeVScaling->SetBinError(46,0.001407568);
1922 Allpt7TeVScaling->SetBinError(47,0.001509742);
1923 Allpt7TeVScaling->SetBinError(48,0.001583129);
1924 Allpt7TeVScaling->SetBinError(49,0.001668789);
1925 Allpt7TeVScaling->SetBinError(50,0.001915902);
1926 Allpt7TeVScaling->SetBinError(51,0.001968585);
1927 Allpt7TeVScaling->SetBinError(52,0.00195473);
1928 Allpt7TeVScaling->SetBinError(53,0.00207896);
1929 Allpt7TeVScaling->SetBinError(54,0.001937327);
1930 Allpt7TeVScaling->SetBinError(55,0.002108783);
1931 Allpt7TeVScaling->SetBinError(56,0.001816997);
1932 Allpt7TeVScaling->SetBinError(57,0.001892795);
1933 Allpt7TeVScaling->SetBinError(58,0.001803616);
1934 Allpt7TeVScaling->SetBinError(59,0.001994761);
1935 Allpt7TeVScaling->SetBinError(60,0.001964909);
1936 Allpt7TeVScaling->SetBinError(61,0.001255034);
1937 Allpt7TeVScaling->SetBinError(62,0.001312232);
1938 Allpt7TeVScaling->SetBinError(63,0.001358296);
1939 Allpt7TeVScaling->SetBinError(64,0.001569736);
1940 Allpt7TeVScaling->SetBinError(65,0.001469072);
1941 Allpt7TeVScaling->SetBinError(66,0.001588803);
1942 Allpt7TeVScaling->SetBinError(67,0.001683862);
1943 Allpt7TeVScaling->SetBinError(68,0.00164699);
1944 Allpt7TeVScaling->SetBinError(69,0.001760645);
1945 Allpt7TeVScaling->SetBinError(70,0.00160423);
1946 Allpt7TeVScaling->SetBinError(71,0.001693146);
1947 Allpt7TeVScaling->SetBinError(72,0.002042705);
1948 Allpt7TeVScaling->SetBinError(73,0.001965856);
1949 Allpt7TeVScaling->SetBinError(74,0.002245841);
1950 Allpt7TeVScaling->SetBinError(75,0.002520926);
1951 Allpt7TeVScaling->SetBinError(76,0.002402524);
1952 Allpt7TeVScaling->SetBinError(77,0.002627656);
1953 Allpt7TeVScaling->SetBinError(78,0.002963027);
1954 Allpt7TeVScaling->SetBinError(79,0.003088673);
1955 Allpt7TeVScaling->SetBinError(80,0.002958055);
1956 Allpt7TeVScaling->SetBinError(81,0.001434729);
1957 Allpt7TeVScaling->SetBinError(82,0.001531537);
1958 Allpt7TeVScaling->SetBinError(83,0.002200666);
1959 Allpt7TeVScaling->SetBinError(84,0.00242244);
1960 Allpt7TeVScaling->SetBinError(85,0.002270338);
1961 Allpt7TeVScaling->SetBinError(86,0.002972849);
1962 Allpt7TeVScaling->SetBinError(87,0.003966084);
1963 Allpt7TeVScaling->SetBinError(88,0.002679263);
1964 Allpt7TeVScaling->SetBinError(89,0.006083804);
1965 Allpt7TeVScaling->SetBinError(90,0.004227019);
1966 Allpt7TeVScaling->SetBinError(91,0.004886052);
1967 Allpt7TeVScaling->SetBinError(93,0.006030514);
1968 Allpt7TeVScaling->SetBinError(94,0.008892003);
1969 Allpt7TeVScaling->SetBinError(95,0.01001297);
1970 Allpt7TeVScaling->SetBinError(96,0.008480241);
1971 Allpt7TeVScaling->SetBinError(97,0.007527505);
1972 Allpt7TeVScaling->SetBinError(98,0.01889477);
1973 Allpt7TeVScaling->SetBinError(103,0.065502);
1974 Allpt7TeVScaling->SetMinimum(0);
1975 Allpt7TeVScaling->SetMaximum(0.04);
1976 Allpt7TeVScaling->SetEntries(1049.145);
1977 Allpt7TeVScaling->SetStats(0);
1978 Allpt7TeVScaling->SetMarkerStyle(20);
1979 Allpt7TeVScaling->GetXaxis()->SetTitle("p_{T}");
1980 Allpt7TeVScaling->GetXaxis()->SetRange(1,91);
1981 Allpt7TeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
1982 Allpt7TeVScaling->GetYaxis()->SetTitleOffset(1.2);
1983 TH1D *Allpt900GeVScaling = new TH1D("Allpt900GeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
1984 Allpt900GeVScaling->SetBinContent(13,0.1950247);
1985 Allpt900GeVScaling->SetBinContent(14,0.147561);
1986 Allpt900GeVScaling->SetBinContent(15,0.136378);
1987 Allpt900GeVScaling->SetBinContent(16,0.1233744);
1988 Allpt900GeVScaling->SetBinContent(17,0.1126807);
1989 Allpt900GeVScaling->SetBinContent(18,0.09909555);
1990 Allpt900GeVScaling->SetBinContent(19,0.09191239);
1991 Allpt900GeVScaling->SetBinContent(20,0.08438053);
1992 Allpt900GeVScaling->SetBinContent(21,0.07119319);
1993 Allpt900GeVScaling->SetBinContent(22,0.05773434);
1994 Allpt900GeVScaling->SetBinContent(23,0.04292845);
1995 Allpt900GeVScaling->SetBinContent(24,0.0396127);
1996 Allpt900GeVScaling->SetBinContent(25,0.03395077);
1997 Allpt900GeVScaling->SetBinContent(26,0.03305251);
1998 Allpt900GeVScaling->SetBinContent(27,0.03297093);
1999 Allpt900GeVScaling->SetBinContent(28,0.031215);
2000 Allpt900GeVScaling->SetBinContent(29,0.03178372);
2001 Allpt900GeVScaling->SetBinContent(30,0.03236985);
2002 Allpt900GeVScaling->SetBinContent(31,0.03271276);
2003 Allpt900GeVScaling->SetBinContent(32,0.02993124);
2004 Allpt900GeVScaling->SetBinContent(33,0.03004746);
2005 Allpt900GeVScaling->SetBinContent(34,0.03077143);
2006 Allpt900GeVScaling->SetBinContent(35,0.03211214);
2007 Allpt900GeVScaling->SetBinContent(36,0.02807512);
2008 Allpt900GeVScaling->SetBinContent(37,0.02651954);
2009 Allpt900GeVScaling->SetBinContent(38,0.02503885);
2010 Allpt900GeVScaling->SetBinContent(39,0.02325777);
2011 Allpt900GeVScaling->SetBinContent(40,0.02773712);
2012 Allpt900GeVScaling->SetBinContent(41,0.02491155);
2013 Allpt900GeVScaling->SetBinContent(42,0.02389028);
2014 Allpt900GeVScaling->SetBinContent(43,0.02085532);
2015 Allpt900GeVScaling->SetBinContent(44,0.01959721);
2016 Allpt900GeVScaling->SetBinContent(45,0.01937255);
2017 Allpt900GeVScaling->SetBinContent(46,0.01745646);
2018 Allpt900GeVScaling->SetBinContent(47,0.01890853);
2019 Allpt900GeVScaling->SetBinContent(48,0.02053692);
2020 Allpt900GeVScaling->SetBinContent(49,0.01813791);
2021 Allpt900GeVScaling->SetBinContent(50,0.02187495);
2022 Allpt900GeVScaling->SetBinContent(51,0.02409687);
2023 Allpt900GeVScaling->SetBinContent(52,0.0206565);
2024 Allpt900GeVScaling->SetBinContent(53,0.02269165);
2025 Allpt900GeVScaling->SetBinContent(54,0.01850795);
2026 Allpt900GeVScaling->SetBinContent(55,0.02115427);
2027 Allpt900GeVScaling->SetBinContent(56,0.01543302);
2028 Allpt900GeVScaling->SetBinContent(57,0.01642095);
2029 Allpt900GeVScaling->SetBinContent(58,0.01542331);
2030 Allpt900GeVScaling->SetBinContent(59,0.01931254);
2031 Allpt900GeVScaling->SetBinContent(60,0.01650654);
2032 Allpt900GeVScaling->SetBinContent(61,0.01827512);
2033 Allpt900GeVScaling->SetBinContent(62,0.01700125);
2034 Allpt900GeVScaling->SetBinContent(63,0.01544321);
2035 Allpt900GeVScaling->SetBinContent(64,0.01830588);
2036 Allpt900GeVScaling->SetBinContent(65,0.01584369);
2037 Allpt900GeVScaling->SetBinContent(66,0.0145421);
2038 Allpt900GeVScaling->SetBinContent(67,0.01382206);
2039 Allpt900GeVScaling->SetBinContent(68,0.01358825);
2040 Allpt900GeVScaling->SetBinContent(69,0.01294888);
2041 Allpt900GeVScaling->SetBinContent(70,0.009346655);
2042 Allpt900GeVScaling->SetBinContent(71,0.01235781);
2043 Allpt900GeVScaling->SetBinContent(72,0.0127376);
2044 Allpt900GeVScaling->SetBinContent(73,0.008968166);
2045 Allpt900GeVScaling->SetBinContent(74,0.01467765);
2046 Allpt900GeVScaling->SetBinContent(75,0.01432309);
2047 Allpt900GeVScaling->SetBinContent(76,0.01204856);
2048 Allpt900GeVScaling->SetBinContent(77,0.01436071);
2049 Allpt900GeVScaling->SetBinContent(78,0.01451222);
2050 Allpt900GeVScaling->SetBinContent(79,0.01378967);
2051 Allpt900GeVScaling->SetBinContent(80,0.01040148);
2052 Allpt900GeVScaling->SetBinContent(81,0.01041213);
2053 Allpt900GeVScaling->SetBinContent(82,0.009971816);
2054 Allpt900GeVScaling->SetBinContent(83,0.01417668);
2055 Allpt900GeVScaling->SetBinContent(84,0.008713292);
2056 Allpt900GeVScaling->SetBinContent(85,0.005425386);
2057 Allpt900GeVScaling->SetBinContent(86,0.005303683);
2058 Allpt900GeVScaling->SetBinContent(87,0.006759432);
2059 Allpt900GeVScaling->SetBinContent(88,0.004445477);
2060 Allpt900GeVScaling->SetBinContent(89,0.01810702);
2061 Allpt900GeVScaling->SetBinContent(90,0.0108909);
2062 Allpt900GeVScaling->SetBinContent(91,0.01186746);
2063 Allpt900GeVScaling->SetBinContent(92,0.006128581);
2064 Allpt900GeVScaling->SetBinContent(93,0.007452721);
2065 Allpt900GeVScaling->SetBinContent(94,0.0259471);
2066 Allpt900GeVScaling->SetBinContent(95,0.0114321);
2067 Allpt900GeVScaling->SetBinContent(98,0.03264295);
2068 Allpt900GeVScaling->SetBinContent(103,0.07829265);
2069 Allpt900GeVScaling->SetBinError(13,0.03504783);
2070 Allpt900GeVScaling->SetBinError(14,0.007336667);
2071 Allpt900GeVScaling->SetBinError(15,0.004765958);
2072 Allpt900GeVScaling->SetBinError(16,0.004028143);
2073 Allpt900GeVScaling->SetBinError(17,0.003760166);
2074 Allpt900GeVScaling->SetBinError(18,0.003357858);
2075 Allpt900GeVScaling->SetBinError(19,0.003156502);
2076 Allpt900GeVScaling->SetBinError(20,0.002970822);
2077 Allpt900GeVScaling->SetBinError(21,0.001886555);
2078 Allpt900GeVScaling->SetBinError(22,0.001676045);
2079 Allpt900GeVScaling->SetBinError(23,0.001411794);
2080 Allpt900GeVScaling->SetBinError(24,0.001346425);
2081 Allpt900GeVScaling->SetBinError(25,0.001254258);
2082 Allpt900GeVScaling->SetBinError(26,0.001299384);
2083 Allpt900GeVScaling->SetBinError(27,0.001328066);
2084 Allpt900GeVScaling->SetBinError(28,0.001330088);
2085 Allpt900GeVScaling->SetBinError(29,0.001446767);
2086 Allpt900GeVScaling->SetBinError(30,0.00145402);
2087 Allpt900GeVScaling->SetBinError(31,0.001463994);
2088 Allpt900GeVScaling->SetBinError(32,0.001449209);
2089 Allpt900GeVScaling->SetBinError(33,0.001414847);
2090 Allpt900GeVScaling->SetBinError(34,0.001598429);
2091 Allpt900GeVScaling->SetBinError(35,0.001590854);
2092 Allpt900GeVScaling->SetBinError(36,0.001526798);
2093 Allpt900GeVScaling->SetBinError(37,0.001486126);
2094 Allpt900GeVScaling->SetBinError(38,0.001457142);
2095 Allpt900GeVScaling->SetBinError(39,0.001474238);
2096 Allpt900GeVScaling->SetBinError(40,0.001757902);
2097 Allpt900GeVScaling->SetBinError(41,0.001712601);
2098 Allpt900GeVScaling->SetBinError(42,0.001671385);
2099 Allpt900GeVScaling->SetBinError(43,0.001570556);
2100 Allpt900GeVScaling->SetBinError(44,0.001627725);
2101 Allpt900GeVScaling->SetBinError(45,0.001637262);
2102 Allpt900GeVScaling->SetBinError(46,0.001641227);
2103 Allpt900GeVScaling->SetBinError(47,0.001716345);
2104 Allpt900GeVScaling->SetBinError(48,0.001907778);
2105 Allpt900GeVScaling->SetBinError(49,0.001842589);
2106 Allpt900GeVScaling->SetBinError(50,0.00215445);
2107 Allpt900GeVScaling->SetBinError(51,0.002310602);
2108 Allpt900GeVScaling->SetBinError(52,0.002171046);
2109 Allpt900GeVScaling->SetBinError(53,0.002386521);
2110 Allpt900GeVScaling->SetBinError(54,0.002149237);
2111 Allpt900GeVScaling->SetBinError(55,0.002233898);
2112 Allpt900GeVScaling->SetBinError(56,0.001856697);
2113 Allpt900GeVScaling->SetBinError(57,0.001891742);
2114 Allpt900GeVScaling->SetBinError(58,0.001840334);
2115 Allpt900GeVScaling->SetBinError(59,0.002168741);
2116 Allpt900GeVScaling->SetBinError(60,0.002044863);
2117 Allpt900GeVScaling->SetBinError(61,0.001431972);
2118 Allpt900GeVScaling->SetBinError(62,0.001452706);
2119 Allpt900GeVScaling->SetBinError(63,0.001477499);
2120 Allpt900GeVScaling->SetBinError(64,0.001722091);
2121 Allpt900GeVScaling->SetBinError(65,0.001674803);
2122 Allpt900GeVScaling->SetBinError(66,0.001737491);
2123 Allpt900GeVScaling->SetBinError(67,0.001783912);
2124 Allpt900GeVScaling->SetBinError(68,0.00186443);
2125 Allpt900GeVScaling->SetBinError(69,0.001965873);
2126 Allpt900GeVScaling->SetBinError(70,0.001687347);
2127 Allpt900GeVScaling->SetBinError(71,0.002072538);
2128 Allpt900GeVScaling->SetBinError(72,0.002233273);
2129 Allpt900GeVScaling->SetBinError(73,0.001965905);
2130 Allpt900GeVScaling->SetBinError(74,0.002669571);
2131 Allpt900GeVScaling->SetBinError(75,0.00278613);
2132 Allpt900GeVScaling->SetBinError(76,0.002661412);
2133 Allpt900GeVScaling->SetBinError(77,0.002952605);
2134 Allpt900GeVScaling->SetBinError(78,0.003268721);
2135 Allpt900GeVScaling->SetBinError(79,0.003273694);
2136 Allpt900GeVScaling->SetBinError(80,0.002900898);
2137 Allpt900GeVScaling->SetBinError(81,0.001677933);
2138 Allpt900GeVScaling->SetBinError(82,0.001933408);
2139 Allpt900GeVScaling->SetBinError(83,0.002759328);
2140 Allpt900GeVScaling->SetBinError(84,0.002526604);
2141 Allpt900GeVScaling->SetBinError(85,0.002297818);
2142 Allpt900GeVScaling->SetBinError(86,0.002659213);
2143 Allpt900GeVScaling->SetBinError(87,0.003392141);
2144 Allpt900GeVScaling->SetBinError(88,0.003150511);
2145 Allpt900GeVScaling->SetBinError(89,0.007499872);
2146 Allpt900GeVScaling->SetBinError(90,0.006322856);
2147 Allpt900GeVScaling->SetBinError(91,0.00689283);
2148 Allpt900GeVScaling->SetBinError(92,0.006146806);
2149 Allpt900GeVScaling->SetBinError(93,0.007481131);
2150 Allpt900GeVScaling->SetBinError(94,0.01853139);
2151 Allpt900GeVScaling->SetBinError(95,0.01149767);
2152 Allpt900GeVScaling->SetBinError(98,0.02345991);
2153 Allpt900GeVScaling->SetBinError(103,0.08126059);
2154 Allpt900GeVScaling->SetMinimum(0);
2155 Allpt900GeVScaling->SetMaximum(0.04);
2156 Allpt900GeVScaling->SetEntries(724.3671);
2157 Allpt900GeVScaling->SetStats(0);
2158 Allpt900GeVScaling->SetMarkerStyle(20);
2159 Allpt900GeVScaling->GetXaxis()->SetTitle("p_{T}");
2160 Allpt900GeVScaling->GetXaxis()->SetRange(1,91);
2161 Allpt900GeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
2162 Allpt900GeVScaling->GetYaxis()->SetTitleOffset(1.2);
2163 Allpt7TeVScaling->Add(Allpt900GeVScaling);
2164 Allpt7TeVScaling->Scale(0.5);
2165 delete Allpt900GeVScaling;
2166 return Allpt7TeVScaling;
2169 TH1D *PbPb276TPCBkgd(){
2170 TH1D *Allpt7TeVScaling = new TH1D("Allpt7TeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
2171 Allpt7TeVScaling->SetBinContent(13,0.1745755);
2172 Allpt7TeVScaling->SetBinContent(14,0.1624186);
2173 Allpt7TeVScaling->SetBinContent(15,0.1431048);
2174 Allpt7TeVScaling->SetBinContent(16,0.1331614);
2175 Allpt7TeVScaling->SetBinContent(17,0.121262);
2176 Allpt7TeVScaling->SetBinContent(18,0.1082923);
2177 Allpt7TeVScaling->SetBinContent(19,0.1011451);
2178 Allpt7TeVScaling->SetBinContent(20,0.08875923);
2179 Allpt7TeVScaling->SetBinContent(21,0.08100933);
2180 Allpt7TeVScaling->SetBinContent(22,0.06527292);
2181 Allpt7TeVScaling->SetBinContent(23,0.05220065);
2182 Allpt7TeVScaling->SetBinContent(24,0.04752904);
2183 Allpt7TeVScaling->SetBinContent(25,0.04421568);
2184 Allpt7TeVScaling->SetBinContent(26,0.03879551);
2185 Allpt7TeVScaling->SetBinContent(27,0.03944679);
2186 Allpt7TeVScaling->SetBinContent(28,0.03707215);
2187 Allpt7TeVScaling->SetBinContent(29,0.03663599);
2188 Allpt7TeVScaling->SetBinContent(30,0.03937437);
2189 Allpt7TeVScaling->SetBinContent(31,0.03888919);
2190 Allpt7TeVScaling->SetBinContent(32,0.03646502);
2191 Allpt7TeVScaling->SetBinContent(33,0.03784992);
2192 Allpt7TeVScaling->SetBinContent(34,0.03360079);
2193 Allpt7TeVScaling->SetBinContent(35,0.03761566);
2194 Allpt7TeVScaling->SetBinContent(36,0.03276653);
2195 Allpt7TeVScaling->SetBinContent(37,0.03401566);
2196 Allpt7TeVScaling->SetBinContent(38,0.02803893);
2197 Allpt7TeVScaling->SetBinContent(39,0.0290018);
2198 Allpt7TeVScaling->SetBinContent(40,0.03323201);
2199 Allpt7TeVScaling->SetBinContent(41,0.03006077);
2200 Allpt7TeVScaling->SetBinContent(42,0.02867674);
2201 Allpt7TeVScaling->SetBinContent(43,0.02471421);
2202 Allpt7TeVScaling->SetBinContent(44,0.02610375);
2203 Allpt7TeVScaling->SetBinContent(45,0.02601621);
2204 Allpt7TeVScaling->SetBinContent(46,0.02184781);
2205 Allpt7TeVScaling->SetBinContent(47,0.02479646);
2206 Allpt7TeVScaling->SetBinContent(48,0.02519956);
2207 Allpt7TeVScaling->SetBinContent(49,0.02376095);
2208 Allpt7TeVScaling->SetBinContent(50,0.02836189);
2209 Allpt7TeVScaling->SetBinContent(51,0.0339595);
2210 Allpt7TeVScaling->SetBinContent(52,0.03057126);
2211 Allpt7TeVScaling->SetBinContent(53,0.03238621);
2212 Allpt7TeVScaling->SetBinContent(54,0.0264272);
2213 Allpt7TeVScaling->SetBinContent(55,0.03203146);
2214 Allpt7TeVScaling->SetBinContent(56,0.02554187);
2215 Allpt7TeVScaling->SetBinContent(57,0.02901947);
2216 Allpt7TeVScaling->SetBinContent(58,0.02584016);
2217 Allpt7TeVScaling->SetBinContent(59,0.03055042);
2218 Allpt7TeVScaling->SetBinContent(60,0.02658193);
2219 Allpt7TeVScaling->SetBinContent(61,0.02553988);
2220 Allpt7TeVScaling->SetBinContent(62,0.02787508);
2221 Allpt7TeVScaling->SetBinContent(63,0.02836785);
2222 Allpt7TeVScaling->SetBinContent(64,0.03449766);
2223 Allpt7TeVScaling->SetBinContent(65,0.02710397);
2224 Allpt7TeVScaling->SetBinContent(66,0.02741966);
2225 Allpt7TeVScaling->SetBinContent(67,0.03184318);
2226 Allpt7TeVScaling->SetBinContent(68,0.02993716);
2227 Allpt7TeVScaling->SetBinContent(69,0.03113033);
2228 Allpt7TeVScaling->SetBinContent(70,0.01946293);
2229 Allpt7TeVScaling->SetBinContent(71,0.02890383);
2230 Allpt7TeVScaling->SetBinContent(72,0.02602078);
2231 Allpt7TeVScaling->SetBinContent(73,0.02063028);
2232 Allpt7TeVScaling->SetBinContent(74,0.03186679);
2233 Allpt7TeVScaling->SetBinContent(75,0.0399062);
2234 Allpt7TeVScaling->SetBinContent(76,0.02051914);
2235 Allpt7TeVScaling->SetBinContent(77,0.04454688);
2236 Allpt7TeVScaling->SetBinContent(78,0.04798449);
2237 Allpt7TeVScaling->SetBinContent(79,0.0311417);
2238 Allpt7TeVScaling->SetBinContent(80,0.03774521);
2239 Allpt7TeVScaling->SetBinContent(81,0.0219128);
2240 Allpt7TeVScaling->SetBinContent(82,0.02323492);
2241 Allpt7TeVScaling->SetBinContent(83,0.02412182);
2242 Allpt7TeVScaling->SetBinContent(84,0.03636555);
2243 Allpt7TeVScaling->SetBinContent(85,0.007488934);
2244 Allpt7TeVScaling->SetBinContent(86,0.01676086);
2245 Allpt7TeVScaling->SetBinContent(87,0.02427021);
2246 Allpt7TeVScaling->SetBinContent(88,0.02482882);
2247 Allpt7TeVScaling->SetBinContent(89,0.03680926);
2248 Allpt7TeVScaling->SetBinContent(90,0.01600685);
2249 Allpt7TeVScaling->SetBinContent(91,0.006885685);
2250 Allpt7TeVScaling->SetBinContent(93,0.0195411);
2251 Allpt7TeVScaling->SetBinContent(94,0.008862645);
2252 Allpt7TeVScaling->SetBinContent(95,0.009963223);
2253 Allpt7TeVScaling->SetBinContent(96,0.01399091);
2254 Allpt7TeVScaling->SetBinContent(97,0.007500135);
2255 Allpt7TeVScaling->SetBinContent(98,0.01922651);
2256 Allpt7TeVScaling->SetBinContent(103,0.03511665);
2257 Allpt7TeVScaling->SetBinError(13,0.03042345);
2258 Allpt7TeVScaling->SetBinError(14,0.007201474);
2259 Allpt7TeVScaling->SetBinError(15,0.004623859);
2260 Allpt7TeVScaling->SetBinError(16,0.004039713);
2261 Allpt7TeVScaling->SetBinError(17,0.003694238);
2262 Allpt7TeVScaling->SetBinError(18,0.003377785);
2263 Allpt7TeVScaling->SetBinError(19,0.00319956);
2264 Allpt7TeVScaling->SetBinError(20,0.00294949);
2265 Allpt7TeVScaling->SetBinError(21,0.001965652);
2266 Allpt7TeVScaling->SetBinError(22,0.001771706);
2267 Allpt7TeVScaling->SetBinError(23,0.0015726);
2268 Allpt7TeVScaling->SetBinError(24,0.001495611);
2269 Allpt7TeVScaling->SetBinError(25,0.00145454);
2270 Allpt7TeVScaling->SetBinError(26,0.001398941);
2271 Allpt7TeVScaling->SetBinError(27,0.001495129);
2272 Allpt7TeVScaling->SetBinError(28,0.001474393);
2273 Allpt7TeVScaling->SetBinError(29,0.001608602);
2274 Allpt7TeVScaling->SetBinError(30,0.001684714);
2275 Allpt7TeVScaling->SetBinError(31,0.001755251);
2276 Allpt7TeVScaling->SetBinError(32,0.001658064);
2277 Allpt7TeVScaling->SetBinError(33,0.001734642);
2278 Allpt7TeVScaling->SetBinError(34,0.001624169);
2279 Allpt7TeVScaling->SetBinError(35,0.001893747);
2280 Allpt7TeVScaling->SetBinError(36,0.001748243);
2281 Allpt7TeVScaling->SetBinError(37,0.001824646);
2282 Allpt7TeVScaling->SetBinError(38,0.001587514);
2283 Allpt7TeVScaling->SetBinError(39,0.001697203);
2284 Allpt7TeVScaling->SetBinError(40,0.002112545);
2285 Allpt7TeVScaling->SetBinError(41,0.002060819);
2286 Allpt7TeVScaling->SetBinError(42,0.002026571);
2287 Allpt7TeVScaling->SetBinError(43,0.001821759);
2288 Allpt7TeVScaling->SetBinError(44,0.002051793);
2289 Allpt7TeVScaling->SetBinError(45,0.002193957);
2290 Allpt7TeVScaling->SetBinError(46,0.001991362);
2291 Allpt7TeVScaling->SetBinError(47,0.002242771);
2292 Allpt7TeVScaling->SetBinError(48,0.002305595);
2293 Allpt7TeVScaling->SetBinError(49,0.002335076);
2294 Allpt7TeVScaling->SetBinError(50,0.002798601);
2295 Allpt7TeVScaling->SetBinError(51,0.003536788);
2296 Allpt7TeVScaling->SetBinError(52,0.003440952);
2297 Allpt7TeVScaling->SetBinError(53,0.003495971);
2298 Allpt7TeVScaling->SetBinError(54,0.003067046);
2299 Allpt7TeVScaling->SetBinError(55,0.003553133);
2300 Allpt7TeVScaling->SetBinError(56,0.003084681);
2301 Allpt7TeVScaling->SetBinError(57,0.003207651);
2302 Allpt7TeVScaling->SetBinError(58,0.002958898);
2303 Allpt7TeVScaling->SetBinError(59,0.003486212);
2304 Allpt7TeVScaling->SetBinError(60,0.003160784);
2305 Allpt7TeVScaling->SetBinError(61,0.00221753);
2306 Allpt7TeVScaling->SetBinError(62,0.002573063);
2307 Allpt7TeVScaling->SetBinError(63,0.003014171);
2308 Allpt7TeVScaling->SetBinError(64,0.003535776);
2309 Allpt7TeVScaling->SetBinError(65,0.003472028);
2310 Allpt7TeVScaling->SetBinError(66,0.003649103);
2311 Allpt7TeVScaling->SetBinError(67,0.004547596);
2312 Allpt7TeVScaling->SetBinError(68,0.004987629);
2313 Allpt7TeVScaling->SetBinError(69,0.005726305);
2314 Allpt7TeVScaling->SetBinError(70,0.003978767);
2315 Allpt7TeVScaling->SetBinError(71,0.00668463);
2316 Allpt7TeVScaling->SetBinError(72,0.005573138);
2317 Allpt7TeVScaling->SetBinError(73,0.005310436);
2318 Allpt7TeVScaling->SetBinError(74,0.007698246);
2319 Allpt7TeVScaling->SetBinError(75,0.01002912);
2320 Allpt7TeVScaling->SetBinError(76,0.006029285);
2321 Allpt7TeVScaling->SetBinError(77,0.0117225);
2322 Allpt7TeVScaling->SetBinError(78,0.01333887);
2323 Allpt7TeVScaling->SetBinError(79,0.009949805);
2324 Allpt7TeVScaling->SetBinError(80,0.01335105);
2325 Allpt7TeVScaling->SetBinError(81,0.004966615);
2326 Allpt7TeVScaling->SetBinError(82,0.006669427);
2327 Allpt7TeVScaling->SetBinError(83,0.007591192);
2328 Allpt7TeVScaling->SetBinError(84,0.01217267);
2329 Allpt7TeVScaling->SetBinError(85,0.002708538);
2330 Allpt7TeVScaling->SetBinError(86,0.008143581);
2331 Allpt7TeVScaling->SetBinError(87,0.01149673);
2332 Allpt7TeVScaling->SetBinError(88,0.01759547);
2333 Allpt7TeVScaling->SetBinError(89,0.01766708);
2334 Allpt7TeVScaling->SetBinError(90,0.01339557);
2335 Allpt7TeVScaling->SetBinError(91,0.004886052);
2336 Allpt7TeVScaling->SetBinError(93,0.01960311);
2337 Allpt7TeVScaling->SetBinError(94,0.008892003);
2338 Allpt7TeVScaling->SetBinError(95,0.01001297);
2339 Allpt7TeVScaling->SetBinError(96,0.008178781);
2340 Allpt7TeVScaling->SetBinError(97,0.007527505);
2341 Allpt7TeVScaling->SetBinError(98,0.01463862);
2342 Allpt7TeVScaling->SetBinError(103,0.03621621);
2343 Allpt7TeVScaling->SetMinimum(0);
2344 Allpt7TeVScaling->SetMaximum(0.04);
2345 Allpt7TeVScaling->SetEntries(1949.423);
2346 Allpt7TeVScaling->SetStats(0);
2347 Allpt7TeVScaling->SetMarkerStyle(20);
2348 Allpt7TeVScaling->GetXaxis()->SetTitle("p_{T}");
2349 Allpt7TeVScaling->GetXaxis()->SetRange(1,91);
2350 Allpt7TeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
2351 Allpt7TeVScaling->GetYaxis()->SetTitleOffset(1.2);
2353 TH1D *Allpt900GeVScaling = new TH1D("Allpt900GeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
2354 Allpt900GeVScaling->SetBinContent(13,0.2098361);
2355 Allpt900GeVScaling->SetBinContent(14,0.1557776);
2356 Allpt900GeVScaling->SetBinContent(15,0.1480364);
2357 Allpt900GeVScaling->SetBinContent(16,0.1368096);
2358 Allpt900GeVScaling->SetBinContent(17,0.1244875);
2359 Allpt900GeVScaling->SetBinContent(18,0.1119436);
2360 Allpt900GeVScaling->SetBinContent(19,0.104192);
2361 Allpt900GeVScaling->SetBinContent(20,0.0938359);
2362 Allpt900GeVScaling->SetBinContent(21,0.08228509);
2363 Allpt900GeVScaling->SetBinContent(22,0.06783117);
2364 Allpt900GeVScaling->SetBinContent(23,0.05079209);
2365 Allpt900GeVScaling->SetBinContent(24,0.04795673);
2366 Allpt900GeVScaling->SetBinContent(25,0.04181242);
2367 Allpt900GeVScaling->SetBinContent(26,0.03994469);
2368 Allpt900GeVScaling->SetBinContent(27,0.03981588);
2369 Allpt900GeVScaling->SetBinContent(28,0.0377358);
2370 Allpt900GeVScaling->SetBinContent(29,0.0399667);
2371 Allpt900GeVScaling->SetBinContent(30,0.04095473);
2372 Allpt900GeVScaling->SetBinContent(31,0.04058456);
2373 Allpt900GeVScaling->SetBinContent(32,0.03641218);
2374 Allpt900GeVScaling->SetBinContent(33,0.03599966);
2375 Allpt900GeVScaling->SetBinContent(34,0.03853838);
2376 Allpt900GeVScaling->SetBinContent(35,0.04105409);
2377 Allpt900GeVScaling->SetBinContent(36,0.03461075);
2378 Allpt900GeVScaling->SetBinContent(37,0.03478729);
2379 Allpt900GeVScaling->SetBinContent(38,0.03150168);
2380 Allpt900GeVScaling->SetBinContent(39,0.03121329);
2381 Allpt900GeVScaling->SetBinContent(40,0.0370806);
2382 Allpt900GeVScaling->SetBinContent(41,0.03322445);
2383 Allpt900GeVScaling->SetBinContent(42,0.03200198);
2384 Allpt900GeVScaling->SetBinContent(43,0.02753292);
2385 Allpt900GeVScaling->SetBinContent(44,0.02776155);
2386 Allpt900GeVScaling->SetBinContent(45,0.02671865);
2387 Allpt900GeVScaling->SetBinContent(46,0.02612601);
2388 Allpt900GeVScaling->SetBinContent(47,0.02779079);
2389 Allpt900GeVScaling->SetBinContent(48,0.02762603);
2390 Allpt900GeVScaling->SetBinContent(49,0.0288977);
2391 Allpt900GeVScaling->SetBinContent(50,0.03181282);
2392 Allpt900GeVScaling->SetBinContent(51,0.04194707);
2393 Allpt900GeVScaling->SetBinContent(52,0.03287613);
2394 Allpt900GeVScaling->SetBinContent(53,0.04363778);
2395 Allpt900GeVScaling->SetBinContent(54,0.03003709);
2396 Allpt900GeVScaling->SetBinContent(55,0.03286254);
2397 Allpt900GeVScaling->SetBinContent(56,0.02585759);
2398 Allpt900GeVScaling->SetBinContent(57,0.03390592);
2399 Allpt900GeVScaling->SetBinContent(58,0.03212414);
2400 Allpt900GeVScaling->SetBinContent(59,0.03559123);
2401 Allpt900GeVScaling->SetBinContent(60,0.02464371);
2402 Allpt900GeVScaling->SetBinContent(61,0.03680997);
2403 Allpt900GeVScaling->SetBinContent(62,0.03569024);
2404 Allpt900GeVScaling->SetBinContent(63,0.03662885);
2405 Allpt900GeVScaling->SetBinContent(64,0.04690057);
2406 Allpt900GeVScaling->SetBinContent(65,0.04036927);
2407 Allpt900GeVScaling->SetBinContent(66,0.03237555);
2408 Allpt900GeVScaling->SetBinContent(67,0.04285642);
2409 Allpt900GeVScaling->SetBinContent(68,0.04778185);
2410 Allpt900GeVScaling->SetBinContent(69,0.0411135);
2411 Allpt900GeVScaling->SetBinContent(70,0.02465524);
2412 Allpt900GeVScaling->SetBinContent(71,0.03686565);
2413 Allpt900GeVScaling->SetBinContent(72,0.03694553);
2414 Allpt900GeVScaling->SetBinContent(73,0.02206743);
2415 Allpt900GeVScaling->SetBinContent(74,0.04854334);
2416 Allpt900GeVScaling->SetBinContent(75,0.04190287);
2417 Allpt900GeVScaling->SetBinContent(76,0.03255752);
2418 Allpt900GeVScaling->SetBinContent(77,0.0715847);
2419 Allpt900GeVScaling->SetBinContent(78,0.07329647);
2420 Allpt900GeVScaling->SetBinContent(79,0.02727783);
2421 Allpt900GeVScaling->SetBinContent(80,0.041527);
2422 Allpt900GeVScaling->SetBinContent(81,0.0400001);
2423 Allpt900GeVScaling->SetBinContent(82,0.0246785);
2424 Allpt900GeVScaling->SetBinContent(83,0.03546198);
2425 Allpt900GeVScaling->SetBinContent(84,0.0244789);
2426 Allpt900GeVScaling->SetBinContent(85,0.01692187);
2427 Allpt900GeVScaling->SetBinContent(86,0.01669025);
2428 Allpt900GeVScaling->SetBinContent(87,0.01506698);
2429 Allpt900GeVScaling->SetBinContent(88,0.02896953);
2430 Allpt900GeVScaling->SetBinContent(89,0.04019321);
2431 Allpt900GeVScaling->SetBinContent(90,0.0108909);
2432 Allpt900GeVScaling->SetBinContent(91,0.02059646);
2433 Allpt900GeVScaling->SetBinContent(92,0.01781294);
2434 Allpt900GeVScaling->SetBinContent(93,0.01930956);
2435 Allpt900GeVScaling->SetBinContent(94,0.0259471);
2436 Allpt900GeVScaling->SetBinContent(95,0.0114321);
2437 Allpt900GeVScaling->SetBinContent(98,0.04961994);
2438 Allpt900GeVScaling->SetBinContent(103,0.1436233);
2439 Allpt900GeVScaling->SetBinError(13,0.04135227);
2440 Allpt900GeVScaling->SetBinError(14,0.007955716);
2441 Allpt900GeVScaling->SetBinError(15,0.005353158);
2442 Allpt900GeVScaling->SetBinError(16,0.00465994);
2443 Allpt900GeVScaling->SetBinError(17,0.004317818);
2444 Allpt900GeVScaling->SetBinError(18,0.003992759);
2445 Allpt900GeVScaling->SetBinError(19,0.003794229);
2446 Allpt900GeVScaling->SetBinError(20,0.003428406);
2447 Allpt900GeVScaling->SetBinError(21,0.002309662);
2448 Allpt900GeVScaling->SetBinError(22,0.002082593);
2449 Allpt900GeVScaling->SetBinError(23,0.001768867);
2450 Allpt900GeVScaling->SetBinError(24,0.001734781);
2451 Allpt900GeVScaling->SetBinError(25,0.001668325);
2452 Allpt900GeVScaling->SetBinError(26,0.001736728);
2453 Allpt900GeVScaling->SetBinError(27,0.001793642);
2454 Allpt900GeVScaling->SetBinError(28,0.001824914);
2455 Allpt900GeVScaling->SetBinError(29,0.002216558);
2456 Allpt900GeVScaling->SetBinError(30,0.00224095);
2457 Allpt900GeVScaling->SetBinError(31,0.002244602);
2458 Allpt900GeVScaling->SetBinError(32,0.002073202);
2459 Allpt900GeVScaling->SetBinError(33,0.001913981);
2460 Allpt900GeVScaling->SetBinError(34,0.002456659);
2461 Allpt900GeVScaling->SetBinError(35,0.002596584);
2462 Allpt900GeVScaling->SetBinError(36,0.002232065);
2463 Allpt900GeVScaling->SetBinError(37,0.00251725);
2464 Allpt900GeVScaling->SetBinError(38,0.002196274);
2465 Allpt900GeVScaling->SetBinError(39,0.002513529);
2466 Allpt900GeVScaling->SetBinError(40,0.002973807);
2467 Allpt900GeVScaling->SetBinError(41,0.002807704);
2468 Allpt900GeVScaling->SetBinError(42,0.002773487);
2469 Allpt900GeVScaling->SetBinError(43,0.002527062);
2470 Allpt900GeVScaling->SetBinError(44,0.002921618);
2471 Allpt900GeVScaling->SetBinError(45,0.002907984);
2472 Allpt900GeVScaling->SetBinError(46,0.003115439);
2473 Allpt900GeVScaling->SetBinError(47,0.003224686);
2474 Allpt900GeVScaling->SetBinError(48,0.00312276);
2475 Allpt900GeVScaling->SetBinError(49,0.00393121);
2476 Allpt900GeVScaling->SetBinError(50,0.003948797);
2477 Allpt900GeVScaling->SetBinError(51,0.005565144);
2478 Allpt900GeVScaling->SetBinError(52,0.004615559);
2479 Allpt900GeVScaling->SetBinError(53,0.006431509);
2480 Allpt900GeVScaling->SetBinError(54,0.004787345);
2481 Allpt900GeVScaling->SetBinError(55,0.004506561);
2482 Allpt900GeVScaling->SetBinError(56,0.004277351);
2483 Allpt900GeVScaling->SetBinError(57,0.005084143);
2484 Allpt900GeVScaling->SetBinError(58,0.005085463);
2485 Allpt900GeVScaling->SetBinError(59,0.005312616);
2486 Allpt900GeVScaling->SetBinError(60,0.003899113);
2487 Allpt900GeVScaling->SetBinError(61,0.003977416);
2488 Allpt900GeVScaling->SetBinError(62,0.004292332);
2489 Allpt900GeVScaling->SetBinError(63,0.005072534);
2490 Allpt900GeVScaling->SetBinError(64,0.006271891);
2491 Allpt900GeVScaling->SetBinError(65,0.006463988);
2492 Allpt900GeVScaling->SetBinError(66,0.005869634);
2493 Allpt900GeVScaling->SetBinError(67,0.008405251);
2494 Allpt900GeVScaling->SetBinError(68,0.009847454);
2495 Allpt900GeVScaling->SetBinError(69,0.009749354);
2496 Allpt900GeVScaling->SetBinError(70,0.007179523);
2497 Allpt900GeVScaling->SetBinError(71,0.01004867);
2498 Allpt900GeVScaling->SetBinError(72,0.01065873);
2499 Allpt900GeVScaling->SetBinError(73,0.007849093);
2500 Allpt900GeVScaling->SetBinError(74,0.01402708);
2501 Allpt900GeVScaling->SetBinError(75,0.01330162);
2502 Allpt900GeVScaling->SetBinError(76,0.01245402);
2503 Allpt900GeVScaling->SetBinError(77,0.02130282);
2504 Allpt900GeVScaling->SetBinError(78,0.02296044);
2505 Allpt900GeVScaling->SetBinError(79,0.01175655);
2506 Allpt900GeVScaling->SetBinError(80,0.0187519);
2507 Allpt900GeVScaling->SetBinError(81,0.009932965);
2508 Allpt900GeVScaling->SetBinError(82,0.007798875);
2509 Allpt900GeVScaling->SetBinError(83,0.01126926);
2510 Allpt900GeVScaling->SetBinError(84,0.01123177);
2511 Allpt900GeVScaling->SetBinError(85,0.01013651);
2512 Allpt900GeVScaling->SetBinError(86,0.01187595);
2513 Allpt900GeVScaling->SetBinError(87,0.009213867);
2514 Allpt900GeVScaling->SetBinError(88,0.02054123);
2515 Allpt900GeVScaling->SetBinError(89,0.01976358);
2516 Allpt900GeVScaling->SetBinError(90,0.006322856);
2517 Allpt900GeVScaling->SetBinError(91,0.01400211);
2518 Allpt900GeVScaling->SetBinError(92,0.01786717);
2519 Allpt900GeVScaling->SetBinError(93,0.01938449);
2520 Allpt900GeVScaling->SetBinError(94,0.01853139);
2521 Allpt900GeVScaling->SetBinError(95,0.01149767);
2522 Allpt900GeVScaling->SetBinError(98,0.03786105);
2523 Allpt900GeVScaling->SetBinError(103,0.1493976);
2524 Allpt900GeVScaling->SetMinimum(0);
2525 Allpt900GeVScaling->SetMaximum(0.04);
2526 Allpt900GeVScaling->SetEntries(482.6447);
2527 Allpt900GeVScaling->SetStats(0);
2528 Allpt900GeVScaling->SetMarkerStyle(20);
2529 Allpt900GeVScaling->GetXaxis()->SetTitle("p_{T}");
2530 Allpt900GeVScaling->GetXaxis()->SetRange(1,91);
2531 Allpt900GeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
2532 Allpt900GeVScaling->GetYaxis()->SetTitleOffset(1.2);
2533 Allpt7TeVScaling->Add(Allpt900GeVScaling);
2534 Allpt7TeVScaling->Scale(0.5);
2535 delete Allpt900GeVScaling;
2536 return Allpt7TeVScaling;
2539 TH1D *pp276ITSBkgd(){
2540 TH1D *Allpt7TeVScaling = new TH1D("Allpt7TeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
2541 Allpt7TeVScaling->SetBinContent(11,0.2557976);
2542 Allpt7TeVScaling->SetBinContent(12,0.1130502);
2543 Allpt7TeVScaling->SetBinContent(13,0.07504393);
2544 Allpt7TeVScaling->SetBinContent(14,0.05774832);
2545 Allpt7TeVScaling->SetBinContent(15,0.06389806);
2546 Allpt7TeVScaling->SetBinContent(16,0.0468956);
2547 Allpt7TeVScaling->SetBinContent(17,0.04355167);
2548 Allpt7TeVScaling->SetBinContent(18,0.04035013);
2549 Allpt7TeVScaling->SetBinContent(19,0.04359472);
2550 Allpt7TeVScaling->SetBinContent(20,0.03392261);
2551 Allpt7TeVScaling->SetBinContent(21,0.0327676);
2552 Allpt7TeVScaling->SetBinContent(22,0.02916985);
2553 Allpt7TeVScaling->SetBinContent(23,0.02603138);
2554 Allpt7TeVScaling->SetBinContent(24,0.02298032);
2555 Allpt7TeVScaling->SetBinContent(25,0.02366939);
2556 Allpt7TeVScaling->SetBinContent(26,0.01941947);
2557 Allpt7TeVScaling->SetBinContent(27,0.02077003);
2558 Allpt7TeVScaling->SetBinContent(28,0.01985847);
2559 Allpt7TeVScaling->SetBinContent(29,0.0177459);
2560 Allpt7TeVScaling->SetBinContent(30,0.01889314);
2561 Allpt7TeVScaling->SetBinContent(31,0.01783637);
2562 Allpt7TeVScaling->SetBinContent(32,0.01742894);
2563 Allpt7TeVScaling->SetBinContent(33,0.01400672);
2564 Allpt7TeVScaling->SetBinContent(34,0.01509014);
2565 Allpt7TeVScaling->SetBinContent(35,0.01473409);
2566 Allpt7TeVScaling->SetBinContent(36,0.01337399);
2567 Allpt7TeVScaling->SetBinContent(37,0.01458302);
2568 Allpt7TeVScaling->SetBinContent(38,0.01103552);
2569 Allpt7TeVScaling->SetBinContent(39,0.01440217);
2570 Allpt7TeVScaling->SetBinContent(40,0.0147644);
2571 Allpt7TeVScaling->SetBinContent(41,0.01459072);
2572 Allpt7TeVScaling->SetBinContent(42,0.01318416);
2573 Allpt7TeVScaling->SetBinContent(43,0.01364365);
2574 Allpt7TeVScaling->SetBinContent(44,0.01186023);
2575 Allpt7TeVScaling->SetBinContent(45,0.01218222);
2576 Allpt7TeVScaling->SetBinContent(46,0.01015807);
2577 Allpt7TeVScaling->SetBinContent(47,0.01158454);
2578 Allpt7TeVScaling->SetBinContent(48,0.009338749);
2579 Allpt7TeVScaling->SetBinContent(49,0.01320016);
2580 Allpt7TeVScaling->SetBinContent(50,0.01029357);
2581 Allpt7TeVScaling->SetBinContent(51,0.01238829);
2582 Allpt7TeVScaling->SetBinContent(52,0.008714745);
2583 Allpt7TeVScaling->SetBinContent(53,0.01300408);
2584 Allpt7TeVScaling->SetBinContent(54,0.009445714);
2585 Allpt7TeVScaling->SetBinContent(55,0.01301231);
2586 Allpt7TeVScaling->SetBinContent(56,0.01010809);
2587 Allpt7TeVScaling->SetBinContent(57,0.01181843);
2588 Allpt7TeVScaling->SetBinContent(58,0.01037317);
2589 Allpt7TeVScaling->SetBinContent(59,0.01172911);
2590 Allpt7TeVScaling->SetBinContent(60,0.007576451);
2591 Allpt7TeVScaling->SetBinContent(61,0.011185);
2592 Allpt7TeVScaling->SetBinContent(62,0.01009882);
2593 Allpt7TeVScaling->SetBinContent(63,0.01042078);
2594 Allpt7TeVScaling->SetBinContent(64,0.01079128);
2595 Allpt7TeVScaling->SetBinContent(65,0.008657009);
2596 Allpt7TeVScaling->SetBinContent(66,0.009641373);
2597 Allpt7TeVScaling->SetBinContent(67,0.01201938);
2598 Allpt7TeVScaling->SetBinContent(68,0.01031088);
2599 Allpt7TeVScaling->SetBinContent(69,0.009905995);
2600 Allpt7TeVScaling->SetBinContent(70,0.009569216);
2601 Allpt7TeVScaling->SetBinContent(71,0.009473246);
2602 Allpt7TeVScaling->SetBinContent(72,0.00825013);
2603 Allpt7TeVScaling->SetBinContent(73,0.008405926);
2604 Allpt7TeVScaling->SetBinContent(74,0.006479467);
2605 Allpt7TeVScaling->SetBinContent(75,0.01135131);
2606 Allpt7TeVScaling->SetBinContent(76,0.007318432);
2607 Allpt7TeVScaling->SetBinContent(77,0.01145386);
2608 Allpt7TeVScaling->SetBinContent(78,0.01425465);
2609 Allpt7TeVScaling->SetBinContent(79,0.01205772);
2610 Allpt7TeVScaling->SetBinContent(80,0.009454997);
2611 Allpt7TeVScaling->SetBinContent(81,0.006863416);
2612 Allpt7TeVScaling->SetBinContent(82,0.006285407);
2613 Allpt7TeVScaling->SetBinContent(83,0.004974776);
2614 Allpt7TeVScaling->SetBinContent(84,0.00748478);
2615 Allpt7TeVScaling->SetBinContent(85,0.002485323);
2616 Allpt7TeVScaling->SetBinContent(86,0.009973802);
2617 Allpt7TeVScaling->SetBinContent(87,0.00543998);
2618 Allpt7TeVScaling->SetBinContent(89,0.01703395);
2619 Allpt7TeVScaling->SetBinContent(90,0.004394557);
2620 Allpt7TeVScaling->SetBinContent(96,0.01833441);
2621 Allpt7TeVScaling->SetBinContent(98,0.02964621);
2622 Allpt7TeVScaling->SetBinContent(101,0.0574538);
2623 Allpt7TeVScaling->SetBinError(11,0.07407797);
2624 Allpt7TeVScaling->SetBinError(12,0.01275005);
2625 Allpt7TeVScaling->SetBinError(13,0.00608927);
2626 Allpt7TeVScaling->SetBinError(14,0.00428747);
2627 Allpt7TeVScaling->SetBinError(15,0.004071853);
2628 Allpt7TeVScaling->SetBinError(16,0.003225169);
2629 Allpt7TeVScaling->SetBinError(17,0.002968269);
2630 Allpt7TeVScaling->SetBinError(18,0.002761875);
2631 Allpt7TeVScaling->SetBinError(19,0.002800096);
2632 Allpt7TeVScaling->SetBinError(20,0.002386005);
2633 Allpt7TeVScaling->SetBinError(21,0.001589813);
2634 Allpt7TeVScaling->SetBinError(22,0.001475329);
2635 Allpt7TeVScaling->SetBinError(23,0.001364666);
2636 Allpt7TeVScaling->SetBinError(24,0.00126007);
2637 Allpt7TeVScaling->SetBinError(25,0.001265789);
2638 Allpt7TeVScaling->SetBinError(26,0.001156208);
2639 Allpt7TeVScaling->SetBinError(27,0.001182566);
2640 Allpt7TeVScaling->SetBinError(28,0.001171098);
2641 Allpt7TeVScaling->SetBinError(29,0.001122203);
2642 Allpt7TeVScaling->SetBinError(30,0.001173633);
2643 Allpt7TeVScaling->SetBinError(31,0.001154546);
2644 Allpt7TeVScaling->SetBinError(32,0.001162445);
2645 Allpt7TeVScaling->SetBinError(33,0.001067574);
2646 Allpt7TeVScaling->SetBinError(34,0.001116243);
2647 Allpt7TeVScaling->SetBinError(35,0.001144851);
2648 Allpt7TeVScaling->SetBinError(36,0.001110251);
2649 Allpt7TeVScaling->SetBinError(37,0.001192711);
2650 Allpt7TeVScaling->SetBinError(38,0.001062774);
2651 Allpt7TeVScaling->SetBinError(39,0.001255752);
2652 Allpt7TeVScaling->SetBinError(40,0.001319021);
2653 Allpt7TeVScaling->SetBinError(41,0.001323284);
2654 Allpt7TeVScaling->SetBinError(42,0.001303463);
2655 Allpt7TeVScaling->SetBinError(43,0.001388458);
2656 Allpt7TeVScaling->SetBinError(44,0.001312344);
2657 Allpt7TeVScaling->SetBinError(45,0.001383885);
2658 Allpt7TeVScaling->SetBinError(46,0.001289152);
2659 Allpt7TeVScaling->SetBinError(47,0.001430287);
2660 Allpt7TeVScaling->SetBinError(48,0.001302716);
2661 Allpt7TeVScaling->SetBinError(49,0.001578988);
2662 Allpt7TeVScaling->SetBinError(50,0.0014581);
2663 Allpt7TeVScaling->SetBinError(51,0.00165325);
2664 Allpt7TeVScaling->SetBinError(52,0.001404793);
2665 Allpt7TeVScaling->SetBinError(53,0.001757303);
2666 Allpt7TeVScaling->SetBinError(54,0.001562987);
2667 Allpt7TeVScaling->SetBinError(55,0.001911932);
2668 Allpt7TeVScaling->SetBinError(56,0.001695077);
2669 Allpt7TeVScaling->SetBinError(57,0.001932989);
2670 Allpt7TeVScaling->SetBinError(58,0.001844963);
2671 Allpt7TeVScaling->SetBinError(59,0.002000117);
2672 Allpt7TeVScaling->SetBinError(60,0.001689391);
2673 Allpt7TeVScaling->SetBinError(61,0.001386339);
2674 Allpt7TeVScaling->SetBinError(62,0.001349763);
2675 Allpt7TeVScaling->SetBinError(63,0.001454327);
2676 Allpt7TeVScaling->SetBinError(64,0.001584791);
2677 Allpt7TeVScaling->SetBinError(65,0.00151686);
2678 Allpt7TeVScaling->SetBinError(66,0.001668507);
2679 Allpt7TeVScaling->SetBinError(67,0.001963962);
2680 Allpt7TeVScaling->SetBinError(68,0.001970941);
2681 Allpt7TeVScaling->SetBinError(69,0.001992913);
2682 Allpt7TeVScaling->SetBinError(70,0.002006771);
2683 Allpt7TeVScaling->SetBinError(71,0.002187254);
2684 Allpt7TeVScaling->SetBinError(72,0.002140473);
2685 Allpt7TeVScaling->SetBinError(73,0.002256925);
2686 Allpt7TeVScaling->SetBinError(74,0.002056219);
2687 Allpt7TeVScaling->SetBinError(75,0.002854892);
2688 Allpt7TeVScaling->SetBinError(76,0.002450159);
2689 Allpt7TeVScaling->SetBinError(77,0.003197387);
2690 Allpt7TeVScaling->SetBinError(78,0.003840947);
2691 Allpt7TeVScaling->SetBinError(79,0.003660464);
2692 Allpt7TeVScaling->SetBinError(80,0.003363956);
2693 Allpt7TeVScaling->SetBinError(81,0.001624793);
2694 Allpt7TeVScaling->SetBinError(82,0.00181065);
2695 Allpt7TeVScaling->SetBinError(83,0.001888966);
2696 Allpt7TeVScaling->SetBinError(84,0.002671173);
2697 Allpt7TeVScaling->SetBinError(85,0.001759843);
2698 Allpt7TeVScaling->SetBinError(86,0.004094911);
2699 Allpt7TeVScaling->SetBinError(87,0.003871198);
2700 Allpt7TeVScaling->SetBinError(89,0.008630108);
2701 Allpt7TeVScaling->SetBinError(90,0.004405367);
2702 Allpt7TeVScaling->SetBinError(96,0.01308755);
2703 Allpt7TeVScaling->SetBinError(98,0.02127892);
2704 Allpt7TeVScaling->SetBinError(101,0.05904744);
2705 Allpt7TeVScaling->SetMinimum(0);
2706 Allpt7TeVScaling->SetMaximum(0.04);
2707 Allpt7TeVScaling->SetEntries(300.6659);
2708 Allpt7TeVScaling->SetStats(0);
2709 Allpt7TeVScaling->SetMarkerStyle(20);
2710 Allpt7TeVScaling->GetXaxis()->SetTitle("p_{T}");
2711 Allpt7TeVScaling->GetXaxis()->SetRange(1,61);
2712 Allpt7TeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
2713 Allpt7TeVScaling->GetYaxis()->SetTitleOffset(1.2);
2714 TH1D *Allpt900GeVScaling = new TH1D("Allpt900GeVScaling","Reconstructed E_{T} from misidentified electrons",111, xAxis1);
2715 Allpt900GeVScaling->SetBinContent(9,1);
2716 Allpt900GeVScaling->SetBinContent(11,0.2834258);
2717 Allpt900GeVScaling->SetBinContent(12,0.1188776);
2718 Allpt900GeVScaling->SetBinContent(13,0.08085647);
2719 Allpt900GeVScaling->SetBinContent(14,0.05677858);
2720 Allpt900GeVScaling->SetBinContent(15,0.0616757);
2721 Allpt900GeVScaling->SetBinContent(16,0.04844882);
2722 Allpt900GeVScaling->SetBinContent(17,0.03999142);
2723 Allpt900GeVScaling->SetBinContent(18,0.03890007);
2724 Allpt900GeVScaling->SetBinContent(19,0.0406008);
2725 Allpt900GeVScaling->SetBinContent(20,0.02900627);
2726 Allpt900GeVScaling->SetBinContent(21,0.03088961);
2727 Allpt900GeVScaling->SetBinContent(22,0.03033992);
2728 Allpt900GeVScaling->SetBinContent(23,0.02521969);
2729 Allpt900GeVScaling->SetBinContent(24,0.02143008);
2730 Allpt900GeVScaling->SetBinContent(25,0.02266187);
2731 Allpt900GeVScaling->SetBinContent(26,0.01981764);
2732 Allpt900GeVScaling->SetBinContent(27,0.02127366);
2733 Allpt900GeVScaling->SetBinContent(28,0.0192753);
2734 Allpt900GeVScaling->SetBinContent(29,0.01854744);
2735 Allpt900GeVScaling->SetBinContent(30,0.01903471);
2736 Allpt900GeVScaling->SetBinContent(31,0.01819287);
2737 Allpt900GeVScaling->SetBinContent(32,0.01715784);
2738 Allpt900GeVScaling->SetBinContent(33,0.01488607);
2739 Allpt900GeVScaling->SetBinContent(34,0.0156348);
2740 Allpt900GeVScaling->SetBinContent(35,0.01699235);
2741 Allpt900GeVScaling->SetBinContent(36,0.01398954);
2742 Allpt900GeVScaling->SetBinContent(37,0.01435865);
2743 Allpt900GeVScaling->SetBinContent(38,0.01236315);
2744 Allpt900GeVScaling->SetBinContent(39,0.01282288);
2745 Allpt900GeVScaling->SetBinContent(40,0.01668125);
2746 Allpt900GeVScaling->SetBinContent(41,0.01372736);
2747 Allpt900GeVScaling->SetBinContent(42,0.01433745);
2748 Allpt900GeVScaling->SetBinContent(43,0.01477496);
2749 Allpt900GeVScaling->SetBinContent(44,0.0116776);
2750 Allpt900GeVScaling->SetBinContent(45,0.01245205);
2751 Allpt900GeVScaling->SetBinContent(46,0.009475905);
2752 Allpt900GeVScaling->SetBinContent(47,0.01117031);
2753 Allpt900GeVScaling->SetBinContent(48,0.009558273);
2754 Allpt900GeVScaling->SetBinContent(49,0.01404047);
2755 Allpt900GeVScaling->SetBinContent(50,0.01037464);
2756 Allpt900GeVScaling->SetBinContent(51,0.01195013);
2757 Allpt900GeVScaling->SetBinContent(52,0.01155682);
2758 Allpt900GeVScaling->SetBinContent(53,0.0137127);
2759 Allpt900GeVScaling->SetBinContent(54,0.009255665);
2760 Allpt900GeVScaling->SetBinContent(55,0.01133598);
2761 Allpt900GeVScaling->SetBinContent(56,0.009080946);
2762 Allpt900GeVScaling->SetBinContent(57,0.01124535);
2763 Allpt900GeVScaling->SetBinContent(58,0.008398657);
2764 Allpt900GeVScaling->SetBinContent(59,0.008324869);
2765 Allpt900GeVScaling->SetBinContent(60,0.007103489);
2766 Allpt900GeVScaling->SetBinContent(61,0.01142644);
2767 Allpt900GeVScaling->SetBinContent(62,0.0110906);
2768 Allpt900GeVScaling->SetBinContent(63,0.01076479);
2769 Allpt900GeVScaling->SetBinContent(64,0.01168746);
2770 Allpt900GeVScaling->SetBinContent(65,0.008513672);
2771 Allpt900GeVScaling->SetBinContent(66,0.00828279);
2772 Allpt900GeVScaling->SetBinContent(67,0.01140648);
2773 Allpt900GeVScaling->SetBinContent(68,0.01111323);
2774 Allpt900GeVScaling->SetBinContent(69,0.007425678);
2775 Allpt900GeVScaling->SetBinContent(70,0.009847098);
2776 Allpt900GeVScaling->SetBinContent(71,0.009834419);
2777 Allpt900GeVScaling->SetBinContent(72,0.008930991);
2778 Allpt900GeVScaling->SetBinContent(73,0.00669819);
2779 Allpt900GeVScaling->SetBinContent(74,0.00662618);
2780 Allpt900GeVScaling->SetBinContent(75,0.01370167);
2781 Allpt900GeVScaling->SetBinContent(76,0.006451024);
2782 Allpt900GeVScaling->SetBinContent(77,0.01307605);
2783 Allpt900GeVScaling->SetBinContent(78,0.01579264);
2784 Allpt900GeVScaling->SetBinContent(79,0.01255205);
2785 Allpt900GeVScaling->SetBinContent(80,0.01010045);
2786 Allpt900GeVScaling->SetBinContent(81,0.01082155);
2787 Allpt900GeVScaling->SetBinContent(82,0.006495255);
2788 Allpt900GeVScaling->SetBinContent(83,0.005512525);
2789 Allpt900GeVScaling->SetBinContent(84,0.003527945);
2790 Allpt900GeVScaling->SetBinContent(85,0.001806946);
2791 Allpt900GeVScaling->SetBinContent(86,0.004225982);
2792 Allpt900GeVScaling->SetBinContent(89,0.01106803);
2793 Allpt900GeVScaling->SetBinContent(90,0.005044269);
2794 Allpt900GeVScaling->SetBinContent(98,0.04456838);
2795 Allpt900GeVScaling->SetBinContent(101,0.07960857);
2796 Allpt900GeVScaling->SetBinError(9,1.414214);
2797 Allpt900GeVScaling->SetBinError(11,0.08936516);
2798 Allpt900GeVScaling->SetBinError(12,0.01474769);
2799 Allpt900GeVScaling->SetBinError(13,0.006947232);
2800 Allpt900GeVScaling->SetBinError(14,0.00470276);
2801 Allpt900GeVScaling->SetBinError(15,0.004394222);
2802 Allpt900GeVScaling->SetBinError(16,0.003598075);
2803 Allpt900GeVScaling->SetBinError(17,0.00312581);
2804 Allpt900GeVScaling->SetBinError(18,0.003002622);
2805 Allpt900GeVScaling->SetBinError(19,0.002976063);
2806 Allpt900GeVScaling->SetBinError(20,0.002438669);
2807 Allpt900GeVScaling->SetBinError(21,0.00172144);
2808 Allpt900GeVScaling->SetBinError(22,0.001661658);
2809 Allpt900GeVScaling->SetBinError(23,0.001477901);
2810 Allpt900GeVScaling->SetBinError(24,0.001329128);
2811 Allpt900GeVScaling->SetBinError(25,0.00137131);
2812 Allpt900GeVScaling->SetBinError(26,0.001299862);
2813 Allpt900GeVScaling->SetBinError(27,0.001332285);
2814 Allpt900GeVScaling->SetBinError(28,0.001274491);
2815 Allpt900GeVScaling->SetBinError(29,0.001266741);
2816 Allpt900GeVScaling->SetBinError(30,0.001305369);
2817 Allpt900GeVScaling->SetBinError(31,0.001295113);
2818 Allpt900GeVScaling->SetBinError(32,0.001278961);
2819 Allpt900GeVScaling->SetBinError(33,0.00122243);
2820 Allpt900GeVScaling->SetBinError(34,0.001256858);
2821 Allpt900GeVScaling->SetBinError(35,0.001357681);
2822 Allpt900GeVScaling->SetBinError(36,0.001267233);
2823 Allpt900GeVScaling->SetBinError(37,0.00131839);
2824 Allpt900GeVScaling->SetBinError(38,0.001256835);
2825 Allpt900GeVScaling->SetBinError(39,0.001306764);
2826 Allpt900GeVScaling->SetBinError(40,0.001544152);
2827 Allpt900GeVScaling->SetBinError(41,0.001438378);
2828 Allpt900GeVScaling->SetBinError(42,0.001507702);
2829 Allpt900GeVScaling->SetBinError(43,0.001615741);
2830 Allpt900GeVScaling->SetBinError(44,0.00143817);
2831 Allpt900GeVScaling->SetBinError(45,0.001536765);
2832 Allpt900GeVScaling->SetBinError(46,0.001377493);
2833 Allpt900GeVScaling->SetBinError(47,0.001536932);
2834 Allpt900GeVScaling->SetBinError(48,0.001466076);
2835 Allpt900GeVScaling->SetBinError(49,0.001814185);
2836 Allpt900GeVScaling->SetBinError(50,0.001620601);
2837 Allpt900GeVScaling->SetBinError(51,0.001814658);
2838 Allpt900GeVScaling->SetBinError(52,0.001822325);
2839 Allpt900GeVScaling->SetBinError(53,0.001976947);
2840 Allpt900GeVScaling->SetBinError(54,0.001729338);
2841 Allpt900GeVScaling->SetBinError(55,0.001988634);
2842 Allpt900GeVScaling->SetBinError(56,0.001792157);
2843 Allpt900GeVScaling->SetBinError(57,0.00206644);
2844 Allpt900GeVScaling->SetBinError(58,0.001842037);
2845 Allpt900GeVScaling->SetBinError(59,0.001826512);
2846 Allpt900GeVScaling->SetBinError(60,0.001732292);
2847 Allpt900GeVScaling->SetBinError(61,0.001512696);
2848 Allpt900GeVScaling->SetBinError(62,0.001543542);
2849 Allpt900GeVScaling->SetBinError(63,0.001633358);
2850 Allpt900GeVScaling->SetBinError(64,0.001816012);
2851 Allpt900GeVScaling->SetBinError(65,0.001680175);
2852 Allpt900GeVScaling->SetBinError(66,0.001692314);
2853 Allpt900GeVScaling->SetBinError(67,0.00213108);
2854 Allpt900GeVScaling->SetBinError(68,0.002295308);
2855 Allpt900GeVScaling->SetBinError(69,0.001926907);
2856 Allpt900GeVScaling->SetBinError(70,0.002272706);
2857 Allpt900GeVScaling->SetBinError(71,0.002475109);
2858 Allpt900GeVScaling->SetBinError(72,0.002399123);
2859 Allpt900GeVScaling->SetBinError(73,0.002241209);
2860 Allpt900GeVScaling->SetBinError(74,0.002365641);
2861 Allpt900GeVScaling->SetBinError(75,0.003450507);
2862 Allpt900GeVScaling->SetBinError(76,0.002503392);
2863 Allpt900GeVScaling->SetBinError(77,0.003801781);
2864 Allpt900GeVScaling->SetBinError(78,0.004417338);
2865 Allpt900GeVScaling->SetBinError(79,0.00421245);
2866 Allpt900GeVScaling->SetBinError(80,0.003844397);
2867 Allpt900GeVScaling->SetBinError(81,0.002274688);
2868 Allpt900GeVScaling->SetBinError(82,0.002043975);
2869 Allpt900GeVScaling->SetBinError(83,0.002262563);
2870 Allpt900GeVScaling->SetBinError(84,0.00204239);
2871 Allpt900GeVScaling->SetBinError(85,0.00180851);
2872 Allpt900GeVScaling->SetBinError(86,0.002994568);
2873 Allpt900GeVScaling->SetBinError(89,0.007939965);
2874 Allpt900GeVScaling->SetBinError(90,0.005058548);
2875 Allpt900GeVScaling->SetBinError(98,0.03222111);
2876 Allpt900GeVScaling->SetBinError(101,0.08264771);
2877 Allpt900GeVScaling->SetMinimum(0);
2878 Allpt900GeVScaling->SetMaximum(0.04);
2879 Allpt900GeVScaling->SetEntries(3.837105);
2880 Allpt900GeVScaling->SetStats(0);
2881 Allpt900GeVScaling->SetMarkerStyle(20);
2882 Allpt900GeVScaling->GetXaxis()->SetTitle("p_{T}");
2883 Allpt900GeVScaling->GetXaxis()->SetRange(1,61);
2884 Allpt900GeVScaling->GetYaxis()->SetTitle("Ratio of E_{T}^{background}/E_{T}^{had, meas.}");
2885 Allpt900GeVScaling->GetYaxis()->SetTitleOffset(1.2);
2887 Allpt7TeVScaling->Add(Allpt900GeVScaling);
2888 Allpt7TeVScaling->Scale(0.5);
2889 delete Allpt900GeVScaling;
2890 return Allpt7TeVScaling;