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