]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/dNdEta/makeSystematics.C
703c586283c3d8d507c4c54baef9943e7f26b72e
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / makeSystematics.C
1 /* $Id$ */
2
3 //
4 // Script to run the creation of input for systematics
5 //
6
7 #include "../CreateESDChain.C"
8 #include "../PWG0Helper.C"
9
10 void makeSystematics(Char_t* dataDir, Int_t nRuns=20, Int_t offset = 0, Bool_t debug = kFALSE, Bool_t aProof = kFALSE, const Char_t* option = "")
11 {
12   if (aProof)
13     connectProof("proof01@lxb6046");
14
15   TString libraries("libEG;libGeom;libESD;libPWG0base;libVMC;libMinuit;libSTEER;libPWG0dep;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6");
16   TString packages("PWG0base;PWG0dep");
17
18   if (!prepareQuery(libraries, packages, kTRUE))
19     return;
20
21   gROOT->ProcessLine(".L CreateCuts.C");
22
23   AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
24   if (!esdTrackCuts)
25   {
26     printf("ERROR: esdTrackCuts could not be created\n");
27     return;
28   }
29
30   TList inputList;
31   inputList.Add(esdTrackCuts);
32
33   TChain* chain = CreateESDChain(dataDir, nRuns, offset);
34
35   TString selector("AlidNdEtaSystematicsSelector.cxx++");
36   if (debug != kFALSE)
37     selector += "g";
38
39   Int_t result = executeQuery(chain, &inputList, selector, option);
40 }
41
42 void runAnalysisWithDifferentMaps(Char_t* dataDir, Int_t nRuns=20, Int_t offset = 0, Bool_t debug = kFALSE, Bool_t proof = kFALSE)
43 {
44   // This functions runs the dN/dEta analysis with different correction maps to gather systematics
45   // It runs with the "normal map", and with 4 other different cases where particle species are enhanced
46   // or reduced.
47   // The normal map is expected in correction_map.root, created by AlidNdEtaCorrectionSelector
48   // The others in new_compositions.root in the folders (K|p)(Boosted|Reduced), created
49   //   by AlidNdEtaSystematicsSelector and Composition() out of drawSystematics.C
50
51   gROOT->ProcessLine(".L testAnalysis2.C");
52
53   gSystem->Exec("rm analysis_esd.root");
54
55   testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "correction_map.root", "dndeta_correction");
56   if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_reference.root") != 0)
57   {
58     printf("systematics_dndeta_reference.root failed\n");
59     return;
60   }
61
62   testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "KBoosted");
63   if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_KBoosted.root") != 0)
64   {
65     printf("systematics_dndeta_KBoosted.root failed\n");
66     return;
67   }
68
69   testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "KReduced");
70   if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_KReduced.root") != 0)
71   {
72     printf("systematics_dndeta_KReduced.root failed\n");
73     return;
74   }
75
76   testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "pBoosted");
77   if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_pBoosted.root") != 0)
78   {
79     printf("systematics_dndeta_pBoosted.root failed\n");
80     return;
81   }
82
83   testAnalysis2(dataDir, nRuns, offset, kFALSE, debug, proof, "new_compositions.root", "pReduced");
84   if (gSystem->Exec("mv analysis_esd.root systematics_dndeta_pReduced.root") != 0)
85   {
86     printf("systematics_dndeta_pReduced.root failed\n");
87     return;
88   }
89 }