]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updates to Trains. create a job-script to help
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 23:13:40 +0000 (23:13 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 23:13:40 +0000 (23:13 +0000)
make the Termiante part of the analysis, secondly it
is used to engage on that discussion.  Hence, the data-member
is changed from TH1* but not

Otherwise small presents

12 files changed:
PWGLF/FORWARD/analysis2/AddTaskCentralMult.C
PWGLF/FORWARD/analysis2/AddTaskForwardMult.C
PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h
PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.cxx
PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h
PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h
PWGLF/FORWARD/analysis2/ForwardAODConfig.C
PWGLF/FORWARD/analysis2/trains/MakeAODTrain.C
PWGLF/FORWARD/analysis2/trains/MakedNdetaTrain.C
PWGLF/FORWARD/analysis2/trains/TrainSetup.C

index abc99c5b13419dc78ae7d219410ec5c87015f7f1..b61fb6694811a4077e02caaf3962416a08948b30 100644 (file)
  * @ingroup pwglf_forward_aod
  */
 AliAnalysisTask* 
-AddTaskCentralMult(Bool_t mc=false, 
-                  UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
+AddTaskCentralMult(Bool_t   mc=false, 
+                  UShort_t sys=0, 
+                  UShort_t sNN=0, 
+                  Short_t  field=0, 
+                  Int_t    debug=0)
 {
   // --- Load libraries ----------------------------------------------
   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
@@ -32,28 +35,17 @@ AddTaskCentralMult(Bool_t mc=false,
   AliCentralMultiplicityTask* task = 0;
   if (!mc) task = new AliCentralMultiplicityTask("Central");
   else     task = new AliCentralMCMultiplicityTask("Central");
-  if(sys>0 && sNN > 0)
+  if(sys>0 && sNN > 0) {
     task->GetManager().Init(sys, sNN, field);
+    if (!task->GetManager().HasSecondaryCorrection()) 
+      Fatal("AddTaskCentralMult", "No secondary correction defined!");
+    if (!task->GetManager().HasAcceptanceCorrection()) 
+      Fatal("AddTaskCentralMult", "No acceptance correction defined!");
+  }
+  task->SetDebugLevel(debug);
+  task->Configure("CentralAODConfig.C");
   mgr->AddTask(task);
 
-  // --- Configure the task ------------------------------------------
-  TString macroPath(gROOT->GetMacroPath());
-  if (!macroPath.Contains("$(ALICE_ROOT)/PWGLF/FORWARD/analysis2")) { 
-    macroPath.Append(":$(ALICE_ROOT)/PWGLF/FORWARD/analysis2");
-    gROOT->SetMacroPath(macroPath);
-  }
-  const char* config = gSystem->Which(gROOT->GetMacroPath(),
-                                     "CentralAODConfig.C");
-  if (!config) 
-    Warning("AddTaskCentralMult", "CentralAODConfig.C not found in %s",
-           gROOT->GetMacroPath());
-  else {
-    Info("AddTaskCentralMult", 
-        "Loading configuration of '%s' from %s",
-        task->ClassName(), config);
-    gROOT->Macro(Form("%s((AliCentralMultiplicityTask*)%p)", config, task));
-    delete config;
-  }
 
   // --- Make the output container and connect it --------------------
   TString outputfile = AliAnalysisManager::GetCommonFileName();
index 7527b4e8bfb202b43861a6fcc5142e798f891c56..6080d66a382bef1b703d8b5ace5735d0fb7df601 100644 (file)
  * @ingroup pwglf_forward_aod
  */
 AliAnalysisTask*
-AddTaskForwardMult(Bool_t mc, UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
+AddTaskForwardMult(Bool_t   mc, 
+                  UShort_t sys=0, 
+                  UShort_t sNN=0, 
+                  Short_t  field=0, 
+                  Int_t    debug=0)
 {
   // --- Load libraries ----------------------------------------------
   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
@@ -44,34 +48,20 @@ AddTaskForwardMult(Bool_t mc, UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
 
   // --- Make the task and add it to the manager ---------------------
   AliForwardMultiplicityBase* task = 0;
-  
-  if (mc)
-    task = new AliForwardMCMultiplicityTask("FMD");
-  else    
-    task = new AliForwardMultiplicityTask("FMD");
+  if (mc) task = new AliForwardMCMultiplicityTask("FMD");
+  else    task = new AliForwardMultiplicityTask("FMD");
+  task->SetDebugLevel(debug);
+  task->Configure("ForwardAODConfig.C");
   mgr->AddTask(task);
   
   // --- Do a local initialisation with assumed values ---------------
-  if (sys > 0 && sNN > 0) 
-    AliForwardCorrectionManager::Instance().Init(sys,sNN,field,mc);
-
-  // --- Configure the task ------------------------------------------
-  TString macroPath(gROOT->GetMacroPath());
-  if (!macroPath.Contains("$(ALICE_ROOT)/PWGLF/FORWARD/analysis2")) { 
-    macroPath.Append(":$(ALICE_ROOT)/PWGLF/FORWARD/analysis2");
-    gROOT->SetMacroPath(macroPath);
-  }
-  const char* config = gSystem->Which(gROOT->GetMacroPath(),
-                                     "ForwardAODConfig.C");
-  if (!config) 
-    Warning("AddTaskForwardMult", "ForwardAODConfig.C not found in %s",
-           gROOT->GetMacroPath());
-  else {
-    Info("AddTaskForwardMult", 
-        "Loading configuration of '%s' from %s",
-        task->ClassName(), config);
-    gROOT->Macro(Form("%s((AliForwardMultiplicityBase*)%p)", config, task));
-    delete config;
+  if (sys > 0 && sNN > 0) {
+    UInt_t what = AliForwardCorrectionManager::kAll;
+    what ^= AliForwardCorrectionManager::kDoubleHit;
+    what ^= AliForwardCorrectionManager::kVertexBias;
+    what ^= AliForwardCorrectionManager::kMergingEfficiency;
+    if (!AliForwardCorrectionManager::Instance().Init(sys,sNN,field,mc,what))
+      Fatal("AddTaskForwardMult", "Failed to initialize corrections");
   }
   
   // --- Make the output container and connect it --------------------
index 64fe763ad5085a0595e4413ad078ff98b23f88ca..d3fcd37d8eeeff58b959ec8f99a7b790571b576a 100644 (file)
@@ -21,6 +21,7 @@
 #include "AliESDEvent.h"
 #include "AliMultiplicity.h"
 #include <TROOT.h>
+#include <TSystem.h>
 #include <TFile.h>
 #include <TError.h>
 #include <TSystem.h>
@@ -130,6 +131,29 @@ AliCentralMultiplicityTask::operator=(const AliCentralMultiplicityTask& o)
   fEtaMax            = o.fEtaMax;
   return *this;
 }
+//____________________________________________________________________
+Bool_t 
+AliCentralMultiplicityTask::Configure(const char* macro)
+{
+  // --- Configure the task ------------------------------------------
+  TString macroPath(gROOT->GetMacroPath());
+  if (!macroPath.Contains("$(ALICE_ROOT)/PWGLF/FORWARD/analysis2")) { 
+    macroPath.Append(":$(ALICE_ROOT)/PWGLF/FORWARD/analysis2");
+    gROOT->SetMacroPath(macroPath);
+  }
+  const char* config = gSystem->Which(gROOT->GetMacroPath(),macro);
+  if (!config) {
+    AliWarningF("%s not found in %s", macro, gROOT->GetMacroPath());
+    return false;
+  }
+
+  AliInfoF("Loading configuration of '%s' from %s", ClassName(), config);
+  gROOT->Macro(Form("%s((AliCentralMultiplicityTask*)%p)", config, this));
+  delete config;
+  
+  return true;
+}
+
 //____________________________________________________________________
 void AliCentralMultiplicityTask::UserCreateOutputObjects() 
 {
index c8b3131fabb49dd9e596a97512e15fa9f44edf98..c03496c422aa6fc5fca9d4e2c9fb677c8915eb2c 100644 (file)
@@ -77,6 +77,14 @@ public:
    * @return Reference to this object 
    */
   AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o);
+  /** 
+   * Configure this task via a macro 
+   * 
+   * @param macro Macro to configure va 
+   * 
+   * @return true on success, false otherwise
+   */
+  virtual Bool_t Configure(const char* macro="CentralAODConfig.C");
   /** 
    * Create output objects 
    * 
index 42daec4e15153f8f9f6df20f2e44a6c1b2e2a731..814718b5c035c149accd754659efe82f36885c5a 100644 (file)
@@ -148,8 +148,10 @@ void AliForwardFlowTaskQC::InitVertexBins()
   for(UShort_t n = 1; n <= 6; n++) {
     if (!fv[n]) continue;
     for (Int_t v = 1; v <= fVtxAxis->GetNbins(); v++) {
-      fBinsFMD.Add(new VertexBin(fVtxAxis->GetBinLowEdge(v), fVtxAxis->GetBinUpEdge(v), n, "FMD"));
-      fBinsSPD.Add(new VertexBin(fVtxAxis->GetBinLowEdge(v), fVtxAxis->GetBinUpEdge(v), n, "SPD", kFALSE));
+      Int_t vL = Int_t(fVtxAxis->GetBinLowEdge(v));
+      Int_t vH = Int_t(fVtxAxis->GetBinUpEdge(v));
+      fBinsFMD.Add(new VertexBin(vL, vH, n, "FMD"));
+      fBinsSPD.Add(new VertexBin(vL, vH, n, "SPD", kFALSE));
     }
   }
 
index 5f7bbda45e9c044748fdf64f2ce347899745b90c..f5048dbce599ee5b4b54f0ecd5d55954c190c6e6 100644 (file)
@@ -248,24 +248,45 @@ public:
      */
     enum { kHmult = 1, kHQnRe, kHQnIm, kHQ2nRe, kHQ2nIm };
     /*
-     * Enumeration for cumulant histogram
+     * Enumeration for cumulant histograms
      */
-    enum { kW2Two = 1, kW2, kW4Four, kW4, kQnRe, kQnIm, kM,
-       kCosphi1phi2, kSinphi1phi2, kCosphi1phi2phi3m, kSinphi1phi2phi3m, kMm1m2, 
-       kw2two, kw2, kw4four, kw4, kpnRe, kpnIm, kmp, 
-       kCospsi1phi2, kSinpsi1phi2, kCospsi1phi2phi3m, kSinpsi1phi2phi3m,
-       kmpmq, kCospsi1phi2phi3p, kSinpsi1phi2phi3p };
+    enum { kW2Two = 1, 
+          kW2, 
+          kW4Four, 
+          kW4, 
+          kQnRe, 
+          kQnIm, 
+          kM,
+          kCosphi1phi2, 
+          kSinphi1phi2, 
+          kCosphi1phi2phi3m, 
+          kSinphi1phi2phi3m, 
+          kMm1m2, 
+          kw2two, 
+          kw2, 
+          kw4four, 
+          kw4, 
+          kpnRe, 
+          kpnIm, 
+          kmp, 
+          kCospsi1phi2, 
+          kSinpsi1phi2, 
+          kCospsi1phi2phi3m, 
+          kSinpsi1phi2phi3m,
+          kmpmq, 
+          kCospsi1phi2phi3p, 
+          kSinpsi1phi2phi3p };
 
-    const UShort_t fMoment;        // flow moment 
-    const Int_t    fVzMin;         // z-vertex min must be in whole [cm]
-    const Int_t    fVzMax;         // z-vertex max must be in whoe [cm]
-    TString        fType;          // data type
-    const Bool_t   fSymEta;        // Use forward-backward symmetry, if detector allows it
-    TH2D*          fCumuRef;       // histogram for reference flow
-    TH2D*          fCumuDiff;      // histogram for differential flow
-    TH3D*          fCumuHist;      // histogram for cumulants calculations
-    TH2D*          fdNdedpAcc;     // Diagnostics histogram to make acc. maps
-    UShort_t       fDebug;         // Debug flag
+    const UShort_t fMoment;    // flow moment 
+    const Int_t    fVzMin;     // z-vertex min must be in whole [cm]
+    const Int_t    fVzMax;     // z-vertex max must be in whoe [cm]
+    TString        fType;      // data type
+    const Bool_t   fSymEta;    // Use forward-backward symmetry, if detector allows it
+    TH2D*          fCumuRef;   // histogram for reference flow
+    TH2D*          fCumuDiff;  // histogram for differential flow
+    TH3D*          fCumuHist;  // histogram for cumulants calculations
+    TH2D*          fdNdedpAcc; // Diagnostics histogram to make acc. maps
+    UShort_t       fDebug;     // Debug flag
 
     ClassDef(VertexBin, 1); // object for cumulants ananlysis in FMD
   };
@@ -307,7 +328,7 @@ protected:
   TList*         fOutputList;     //  Output list
   AliAODEvent*   fAOD;            //  AOD event
   Bool_t         fv[7];           //  Calculate v_{n} flag
-  Float_t       fVtx;        //  Z vertex bin
+  Float_t       fVtx;            //  Z vertex bin
   Double_t       fCent;           //  Centrality
   TH1D*          fHistCent;       //  Diagnostics hist for centrality
   TH1D*          fHistVertexSel;  //  Diagnostics hist for selected vertices
index 36cafe77105a340dac0bec3fb5aa2e867742fdd0..503af41c579d7bd793f77e18bd4b5a277717b707 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliFMDEventPlaneFinder.h"
 #include "AliESDEvent.h"
 #include <TROOT.h>
+#include <TSystem.h>
 #include <TAxis.h>
 #include <THStack.h>
 #include <iostream>
@@ -58,6 +59,28 @@ AliForwardMultiplicityBase::operator=(const AliForwardMultiplicityBase& o)
   fCorrManager   = o.fCorrManager;
   return *this;
 }
+//____________________________________________________________________
+Bool_t 
+AliForwardMultiplicityBase::Configure(const char* macro)
+{
+  // --- Configure the task ------------------------------------------
+  TString macroPath(gROOT->GetMacroPath());
+  if (!macroPath.Contains("$(ALICE_ROOT)/PWGLF/FORWARD/analysis2")) { 
+    macroPath.Append(":$(ALICE_ROOT)/PWGLF/FORWARD/analysis2");
+    gROOT->SetMacroPath(macroPath);
+  }
+  const char* config = gSystem->Which(gROOT->GetMacroPath(), macro);
+  if (!config) {
+    AliWarningF("%s not found in %s", macro, gROOT->GetMacroPath());
+    return false;
+  }
+
+  AliInfoF("Loading configuration of '%s' from %s",  ClassName(), config);
+  gROOT->Macro(Form("%s((AliForwardMultiplicityBase*)%p)", config, this));
+  delete config;
+ return true;
+}
 
 //____________________________________________________________________
 Bool_t 
index 4a25f5ea4f421113996e300edbccab2b0a567df1..dea8221a831c334b38318bd0f7db651dd3a34844 100644 (file)
@@ -159,6 +159,14 @@ public:
   /** 
    * @} 
    */
+  /** 
+   * Configure this task via a macro 
+   * 
+   * @param macro Macro to configure va 
+   * 
+   * @return true on success, false otherwise
+   */
+  virtual Bool_t Configure(const char* macro="ForwardAODConfig.C");
   /** 
    * Print information 
    * 
@@ -252,6 +260,17 @@ public:
    * @} 
    */
   virtual void SetDebug(Int_t dbg) = 0;
+  /** 
+   * Overload super class method for setting debug level to call our
+   * SetDebug member function.
+   * 
+   * @param dbg Debug level (0: no output, 1: essentials, 3: a whole lot)
+   */
+  virtual void SetDebugLevel(Int_t dbg) 
+  { 
+    AliAnalysisTaskSE::SetDebugLevel(dbg); 
+    SetDebug(dbg);
+  }
 protected: 
   /** 
    * Constructor 
index 52a76d261cd7eaa6d530b79ed47f626d7b74b22a..60dff2c78c90e9f38e50b7e7176655aa684bb131 100644 (file)
@@ -148,9 +148,9 @@ ForwardAODConfig(AliForwardMultiplicityBase* task)
 
   // --- Debug -------------------------------------------------------
   // Set the overall debug level (1: some output, 3: a lot of output)
-  task->SetDebug(0);
+  // task->SetDebug(0);
   // Set the debug level of a single algorithm 
-  task->GetSharingFilter().SetDebug(3);
+  // task->GetSharingFilter().SetDebug(3);
 
   // --- Eventplane Finder -------------------------------------------
   task->GetEventPlaneFinder().SetUsePhiWeights(false);
index 268fb59b7e6c8313b69bf21cae6152940d0e3d8c..d52f9c866a5141004886cf72299960f2efe1818d 100644 (file)
@@ -64,8 +64,22 @@ public:
       fSys(sys), 
       fSNN(sNN), 
       fField(field),
-      fUseCent(useCent)
+      fUseCent(useCent), 
+      fDebugLvl(0), 
+      fUseTPCEventPlane(false)
   {}
+  /** 
+   * Set the debug level on Forward objects
+   * 
+   * @param lvl Debug level
+   */
+  void SetDebugLevel(Int_t lvl) { fDebugLvl = lvl; }
+  /** 
+   * If set to true, add TPC event plane task. 
+   * 
+   * @param use Wheter to include TPC event plane task 
+   */
+  void SetUseTPCEventPlance(Bool_t use) { fUseTPCEventPlane = use; }
   /** 
    * Run this analysis 
    * 
@@ -132,19 +146,19 @@ protected:
     Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
     
     // --- Add TPC eventplane task
-    gROOT->Macro("AddTaskEventplane.C");
+    if (fUseTPCEventPlane) gROOT->Macro("AddTaskEventplane.C");
 
     // --- Task to copy header information ---------------------------
     gROOT->Macro("AddTaskCopyHeader.C");
 
     // --- Add the task ----------------------------------------------
-    gROOT->Macro(Form("AddTaskForwardMult.C(%d,%d,%d,%d)", 
-                     mc, fSys, fSNN, fField));
+    gROOT->Macro(Form("AddTaskForwardMult.C(%d,%d,%d,%d,%d)", 
+                     mc, fSys, fSNN, fField, fDebugLvl));
     AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "ForwardAODConfig.C"));
 
     // --- Add the task ----------------------------------------------
-    gROOT->Macro(Form("AddTaskCentralMult.C(%d,%d,%d,%d)", 
-                     mc, fSys, fSNN, fField));
+    gROOT->Macro(Form("AddTaskCentralMult.C(%d,%d,%d,%d,%d)", 
+                     mc, fSys, fSNN, fField, fDebugLvl));
     AddExtraFile(gSystem->Which(gROOT->GetMacroPath(), "CentralAODConfig.C"));
 
     // --- Add MC particle task --------------------------------------
@@ -178,41 +192,6 @@ protected:
     // --- Ignore trigger class when selecting events.  This means ---
     // --- that we get offline+(A,C,E) events too --------------------
     // ps->SetSkipTriggerClassSelection(true);
-/*
-    if (mc) {
-      AliOADBPhysicsSelection * oadbDefaultPbPb = new AliOADBPhysicsSelection("oadbDefaultPbPb");
-      oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kHighMult,"+C0SMH-B-NOPF-ALLNOTRD","B",0);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-A-NOPF-ALLNOTRD","A",0);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-C-NOPF-ALLNOTRD","C",0);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-E-NOPF-ALLNOTRD","E",0);  
-      oadbDefaultPbPb->SetHardwareTrigger         ( 0,"SPDGFO >= 100");
-      oadbDefaultPbPb->SetOfflineTrigger          ( 0,"SPDGFO >= 100 && !V0ABG && !V0CBG");
-  
-      oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kMB,"+CMBACS2-B-NOPF-ALLNOTRD","B",1);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-A-NOPF-ALLNOTRD","A",1);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-C-NOPF-ALLNOTRD","C",1);
-      oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-E-NOPF-ALLNOTRD","E",1);
-      oadbDefaultPbPb->SetHardwareTrigger         ( 1,"(V0A && V0C && SPDGFO > 1)");
-      oadbDefaultPbPb->SetOfflineTrigger          ( 1,"(V0A && V0C && SPDGFO > 1) && !V0ABG && !V0CBG");
-    // LHC10h8
-      AliOADBPhysicsSelection * oadbLHC10h8 = new AliOADBPhysicsSelection("oadbLHC10h8");
-      oadbLHC10h8->AddCollisionTriggerClass   ( AliVEvent::kHighMult,"+C0SMH-B-NOPF-ALL","B",0);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-A-NOPF-ALL","A",0);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-C-NOPF-ALL","C",0);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kHighMult,"+C0SMH-E-NOPF-ALL","E",0);  
-      oadbLHC10h8->SetHardwareTrigger         ( 0,"SPDGFO >= 100");
-      oadbLHC10h8->SetOfflineTrigger          ( 0,"SPDGFO >= 100 && !V0ABG && !V0CBG");
-  
-      oadbLHC10h8->AddCollisionTriggerClass   ( AliVEvent::kMB,"+CMBACS2-B-NOPF-ALL","B",1);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-A-NOPF-ALL","A",1);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-C-NOPF-ALL","C",1);
-      oadbLHC10h8->AddBGTriggerClass          ( AliVEvent::kMB,"+CMBACS2-E-NOPF-ALL","E",1);
-      oadbLHC10h8->SetHardwareTrigger         ( 1,"(V0A && V0C && SPDGFOL1 > 1)");
-      oadbLHC10h8->SetOfflineTrigger          ( 1,"(V0A && V0C && SPDGFOL1 > 1) && !V0ABG && !V0CBG");
-
-      ps->SetCustomOADBObjects(oadbDefaultPbPb, 0, 0);
-      ps->SetCustomOADBObjects(oadbLHC10h8, 0, 0);
-    }*/
   }
   //__________________________________________________________________
   /** 
@@ -226,10 +205,97 @@ protected:
     if (!fUseCent) return;
     TrainSetup::CreateCentralitySelection(mc, mgr);
   }
+  //__________________________________________________________________
+  /** 
+   * Create the setup script.  This is overloaded here, so that we can
+   * create our dN/deta job script here.
+   * 
+   * @param type   Type of analysis
+   * @param mode   Mode of the analysis 
+   * @param mc     Whether this is MC or not 
+   * @param usePar Whether to use par files or not 
+   * @param dbg    Debug level
+   */
+  virtual void CreateSetupScript(EType  type, 
+                                EMode  mode, 
+                                Bool_t mc, 
+                                Bool_t usePar, 
+                                Int_t  dbg) const
+  {
+    TrainSetup::CreateSetupScript(type, mode, mc, usePar, dbg);
+    
+    Info("CreateSetupScript", "Creating dNdeta train setup script");
+    TString base(Form("%s_dndeta", fName.Data()));
+    TString escaped = EscapeName(base, fDatime);
+    std::ofstream o(Form("%s.C", escaped.Data()));
+    if (!o) { 
+      Error("CreateSetupScript", "Failed to make dNdeta script %s.C", 
+           escaped.Data());
+      return;
+    }
+    
+    o << std::boolalpha 
+      << "// Script to analyse AOD pass " << EscapedName() << " for dN/deta\n"
+      << "// Automatically generated by MakeAODTrain\n"
+      << "void " << escaped << "(bool terminate=false,"
+      << "const char* trig=\"INEL\",Double_t vzMin=-10, Double_t vzMax=+10,"
+      << "const char* scheme=\"FULL\")\n"
+      << "{\n";
+    WriteBuild(o, "MakedNdetaTrain");
+
+    o << "  MakedNdetaTrain t(\"" << base << "\",trig,vzMin,vzMax,scheme,"
+      << fUseCent << ");\n";
+    TrainSetup::WriteSettings(o, "t");
+    o << "  t.SetDataDir(\"" << GetOutputDirectory(mode) << "\");\n";
+    WriteRuns(o, "t");
+      
+    const char* cmode = (mode == kLocal ? "\"LOCAL\"" : 
+                        mode == kProof ? "\"PROOF\"" : "\"GRID\"");
+    o << "  t.Run(" << cmode << ",(terminate ? \"TERMINATE\" : \"FULL\"),-1,"
+      << usePar << ',' << dbg << ");\n"
+      << "}\n"
+      << "// EOF" << std::endl;
+    
+    o.close();
+  }
+  //__________________________________________________________________
+  const char* ClassName() const { return "MakeAODTrain"; }
+  //__________________________________________________________________
+  void WriteConstruction(std::ostream& o, const char* obj) const
+  {
+    o << "  UShort_t sys = " << fSys     << "; // 1:pp, 2:PbPb, 3:pPb\n"
+      << "  UShort_t sNN = " << fSNN     << "; // sqrt(sNN) in GeV\n"
+      << "  Short_t  fld = " << fField   << "; // L3 field in kG\n"
+      << "  Bool_t   cen = " << fUseCent << "; // enable centrality\n" 
+      << "  MakeAODTrain "<< obj << "(\"" << fName << "\",sys,sNN,fld,cen);\n"; 
+  }
+  //__________________________________________________________________
+  void WriteSettings(std::ostream& o, const char* obj) const
+  {
+    TrainSetup::WriteSettings(o, obj);
+    o << "  " << obj << ".SetDebugLvl(" << fDebugLvl << ");\n"
+      << "  " << obj << ".SetUseTPCEventPlane(" << fUseTPCEventPlane << ");\n"
+      << std::endl;
+  }
+  //__________________________________________________________________
+  void WriteRun(std::ostream& o, 
+               const char* obj, 
+               const char* /*type*/, 
+               const char* mode, 
+               const char* oper, 
+               Bool_t      mc, 
+               Bool_t      usePar, 
+               Int_t       dbg) const
+  {
+    o << "  " << obj << ".Run(" << mode << ',' << oper << ",-1," << mc << ','
+      << usePar << ',' << dbg << ");" << std::endl;
+  }
   UShort_t fSys;
   UShort_t fSNN;
   Short_t  fField;
   Bool_t   fUseCent;
+  Int_t    fDebugLvl;
+  Bool_t   fUseTPCEventPlane;
 };
 //
 // EOF
index e44c6781ad2874874acaa5a50668bd1239f9cee5..3b2f8a4241f947e554234931f7f7a57239f9efcd 100644 (file)
@@ -67,9 +67,9 @@ public:
    * @param usePar   If true, use PARs 
    */
   void Run(const char* mode, const char* oper, 
-          Int_t nEvents=-1, Bool_t usePar=false)
+          Int_t nEvents=-1, Bool_t usePar=false, Int_t dbg=0)
   {
-    Exec("AOD", mode, oper, nEvents, false, usePar);
+    Exec("AOD", mode, oper, nEvents, false, usePar, dbg);
   }
   /** 
    * Run this analysis 
@@ -80,9 +80,9 @@ public:
    * @param usePar   If true, use PARs 
    */
   void Run(EMode mode, EOper oper, Int_t nEvents=-1, 
-          Bool_t usePar=false)
+          Bool_t usePar=false, Int_t dbg=0)
   {
-    Exec(kAOD, mode, oper, nEvents, false, usePar);
+    Exec(kAOD, mode, oper, nEvents, false, usePar, dbg);
   }
   /** 
    * Set the trigger to use (INEL, INEL>0, NSD)
@@ -148,6 +148,31 @@ protected:
    * @return 0
    */
   AliVEventHandler* CreateOutputHandler(EType) { return 0; }
+  //__________________________________________________________________
+  const char* ClassName() const { return "MakedNdetaTrain"; }
+  //__________________________________________________________________
+  void WriteConstruction(std::ostream& o, const char* obj) const
+  {
+    o << "  const char* trig   = \"" << fTrig << "\";\n"
+      << "  Double_t    vzMin  = " << fVzMin << ";\n"
+      << "  Double_t    vzMax  = " << fVzMax << ";\n"
+      << "  const char* scheme = \"" << fScheme << "\";\n"
+      << "  Bool_t      cent   = " << fUseCent << ";\n"
+      << "  MakedNdetaTrain " << obj << "(\"" 
+      << fName << "\",trig,vzMin,vzMax,scheme,cent);\n";
+  }
+  void WriteRun(std::ostream& o, 
+               const char* obj, 
+               const char* /* type */, 
+               const char* mode, 
+               const char* oper, 
+               Bool_t      mc, 
+               Bool_t      usePar, 
+               Int_t       dbg) const
+  {
+    o << "  " << obj << ".Run(" << mode << ',' << oper << ",-1," 
+      << usePar << ',' << dbg << ");" << std::endl;
+  }
   TString  fTrig;      // Trigger to use 
   Double_t fVzMin;     // Least v_z
   Double_t fVzMax;     // Largest v_z
index dbf71c1fcde400f20b6c4f010f8e35d10b1f53f4..9cd3c12d9cb01ba6626761b6f9192b3da063a88d 100644 (file)
@@ -49,6 +49,7 @@
 class TArrayI;
 class TChain;
 class AliAnalysisManager;
+class TDatime;
 #endif
 
 //====================================================================
@@ -192,6 +193,7 @@ struct TrainSetup
             UShort_t year=0, UShort_t month=0, 
             UShort_t day=0, UShort_t hour=0, UShort_t min=0) 
     : fName(name),
+      fEscapedName(name),
       fRootVersion("v5-28-00a"),
       fAliRootVersion("v4-21-18-AN"),
       fAliEnAPIVersion("V1.1x"),
@@ -199,40 +201,51 @@ struct TrainSetup
       fDataDir("/alice/data/2010/LHC10c"),
       fDataSet("/COMMON/COMMON/LHC09a4_run8100X#/esdTree"),
       fXML(""), 
+      fNReplica(4),
+      fESDPass(3),
+      fPassPostfix(""),
+      fAllowOverwrite(kFALSE),
+      fUseGDB(kFALSE), 
+      fMaxSplit(50),
       fRunNumbers(0),
       fListOfPARs(),
       fListOfSources(),
       fListOfLibraries(),
       fListOfExtras(),
-      fNReplica(4),
-      fESDPass(3),
-      fPassPostfix(""),
-      fEscapedName(name),
-      fAllowOverwrite(kFALSE),
-      fUseGDB(kFALSE)
+      fDatime((year<1995?1995:year), month, day, hour, min, 0)
+  {
+    // If no time is specified, set to now 
+    if (useDateTime && (year == 0 || month == 0 || day == 0)) fDatime.Set();
+      
+    fEscapedName = EscapeName(fName, fDatime);
+  }
+  
+  static TString EscapeName(const char* name, const TDatime& datime)
   {
+    TString escaped = name;
     char  c[] = { ' ', '/', '@', 0 };
     char* p   = c;
     while (*p) { 
-      fEscapedName.ReplaceAll(Form("%c", *p), "_");
+      escaped.ReplaceAll(Form("%c", *p), "_");
       p++;
     }
-
-    if (useDateTime) { 
-      if (year == 0 || month == 0 || day == 0) {
-       TDatime now;
-       year  = now.GetYear();
-       month = now.GetMonth();
-       day   = now.GetDay();
-       hour  = now.GetHour();
-       min   = now.GetMinute();
-      }
-      fEscapedName.Append(Form("_%04d%02d%02d_%02d%02d", 
-                              year, month, day, hour, min));
-    }
-
+    if (datime.GetYear() <= 1995 && 
+       datime.GetMonth() == 0 && 
+       datime.GetDay() == 0) return escaped;
+    escaped.Append(Form("_%04d%02d%02d_%02d%02d", 
+                       datime.GetYear(), 
+                       datime.GetMonth(), 
+                       datime.GetDay(), 
+                       datime.GetHour(), 
+                       datime.GetMinute()));
+    return escaped;
+  }    
+  void SetDateTime(UShort_t year, UShort_t month, UShort_t day, 
+                  UShort_t hour, UShort_t minutes)
+  {
+    fDatime.Set((year<1995?1995:year), month, day, hour, minutes, 0);
+    fEscapedName = EscapeName(fName, fDatime);
   }
-
   //__________________________________________________________________
   /** 
    * Parse a string into a type enum
@@ -349,7 +362,12 @@ struct TrainSetup
    * @param v Version string of AliROOT 
    */
   void SetAliROOTVersion(const char* v) { fAliRootVersion = v; }
-
+  //__________________________________________________________________
+  /** 
+   * Set the AliEn API version to use 
+   * 
+   * @param v AliEn API version 
+   */
   void SetAliEnAPIVersion(const char* v) { fAliEnAPIVersion = v; }
   //__________________________________________________________________
   /** 
@@ -386,12 +404,14 @@ struct TrainSetup
    * @param n Number of replicas requested 
    */
   void SetNReplica(Int_t n) { fNReplica = n; }
+  //__________________________________________________________________
   /** 
    * Set the ESD pass to use 
    * 
    * @param pass Pass number 
    */
   void SetESDPass(Int_t pass) { fESDPass = pass; }
+  //__________________________________________________________________
   /** 
    * Set the ESD pass to use 
    * 
@@ -406,6 +426,13 @@ struct TrainSetup
    */
   void SetUseGDB(Bool_t use=kTRUE) { fUseGDB = use; }
   //__________________________________________________________________
+  /** 
+   * Set the maximum number of files per sub-job.  
+   * 
+   * @param max Maximum number of files per sub-job
+   */  
+  void SetMaxSplit(UShort_t max=50) { fMaxSplit = max; }
+  //__________________________________________________________________
   /** 
    * Add a source file to be copied and byte compiled on slaves 
    * 
@@ -617,8 +644,8 @@ struct TrainSetup
             << base << "." << ext << "++g\");\n"
             << "  if (ret != 0) Fatal(\"BUILD\",\"Failed to build\");\n"
             << "  else Info(\"BUILD\", \"Made " << base << "\");\n"
-           << "}\n"
-           << std::endl;
+            << "}\n"
+            << std::endl;
       cbuild.close();
       
       // Make our set-up script 
@@ -664,55 +691,68 @@ struct TrainSetup
     return retval;
   }
   //__________________________________________________________________
+  static void PrintFieldName(std::ostream& o, const char* name)
+  {
+    o << "  " << std::left << std::setw(20) << name << ": " << std::flush;
+  }
+  //__________________________________________________________________
+  static void PrintFieldList(std::ostream& o, const char* name, 
+                            const TCollection& c)
+  {
+    PrintFieldName(o, name);
+    Bool_t   first = true;
+    TObject* obj = 0;
+    TIter    next(&c);
+    while ((obj = next())) {
+      o << (first ? "" : ", ") << obj->GetName();
+      first = false;
+    }
+    std::cout << std::endl;
+  }
+  //__________________________________________________________________
+  template <typename T>
+  static void PrintField(std::ostream& o, const char* name, T& value) 
+  {
+    PrintFieldName(o, name);
+    o << value << std::endl;
+  }
+  //__________________________________________________________________
   /** 
    * Print the setup 
    * 
    */
-  void Print() const 
+  virtual void Print() const 
   {
     bool mc = AliAnalysisManager::GetAnalysisManager()
       ->GetMCtruthEventHandler();
     std::cout << fName << " train setup\n"
-             << std::boolalpha
-             << "  ROOT version:         " << fRootVersion    << "\n"
-             << "  AliROOT version:      " << fAliRootVersion << "\n"
-             << "  Name of proof server: " << fProofServer    << "\n"
-             << "  Grid Input directory: " << fDataDir        << "\n"
-             << "  Proof data set name:  " << fDataSet        << "\n"
-             << "  XML collection:       " << fXML            << "\n"
-             << "  Monte-Carlo input:    " << mc              << "\n"
-             << "  Storage replication:  " << fNReplica       << "\n"
-             << "  Run numbers:          " << std::flush;
+             << std::boolalpha;
+    PrintField(std::cout, "Escaped name",               fEscapedName);
+    PrintField(std::cout, "ROOT version",              fRootVersion);
+    PrintField(std::cout, "AliROOT version",           fAliRootVersion);
+    PrintField(std::cout, "AliEn API version",         fAliEnAPIVersion);
+    PrintField(std::cout, "Name of proof server",      fProofServer);
+    PrintField(std::cout, "Input directory",           fDataDir);
+    PrintField(std::cout, "Proof data set name",       fDataSet);
+    PrintField(std::cout, "XML collection",            fXML);
+    PrintField(std::cout, "Storage replication",       fNReplica);
+    PrintField(std::cout, "ESD pass",                  fESDPass);
+    PrintField(std::cout, "ESD pass postfix",          fPassPostfix);
+    PrintField(std::cout, "Allow overwrite",            fAllowOverwrite);
+    PrintField(std::cout, "Do GDB debugging",           fUseGDB);
+    PrintField(std::cout, "Max # files per split",      fMaxSplit);
+    PrintField(std::cout, "Monte-Carlo input",         mc);
+
+    PrintFieldName(std::cout, "Run numbers");
     for (Int_t i = 0; i < fRunNumbers.GetSize(); i++) 
       std::cout << (i == 0 ? "" : ", ") << fRunNumbers.At(i);
+    std::cout << std::endl;
 
-    std::cout << "\n"
-             << "  PAR files:            " << std::flush;
-    Bool_t first = true;
-    TObject* obj = 0;
-    TIter nextPar(&fListOfPARs);
-    while ((obj = nextPar())) {
-      std::cout << (first ? "" : ", ") << obj->GetName();
-      first = false;
-    }
+    PrintFieldList(std::cout, "PAR files",             fListOfPARs);
+    PrintFieldList(std::cout, "Script sources",        fListOfSources);
+    PrintFieldList(std::cout, "Libraries",             fListOfLibraries);
+    PrintFieldList(std::cout, "Extras",                fListOfExtras);
 
-    std::cout << "\n"
-             << "  Script sources:       " << std::flush;
-    first = true;
-    TIter nextSrc(&fListOfSources);
-    while ((obj = nextSrc())) {
-      std::cout << (first ? "" : ", ") << obj->GetName();
-      first = false;
-    }
-
-    std::cout << "\n"
-             << "  Libraries to load:    " << std::flush;
-    first = true;
-    TIter nextLib(&fListOfLibraries);
-    while ((obj = nextLib())) {
-      std::cout << (first ? "" : ", ") << obj->GetName();
-      first = false;
-    }
     std::cout << std::noboolalpha << std::endl;
 
     AliAnalysisGrid* plugin = 
@@ -814,6 +854,9 @@ struct TrainSetup
     AliAnalysisAlien* gridHandler = CreateGridHandler(type, mode, oper);
     if (gridHandler) mgr->SetGridHandler(gridHandler);
     
+    // --- Print setup -----------------------------------------------
+    CreateSetupScript(type, mode, mc, usePar, dbg);
+
     // --- Print setup -----------------------------------------------
     Print();
     // if (mode == kProof) {
@@ -867,20 +910,25 @@ protected:
    * @param o Object to copy from
    */
   TrainSetup(const TrainSetup& o)
-    : fName(o.fName),
-      fRootVersion(o.fRootVersion),
-      fAliRootVersion(o.fAliRootVersion),
-      fProofServer(o.fProofServer),
-      fDataDir(o.fDataDir),    
-      fDataSet(o.fDataSet),    
-      fXML(o.fXML),    
-      fRunNumbers(o.fRunNumbers),
-      fListOfPARs(),
-      fListOfSources(),
-      fListOfLibraries(),
-      fListOfExtras(),
-      fNReplica(o.fNReplica),
-      fESDPass(o.fESDPass)
+  : fName(o.fName),
+    fRootVersion(o.fRootVersion),
+    fAliRootVersion(o.fAliRootVersion),
+    fProofServer(o.fProofServer),
+    fDataDir(o.fDataDir),      
+    fDataSet(o.fDataSet),      
+    fXML(o.fXML),      
+    fNReplica(o.fNReplica),
+    fESDPass(o.fESDPass),
+    fPassPostfix(o.fPassPostfix),
+    fAllowOverwrite(o.fAllowOverwrite),
+    fUseGDB(o.fUseGDB),
+    fMaxSplit(o.fMaxSplit),
+    fRunNumbers(o.fRunNumbers),
+    fListOfPARs(),
+    fListOfSources(),
+    fListOfLibraries(),
+    fListOfExtras(),
+    fDatime(o.fDatime)
   {
     if (isdigit(fName[0])) { 
       Warning("TrainSetup", "Name starts with a digit, prepending 'a' to name");
@@ -1103,9 +1151,10 @@ protected:
 
     // Data search patterns 
     TString pat;
-    if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()) {
+    if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler() ||
+       type == kAOD) {
       pat = "*/";
-      plugin->SetRunPrefix("");
+      plugin->SetRunPrefix(type == kAOD ? "000" : "");
     }
     else {
       pat = Form("*ESDs/pass%d%s/*/", fESDPass, fPassPostfix.Data());
@@ -1229,6 +1278,7 @@ protected:
     
     // Split by storage element - must be lower case!
     plugin->SetSplitMode("se");
+    plugin->SetSplitMaxInputFileNumber(fMaxSplit);
 
     return plugin;
   }
@@ -1310,8 +1360,9 @@ protected:
   virtual void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr)
   {
     gROOT->Macro("AddTaskCentrality.C");
+    const char* name = "CentralitySelection";
     AliCentralitySelectionTask* ctask = 
-      dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask("CentralitySelection"));
+      dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask(name));
     if (!ctask) return;
     // ctask->SetPass(fESDPass);
     if (mc) ctask->SetMCInput();
@@ -1558,7 +1609,7 @@ protected:
     }
     
     // Extract archive 
-    gSystem->Exec(Form("tar xvzf %s", parFile.Data()));
+    gSystem->Exec(Form("tar xzf %s", parFile.Data()));
     
     // Change directory into par archive
     TString cwd = gSystem->WorkingDirectory();
@@ -1836,7 +1887,140 @@ protected:
     return chain;
   }
   //__________________________________________________________________
+  TString GetOutputDirectory(EMode mode) const 
+  {
+    TString ret(fEscapedName);
+    if (mode != kGrid) return ret;
+    
+    AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
+    if (!am) { 
+      Warning("GetOutputDirectory", "No analysis manager defined yet");
+      return ret;
+    }
+    AliAnalysisGrid* ag = am->GetGridHandler();
+    if (!ag) { 
+      Warning("GetOutputDirectory", "No grid handler defined yet");
+      return ret;
+    }
+    AliAnalysisAlien* aa = dynamic_cast<AliAnalysisAlien*>(ag);
+    if (!aa) { 
+      Warning("GetOutputDirectory", "Grid handler isn't for AliEn");
+      return ret;
+    }
+    ret = aa->GetGridOutputDir();
+    if (!ret.BeginsWith("/")) {
+      if (gGrid)
+       ret = Form("%s/%s/%s", gGrid->GetHomeDirectory(), 
+                  fEscapedName.Data(), aa->GetGridOutputDir());
+      else 
+       ret = Form("%s/%s", fEscapedName.Data(), aa->GetGridOutputDir());
+    }
+    return ret;
+  }
+      
+  //__________________________________________________________________
+  virtual void WriteConstruction(std::ostream& o, const char* obj) const
+  {
+    o << "  " << ClassName() << " " 
+      << obj << "(\"" << fName << "\");" << std::endl;
+  }
+  //__________________________________________________________________
+  virtual void WriteSettings(std::ostream& o, const char* obj) const
+  {
+    o << "  " << obj << ".SetDateTime(" << fDatime.GetYear() << ',' 
+      << fDatime.GetMonth() << ',' 
+      << fDatime.GetDay() << ',' 
+      << fDatime.GetHour() << ',' 
+      << fDatime.GetMinute() << ");\n"
+      << "  " << obj << ".SetROOTVersion(\"" << fRootVersion << "\");\n"
+      << "  " << obj << ".SetAliROOTVersion(\"" << fAliRootVersion << "\");\n"
+      << "  " << obj << ".SetAliEnAPIVersion(\"" << fAliEnAPIVersion << "\");\n"
+      << "  " << obj << ".SetProofServer(\"" << fProofServer << "\");\n"
+      << "  " << obj << ".SetDataDir(\"" << fDataDir << "\");\n"
+      << "  " << obj << ".SetDataSet(\"" << fDataSet << "\");\n"
+      << "  " << obj << ".SetXML(\"" << fXML << "\");\n"
+      << "  " << obj << ".SetNReplica(" << fNReplica << ");\n"
+      << "  " << obj << ".SetESDPass(" << fESDPass << ");\n"
+      << "  " << obj << ".SetPassPostfix(\"" << fPassPostfix << "\");\n"
+      << "  " << obj << ".SetAllowOverwrite(" << fAllowOverwrite << ");\n"
+      << "  " << obj << ".SetUseGDB(" << fUseGDB << ");\n"
+      << "  " << obj << ".SetMaxSplit(" << fMaxSplit << ");\n"
+      << std::endl;
+  } 
+  //__________________________________________________________________
+  virtual void WriteRun(std::ostream& o, 
+                       const char* obj, 
+                       const char* type, 
+                       const char* mode, 
+                       const char* oper, 
+                       Bool_t      mc, 
+                       Bool_t      usePar, 
+                       Int_t       dbg) const
+  {
+    o << "  " << obj << ".Run(" << type << "," << mode 
+      << "," << oper << "," << mc << "," << usePar << "," 
+      << dbg << ");" << std::endl;
+  }
+  //__________________________________________________________________
+  virtual const char* ClassName() const
+  {
+    return "TrainSetup";
+  }
+  //__________________________________________________________________
+  virtual void WriteBuild(std::ostream& o, const char* cls) const
+  {
+    o << "  const char* builder = \n"
+      << "    \"$(ALICE_ROOT)/PWGLF/FORWARD/analysis2/trains/BuildTrain.C\";\n"
+      << "  gROOT->LoadMacro(builder);\n"
+      << "  BuildTrain(\"" << cls << "\");\n" << std::endl;
+  }
+  //__________________________________________________________________
+  virtual void WriteRuns(std::ostream& o, const char* obj) const
+  {
+    for (Int_t i = 0; i < fRunNumbers.GetSize(); i++) 
+      o << "  " << obj << ".AddRun(" << fRunNumbers.At(i) << ");\n";
+    o << std::endl;
+  }
+  //__________________________________________________________________
+  virtual void CreateSetupScript(EType  type, 
+                                EMode  mode, 
+                                Bool_t mc, 
+                                Bool_t usePar, 
+                                Int_t  dbg) const
+  {
+    std::ofstream o(Form("setup_%s.C", fEscapedName.Data()));
+    if (!o) { 
+      Error("CreateSetupScript", "Failed to generate setup_%s.C", 
+           fEscapedName.Data());
+      return;
+    }
+    const char* cls = ClassName();
+    o << std::boolalpha 
+      << "// Script to set-up the analysis chain\n"
+      << "// Automatically generated by TrainSetup\n"
+      << "// Run with argument to true, to do Terminate processing\n"
+      << "void setup_" << fEscapedName << "(bool terminate)\n"
+      << "{\n";
+    WriteBuild(o, cls);
+    WriteConstruction(o, "t");
+    WriteSettings(o, "t");
+    WriteRuns(o, "t");
+
+    const char* ctype = (type == kESD ? "\"ESD\"" : "\"AOD\"");
+    const char* cmode = (mode == kLocal ? "\"LOCAL\"" : 
+                        mode == kProof ? "\"PROOF\"" : "\"GRID\"");
+    WriteRun(o, "t", ctype, cmode, "(terminate ? \"TERMINATE\" : \"FULL\")",
+            mc, usePar, dbg);
+            
+    
+    o << "\n}\n// EOF\n" << std::endl;
+       
+    
+    o.close();
+  }
+  //__________________________________________________________________
   TString fName;             // Name of analysis
+  TString fEscapedName;      // Name escaped for special chars
   TString fRootVersion;      // ROOT version to use 
   TString fAliRootVersion;   // AliROOT version to use 
   TString fAliEnAPIVersion;  // AliEn API version to use 
@@ -1844,17 +2028,18 @@ protected:
   TString fDataDir;          // Grid Input directory 
   TString fDataSet;          // Proof data set name 
   TString fXML;              // XML collection for local/proof mode
-  TArrayI fRunNumbers;       // List of run number 
-  TList   fListOfPARs;       // List of PAR files to use 
-  TList   fListOfSources;    // List of sources to upload and AcLIC
-  TList   fListOfLibraries;  // List of libraries to load
-  TList   fListOfExtras;     // List of extra files to upload
   Int_t   fNReplica;         // Storage replication
   Int_t   fESDPass;          // ESD pass number 
   TString fPassPostfix;      // Possible pass postfix
-  TString fEscapedName;      // Name escaped for special chars
   Bool_t  fAllowOverwrite;   // Allow overwriting output dir
   Bool_t  fUseGDB;           // Wrap PROOF slaves in GDB 
+  Int_t   fMaxSplit;         // Maximum number of files per split
+  TArrayI fRunNumbers;       // List of run number 
+  TList   fListOfPARs;       // List of PAR files to use 
+  TList   fListOfSources;    // List of sources to upload and AcLIC
+  TList   fListOfLibraries;  // List of libraries to load
+  TList   fListOfExtras;     // List of extra files to upload
+  TDatime fDatime;
 };