Changes in the ACORDE libraries to compile on Windows/Cygwin
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManagerCAF.C
CommitLineData
aa191e39 1void JetAnalysisManagerCAF()
2{
3 //
4 if (gApplication) gApplication->InitializeGraphics();
5 gROOT->LoadMacro("CreateESDChain.C");
6 //
7 // Connect to proof
312525d3 8
a0255da7 9 TProof::Reset("proof://morsch@lxb6046.cern.ch");
aa191e39 10 TProof::Open("proof://morsch@lxb6046.cern.ch");
312525d3 11
12 // gProof->SetParallel(1);
13// gProof->ClearPackage("ESD");
14// gProof->ClearPackage("AOD");
15 //gProof->ClearPackage("JETAN");
16 //gProof->ClearPackage("ANALYSIS");
aa191e39 17
18 gProof->ShowEnabledPackages();
19 // Enable the ESD Package
20 gProof->UploadPackage("ESD.par");
21 gProof->EnablePackage("ESD");
312525d3 22 // Enable the AOD Package
23 gProof->UploadPackage("AOD.par");
24 gProof->EnablePackage("AOD");
aa191e39 25 // Enable the Analysis Package
26 gProof->UploadPackage("ANALYSIS.par");
27 gProof->EnablePackage("ANALYSIS");
312525d3 28
aa191e39 29 // Enable the JETAN Package
30 gProof->UploadPackage("JETAN.par");
31 gProof->EnablePackage("JETAN");
312525d3 32
aa191e39 33 //
34 gProof->ShowEnabledPackages();
35
36 //
37 //
38 // Create the chain
39 //
a0255da7 40 TChain* chain = CreateESDChain("test.txt", 200);
312525d3 41
aa191e39 42 //
312525d3 43 // Create the analysis manager
aa191e39 44 //
a0255da7 45 AliAODHandler* aodHandler = new AliAODHandler();
312525d3 46 aodHandler->SetOutputFileName("aod.root");
47
48 AliAnalysisManager *mgr = new AliAnalysisManager("Jet Manager", "Jet Manager");
a0255da7 49 mgr->SetEventHandler(aodHandler);
aa191e39 50 mgr-> SetDebugLevel(10);
312525d3 51
52//
53// Jet Finder Task
54//
55
aa191e39 56 AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
aa191e39 57 jetana->SetDebugLevel(10);
58 mgr->AddTask(jetana);
312525d3 59//
60// ESD Filter Task
61//
62 //
63 // Set of cuts
64 //
65 // standard
66 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
67 esdTrackCutsL->SetMinNClustersTPC(50);
68 esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
69 esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
70 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
71 esdTrackCutsL->SetMinNsigmaToVertex(3);
72 esdTrackCutsL->SetRequireSigmaToVertex(kTRUE);
73 esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
74 //
75 // hard
76 AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Hard");
77 esdTrackCutsH->SetMinNClustersTPC(100);
78 esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0);
79 esdTrackCutsH->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
80 esdTrackCutsH->SetRequireTPCRefit(kTRUE);
81 esdTrackCutsH->SetMinNsigmaToVertex(2);
82 esdTrackCutsH->SetRequireSigmaToVertex(kTRUE);
83 esdTrackCutsH->SetAcceptKingDaughters(kFALSE);
84 //
85 //
86 AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
87 trackFilter->AddCuts(esdTrackCutsL);
88 trackFilter->AddCuts(esdTrackCutsH);
89 //
90 AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
91 esdfilter->SetTrackFilter(trackFilter);
92 esdfilter->SetDebugLevel(10);
93 mgr->AddTask(esdfilter);
aa191e39 94 //
95 // Create containers for input/output
96 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
97 AliAnalysisManager::kInputContainer);
98
99 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
312525d3 100 AliAnalysisManager::kOutputContainer, "default");
101
102 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TH1F::Class(),
103 AliAnalysisManager::kOutputContainer, "histos.root");
aa191e39 104
105 mgr->ConnectInput (jetana, 0, cinput1);
106 mgr->ConnectOutput(jetana, 0, coutput1);
312525d3 107 mgr->ConnectOutput(jetana, 1, coutput2);
108
109 mgr->ConnectInput (esdfilter, 0, cinput1 );
110 mgr->ConnectOutput (esdfilter, 0, coutput1);
aa191e39 111 //
112 // Run the analysis
113 //
114 mgr->InitAnalysis();
115 mgr->PrintStatus();
a0255da7 116 mgr->StartAnalysis("proof",chain);
aa191e39 117}