Adding analysis task for the centrality trigger calibration.
[u/mrichter/AliRoot.git] / PWG1 / VZERO / runAnaTrigProof.C
CommitLineData
c014f07d 1void runAnaTrigProof(const char *dataset = "LHC10h_000138396_hlt_clustering", Int_t workers=28, Long64_t nentries=10000000, Long64_t firstentry=0)
2{
3 gSystem->Load("libANALYSIS");
4 gSystem->Load("libANALYSISalice");
5 gSystem->AddIncludePath("-I$ALICE_ROOT/include ");
6
7 // Connect to Proof
8 gEnv->SetValue("XSec.GSI.DelegProxy","2");
9 Char_t *alienuser = gSystem->Getenv("alien_API_USER");
10 cout<<"==> Your AliEn username is: "<<alienuser<<endl;
11
12 TProof *p = TProof::Open(alienuser!=0 ? Form("%s@alice-caf.cern.ch",
13 alienuser) : "alice-caf.cern.ch",
14 workers>0 ? Form("workers=%d",workers) : "");
15
16 // gProof->GetManager()->SetROOTVersion("VO_ALICE@ROOT::v5-28-00f");
17 gProof->EnablePackage("VO_ALICE@AliRoot::v5-02-07-AN");
18
19 // Create the analysis manager
20 AliAnalysisManager *mgr = new AliAnalysisManager("AliAnaFwdDet");
21
22 AliESDInputHandler* esdH = new AliESDInputHandler();
23 esdH->SetInactiveBranches("FMD AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend.fTracks Kinks MuonTracks TrdTracks");
24 // esdH->SetReadFriends(kTRUE);
25 esdH->SetReadFriends(kFALSE);
26 mgr->SetInputEventHandler(esdH);
27
28 // physics and centrality selection
29 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
30 AliPhysicsSelectionTask *physicsSelectionTask = AddTaskPhysicsSelection(kFALSE);
31 AliOADBTriggerAnalysis * oadbTrigAnalysis = new
32 AliOADBTriggerAnalysis("CustomTA");
33 oadbTrigAnalysis->SetZDCCorrParameters(-0.823, -0.653, 4*0.58, 4*0.5);
34 physicsSelectionTask->GetPhysicsSelection()->SetCustomOADBObjects(0,0,oadbTrigAnalysis);
35
36
37 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
38 AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
39
40 // Create task
41 gProof->Load(Form("%s/AliAnaVZEROTrigger.cxx++g",
42 gSystem->pwd()));
43 AliAnaVZEROTrigger *task = new AliAnaVZEROTrigger("AliAnaVZEROTrigger");
44 task->SetMBTrigName("CMBACS2");
45 task->Setup("trigger.txt");
46
47 // Add task
48 mgr->AddTask(task);
49
50 // Create containers for input/output
51 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
52 AliAnalysisDataContainer *coutput =
53 mgr->CreateContainer("coutput", TList::Class(),
54 AliAnalysisManager::kOutputContainer, Form("VZERO.Trigger.%s.root",dataset));
55
56 // Connect input/output
57 mgr->ConnectInput(task, 0, cinput);
58 mgr->ConnectOutput(task, 1, coutput);
59
60
61 // Enable debug printouts
62 // mgr->SetDebugLevel(3);
63
64 if (!mgr->InitAnalysis())
65 return;
66
67 mgr->PrintStatus();
68
69 mgr->StartAnalysis("proof", Form("/alice/data/%s",dataset), nentries, firstentry);
70}
71