Examples script to run jet finder under proof.
[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::Open("proof://morsch@lxb6046.cern.ch"); 
10
11 //    gProof->SetParallel(1);
12 //    gProof->ClearPackage("ESD");
13 //    gProof->ClearPackage("JETAN");
14 //    gProof->ClearPackage("ANALYSIS");
15     
16     gProof->ShowEnabledPackages();
17     // Enable the ESD Package
18     gProof->UploadPackage("ESD.par");
19     gProof->EnablePackage("ESD");
20      // Enable the Analysis Package
21     gProof->UploadPackage("ANALYSIS.par");
22     gProof->EnablePackage("ANALYSIS");
23     // Enable the JETAN Package
24     gProof->UploadPackage("JETAN.par");
25     gProof->EnablePackage("JETAN");
26     // Load Configuration macro
27     //gProof->Load("ConfigJetAnalysis.C");
28     //
29     gProof->ShowEnabledPackages();
30     
31     //
32     //
33     // Create the chain
34     //
35     TChain* chain = CreateESDChain("ESD100_110_v3.txt");
36     // TChain* chain = CreateESDChain("test.txt", 100);  
37     //
38     // Make the analysis manager
39     //
40     AliAnalysisManager *mgr     = new AliAnalysisManager("Jet Manager", "Jet Manager");
41     mgr-> SetDebugLevel(10);
42     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
43     jetana->Init();
44     jetana->SetDebugLevel(10);
45     mgr->AddTask(jetana);
46     //
47     // Create containers for input/output
48     AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(), 
49                                                              AliAnalysisManager::kInputContainer);
50
51     AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
52                                                               AliAnalysisManager::kOutputContainer, "jets.root");
53
54     mgr->ConnectInput (jetana, 0, cinput1);
55     mgr->ConnectOutput(jetana, 0, coutput1);
56     //
57     // Run the analysis
58     //    
59     mgr->InitAnalysis();
60     mgr->PrintStatus();
61     mgr->StartAnalysis("proof", chain);
62     
63 }