Correction.
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManagerLoc.C
CommitLineData
c89067f5 1void JetAnalysisManagerLoc()
2{
99b06af5 3 gSystem->Load("libTree.so");
4 gSystem->Load("libGeom.so");
5 gSystem->Load("libVMC.so");
6 gSystem->Load("libANALYSIS.so");
7 gSystem->Load("libSTEERBase.so");
8 gSystem->Load("libAOD.so");
9 gSystem->Load("libESD.so");
10 gSystem->Load("libJETAN.so");
11 gSystem->Load("libPWG0base.so");
c89067f5 12 //
13 if (gApplication) gApplication->InitializeGraphics();
14 // Create the chain
15 //
99b06af5 16 gROOT->LoadMacro("CreateESDChain.C");
c89067f5 17 TChain* chain = new TChain("esdTree");
887fc299 18 chain->Add("/home/morsch/AliRoot/data/data_jets102/AliESDs.root");
99b06af5 19
20 ///////////////////////////////////////////////////////////////////////////////////
887fc299 21 // Create the analysis manager
c89067f5 22 //
99b06af5 23 // Input
24 AliESDInputHandler* inpHandler = new AliESDInputHandler();
25 // Output
26 AliAODHandler* aodHandler = new AliAODHandler();
887fc299 27 aodHandler->SetOutputFileName("aod.root");
99b06af5 28 // MC Truth
887fc299 29 AliMCEventHandler* mcHandler = new AliMCEventHandler();
99b06af5 30
a0255da7 31
99b06af5 32 AliAnalysisManager *mgr = new AliAnalysisManager("Jet Manager", "Jet Manager");
33 mgr->SetInputEventHandler (inpHandler);
34 mgr->SetOutputEventHandler (aodHandler);
35 mgr->SetMCtruthEventHandler(mcHandler);
36 mgr-> SetDebugLevel(10);
37 ///////////////////////////////////////////////////////////////////////////////////
38
39
887fc299 40 //
99b06af5 41 // Set of cuts
42 //
43 // standard
44 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
45 esdTrackCutsL->SetMinNClustersTPC(50);
46 esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
47 esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
48 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
49 esdTrackCutsL->SetMinNsigmaToVertex(3);
50 esdTrackCutsL->SetRequireSigmaToVertex(kTRUE);
51 esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
52 //
53 // hard
54 AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Hard");
55 esdTrackCutsH->SetMinNClustersTPC(100);
56 esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0);
57 esdTrackCutsH->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
58 esdTrackCutsH->SetRequireTPCRefit(kTRUE);
59 esdTrackCutsH->SetMinNsigmaToVertex(2);
60 esdTrackCutsH->SetRequireSigmaToVertex(kTRUE);
61 esdTrackCutsH->SetAcceptKingDaughters(kFALSE);
62 //
63 AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
64 trackFilter->AddCuts(esdTrackCutsL);
65 trackFilter->AddCuts(esdTrackCutsH);
66 //
67 AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
68 esdfilter->SetTrackFilter(trackFilter);
69 esdfilter->SetDebugLevel(10);
70 mgr->AddTask(esdfilter);
71
c89067f5 72 AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
73 jetana->SetDebugLevel(10);
74 mgr->AddTask(jetana);
a0255da7 75
c89067f5 76 //
77 // Create containers for input/output
78 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
79 AliAnalysisManager::kInputContainer);
80
81 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
99b06af5 82 AliAnalysisManager::kOutputContainer, "default");
83 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(),
887fc299 84 AliAnalysisManager::kOutputContainer, "histos.root");
85
99b06af5 86 mgr->ConnectInput (esdfilter, 0, cinput1 );
87 mgr->ConnectOutput (esdfilter, 0, coutput1 );
88
89 mgr->ConnectInput (jetana, 0, cinput1 );
90 mgr->ConnectOutput (jetana, 0, coutput1 );
91 mgr->ConnectOutput (jetana, 1, coutput2 );
92
93
c89067f5 94 //
95 // Run the analysis
96 //
97 mgr->InitAnalysis();
98 mgr->PrintStatus();
99 mgr->StartAnalysis("local",chain);
100}