AliPhysics  b8420c0 (b8420c0)
MakeNDataNMCComparisonPerSMClusterEbin.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 //------------------------------------------------------------------------------
49 //------------------------------------------------------------------------------
51 (
52  Bool_t debug = kFALSE
53 )
54 {
55  // Energy bins and productions
56  // Depending on the production more or less energy bins considered
57 
58  const Int_t nEBins = 5;
59  TArrayD binE; binE.Set(nEBins+1);
60  Double_t energyBins[] = { 8, 10, 12, 14, 16, 18, 20 };
61  for(Int_t ie = 0; ie < nEBins+1; ie++) binE[ie] = energyBins[ie];
62 
63  const Int_t nProd = 2;
64  TString prod [nProd];
66 
67  if ( debug ) printf("N prod %d\n",nProd);
68 
69  // Put here the path to the output files per Data or MC production
70 
71  Int_t nproditer = 0;
72  prod [nproditer++] = Form("data/module/TCardChannel2/LHC11cd_EMC7");
73  prodLeg[nproditer-1] = Form("Data, pp @ 7 TeV, kEMC7, LHC11c+d");
74 
75  prod [nproditer++] = Form("data/LHC16l_EG1");
76  prodLeg[nproditer-1] = Form("Data, pp @ 13 TeV, kEMCEGA-EG1, LHC16l");
77 
78  TString titleData = "pp_7_13_TeV";
79  TString daLeg = "pp @ 7 & 13 TeV";
80 
81  TString titleMC = "";
82  TString mcLeg = "";
83 
84  //
85  Int_t firstMC = 2; // All data
86  //
87 
88  if ( debug )
89  {
90  for(Int_t iprod = 0; iprod < nProd; iprod++)
91  {
92  printf("iprod %d,\n \t file: %s,\n \t legend: %s\n",
93  iprod,prod[iprod].Data(),prodLeg[iprod].Data());
94  }
95  }
96 
97  Int_t nHisto = 26;
98  TString histoName[] =
99  {
100  "SMM02NoCut","SMM02","SMNCell",
101  "SMM20LowM02NoCut","SMM20LowM02","SMM20HighM02NoCut","SMM20HighM02",
102  "SMEMaxEClusterRat","SMNCellModuleMax","SMNCellModuleOut",
103  "SMECellModuleMax","SMECellModuleOut","SMNCellModuleMaxOutRat","SMECellModuleMaxRat",
104  "SMECellModuleMaxOutRat","SMECellModuleMaxTot","SMECellModuleMaxTotRat","SMECellModuleMaxTotRatClus",
105  "SMNCellModuleOutModDiff","SMNCellModuleOutModSame","SMECellModuleOutModDiff","SMECellModuleOutModSame",
106  "TCardChannelNCellModMax","TCardChannelNCell","TCardChannelM02","TCardChannelM02NoCut"
107  };
108 
109  TString clusterization = "";//"_V1_Ecell100_Eseed500",
110  TString tm = "_TMDep";//"TMFix",
111  TString pid = "_Neutral";//"_Electron", "_Hadron","Neutral"
112  Bool_t plotRatio = kFALSE;
113  Bool_t saveHisto = kFALSE;
114  Int_t firstP = 0;
115  Int_t lastP = 9;
116  TString outputFileName = "";
117  TString opt = "";
118 
119  for(Int_t ihisto = 0; ihisto < 3; ihisto++)
120  {
121  if(histoName[ihisto].Contains("TCard")) lastP = 15;
122  printf("histogram %d %s\n",ihisto,histoName[ihisto].Data());
123 
125  (outputFileName,
126  histoName[ihisto], nProd, prod, prodLeg,
127  clusterization,tm,pid,
128  titleMC , mcLeg,
129  titleData, daLeg,
130  firstP, lastP,
131  binE, firstMC,
132  plotRatio, saveHisto,
133  opt, debug);
134  } // histogram loop
135 
136 }
137 
138 
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.
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
void MakeNDataNMCComparisonPerSMClusterEbin(Bool_t debug=kFALSE)
TString prod[]
productions to be compared, directory name