]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/JetAnalysisManager.C
Adding new macro, loadFromOCDB.C, for loading magnetic field, mapping and
[u/mrichter/AliRoot.git] / JETAN / JetAnalysisManager.C
1 void JetAnalysisManager()
2 {
3     //
4     // Load relevant libraries
5     //
6     gSystem->Load("libTree.so");
7     gSystem->Load("libNetx.so");
8     gSystem->Load("libProof.so");
9     gSystem->Load("libProofPlayer.so");
10     gSystem->Load("libGeom.so");
11     gSystem->Load("libEG");
12
13     gSystem->Load("libANALYSIS.so");
14     gSystem->Load("libESD.so"); 
15     gSystem->Load("libJETAN.so");
16     //
17     // Connect to alien
18     //
19     TGrid::Connect("alien://"); 
20     
21     AliTagAnalysis *TagAna = new AliTagAnalysis(); 
22     AliEventTagCuts *EvCuts = new AliEventTagCuts();
23     AliRunTagCuts   *RuCuts = new AliRunTagCuts();
24     //EvCuts->SetNChargedAbove1GeVRange(1, 1000);
25     //EvCuts->SetMultiplicityRange(11,120);
26     //EvCuts->SetNPionRange(2,10000);
27      TAlienCollection* coll = TAlienCollection::Open("tag100.xml");
28      TGridResult* TagResult = coll->GetGridResult("", 0, 0);
29      TagResult->Print();
30      TagAna->ChainGridTags(TagResult);
31
32   //////////////////////////////////////////////////////////////////
33   //Get the chain
34      printf("*******************************\n");
35      printf("*** Getting the Chain       ***\n");
36      printf("*******************************\n");
37      TChain* chain1 = 0x0;
38      chain1 = TagAna->QueryTags(RuCuts, EvCuts);
39      chain1->ls();
40      
41     //
42     // Make the analysis manager
43     //
44     AliAnalysisManager *mgr = new AliAnalysisManager("Manager", "Manager");
45     mgr-> SetDebugLevel(10);
46     
47     AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
48     jetana->SetDebugLevel(10);
49     
50     mgr->AddTask(jetana);
51     // Create containers for input/output
52     AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(), 
53                                                              AliAnalysisManager::kInputContainer);
54
55     AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),
56                                                               AliAnalysisManager::kOutputContainer);
57
58     mgr->ConnectInput (jetana,0,cinput1);
59     mgr->ConnectOutput(jetana,0,coutput1);
60     cinput1->SetData(chain1);
61
62 //
63 // Run the analysis
64 //    
65
66     if (mgr->InitAnalysis()) {
67         mgr->PrintStatus();
68         mgr->StartAnalysis("local", chain1);
69     }
70 }