]>
Commit | Line | Data |
---|---|---|
dc740de4 | 1 | /* $Id$ */ |
2 | ||
75e130df | 3 | // |
4 | // Script to test the dN/dEta analysis using the dNdEtaAnalysis and | |
5 | // dNdEtaCorrection classes. Note that there is a cut on the events, | |
6 | // so the measurement will be biassed. | |
7 | // | |
8 | // implementation with TSelector | |
9 | // | |
10 | ||
11 | #include "../CreateESDChain.C" | |
0bd1f8a0 | 12 | #include "../PWG0Helper.C" |
75e130df | 13 | |
4c351225 | 14 | void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* correctionMapFile = "correction_map.root", const char* correctionMapFolder = "dndeta_correction", const char* option = "", const char* proofServer = "jgrosseo@lxb6046") |
75e130df | 15 | { |
0bd1f8a0 | 16 | if (aProof) |
4c351225 | 17 | connectProof(proofServer); |
10ebe68d | 18 | |
0bd1f8a0 | 19 | TString libraries("libEG;libGeom;libESD;libPWG0base"); |
20 | TString packages("PWG0base"); | |
21 | if (aMC != kFALSE) | |
16e24ca3 | 22 | { |
4c351225 | 23 | libraries += ";libVMC;libMinuit;libSTEER;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6;libPWG0dep"; |
0bd1f8a0 | 24 | packages += ";PWG0dep"; |
25 | } | |
16e24ca3 | 26 | |
0bd1f8a0 | 27 | if (!prepareQuery(libraries, packages, kTRUE)) |
28 | return; | |
16e24ca3 | 29 | |
0bd1f8a0 | 30 | //TODO somehow prevent loading several times |
31 | gROOT->ProcessLine(".L CreateCuts.C"); | |
32 | gROOT->ProcessLine(".L drawPlots.C"); | |
16e24ca3 | 33 | |
0bd1f8a0 | 34 | TChain* chain = CreateESDChain(data, nRuns, offset); |
75e130df | 35 | |
37dbb69e | 36 | |
0bd1f8a0 | 37 | TList inputList; |
16e24ca3 | 38 | |
847489f7 | 39 | if (aMC == kFALSE) |
40 | { | |
4c351225 | 41 | // selection of esd tracks |
42 | AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(); | |
43 | if (!esdTrackCuts) | |
44 | { | |
45 | printf("ERROR: esdTrackCuts could not be created\n"); | |
46 | return; | |
47 | } | |
48 | ||
49 | inputList.Add(esdTrackCuts); | |
50 | ||
0bd1f8a0 | 51 | AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(correctionMapFolder, correctionMapFolder); |
52 | dNdEtaCorrection->LoadHistograms(correctionMapFile, correctionMapFolder); | |
10ebe68d | 53 | dNdEtaCorrection->ReduceInformation(); |
0bd1f8a0 | 54 | dNdEtaCorrection->SetName("dndeta_correction"); |
55 | dNdEtaCorrection->SetTitle("dndeta_correction"); | |
847489f7 | 56 | |
0bd1f8a0 | 57 | inputList.Add(dNdEtaCorrection); |
847489f7 | 58 | } |
59 | ||
dc740de4 | 60 | TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisESDSelector" : "AlidNdEtaAnalysisMCSelector"); |
4dd2ad81 | 61 | AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo); |
62 | ||
4c351225 | 63 | selectorName += ".cxx+"; |
16e24ca3 | 64 | |
fcf2fb36 | 65 | if (aDebug != kFALSE) |
66 | selectorName += "g"; | |
67 | ||
5c495d37 | 68 | Int_t result = executeQuery(chain, &inputList, selectorName, option); |
847489f7 | 69 | |
0bd1f8a0 | 70 | if (result >= 0) |
16e24ca3 | 71 | { |
0bd1f8a0 | 72 | dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta"); |
5fbd0b17 | 73 | |
0bd1f8a0 | 74 | TFile* file = TFile::Open(aMC ? "analysis_mc.root" : "analysis_esd.root"); |
75 | if (!file) | |
76 | { | |
77 | cout << "Error. File not found" << endl; | |
78 | return; | |
79 | } | |
80 | fdNdEtaAnalysis->LoadHistograms(); | |
81 | fdNdEtaAnalysis->DrawHistograms(); | |
10ebe68d | 82 | |
0bd1f8a0 | 83 | dNdEta(kTRUE); |
10ebe68d | 84 | } |
75e130df | 85 | } |