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.
8 // implementation with TSelector
11 #include "../CreateESDChain.C"
13 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)
15 gSystem->Load("libEG");
16 gSystem->Load("libGeom");
17 gSystem->Load("libESD");
18 gSystem->Load("libPWG0base");
20 gSystem->Load("libPWG0dep");
22 gROOT->ProcessLine(".L CreatedNdEta.C");
23 gROOT->ProcessLine(".L CreateCuts.C");
26 TVirtualProof* proof = 0;
28 chain = CreateESDChainFromDir(data, nRuns, offset);
31 chain = CreateESDChainFromList(data, nRuns, offset);
32 proof = gROOT->Proof("jgrosseo@lxb6046");
36 printf("ERROR: PROOF connection not established.\n");
40 if (proof->EnablePackage("ESD"))
42 printf("ERROR: ESD package could not be enabled.\n");
46 if (proof->EnablePackage("PWG0base"))
48 printf("ERROR: PWG0base package could not be enabled.\n");
54 if (proof->EnablePackage("PWG0dep"))
56 printf("ERROR: PWG0dep package could not be enabled.\n");
61 //chain->SetProof(proof);
64 // ########################################################
65 // selection of esd tracks
66 AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
69 printf("ERROR: esdTrackCuts could not be created\n");
73 chain->GetUserInfo()->Add(esdTrackCuts);
75 proof->AddInput(esdTrackCuts);
79 AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection();
80 dNdEtaCorrection->LoadHistograms("correction_map.root","dndeta_correction");
81 //dNdEtaCorrection->RemoveEdges(2, 0, 2);
83 chain->GetUserInfo()->Add(dNdEtaCorrection);
85 proof->AddInput(dNdEtaCorrection);
88 TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisESDSelector" : "AlidNdEtaAnalysisMCSelector");
89 AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
91 // workaround for a bug in PROOF that only allows header files for .C files
92 // please create symlink from <selector>.cxx to <selector>.C
94 selectorName += ".C+";
96 selectorName += ".cxx+";
104 Long64_t result = -1;
107 result = chain->MakeTDSet()->Process(selectorName);
109 result = chain->Process(selectorName);
113 printf("ERROR: Executing process failed with %d.\n", result);
120 CreatedNdEta(aMC ? kFALSE : kTRUE, aMC ? "analysis_mc.root" : "analysis_esd.root");