Double declaration removed.
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManagerLoc.C
CommitLineData
c89067f5 1void JetAnalysisManagerLoc()
2{
cd008479 3 gSystem->Load("libTree.so");
4 gSystem->Load("libGeom.so");
5 gSystem->Load("libVMC.so");
6 gSystem->Load("libANALYSIS.so");
887fc299 7 gSystem->Load("libSTEERBase.so");
cd008479 8 gSystem->Load("libAOD.so");
9 gSystem->Load("libESD.so");
10 gSystem->Load("libJETAN.so");
c89067f5 11 //
12 if (gApplication) gApplication->InitializeGraphics();
13 // Create the chain
14 //
15 TChain* chain = new TChain("esdTree");
887fc299 16 chain->Add("/home/morsch/AliRoot/data/data_jets102/AliESDs.root");
17 chain->Add("/home/morsch/AliRoot/data/data_jets103/AliESDs.root");
c89067f5 18 //
887fc299 19 // Create the analysis manager
c89067f5 20 //
a0255da7 21 AliAnalysisManager *mgr = new AliAnalysisManager("Jet Manager", "Jet Manager");
887fc299 22 mgr->SetDebugLevel(10);
23 //
24 // Common output service
a0255da7 25 AliAODHandler* aodHandler = new AliAODHandler();
887fc299 26 aodHandler->SetOutputFileName("aod.root");
27 mgr->SetOutputEventHandler(aodHandler);
28 //
29 // Common MC truth services
30 AliMCEventHandler* mcHandler = new AliMCEventHandler();
31 mgr->SetMCtruthEventHandler(mcHandler);
a0255da7 32
887fc299 33 //
34 // Jet analysis
c89067f5 35 AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
36 jetana->SetDebugLevel(10);
37 mgr->AddTask(jetana);
a0255da7 38
c89067f5 39 //
40 // Create containers for input/output
41 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
42 AliAnalysisManager::kInputContainer);
43
44 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
a0255da7 45 AliAnalysisManager::kOutputContainer, "aod.root");
c89067f5 46
887fc299 47 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TH1F::Class(),
48 AliAnalysisManager::kOutputContainer, "histos.root");
49
50 mgr->ConnectInput (jetana, 0, cinput1 );
a0255da7 51 mgr->ConnectOutput (jetana, 0, coutput1 );
887fc299 52 mgr->ConnectOutput (jetana, 1, coutput2 );
c89067f5 53 //
54 // Run the analysis
55 //
56 mgr->InitAnalysis();
57 mgr->PrintStatus();
58 mgr->StartAnalysis("local",chain);
59}