]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/runProofFwdDetsQA.C
Added protection agains null primary vertex pointer
[u/mrichter/AliRoot.git] / PWG1 / runProofFwdDetsQA.C
1 void runProofFwdDetsQA(const char * dataset = "/COMMON/COMMON/LHC09a4_run8101X",Long64_t nentries=100000, 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   TProof::Open("cheshkov:PWG0@alicecaf");
10
11   // Upload and enable packages: please use the correct version!
12   gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
13   gProof->EnablePackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
14
15   // Create the analysis manager
16   AliAnalysisManager *mgr = new AliAnalysisManager("AliAnaFwdDetsQA");
17
18   AliVEventHandler* esdH = new AliESDInputHandler();
19   mgr->SetInputEventHandler(esdH);
20
21   // Enable MC event handler
22   AliVEventHandler* handler = new AliMCEventHandler;
23   mgr->SetMCtruthEventHandler(handler);
24
25   // Create task
26
27   gProof->Load(Form("%s/PWG1/AliAnaFwdDetsQA.cxx++g",
28                     gSystem->Getenv("ALICE_ROOT")));
29   AliAnalysisTask *task = new AliAnaFwdDetsQA("AliAnaFwdDetsQA");
30
31   // Add task
32   mgr->AddTask(task);
33
34   // Create containers for input/output
35   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
36   AliAnalysisDataContainer *coutput = 
37     mgr->CreateContainer("coutput", TList::Class(), 
38     AliAnalysisManager::kOutputContainer, "FwdDetsQA.root");
39
40   // Connect input/output
41   mgr->ConnectInput(task, 0, cinput);
42   mgr->ConnectOutput(task, 1, coutput);
43
44
45   // Enable debug printouts
46   mgr->SetDebugLevel(3);
47
48   if (!mgr->InitAnalysis())
49     return;
50
51   mgr->PrintStatus();
52
53   TFileCollection *proofColl = gProof->GetDataSet(dataset);
54   TChain *chain = new TChain("esdTree");
55   chain->AddFileInfoList((TCollection*)(proofColl->GetList()));
56   mgr->StartAnalysis("proof", chain, nentries, firstentry);
57
58     //  mgr->StartAnalysis("proof",dataset,nentries,firstentry);
59 }
60