]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add support for opening alien files directly from the command-line, like:
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Aug 2009 18:24:06 +0000 (18:24 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Aug 2009 18:24:06 +0000 (18:24 +0000)
  alieve visscan_init.C'("alien:///alice/data/2009/LHC09c/and-so-on/")'

alieve_init.C
=============
- If path begins with 'alien:' and gGrid is not set, do TGrid::Connect("alien").

visscan_init.C
==============
- Add path argument and pass it to alieve_init().

EVE/macros/alieve_init.C
EVE/macros/visscan_init.C

index 1781239d1e38762d1d0689e2cbdf47f873b89ca6..e4955699ee77f94aa9f790efd66603fb14394601 100644 (file)
@@ -7,7 +7,7 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
-void alieve_init(const Text_t* path   = ".", Int_t event=0,
+void alieve_init(const TString& path   = ".", Int_t event=0,
                  const Text_t* esdfile = 0,
                  const Text_t* aodfile = 0,
                  const Text_t* rawfile = 0,
@@ -35,13 +35,32 @@ void alieve_init(const Text_t* path   = ".", Int_t event=0,
                                        assert_aod, assert_raw);
 
   // Open event
-  if (path != 0)
+  if (path.BeginsWith("alien:"))
   {
-    Info("alieve_init", "Opening event %d from '%s' ...", event, path);
-    TString name("Event"); // CINT has trouble with direct "Event".
-    new AliEveEventManager(name, path, event);
-    gEve->AddEvent(AliEveEventManager::GetMaster());
+    if (gGrid != 0)
+    {
+      Info("alieve_init", "TGrid already initializied. Skiping checks and initialization.");
+    }
+    else
+    {
+      Info("alieve_init", "AliEn requested - connecting.");
+      if (gSystem->Getenv("alien_API_VO") == 0)
+      {
+       Error("alieve_init", "AliEn environment not initialized. Aborting.");
+       gSystem->Exit(1);
+      }
+      if (TGrid::Connect("alien") == 0)
+      {
+       Error("alieve_init", "TGrid::Connect() failed. Aborting.");
+       gSystem->Exit(1);
+      }
+    }
   }
+
+  Info("alieve_init", "Opening event %d from '%s' ...", event, path.Data());
+  TString name("Event"); // CINT has trouble with direct "Event".
+  new AliEveEventManager(name, path, event);
+  gEve->AddEvent(AliEveEventManager::GetMaster());
 }
 
 void alieve_init_import_macros()
index d2b2adee372996ed4357ac264183dd326ff10b8d..ac6bbf74d76552d4d270c180c6c507ee434bfd5a 100644 (file)
@@ -38,7 +38,7 @@ Bool_t gShowMUONRhoZ = kTRUE;
 
 Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
 
-void visscan_init(Bool_t show_extra_geo=kFALSE)
+void visscan_init(const TString& path=".", Bool_t show_extra_geo=kFALSE)
 {
   if (!show_extra_geo)
   {
@@ -48,7 +48,7 @@ void visscan_init(Bool_t show_extra_geo=kFALSE)
   AliEveEventManager::AddAODfriend("AliAOD.VertexingHF.root");
 
   TEveUtil::LoadMacro("alieve_init.C");
-  alieve_init(".", -1);
+  alieve_init(path, -1);
 
   // TEveLine::SetDefaultSmooth(1);