3 * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk>
4 * @date Tue Oct 16 19:02:14 2012
6 * @brief AAF analysis helper
8 * @ingroup pwglf_forward_trains_helper
13 #include "ProofRailway.C"
15 # include "AvailableSoftware.C"
19 # include <AliAnalysisManager.h>
22 class AliAnalysisAlien;
25 // ===================================================================
27 * Handle analysis on an Alice Analysis Facility (AAF)
29 * This helper is triggered by a URL of the form
32 * proof://[<user>@]<host>[:<port>]/<dsname>[?<options>][#<treename>]
34 * where <host@&t; is a known AAF (e.g., <tt>alice-caf.cern.ch</tt>)
36 * <dt><user></dt>
37 * <dd>Optional user name</dd>
38 * <dt><host></dt>
39 * <dd>PROOF cluster master host</dd>
40 * <dt><port></dt>
41 * <dd>Optional PROOF cluster port on master host</dd>
42 * <dt><dsname></dt>
43 * <dd>Data set name</dd>
44 * <dt><treename></dt>
45 * <dd>Optional tree name in data set, often <tt>esdTree</tt> or
46 * <tt>aodTree</tt></dd>
47 * <dt><options></dt>
48 * <dd>List of options separated by an &
50 * <dt><tt>dsname</tt>[=<output dataset>]</dt>
51 * <dd>Register tree output (e.g., AOD) as a new data set on the
52 * PROOF cluster. If <output dataset> is not specified, take
53 * the name of the train.</dd>
54 * <dt><tt>storage=<url></tt></dt>
55 * <dd>Specify a non-default storage location for special output
56 * (e.g., AOD trees). <url> should be a valid XRootd
57 * server URI accessible to the slaves - e.g.,
58 * <tt>root://lxplus.cern.ch:10930//tmp</tt>.</dd>
59 * <dt><tt>mode=[default,rec,sim,train,custom]</tt></dt>
60 * <dd>Set the AliROOT mode. If not specified <tt>default</tt>
61 * is assumed. See also CreateAliROOTPar</dd>
62 * <dt><tt>par</tt></dt>
63 * <dd> Use par files </dd>
68 * Note, this helper does not use the AliAnalysisAlien plugin
70 * @ingroup pwglf_forward_trains_helper
72 struct AAFRailway : public ProofRailway
78 * @param verbose Verbosity
80 AAFRailway(const TUrl& url, Int_t verbose)
81 : ProofRailway(url, verbose)
83 fOptions.Add("aliroot", "VERSION", "AliROOT version", "last");
84 fOptions.Add("root", "VERISON", "ROOT version", "last");
85 fOptions.Add("nocache", "Disable tree cache");
87 virtual ~AAFRailway() {}
89 * Get the name of the AliROOT par file to use
93 virtual const char* AliROOTParName() const
95 return Form("VO_ALICE@AliRoot::%s", fOptions.Get("aliroot").Data());
97 virtual Bool_t CreateAliROOTPar()
102 * Set-up done before task set-ups. Overload ProofRailway::PreSetup
103 * to specify the ROOT version using TProofMgr::SetROOTVersion
105 * @return true on success
107 virtual Bool_t PreSetup()
109 TString aliroot("last");
110 TString root("last");
111 if (fOptions.Has("aliroot")) aliroot = fOptions.Get("aliroot");
112 if (fOptions.Has("root")) root = fOptions.Get("root");
114 AvailableSoftware::Check(aliroot, root);
115 fOptions.Set("aliroot", aliroot);
116 fOptions.Set("root", root);
120 // Set this before we try to access the cluster
121 gEnv->SetValue("XSec.GSI.DelegProxy", "2");
123 TProof::Mgr(fUrl.GetHost())
124 ->SetROOTVersion(Form("VO_ALICE@ROOT::%s", root.Data()));
126 if (!ProofRailway::PreSetup()) return false;
128 if (fOptions.Has("nocache"))
129 gProof->SetParameter("PROOF_UseTreeCache", 0);
133 * @return URI help string
135 virtual const Char_t* UrlHelp() const
137 return "proof://<host>/<dataset>?[&<options>][#<treename>]";
140 * @return short description
142 virtual const char* Desc() const { return "AAF"; }