]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the files needed to run an interactive analysis sessions using the event tags...
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Dec 2006 15:20:29 +0000 (15:20 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Dec 2006 15:20:29 +0000 (15:20 +0000)
PWG2/AnalysisMacros/Interactive/alienroot [new file with mode: 0644]
PWG2/AnalysisMacros/Interactive/demoInteractive.C [new file with mode: 0644]
PWG2/AnalysisMacros/Interactive/runAnalysis.C [new file with mode: 0644]

diff --git a/PWG2/AnalysisMacros/Interactive/alienroot b/PWG2/AnalysisMacros/Interactive/alienroot
new file mode 100644 (file)
index 0000000..cb0cd39
--- /dev/null
@@ -0,0 +1,13 @@
+# Put this file under your $HOME/bin (or wherever you want)
+# and place the corresponding directory in your $PATH
+#!/bin/bash
+
+export ALIEN=/home/trn2301/alien
+export ROOTSYS=/home/trn2301/root
+export PATH=$ROOTSYS/bin:$PATH
+export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH:$ALIEN/api/lib
+
+if [ -e /tmp/gclient_env_$UID ]; then
+   source /tmp/gclient_env_$UID;
+  root.exe $*
+fi
diff --git a/PWG2/AnalysisMacros/Interactive/demoInteractive.C b/PWG2/AnalysisMacros/Interactive/demoInteractive.C
new file mode 100644 (file)
index 0000000..9c495d5
--- /dev/null
@@ -0,0 +1,36 @@
+//________________________________________________________________________
+void demoInteractive() {
+  //____________________________________________//
+  AliTagAnalysis *TagAna = new AliTagAnalysis(); 
+
+  AliEventTagCuts *EvCuts1 = new AliEventTagCuts();
+  EvCuts1->SetMultiplicityRange(11,12);  
+  //grid tags
+  TAlienCollection* coll = TAlienCollection::Open("tag10.xml");
+  TGridResult* TagResult = coll->GetGridResult("");
+  TagAna->ChainGridTags(TagResult);
+  TChain* chain1 = 0x0;
+  chain1 = TagAna->QueryTags(EvCuts1);
+
+  //____________________________________________//
+  // Make the analysis manager
+  AliAnalysisManager *mgr = new AliAnalysisManager();
+  //____________________________________________//
+  // 1st Pt task
+  AliAnalysisTask *task1 = new AliAnalysisTaskPt("TaskPt");
+  mgr->AddTask(task1);
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),AliAnalysisManager::kOutputContainer);
+  
+  //____________________________________________//
+  mgr->ConnectInput(task1,0,cinput1);
+  mgr->ConnectOutput(task1,0,coutput1);
+  cinput1->SetData(chain1);
+  
+  if (mgr->InitAnalysis()) {
+    mgr->PrintStatus();
+    chain1->Process(mgr);
+  }
+}                         
+                      
diff --git a/PWG2/AnalysisMacros/Interactive/runAnalysis.C b/PWG2/AnalysisMacros/Interactive/runAnalysis.C
new file mode 100644 (file)
index 0000000..4134179
--- /dev/null
@@ -0,0 +1,95 @@
+void runAnalysis() {
+  TStopwatch timer;
+  timer.Start();
+
+  //____________________________________________________//
+  //_____________Setting up ESD.par_____________________//
+  //____________________________________________________//
+  const char* pararchivename1 = "ESD";
+  //////////////////////////////////////////
+  // Libraries required to load
+  //////////////////////////////////////////
+
+  //////////////////////////////////////////////////////////////////
+  // Setup PAR File
+  if (pararchivename1) {
+    char processline[1024];
+    sprintf(processline,".! tar xvzf %s.par",pararchivename1);
+    gROOT->ProcessLine(processline);
+    const char* ocwd = gSystem->WorkingDirectory();
+    gSystem->ChangeDirectory(pararchivename1);
+
+    // check for BUILD.sh and execute
+    if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
+      printf("*******************************\n");
+      printf("*** Building PAR archive    ***\n");
+      printf("*******************************\n");
+
+      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
+        Error("runProcess","Cannot Build the PAR Archive! - Abort!");
+        return -1;
+      }
+    }
+    // check for SETUP.C and execute
+    if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
+      printf("*******************************\n");
+      printf("*** Setup PAR archive       ***\n");
+      printf("*******************************\n");
+      gROOT->Macro("PROOF-INF/SETUP.C");
+    }
+    
+    gSystem->ChangeDirectory("../");
+  }
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libESD.so");
+
+  //_____________________________________________________________//
+  //_____________Setting up ANALYSIS_NEW.par_____________________//
+  //_____________________________________________________________//
+  const char* pararchivename2 = "ANALYSIS_NEW";
+  //////////////////////////////////////////
+  // Libraries required to load
+  //////////////////////////////////////////
+
+  //////////////////////////////////////////////////////////////////
+  // Setup PAR File
+  if (pararchivename2) {
+    char processline[1024];
+    sprintf(processline,".! tar xvzf %s.par",pararchivename2);
+    gROOT->ProcessLine(processline);
+    const char* ocwd = gSystem->WorkingDirectory();
+    gSystem->ChangeDirectory(pararchivename2);
+
+    // check for BUILD.sh and execute
+    if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
+      printf("*******************************\n");
+      printf("*** Building PAR archive    ***\n");
+      printf("*******************************\n");
+
+      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
+        Error("runProcess","Cannot Build the PAR Archive! - Abort!");
+        return -1;
+      }
+    }
+    // check for SETUP.C and execute
+    if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
+      printf("*******************************\n");
+      printf("*** Setup PAR archive       ***\n");
+      printf("*******************************\n");
+      gROOT->Macro("PROOF-INF/SETUP.C");
+    }
+    
+    gSystem->ChangeDirectory("../");
+  }
+  gSystem->Load("libANALYSIS_NEW.so");
+
+  printf("*** Connect to AliEn ***\n");
+  TGrid::Connect("alien://"); 
+
+  gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");  
+  gROOT->LoadMacro("demoInteractive.C");
+  demoInteractive();
+
+  timer.Stop();
+  timer.Print();
+}