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