1 // Macro to run TPC performance
6 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/LoadMyLibs.C");
8 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
9 TChain* chain = CreateESDChain("esd_v4-16-Rev-08-grid.txt", 10, 0);
12 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTask.C");
13 RunPerformanceTask(chain, kTRUE, kFALSE);
15 //2. Run on PROOF Lite e.g.
19 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/ProofEnableAliRoot.C");
20 ProofEnableAliRoot("/u/jacek/alice/AliRoot/HEAD/");
22 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
23 TChain* chain = CreateESDChain("esd_v4-16-Rev-08-grid.txt", 500, 0);
24 //TChain* chain = CreateESDChain("esd_TRUNK_flat_ideal_geom.txt", 50, 0);
27 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTask.C");
28 RunPerformanceTask(chain, kTRUE, kTRUE);
31 //3. Run only on static PROOF at GSI e.g.
33 TProof::Reset("jacek@lxgrid5.gsi.de");
34 TProofMgr * proofmgr = TProof::Mgr("jacek@lxgrid5.gsi.de");
35 proofmgr->SetROOTVersion("523-02");
36 TProof * proof = proofmgr->CreateSession();
37 proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000);
39 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/ProofEnableAliRoot.C");
40 ProofEnableAliRoot("/u/jacek/alice/AliRoot/HEAD/");
42 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
43 TChain* chain = CreateESDChain("esd_v4-16-Rev-08-grid.txt", 200, 0);
46 gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTask.C");
47 RunPerformanceTask(chain, kTRUE, kTRUE);
49 //4. Make final spectra and store them in the
50 // output folder and generate control pictures e.g.
52 TFile f("TPC.Performance.root");
53 AliPerformanceRes * compObjRes = (AliPerformanceRes*)coutput->FindObject("AliPerformanceResTPCInner");
54 compObjRes->Analyse();
55 compObjRes->GetAnalysisFolder()->ls("*");
56 compObjRes->PrintHisto(kTRUE,"PerformanceResTPCInnerQA.ps");
57 TFile fout("AnalysedResTPCInner.root","recreate");
58 compObjRes->GetAnalysisFolder()->Write();
65 //_____________________________________________________________________________
66 void RunPerformanceTask(TChain *chain, Bool_t bUseMCInfo=kTRUE, Bool_t bProof=kTRUE)
70 AliDebug(AliLog::kError, "ERROR: No input chain available");
79 TProof::Reset("jacek@lxgrid5.gsi.de");
80 TProofMgr * proofmgr = TProof::Mgr("jacek@lxgrid5.gsi.de");
81 proofmgr->SetROOTVersion("523-02");
82 TProof * proof = proofmgr->CreateSession();
83 proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000);
87 //cout << "*** START PROOF Lite SESSION ***" << endl;
89 gROOT->LoadMacro("ProofEnableAliRoot.C");
90 ProofEnableAliRoot("/u/jacek/alice/AliRoot/HEAD/");
95 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
98 // Create global cuts objects
101 // Create ESD track reconstruction cuts
102 AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts();
104 pRecInfoCuts->SetMaxDCAToVertexXY(3.0);
105 pRecInfoCuts->SetMaxDCAToVertexZ(3.0);
106 pRecInfoCuts->SetMinNClustersTPC(50);
107 pRecInfoCuts->SetMinNClustersITS(2);
108 pRecInfoCuts->SetHistogramsOn(kFALSE);
110 AliDebug(AliLog::kError, "ERROR: Cannot create AliRecInfoCuts object");
113 // Create MC track reconstruction cuts
114 AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts();
116 pMCInfoCuts->SetMinTrackLength(70);
118 AliDebug(AliLog::kError, "ERROR: Cannot AliMCInfoCuts object");
122 // Create performance objects and set cuts
124 const Int_t kTPC = 0; const Int_t kTPCITS = 1; const Int_t kConstrained = 2; const Int_t kTPCInner = 3;
129 AliPerformanceRes *pCompRes0 = new AliPerformanceRes("AliPerformanceRes","AliPerformanceRes",kTPC,kFALSE);
131 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceRes object");
133 pCompRes0->SetAliRecInfoCuts(pRecInfoCuts);
134 pCompRes0->SetAliMCInfoCuts(pMCInfoCuts);
136 AliPerformanceRes *pCompRes3 = new AliPerformanceRes("AliPerformanceResTPCInner","AliPerformanceResTPCInner",kTPCInner,kFALSE);
138 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceResInnerTPC object");
140 pCompRes3->SetAliRecInfoCuts(pRecInfoCuts);
141 pCompRes3->SetAliMCInfoCuts(pMCInfoCuts);
145 AliPerformanceEff *pCompEff0 = new AliPerformanceEff("AliPerformanceEff","AliPerformanceEff",kTPC,kFALSE);
147 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceEff object");
149 pCompEff0->SetAliRecInfoCuts(pRecInfoCuts);
150 pCompEff0->SetAliMCInfoCuts(pMCInfoCuts);
154 AliPerformanceDEdx *pCompDEdx3 = new AliPerformanceDEdx("AliPerformanceDEdxTPCInner","AliPerformanceDEdxTPCInner",kTPCInner,kFALSE);
156 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceDEdxTPCInner object");
158 pCompDEdx3->SetAliRecInfoCuts(pRecInfoCuts);
159 pCompDEdx3->SetAliMCInfoCuts(pMCInfoCuts);
163 AliPerformanceDCA *pCompDCA0 = new AliPerformanceDCA("AliPerformanceDCA","AliPerformanceDCA",kTPC,kFALSE);
165 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceDCA object");
167 pCompDCA0->SetAliRecInfoCuts(pRecInfoCuts);
168 pCompDCA0->SetAliMCInfoCuts(pMCInfoCuts);
172 AliPerformanceTPC *pCompTPC0 = new AliPerformanceTPC("AliPerformanceTPC","AliPerformanceTPC",kTPC,kFALSE);
174 AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceTPC object");
176 pCompTPC0->SetAliRecInfoCuts(pRecInfoCuts);
177 pCompTPC0->SetAliMCInfoCuts(pMCInfoCuts);
179 // Swtich off all AliInfo (too much output!!!)
180 AliLog::SetGlobalLogLevel(AliLog::kError);
182 // Create the analysis manager
183 AliAnalysisManager *mgr = new AliAnalysisManager;
186 AliPerformanceTask *task = new AliPerformanceTask("Performance","TPC Performance");
187 if (bUseMCInfo) task->SetUseMCInfo(kTRUE);
188 task->AddPerformanceObject( pCompRes0 );
189 task->AddPerformanceObject( pCompRes3 );
190 task->AddPerformanceObject( pCompEff0 );
191 task->AddPerformanceObject( pCompDEdx3 );
192 task->AddPerformanceObject( pCompDCA0 );
193 task->AddPerformanceObject( pCompTPC0 );
199 AliESDInputHandler* esdH = new AliESDInputHandler;
200 //esdH->SetInactiveBranches("*");
201 mgr->SetInputEventHandler(esdH);
204 // Enable MC event handler
205 AliMCEventHandler* handler = new AliMCEventHandler;
206 //handler->SetReadTR(kFALSE);
207 handler->SetReadTR(kTRUE);
208 mgr->SetMCtruthEventHandler(handler);
211 // Create input chain
212 //gROOT->LoadMacro("CreateESDChain.C");
213 //TChain* chain = CreateESDChain(fileList, NumberOfFiles, fromFile);
215 // printf("ERROR: chain cannot be created\n");
219 // Create containers for input
220 //AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer);
221 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
222 mgr->ConnectInput(task, 0, cinput);
224 // Create containers for output
225 AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName()));
226 mgr->ConnectOutput(task, 0, coutput);
228 // Enable debug printouts
229 mgr->SetDebugLevel(0);
231 if (!mgr->InitAnalysis())
236 if(bProof) mgr->StartAnalysis("proof",chain);
237 else mgr->StartAnalysis("local",chain);