few more protections
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / testAnalysis2.C
CommitLineData
75e130df 1//
2// Script to test the dN/dEta analysis using the dNdEtaAnalysis and
3// dNdEtaCorrection classes. Note that there is a cut on the events,
4// so the measurement will be biassed.
5//
6// implementation with TSelector
7//
8
9#include "../CreateESDChain.C"
10
4dd2ad81 11testAnalysis2(Char_t* dataDir, Int_t nRuns=20, Bool_t aMC = kFALSE)
75e130df 12{
13 gSystem->Load("libPWG0base");
14
15 TChain* chain = CreateESDChain(dataDir, nRuns);
16
17 // ########################################################
18 // selection of esd tracks
19 AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts();
20 esdTrackCuts->DefineHistograms(1);
21
22 esdTrackCuts->SetMinNClustersTPC(50);
23 esdTrackCuts->SetMaxChi2PerClusterTPC(3.5);
24 esdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
25 esdTrackCuts->SetRequireTPCRefit(kTRUE);
26
27 esdTrackCuts->SetMinNsigmaToVertex(3);
28 esdTrackCuts->SetAcceptKingDaughters(kFALSE);
29
30 chain->GetUserInfo()->Add(esdTrackCuts);
31
dded7a68 32 if (aMC == kFALSE)
33 {
34 dNdEtaCorrection* dNdEtaCorrection = new dNdEtaCorrection();
35 dNdEtaCorrection->LoadHistograms("correction_map.root","dndeta_correction");
36 dNdEtaCorrection->RemoveEdges(2,0,2);
37
38 chain->GetUserInfo()->Add(dNdEtaCorrection);
39 }
40
4dd2ad81 41 TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisSelector" : "AlidNdEtaAnalysisMCSelector");
42
43 AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
44
45 chain->Process(selectorName + ".cxx+");
75e130df 46}