]>
Commit | Line | Data |
---|---|---|
d269b0e6 | 1 | void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outputFile.root", Int_t NumberOfFiles=10,Int_t fromFile=0, Int_t nEvents=1000, Int_t firstEvent =0, Bool_t bUseMCInfo=kTRUE, Float_t zvWindow=20., Int_t cutMode=9,Float_t etaWindow=0.9, Float_t ptMin=0.15,AlidNdPtHelper::AnalysisMode analysisMode = AlidNdPtHelper::kTPC, AlidNdPtHelper::ParticleMode particleMode = AlidNdPtHelper::kAllPart, AlidNdPtHelper::OutputObject outputObject=AlidNdPtHelper::kCorrection,const char *corrFile = "corrMatricesFile.root",Bool_t bProof=kFALSE) |
0aaa8b91 | 2 | { |
3 | // set Proof | |
4 | if(bProof) { | |
5 | ||
6 | //cout << "*** START PROOF Lite SESSION ***" << endl; | |
d269b0e6 | 7 | //TProof::Open(""); // 1. Enter your username here |
0aaa8b91 | 8 | |
d269b0e6 | 9 | //TProofMgr * proofmgr = TProof::Mgr("lxialpod2.gsi.de:21001"); |
f33b8af4 | 10 | //TProofMgr * proofmgr = TProof::Mgr("lxialpod.gsi.de:21001"); |
d269b0e6 | 11 | TProofMgr * proofmgr = TProof::Mgr("lxialpod.gsi.de:21004"); |
bad4ba69 | 12 | //TProofMgr * proofmgr = TProof::Mgr("lxial39.gsi.de:21001"); |
0aaa8b91 | 13 | TProof * proof = proofmgr->CreateSession(); |
f33b8af4 | 14 | proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000); |
0aaa8b91 | 15 | |
16 | // -- Load AliRoot Libraries | |
4fa29112 | 17 | gROOT->LoadMacro("ProofEnableAliRootGSI.C"); |
bad4ba69 | 18 | ProofEnableAliRootGSI("/u/jacek/alice/AliRoot/trunk"); |
0aaa8b91 | 19 | } |
20 | ||
21 | // Swtich off all AliInfo (too much output!!!) | |
22 | AliLog::SetGlobalLogLevel(AliLog::kError); | |
23 | ||
24 | // Create analysis manager | |
25 | AliAnalysisManager *mgr = new AliAnalysisManager; | |
26 | ||
d269b0e6 | 27 | // |
28 | // Create physics trigger selection class | |
29 | // | |
30 | AliPhysicsSelection *physTrigSel = new AliPhysicsSelection(); | |
31 | ||
0aaa8b91 | 32 | // |
33 | // Create event cuts | |
34 | // | |
35 | AlidNdPtEventCuts *evtCuts = new AlidNdPtEventCuts("AlidNdPtEventCuts","Event cuts"); | |
36 | evtCuts->SetZvRange(-zvWindow,zvWindow); | |
37 | evtCuts->SetMeanXYZv(0.0,0.0,0.0); | |
38 | evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0); | |
bad4ba69 | 39 | evtCuts->SetTriggerRequired(kTRUE); |
d269b0e6 | 40 | //evtCuts->SetTriggerRequired(kFALSE); |
0aaa8b91 | 41 | |
42 | // Create geom. acceptance cuts | |
43 | AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts"); | |
44 | accCuts->SetEtaRange(-etaWindow,etaWindow); | |
45 | accCuts->SetPtRange(ptMin,1.e10); | |
46 | accCuts->SetMaxDCAr(3.0); | |
47 | accCuts->SetMaxDCAz(30.0); | |
48 | ||
49 | // Create standard esd track cuts | |
d269b0e6 | 50 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/dNdPt/macros/CreatedNdPtTrackCuts.C"); |
bad4ba69 | 51 | AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode); |
0aaa8b91 | 52 | if (!esdTrackCuts) { |
53 | printf("ERROR: esdTrackCuts could not be created\n"); | |
54 | return; | |
55 | } else { | |
56 | esdTrackCuts->SetHistogramsOn(kTRUE); | |
57 | } | |
58 | ||
59 | // | |
60 | // Create task | |
61 | // | |
62 | AlidNdPtTask *task = new AlidNdPtTask("AlidNdPtTask"); | |
63 | if (bUseMCInfo) task->SetUseMCInfo(kTRUE); | |
64 | ||
65 | // create cut analysis object | |
66 | if(outputObject==AlidNdPtHelper::kCutAnalysis) | |
67 | { | |
68 | AlidNdPtCutAnalysis *fdNdPtCutAnalysis = new AlidNdPtCutAnalysis("dNdPtCutAnalysis","dN/dPt Cut Analysis"); | |
69 | fdNdPtCutAnalysis->SetEventCuts(evtCuts); | |
70 | fdNdPtCutAnalysis->SetAcceptanceCuts(accCuts); | |
71 | fdNdPtCutAnalysis->SetTrackCuts(esdTrackCuts); | |
72 | fdNdPtCutAnalysis->SetAnalysisMode(analysisMode); | |
d269b0e6 | 73 | fdNdPtCutAnalysis->SetParticleMode(particleMode); |
f33b8af4 | 74 | if(bUseMCInfo) |
75 | { | |
d269b0e6 | 76 | //fdNdPtCutAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); |
77 | physTrigSel->SetAnalyzeMC(); | |
78 | fdNdPtCutAnalysis->SetPhysicsTriggerSelection(physTrigSel); | |
f33b8af4 | 79 | fdNdPtCutAnalysis->SetUseMCInfo(kTRUE); |
80 | } | |
81 | else { // online trigger | |
d269b0e6 | 82 | fdNdPtCutAnalysis->SetPhysicsTriggerSelection(physTrigSel); |
f33b8af4 | 83 | //fdNdPtCutAnalysis->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); |
d269b0e6 | 84 | //fdNdPtCutAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL"); |
f33b8af4 | 85 | //fdNdPtCutAnalysis->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); |
86 | //fdNdPtCutAnalysis->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); | |
87 | //fdNdPtCutAnalysis->SetTriggerClass("CINT1-E-NOPF-ALL"); | |
88 | } | |
0aaa8b91 | 89 | |
90 | task->AddAnalysisObject( fdNdPtCutAnalysis ); | |
91 | } | |
92 | ||
93 | // create analysis object | |
94 | if(outputObject==AlidNdPtHelper::kAnalysis) | |
95 | { | |
96 | AlidNdPtAnalysis *fdNdPtAnalysis = new AlidNdPtAnalysis("dNdPtAnalysis","dN/dPt Analysis"); | |
97 | fdNdPtAnalysis->SetEventCuts(evtCuts); | |
98 | fdNdPtAnalysis->SetAcceptanceCuts(accCuts); | |
99 | fdNdPtAnalysis->SetTrackCuts(esdTrackCuts); | |
100 | fdNdPtAnalysis->SetAnalysisMode(analysisMode); | |
d269b0e6 | 101 | fdNdPtAnalysis->SetParticleMode(particleMode); |
f33b8af4 | 102 | if(bUseMCInfo) |
103 | { | |
d269b0e6 | 104 | //fdNdPtAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); |
105 | physTrigSel->SetAnalyzeMC(); | |
106 | fdNdPtAnalysis->SetPhysicsTriggerSelection(physTrigSel); | |
107 | ||
f33b8af4 | 108 | fdNdPtAnalysis->SetUseMCInfo(kTRUE); |
d269b0e6 | 109 | //fdNdPtAnalysis->SetHistogramsOn(kTRUE); |
110 | fdNdPtAnalysis->SetHistogramsOn(kFALSE); | |
f33b8af4 | 111 | } |
112 | else { // online trigger | |
d269b0e6 | 113 | fdNdPtAnalysis->SetPhysicsTriggerSelection(physTrigSel); |
f33b8af4 | 114 | //fdNdPtAnalysis->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); |
d269b0e6 | 115 | //fdNdPtAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL"); |
f33b8af4 | 116 | //fdNdPtAnalysis->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); |
117 | //fdNdPtAnalysis->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); | |
118 | //fdNdPtAnalysis->SetTriggerClass("CINT1-E-NOPF-ALL"); | |
119 | } | |
0aaa8b91 | 120 | |
0aaa8b91 | 121 | task->AddAnalysisObject( fdNdPtAnalysis ); |
122 | } | |
123 | ||
124 | // create correction object | |
125 | if(outputObject == AlidNdPtHelper::kCorrection) | |
126 | { | |
127 | AlidNdPtCorrection *fdNdPtCorrection = new AlidNdPtCorrection("dNdPtCorrection","dN/dPt Correction", corrFile); | |
128 | ||
129 | fdNdPtCorrection->SetEventCuts(evtCuts); | |
130 | fdNdPtCorrection->SetAcceptanceCuts(accCuts); | |
131 | fdNdPtCorrection->SetTrackCuts(esdTrackCuts); | |
132 | fdNdPtCorrection->SetAnalysisMode(analysisMode); | |
d269b0e6 | 133 | fdNdPtCorrection->SetParticleMode(particleMode); |
f33b8af4 | 134 | if(bUseMCInfo) |
135 | { | |
d269b0e6 | 136 | //fdNdPtCorrection->SetTrigger(AliTriggerAnalysis::kMB1); |
137 | physTrigSel->SetAnalyzeMC(); | |
138 | fdNdPtCorrection->SetPhysicsTriggerSelection(physTrigSel); | |
f33b8af4 | 139 | fdNdPtCorrection->SetUseMCInfo(kTRUE); |
140 | } | |
141 | else { // online trigger | |
d269b0e6 | 142 | fdNdPtCorrection->SetPhysicsTriggerSelection(physTrigSel); |
f33b8af4 | 143 | //fdNdPtCorrection->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); |
d269b0e6 | 144 | //fdNdPtCorrection->SetTriggerClass("CINT1B-ABCE-NOPF-ALL"); |
f33b8af4 | 145 | //fdNdPtCorrection->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); |
146 | //fdNdPtCorrection->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); | |
147 | //fdNdPtCorrection->SetTriggerClass("CINT1-E-NOPF-ALL"); | |
148 | } | |
0aaa8b91 | 149 | |
150 | task->AddAnalysisObject( fdNdPtCorrection ); | |
151 | } | |
152 | ||
153 | // Add task | |
154 | mgr->AddTask(task); | |
155 | ||
156 | // Add ESD handler | |
157 | AliESDInputHandler* esdH = new AliESDInputHandler; | |
158 | //esdH->SetInactiveBranches("*"); | |
159 | mgr->SetInputEventHandler(esdH); | |
160 | ||
161 | if(bUseMCInfo) { | |
162 | // Enable MC event handler | |
163 | AliMCEventHandler* handler = new AliMCEventHandler; | |
164 | handler->SetReadTR(kFALSE); | |
165 | //handler->SetReadTR(kTRUE); | |
166 | mgr->SetMCtruthEventHandler(handler); | |
167 | } | |
168 | ||
169 | // Create input chain | |
170 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
171 | TChain* chain = CreateESDChain(fileList, NumberOfFiles, fromFile); | |
172 | if(!chain) { | |
173 | printf("ERROR: chain cannot be created\n"); | |
174 | return; | |
175 | } | |
176 | ||
177 | // Create containers for input | |
0aaa8b91 | 178 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); |
179 | mgr->ConnectInput(task, 0, cinput); | |
180 | ||
181 | // Create containers for output | |
182 | AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput", TList::Class(), AliAnalysisManager::kOutputContainer, outFile); | |
183 | mgr->ConnectOutput(task, 0, coutput); | |
184 | ||
185 | // Enable debug printouts | |
186 | mgr->SetDebugLevel(0); | |
187 | ||
188 | if (!mgr->InitAnalysis()) | |
189 | return; | |
190 | ||
191 | mgr->PrintStatus(); | |
192 | ||
193 | if(bProof) mgr->StartAnalysis("proof",chain, nEvents, firstEvent); | |
194 | else mgr->StartAnalysis("local",chain,nEvents, firstEvent); | |
195 | } | |
196 |