removing the old macro
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Mar 2007 07:31:29 +0000 (07:31 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Mar 2007 07:31:29 +0000 (07:31 +0000)
PWG2/AnalysisMacros/Batch/demoBatch.C
PWG2/AnalysisMacros/Batch/runAnalysis.C [deleted file]

index bd414c7..8792ed6 100644 (file)
@@ -1,42 +1,39 @@
 //________________________________________________________________________
-void demoBatch(const char* collectionfile) {
-  //____________________________________________//
-  // Open a collection
-  TAlienCollection* coll = TAlienCollection::Open(collectionfile);
-  if (!coll) Error("demoBatch", Form("Cannot create an AliEn collection from %s", collectionfile));
+void demoBatch() {
+  const char *collectionfile = "wn.xml";
 
   //____________________________________________//
-  // Create an esd chain
-  const char *chainname="esdTree";
-  TChain* chain1 = new TChain(chainname);
-  
-  //____________________________________________//
-  // Convert the collection and fill tha chain
-  coll->Reset();
-  while ( coll->Next() ) {
-    Info("demoBatch", Form("Adding %s", coll->GetTURL("")));
-    chain1->Add(coll->GetTURL(""));
-  }
+  //Usage of event tags
+  AliTagAnalysis *analysis = new AliTagAnalysis();
+  TChain *chain = 0x0;
+  chain = analysis->GetChainFromCollection(collectionfile,"esdTree");
 
   //____________________________________________//
+  //Usage of a collection file - no tags
+  /*TChain *chain = new TChain("esdTree");
+  TAlienCollection *collection = TAlienCollection::Open(collectionfile);
+  TGridResult *result = collection->GetGridResult("",0,0);
+  for(Int_t i = 0; i < resukt->GetEntries(); i++)  chain->Add(result->GetKey(i,"turl"));*/
+   
+  //____________________________________________//
   // 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("grid",chain);
   }
 }                         
                       
diff --git a/PWG2/AnalysisMacros/Batch/runAnalysis.C b/PWG2/AnalysisMacros/Batch/runAnalysis.C
deleted file mode 100644 (file)
index 11db5f3..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-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.so");
-
-  printf("*** Connect to AliEn ***\n");
-  TGrid::Connect("alien://"); 
-
-  gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");  
-  gROOT->LoadMacro("demoBatch.C");
-  demoBatch("pp.xml");
-
-  timer.Stop();
-  timer.Print();
-}