Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ANALYSIS / runKineProof.C
1 {
2     gSystem->Load("libPhysics");
3     // Connecting to the PROOF cluster
4     TProof::Open("alicecaf");
5
6     // Clear packages if changing ROOT version on CAF or local
7     //gProof->ClearPackages();
8     
9     // Enable the needed packages
10     gProof->UploadPackage("STEERBase");
11     gProof->EnablePackage("STEERBase");
12     gProof->UploadPackage("ESD");
13     gProof->EnablePackage("ESD");
14     gProof->UploadPackage("AOD");
15     gProof->EnablePackage("AOD");
16     gProof->UploadPackage("ANALYSIS");
17     gProof->EnablePackage("ANALYSIS");
18     gProof->UploadPackage("ANALYSISalice");
19     gProof->EnablePackage("ANALYSISalice");
20     gProof->UploadPackage("JETAN");
21     gProof->EnablePackage("JETAN");
22        
23     // Create the analysis manager
24     mgr = new AliAnalysisManager("Analysis UE test");
25
26     // Create, add task
27     gProof->Load("AliKineTrackCuts.cxx+");
28     AliKineTrackCuts* trackCuts = new AliKineTrackCuts("AliKineTrackCuts", "Eta");
29     trackCuts->SetEtaRange(-1., 1.);
30     
31     AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
32     trackFilter->AddCuts(trackCuts);
33     
34     gProof->Load("AliAnalysisTaskKineFilter.cxx+");
35     AliAnalysisTaskKineFilter *kinefilter = new AliAnalysisTaskKineFilter("Kine Filter");
36     kinefilter->SetTrackFilter(trackFilter);
37     mgr->AddTask(kinefilter);
38     
39     // Create chain of input files
40     gROOT->LoadMacro("CreateESDChain.C");
41     chain = CreateChain( "TE", "KINE82XX_30K.txt", 200);
42  
43  
44  
45     /////////////////////////////////////////////////////////////////////////////////// 
46     // Create the analysis manager
47     //
48     // Input 
49     // MC Truth
50     AliMCEventHandler* mcHandler = new AliMCEventHandler();
51     mcHandler->SetReadTR(kFALSE);
52     
53     // Output
54     AliAODHandler* aodHandler = new AliAODHandler();
55     aodHandler->SetOutputFileName( "aodKine.root" );
56
57     AliAnalysisManager *mgr  = new AliAnalysisManager("Jet Manager", "Jet Manager");
58 //    mgr->SetInputEventHandler  (inpHandler);
59     mgr->SetMCtruthEventHandler(mcHandler);
60     mgr->SetOutputEventHandler (aodHandler);
61     mgr->SetDebugLevel(10);
62     
63     /////////////////////////////////////////////////////////////////////////////////// 
64     
65     //
66     // Set of cuts
67     // 
68     AliKineTrackCuts* trackCuts = new AliKineTrackCuts("AliKineTrackCuts", "Eta");
69     trackCuts->SetEtaRange(-1., 1.);
70  //   trackCuts->SetPtRange(0.5);
71               
72     AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
73     trackFilter->AddCuts(trackCuts);
74     
75     
76     AliAnalysisTaskKineFilter* kinefilter = new AliAnalysisTaskKineFilter("Kine Filter");
77     kinefilter->SetTrackFilter(trackFilter);
78     kinefilter->SetDebugLevel(10);
79     mgr->AddTask(kinefilter);
80     
81     //    Analysis Task for Jet
82     //  AliAnalysisTaskJets need ConfigJetAnalysis.C macro !!!!
83     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
84     jetana->SetDebugLevel(10);
85     mgr->AddTask(jetana);
86
87     //
88     // Create containers for input/output                  
89     AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
90     if (!cinput1) cinput1 = mgr->CreateContainer("cchain",TChain::Class(), 
91                                       AliAnalysisManager::kInputContainer);
92
93     AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
94     AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(),
95                                                               AliAnalysisManager::kOutputContainer, "histos.root");
96
97     mgr->ConnectInput  (kinefilter,  0, cinput1  );
98     mgr->ConnectOutput (kinefilter,  0, coutput1 );
99
100     mgr->ConnectInput  (jetana,     0, cinput1  );
101     mgr->ConnectOutput (jetana,     0, coutput1 );
102     mgr->ConnectOutput (jetana,     1, coutput2 );
103
104
105     //
106     // Run the analysis
107     //    
108     if( mgr->InitAnalysis() ) {
109       mgr->PrintStatus();
110       mgr->StartAnalysis("proof", chain );
111     }
112 }