Modifications to the examples following the latest developments.
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Feb 2007 14:25:39 +0000 (14:25 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Feb 2007 14:25:39 +0000 (14:25 +0000)
PWG2/AnalysisMacros/Interactive/demoInteractive.C
PWG2/AnalysisMacros/Interactive/runAnalysis.C

index 9c495d5..5258244 100644 (file)
@@ -1,36 +1,37 @@
 //________________________________________________________________________
 void demoInteractive() {
   //____________________________________________//
-  AliTagAnalysis *TagAna = new AliTagAnalysis(); 
-
-  AliEventTagCuts *EvCuts1 = new AliEventTagCuts();
-  EvCuts1->SetMultiplicityRange(11,12);  
+  AliTagAnalysis *TagAna = new AliTagAnalysis();
+  AliRunTagCuts *RunCuts = new AliRunTagCuts();
+  AliEventTagCuts *EvCuts = new AliEventTagCuts();
+  EvCuts->SetMultiplicityRange(11,12);
   //grid tags
-  TAlienCollection* coll = TAlienCollection::Open("tag10.xml");
+  TAlienCollection* coll = TAlienCollection::Open("tag.xml");
   TGridResult* TagResult = coll->GetGridResult("");
   TagAna->ChainGridTags(TagResult);
-  TChain* chain1 = 0x0;
-  chain1 = TagAna->QueryTags(EvCuts1);
-
+  TChain* chain = 0x0;
+  chain = TagAna->QueryTags(RunCuts,EvCuts);
   //____________________________________________//
   // Make the analysis manager
-  AliAnalysisManager *mgr = new AliAnalysisManager();
+  AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
   //____________________________________________//
   // 1st Pt task
-  AliAnalysisTask *task1 = new AliAnalysisTaskPt("TaskPt");
+  AliAnalysisTaskPt *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);
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),AliAnalysisManager::kOutputContainer,"Pt.ESD.root");
   
   //____________________________________________//
   mgr->ConnectInput(task1,0,cinput1);
   mgr->ConnectOutput(task1,0,coutput1);
-  cinput1->SetData(chain1);
+  cinput1->SetData(chain);
   
   if (mgr->InitAnalysis()) {
     mgr->PrintStatus();
-    chain1->Process(mgr);
+    mgr->StartAnalysis("local",chain);
   }
 }                         
                       
index a0ed1ef..7ab68f9 100644 (file)
@@ -2,63 +2,40 @@ void runAnalysis() {
   TStopwatch timer;
   timer.Start();
 
+  printf("*** Connect to AliEn ***\n");
+  TGrid::Connect("alien://");
   //____________________________________________________//
   //_____________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("../");
-  }
+  setupPar("ESD");
   gSystem->Load("libVMC.so");
   gSystem->Load("libESD.so");
 
   //_____________________________________________________________//
-  //_____________Setting up ANALYSIS.par_____________________//
+  //_____________Setting up ANALYSIS_NEW.par_____________________//
   //_____________________________________________________________//
-  const char* pararchivename2 = "ANALYSIS";
-  //////////////////////////////////////////
-  // Libraries required to load
-  //////////////////////////////////////////
+  setupPar("ANALYSIS");
+  gSystem->Load("ANALYSIS/libANALYSIS.so");
+
+  gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");
+  gROOT->LoadMacro("demoInteractive.C");
+  demoInteractive();
+
+  timer.Stop();
+  timer.Print();
+}
 
-  //////////////////////////////////////////////////////////////////
-  // Setup PAR File
-  if (pararchivename2) {
+Int_t setupPar(const char* pararchivename) {
+  ///////////////////
+  // Setup PAR File//
+  ///////////////////
+  if (pararchivename) {
     char processline[1024];
-    sprintf(processline,".! tar xvzf %s.par",pararchivename2);
+    sprintf(processline,".! tar xvzf %s.par",pararchivename);
     gROOT->ProcessLine(processline);
     const char* ocwd = gSystem->WorkingDirectory();
-    gSystem->ChangeDirectory(pararchivename2);
+    gSystem->ChangeDirectory(pararchivename);
 
     // check for BUILD.sh and execute
     if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
@@ -67,7 +44,7 @@ void runAnalysis() {
       printf("*******************************\n");
 
       if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
-        Error("runProcess","Cannot Build the PAR Archive! - Abort!");
+        Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
         return -1;
       }
     }
@@ -81,15 +58,6 @@ void runAnalysis() {
     
     gSystem->ChangeDirectory("../");
   }
-  gSystem->Load("libANALYSIS.so");
-
-  printf("*** Connect to AliEn ***\n");
-  TGrid::Connect("alien://"); 
 
-  gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");  
-  gROOT->LoadMacro("demoInteractive.C");
-  demoInteractive();
-
-  timer.Stop();
-  timer.Print();
+  return 1;
 }