Changes in the ACORDE libraries to compile on Windows/Cygwin
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManagerCAF.C
1 void JetAnalysisManagerCAF()
2 {
3     //
4     if (gApplication) gApplication->InitializeGraphics();
5     gROOT->LoadMacro("CreateESDChain.C");
6     //
7     // Connect to proof
8     
9     TProof::Reset("proof://morsch@lxb6046.cern.ch"); 
10     TProof::Open("proof://morsch@lxb6046.cern.ch"); 
11     
12     //   gProof->SetParallel(1);
13 //    gProof->ClearPackage("ESD");
14 //    gProof->ClearPackage("AOD");
15     //gProof->ClearPackage("JETAN");
16     //gProof->ClearPackage("ANALYSIS");
17     
18     gProof->ShowEnabledPackages();
19     // Enable the ESD Package
20     gProof->UploadPackage("ESD.par");
21     gProof->EnablePackage("ESD");
22      // Enable the AOD Package
23     gProof->UploadPackage("AOD.par");
24     gProof->EnablePackage("AOD");
25      // Enable the Analysis Package
26     gProof->UploadPackage("ANALYSIS.par");
27     gProof->EnablePackage("ANALYSIS");
28
29     // Enable the JETAN Package
30     gProof->UploadPackage("JETAN.par");
31     gProof->EnablePackage("JETAN");
32
33     //
34     gProof->ShowEnabledPackages();
35     
36     //
37     //
38     // Create the chain
39     //
40     TChain* chain = CreateESDChain("test.txt", 200);
41     
42     //
43     // Create the analysis manager
44     //
45     AliAODHandler* aodHandler   = new AliAODHandler();
46     aodHandler->SetOutputFileName("aod.root");
47     
48     AliAnalysisManager *mgr  = new AliAnalysisManager("Jet Manager", "Jet Manager");
49     mgr->SetEventHandler(aodHandler);
50     mgr-> SetDebugLevel(10);
51
52 //
53 //   Jet Finder Task
54 //
55
56     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
57     jetana->SetDebugLevel(10);
58     mgr->AddTask(jetana);
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);
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(),
100                                                               AliAnalysisManager::kOutputContainer, "default");
101
102     AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TH1F::Class(),
103                                                               AliAnalysisManager::kOutputContainer, "histos.root");
104
105     mgr->ConnectInput (jetana, 0, cinput1);
106     mgr->ConnectOutput(jetana, 0, coutput1);
107     mgr->ConnectOutput(jetana, 1, coutput2);
108
109     mgr->ConnectInput  (esdfilter,  0, cinput1 );
110     mgr->ConnectOutput (esdfilter,  0, coutput1);
111     //
112     // Run the analysis
113     //    
114     mgr->InitAnalysis();
115     mgr->PrintStatus();
116     mgr->StartAnalysis("proof",chain);
117 }