Example macro for jet analysis.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jan 2007 14:45:21 +0000 (14:45 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jan 2007 14:45:21 +0000 (14:45 +0000)
JETAN/JetAnalysisManager.C [new file with mode: 0644]

diff --git a/JETAN/JetAnalysisManager.C b/JETAN/JetAnalysisManager.C
new file mode 100644 (file)
index 0000000..bac6a18
--- /dev/null
@@ -0,0 +1,53 @@
+void JetAnalysisManager()
+{
+    //
+    // Load relevant libraries
+    //
+    gSystem->Load("libEG.so");
+    gSystem->Load("libGeom.so");
+    gSystem->Load("libANALYSIS_NEW.so");
+    gSystem->Load("libESD.so"); 
+    gSystem->Load("libJETAN.so");
+    //
+    // Connect to alien
+    //
+    TGrid::Connect("alien://"); 
+    //
+    // Prepare the input event chain
+    //
+    AliTagAnalysis *TagAna = new AliTagAnalysis(); 
+    // create an EventTagCut object
+    AliEventTagCuts *EvCuts = new AliEventTagCuts();
+    AliRunTagCuts   *RuCuts = new AliRunTagCuts();
+    TAlienCollection* coll = TAlienCollection::Open("tags/tag100.xml");
+    TGridResult* TagResult = coll->GetGridResult("");
+    TagAna->ChainGridTags(TagResult);
+    TChain* chain1 = 0x0;
+    chain1 = TagAna->QueryTags(RuCuts, EvCuts);
+    //
+    // Make the analysis manager
+    //
+    AliAnalysisManager *mgr = new AliAnalysisManager();
+    AliAnalysisTask *jetana = new AliAnalysisTaskJets("JetAnalysis");
+    
+    mgr->AddTask(jetana);
+    // Create containers for input/output
+    AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(), 
+                                                            AliAnalysisManager::kInputContainer);
+    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),
+                                                             AliAnalysisManager::kOutputContainer);
+    printf("Connectiong I/O \n");
+    
+    mgr->ConnectInput (jetana,0,cinput1);
+    mgr->ConnectOutput(jetana,0,coutput1);
+    cinput1->SetData(chain1);
+
+//
+// Run the analysis
+//    
+
+    if (mgr->InitAnalysis()) {
+       mgr->PrintStatus();
+       chain1->Process(mgr);
+    }
+}