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 "ProofHelper.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@gt; is a known AAF (e.g., <tt>alice-caf.cern.ch</tt>)
36 * <dt><user@gt;</dt>
37 * <dd>Optional user name</dd>
38 * <dt><host@gt;</dt>
39 * <dd>PROOF cluster master host</dd>
40 * <dt><port@gt;</dt>
41 * <dd>Optional PROOF cluster port on master host</dd>
42 * <dt><dsname@gt;</dt>
43 * <dd>Data set name</dd>
44 * <dt><treename@gt;</dt>
45 * <dd>Optional tree name in data set, often <tt>esdTree</tt> or
46 * <tt>aodTree</tt></dd>
47 * <dt><options@gt;</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</tt>. 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 AAFHelper : public ProofHelper
80 AAFHelper(const TUrl& url, Int_t verbose)
81 : ProofHelper(url, verbose)
83 fOptions.Add("aliroot", "VERSION", "AliROOT version", "last");
84 fOptions.Add("root", "VERISON", "ROOT version", "last");
86 virtual ~AAFHelper() {}
88 * Get the name of the AliROOT par file to use
92 virtual const char* AliROOTParName() const
94 return Form("VO_ALICE@AliRoot::%s", fOptions.Get("aliroot").Data());
96 virtual Bool_t CreateAliROOTPar()
101 * Set-up done before task set-ups. Overload ProofHelper::PreSetup
102 * to specify the ROOT version using TProofMgr::SetROOTVersion
104 * @return true on success
106 virtual Bool_t PreSetup()
108 TString aliroot("last");
109 TString root("last");
110 if (fOptions.Has("aliroot")) aliroot = fOptions.Get("aliroot");
111 if (fOptions.Has("root")) root = fOptions.Get("root");
113 AvailableSoftware::Check(aliroot, root);
114 fOptions.Set("aliroot", aliroot);
115 fOptions.Set("root", root);
119 // Set this before we try to access the cluster
120 gEnv->SetValue("XSec.GSI.DelegProxy", "2");
122 TProof::Mgr(fUrl.GetHost())
123 ->SetROOTVersion(Form("VO_ALICE@ROOT::%s", root.Data()));
125 return ProofHelper::PreSetup();
128 * @return URI help string
130 virtual const Char_t* UrlHelp() const
132 return "proof://<host>/<dataset>?[&<options>][#<treename>]";
135 * @return short description
137 virtual const char* Desc() const { return "AAF"; }