AliPhysics  2c6b7ad (2c6b7ad)
MakeDataMCComparisonPerSMClusterEbin.C
Go to the documentation of this file.
1 
18 #if !defined(__CINT__) || defined(__MAKECINT__)
19 
20 #include <TFile.h>
21 #include <TDirectoryFile.h>
22 #include <TList.h>
23 #include <TString.h>
24 #include <TROOT.h>
25 #include <TStyle.h>
26 #include <TH1D.h>
27 #include <TH2F.h>
28 #include <TH3F.h>
29 #include <TCanvas.h>
30 #include <TPad.h>
31 #include <TLegend.h>
32 #include <TObject.h>
33 #include <TAxis.h>
34 #include <TGaxis.h>
35 #include <TLine.h>
36 #include <TF1.h>
37 #include <TMath.h>
38 #include <TArrayD.h>
39 #include <TGraphErrors.h>
40 
42 
43 #endif
44 
45 //------------------------------------------------------------------------------
51 //------------------------------------------------------------------------------
53 (
54  TString titleMC = "JJDecLow", // "JJDecHigh", "MB", "JJDecLow"
55  TString titleData= "LHC11cd_EMC7",//"LHC11cd_EMC7", "LHC11cd_INT7"
56  Bool_t debug = kFALSE
57 )
58 {
59  // Energy bins and productions
60  // Depending on the production more or less energy bins considered
61 
62  const Int_t nEBins = 5;//5;
63  TArrayD binE; binE.Set(nEBins+1);
64  Double_t binEErr[] = { 1, 1, 1, 1, 1, 1, 1};
65 
66  TString daLeg = "pp@7 TeV, LHC11c+d EMC7";
67  if(titleData == "LHC11cd_EMC7")
68  daLeg = "pp@7 TeV, LHC11c+d EMC7";
69  if(titleData == "LHC11cd_INT7")
70  daLeg = "pp@7 TeV, LHC11c+d INT7";
71 
72  TString mcDir = "JJ_Dec_GJ";
73  TString mcLeg = "MC: #gammaJ+JJ({p^{EMCal}_{T,#gamma}>3.5 GeV/#it{c})";
74  if ( titleMC.Contains("Low") )
75  {
76  // JJDecLow
77  Double_t energyBins[] = { 8, 10, 12, 14, 16, 18, 20 };
78  for(Int_t ie = 0; ie < nEBins+1; ie++) binE[ie] = energyBins[ie];
79  mcDir = "JJ_Dec_GJ";
80  mcLeg = "#gammaJ+JJ(p^{EMCal}_{T,#gamma}>3.5 GeV/#it{c})";
81  }
82 
83  if ( titleMC.Contains("High") )
84  {
85  // JJDecHigh
86  Double_t energyBins[] = { 18, 20, 25, 30, 35, 40, 50 };
87  for(Int_t ie = 0; ie < nEBins+1; ie++) binE[ie] = energyBins[ie];
88  mcDir = "JJ_Dec_High_GJ";
89  mcLeg = "#gammaJ+JJ(p^{EMCal}_{T,#gamma}>7 GeV/#it{c})}";
90  }
91 
92  if ( titleMC.Contains("MB") )
93  {
94  // MB
95  Double_t energyBins[] = { 5, 7, 12};
96  for(Int_t ie = 0; ie < nEBins+1; ie++) binE[ie] = energyBins[ie];
97  mcDir = "MB";
98  mcLeg = "Min. Bias";
99  }
100 
101  Int_t nprodtmp = 3;
102 
103  Bool_t bIndFracCase = kFALSE;
104  if ( bIndFracCase ) nprodtmp = 7;
105 
106  const Int_t nProd = nprodtmp;
107  TString prod [nProd];
109 
110  if ( debug ) printf("N prod %d\n",nProd);
111 
112  Int_t nproditer = 0;
113  if ( !bIndFracCase )
114  {
115  prod [nproditer++] = Form("data/module/TCardChannel3/%s",titleData.Data());
116  prodLeg[nproditer-1] = "Data";
117  prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic0_Scaled2_v2",mcDir.Data());
118  prodLeg[nproditer-1] = "MC, default";
119  prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_EcellCut_Scaled2_v2",mcDir.Data());
120  prodLeg[nproditer-1] = "MC, mimic";//", #it{E}_{ind}>100 MeV";
121 
122 // prod [nproditer++] = Form("data/module/TCardChannel2/ClV2/%s",titleData.Data());
123 // prodLeg[nproditer-1] = "Data, Clus. V2";
124 // prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic0_Scaled2/ClV2",mcDir.Data()) ;
125 // prodLeg[nproditer-1] = "MC, default, Clus. V2";
126 // prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_EcellCut_Scaled2/ClV2",mcDir.Data());
127 // prodLeg[nproditer-1] = "MC, mimic, Clust. V2";//", #it{E}_{ind}>100 MeV, Clus. V2";
128 
129  //prod [nproditer++] = Form("data/module/TCardChannel_NLoff/%s",titleData.Data());
130  //prodLeg[nproditer-1] = "Data, NL off";
131  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Default2" ,mcDir.Data());
132  //prodLeg[nproditer-1] = "MC, default";
133 
134  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic0_NLoff",mcDir.Data());
135  //prodLeg[nproditer-1] = "MC, default, NL off";
136  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c",mcDir.Data());
137  //prodLeg[nproditer-1] = "MC, mimic";
138  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_v1",mcDir.Data())
139  //prodLeg[nproditer-1] = "MC, mimic";
140  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_EcellCut",mcDir.Data())
141  //prodLeg[nproditer-1] = "MC, mimic, #it{E}_{ind} > 100 MeV";
142 
143  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_MimicEmCorr_v1",mcDir.Data());
144  //prodLeg[nproditer-1] = "MC, mimic, EMCal Corr.";
145  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_NLoff",mcDir.Data());
146  //prodLeg[nproditer-1] = "MC, mimic, NL off";
147  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_NLoff_EcellCut",mcDir.Data()) ;
148  //prodLeg[nproditer-1] = "MC, mimic, #it{E}_{ind}>100 MeV, NL off";
149  //prod [nproditer++] = Form("simu/module//pp_7TeV_%s/TCardChannel_Mimic10c_NLoff_10MeV" ,mcDir.Data()) ;
150  //prodLeg[nproditer-1] = "MC, mimic, #it{E}_{ind}>100 MeV, #it{E}_{leak}< 10 MeV, NL off";
151  }
152  else
153  {
154  printf("INDUCED Fraction cases!!!! %d\n",nproditer);
155  if ( titleMC.Contains("Low") )
156  {
157  prod [nproditer++] = "data/LHC11cd_EMC7";
158  prodLeg[nproditer-1] = "Data";
159  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/default/sumw2on";
160  prodLeg[nproditer-1] = "MC, Default";
161  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_79/sumw2on"; // 0.1%
162  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.1%";
163  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_78/sumw2on"; // 0.2%
164  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.2%";
165  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_71/sumw2on"; // 0.3%
166  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.3%";
167  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_77/sumw2on"; // 0.4%
168  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.4%";
169  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_70/sumw2on"; // 0.5%
170  prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.5%";
171  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_76/sumw2on"; // 0.6%
172  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.6%";
173  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_75/sumw2on"; // 0.7%
174  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.7%";
175  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_69/sumw2on"; // 0.8%
176  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.8%";
177  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_74/sumw2on"; // 0.9%
178  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=0.9%";
179  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_68/sumw2on"; // 1.0%
180  prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.0%";
181  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_89/sumw2on"; // 1.05%
182  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.05%";
183  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_73/sumw2on"; // 1.1%
184  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.1%";
185  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_95/sumw2on"; // 1.125%
186  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.125%";
187  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_85/sumw2on"; // 1.15%
188  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.15%";
189  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_90/sumw2on"; // 1.175%
190  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.175%";
191  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_67/sumw2on"; // 1.2%
192  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.2%";
193  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_91/sumw2on"; // 1.225%
194  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.225%";
195  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_86/sumw2on"; // 1.25%
196  prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.25%";
197  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_92/sumw2on"; // 1.275%
198  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.275%";
199  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_66/sumw2on"; // 1.3%
200  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.3%";
201  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_93/sumw2on"; // 1.325%
202  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.325%";
203  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_87/sumw2on"; // 1.35%
204  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.35%";
205  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_94/sumw2on"; // 1.375%
206  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.375%";
207  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_65/sumw2on"; // 1.4%
208  prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.4%";
209  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_88/sumw2on"; // 1.45%
210  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.45%";
211  prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_64/sumw2on"; // 1.5%
212  prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.5%";
213  // prod [nproditer++] = "simu/mimic/pp_7TeV_JJ_Dec_GJ/TCard_C_72/sumw2on"; // 1.6%
214  // prodLeg[nproditer-1] = "MC, mimic #mu_{1}=1.6%";
215  }
216  }
217 
218  if ( debug )
219  {
220  for(Int_t iprod = 0; iprod < nProd; iprod++)
221  {
222  printf("iprod %d,\n \t file: %s,\n \t legend: %s\n",
223  iprod,prod[iprod].Data(),prodLeg[iprod].Data());
224  }
225  }
226 
227  TString histoName[] =
228  {
229  "SMM02NoCut","SMM02","SMM20LowM02NoCut","SMM20LowM02","SMM20HighM02NoCut","SMM20HighM02","SMNCell",
230  "SMEMaxEClusterRat","SMNCellModuleMax","SMNCellModuleOut",
231  "SMECellModuleMax","SMECellModuleOut","SMNCellModuleMaxOutRat","SMECellModuleMaxRat",
232  "SMECellModuleMaxOutRat","SMECellModuleMaxTot","SMECellModuleMaxTotRat","SMECellModuleMaxTotRatClus",
233  "SMNCellModuleOutModDiff","SMNCellModuleOutModSame","SMECellModuleOutModDiff","SMECellModuleOutModSame",
234  "TCardChannelNCellModMax","TCardChannelNCell","TCardChannelM02","TCardChannelM02NoCut"
235  };
236 
237  TString clusterization = "";//"_V1_Ecell100_Eseed500",
238  TString tm = "_TMDep";//"TMFix",
239  TString pid = "_Neutral";//"_Electron", "_Hadron","Neutral"
240  Bool_t plotRatio = kFALSE;
241  Bool_t saveHisto = kFALSE;
242  Int_t firstP = 0;
243  Int_t lastP = 9;
244  Int_t firstMC = 1;
245  TString outputFileName = "";
246  TString opt = "";
247  if(bIndFracCase)
248  {
249  if ( clusterization =="" ) clusterization = "_V1_Ecell100_Eseed500";
250  opt = "_IndFracCases";
251  }
252 
253  for(Int_t ihisto = 0; ihisto < 26; ihisto++)
254  {
255  if(histoName[ihisto].Contains("TCard")) lastP = 15;
256  printf("histogram %d %s\n",ihisto,histoName[ihisto].Data());
257 
259  (outputFileName,
260  histoName[ihisto], nProd, prod, prodLeg,
261  clusterization,tm,pid,
262  titleMC , mcLeg,
263  titleData, daLeg,
264  firstP, lastP,
265  binE, firstMC,
266  plotRatio, saveHisto,
267  opt, debug);
268  } // histogram loop
269 
270 }
271 
272 
double Double_t
Definition: External.C:58
int Int_t
Definition: External.C:63
const Int_t nProd
Compare a cluster parameter (shower shape) between different productions.
void MakeDataMCComparisonPerSMClusterEbin(TString titleMC="JJDecLow", TString titleData="LHC11cd_EMC7", Bool_t debug=kFALSE)
TString prodLeg[]
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void CompareTH3DataAndMCProd(TString &outputFileName, TString histoName="SMM02NoCut", const Int_t nProd=3, TString *prod=0x0, TString *prodLeg=0x0, TString clusterization="", TString tm="_TMDep", TString pid="_Neutral", TString titleMC="JJDecLow", TString mcLeg="MC: #gammaJ+JJ({p^{EMCal}_{T,#gamma}>3.5 GeV/#it{c})", TString titleData="LHC11cd_EMC7", TString daLeg="pp@7 TeV, LHC11c+d EMC7", Int_t firstP=0, Int_t lastP=9, TArrayD binE=0, Int_t firstMC=1, Bool_t plotRatio=kFALSE, Bool_t saveHisto=kFALSE, TString opt="", Bool_t debug=kFALSE)
bool Bool_t
Definition: External.C:53
TString prod[]
productions to be compared, directory name