adding AliPhysics to analysis manager
authorjgrosseo <jgrosseo@cern.ch>
Wed, 21 Jan 2015 09:22:11 +0000 (10:22 +0100)
committerjgrosseo <jgrosseo@cern.ch>
Wed, 21 Jan 2015 09:22:11 +0000 (10:22 +0100)
ANALYSIS/ANALYSIS/AliAnalysisGrid.h
ANALYSIS/ANALYSISalice/AliAnalysisAlien.cxx
ANALYSIS/ANALYSISalice/AliAnalysisAlien.h

index 0e77ea0..4592ee0 100644 (file)
@@ -74,6 +74,7 @@ enum EPluginBits {
    virtual void        SetAPIVersion(const char *version)                = 0;
    virtual void        SetROOTVersion(const char *version)               = 0;
    virtual void        SetAliROOTVersion(const char *version)            = 0;
+   virtual void        SetAliPhysicsVersion(const char *version)         = 0;
    virtual void        SetUser(const char *user)                         = 0;
    virtual void        SetTTL(Int_t ttl=30000)                           = 0;
    virtual void        SetGridWorkingDir(const char *name="workdir")     = 0;
index 7a1af15..a13a622 100644 (file)
@@ -112,6 +112,7 @@ AliAnalysisAlien::AliAnalysisAlien()
                   fAPIVersion(),
                   fROOTVersion(),
                   fAliROOTVersion(),
+                  fAliPhysicsVersion(),
                   fExternalPackages(),
                   fUser(),
                   fGridWorkingDir(),
@@ -194,6 +195,7 @@ AliAnalysisAlien::AliAnalysisAlien(const char *name)
                   fAPIVersion(),
                   fROOTVersion(),
                   fAliROOTVersion(),
+                  fAliPhysicsVersion(),
                   fExternalPackages(),
                   fUser(),
                   fGridWorkingDir(),
@@ -276,6 +278,7 @@ AliAnalysisAlien::AliAnalysisAlien(const AliAnalysisAlien& other)
                   fAPIVersion(other.fAPIVersion),
                   fROOTVersion(other.fROOTVersion),
                   fAliROOTVersion(other.fAliROOTVersion),
+                  fAliPhysicsVersion(other.fAliPhysicsVersion),
                   fExternalPackages(other.fExternalPackages),
                   fUser(other.fUser),
                   fGridWorkingDir(other.fGridWorkingDir),
@@ -400,6 +403,7 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
       fAPIVersion              = other.fAPIVersion;
       fROOTVersion             = other.fROOTVersion;
       fAliROOTVersion          = other.fAliROOTVersion;
+      fAliPhysicsVersion       = other.fAliPhysicsVersion;
       fExternalPackages        = other.fExternalPackages;
       fUser                    = other.fUser;
       fGridWorkingDir          = other.fGridWorkingDir;
@@ -1750,6 +1754,10 @@ Bool_t AliAnalysisAlien::CreateJDL()
          fGridJDL->AddToPackages("AliRoot", fAliROOTVersion,"VO_ALICE", "List of requested packages");
          fMergingJDL->AddToPackages("AliRoot", fAliROOTVersion, "VO_ALICE", "List of requested packages");
       }   
+      if (!fAliPhysicsVersion.IsNull()) {
+         fGridJDL->AddToPackages("AliPhysics", fAliPhysicsVersion,"VO_ALICE", "List of requested packages");
+         fMergingJDL->AddToPackages("AliPhysics", fAliPhysicsVersion, "VO_ALICE", "List of requested packages");
+      }   
       if (!fROOTVersion.IsNull()) {
          fGridJDL->AddToPackages("ROOT", fROOTVersion);
          fMergingJDL->AddToPackages("ROOT", fROOTVersion);
@@ -2553,6 +2561,7 @@ void AliAnalysisAlien::Print(Option_t *) const
       else
       printf("=   ROOT version requested________________________ default\n");
       printf("=   AliRoot version requested_____________________ %s\n", fAliROOTVersion.Data());
+      printf("=   AliPhysics version requested__________________ %s\n", fAliPhysicsVersion.Data());
       if (!fAliRootMode.IsNull())
       printf("=   Requested AliRoot mode________________________ %s\n", fAliRootMode.Data());  
       if (fNproofWorkers)
@@ -2586,6 +2595,7 @@ void AliAnalysisAlien::Print(Option_t *) const
    printf("=   Version of API requested: ____________________ %s\n", fAPIVersion.Data());
    printf("=   Version of ROOT requested: ___________________ %s\n", fROOTVersion.Data());
    printf("=   Version of AliRoot requested: ________________ %s\n", fAliROOTVersion.Data());
+   printf("=   Version of AliPhysics requested: _____________ %s\n", fAliPhysicsVersion.Data());
    if (fUser.Length()) 
    printf("=   User running the plugin: _____________________ %s\n", fUser.Data());
    printf("=   Grid workdir relative to user $HOME: _________ %s\n", fGridWorkingDir.Data());
@@ -2691,6 +2701,7 @@ void AliAnalysisAlien::SetDefaults()
    fAPIVersion                 = "";
    fROOTVersion                = "";
    fAliROOTVersion             = "";
+   fAliPhysicsVersion          = "";
    fUser                       = "";  // Your alien user name
    fGridWorkingDir             = "";
    fGridDataDir                = "";  // Can be like: /alice/sim/PDC_08a/LHC08c9/
@@ -3478,6 +3489,13 @@ Bool_t AliAnalysisAlien::StartAnalysis(Long64_t /*nentries*/, Long64_t /*firstEn
                 return kFALSE;
              }
            }
+           if ( ! fAliPhysicsVersion.IsNull() ) {
+             if (gROOT->ProcessLine(Form("gProof->EnablePackage(\"VO_ALICE@AliPhysics::%s\", (TList*)%p, kTRUE);", 
+                                         fAliPhysicsVersion.Data(), &optionsList))) {
+                Error("StartAnalysis", "There was an error trying to enable package VO_ALICE@AliPhysics::%s", fAliPhysicsVersion.Data());
+                return kFALSE;
+             }
+           }
          }
          // Enable first par files from fAdditionalLibs
          if (!parLibs.IsNull()) {
index e5419c3..2878536 100644 (file)
@@ -87,6 +87,8 @@ public:
    const char         *GetROOTVersion() const                            {return fROOTVersion;}
    virtual void        SetAliROOTVersion(const char *version)            {fAliROOTVersion=version;}
    const char         *GetAliROOTVersion() const                         {return fAliROOTVersion;}
+   virtual void        SetAliPhysicsVersion(const char *version)         {fAliPhysicsVersion=version;}
+   const char         *GetAliPhysicsVersion() const                      {return fAliPhysicsVersion;}
    virtual void        SetUser(const char *user)                         {fUser = user;}
    const char         *GetUser() const                                   {return fUser;}
    virtual void        SetTTL(Int_t ttl=30000)                           {fTTL = ttl;}
@@ -268,6 +270,7 @@ private:
    TString          fAPIVersion;      // API version
    TString          fROOTVersion;     // ROOT version
    TString          fAliROOTVersion;  // AliROOT version
+   TString          fAliPhysicsVersion; // AliPhysics version
    TString          fExternalPackages; // External packages
    TString          fUser;            // AliEn user name
    TString          fGridWorkingDir;  // AliEn directory containing the input packages
@@ -305,6 +308,6 @@ private:
    TString          fFriendLibs;      // List of libs (separated by blacs) needed for friends processing
    TString          fTreeName;        // Name of the tree to be analyzed
 
-   ClassDef(AliAnalysisAlien, 26)   // Class providing some AliEn utilities
+   ClassDef(AliAnalysisAlien, 27)   // Class providing some AliEn utilities
 };
 #endif