Fixes, AOD merge now uses AODConfig
authorcholm <Christian.Holm.Christensen@cern.ch>
Mon, 6 Oct 2014 09:08:38 +0000 (11:08 +0200)
committercholm <Christian.Holm.Christensen@cern.ch>
Mon, 6 Oct 2014 09:08:38 +0000 (11:08 +0200)
PWGLF/FORWARD/analysis2/sim/AOD.C
PWGLF/FORWARD/analysis2/sim/Config.C
PWGLF/FORWARD/analysis2/sim/Final.jdl.in
PWGLF/FORWARD/analysis2/sim/Merge.jdl.in
PWGLF/FORWARD/analysis2/sim/Simulate.C
PWGLF/FORWARD/analysis2/sim/doit.sh

index 2badbf2..7dfd873 100644 (file)
@@ -364,7 +364,7 @@ void AddAnalysisTasks(const char *cdb_location)
   }
 
   // ---- PWG3 JPSI filtering (only pp) ------------------------------
-  if (aodCfg->UsePWGDQJPSIfilter() && (iCollision==0)) {
+  if (aodCfg->UsePWGDQJPSIfilter()) {
     gROOT->LoadMacro(pwgdq+"/dielectron/macros/AddTaskJPSIFilter.C");
     AliAnalysisTaskSE *taskJPSIfilter = AddTaskJPSIFilter();
 
@@ -390,7 +390,7 @@ void AddAnalysisTasks(const char *cdb_location)
 
   // Configurations flags, move up?
   if (aodCfg->UseJETAN()) {
-#if 1
+#if 0
     Warning("", "JET analysis disabled - major restructuring ofg JETAN");
 #else
     TString jetAOD             = "AliAOD.Jets.root";
@@ -511,21 +511,25 @@ void AODMerge()
   // Merging method. No staging and no terminate phase.
   TStopwatch  timer; timer.Start();
   TString     outputDir     = "wn.xml";
-  TString     outputFiles   = ("EventStat_temp.root," +
-                              "AODQA.root," +
-                              "AliAOD.root," +
-                              "AliAOD.VertexingHF.root," +
-                              "AliAOD.Muons.root," +
-                              "AliAOD.Jets.root," +
-                              "pyxsec_hists.root");
+  TObjArray   outputFiles;
+  outputFiles.Add(new TObjString("EventStat_temp.root,"));
+  outputFiles.Add(new TObjString("AODQA.root,"));
+  outputFiles.Add(new TObjString("AliAOD.root,"));
+  if (aodCfg->UsePWGHFvertexing()) 
+    outputFiles.Add(new TObjString("AliAOD.VertexingHF.root,"));
+  if (aodCfg->UseESDfilter() && aodCfg->UseMUONcopyAOD())
+    outputFiles.Add(new TObjString("AliAOD.Muons.root,"));
+  if (aodCfg->UseJETAN()) 
+    outputFiles.Add(new TObjString("AliAOD.Jets.root,"));
+  if (aodCfg->UsePWGDQJPSIfilter()) 
+    outputFiles.Add(new TObjString("AliAOD.Dielectron.root,"));
+  outputFiles.Add(new TObjString("pyxsec_hists.root"));
   TString     mergeExcludes = "";
-  TObjArray*  tokens        = outputFiles.Tokenize(",");
-  TIter       iter(tokens);
+  TIter       iter(outputFiles);
   TObjString* str           = 0;
-  TString     outputFile;
-  Bool_t      merged = kTRUE;
+  Bool_t      merged        = kTRUE;
   while ((str = static_cast<TObjString*>(iter()))) {
-    outputFile = str->GetString();
+    TString& outputFile = str->GetString();
     // Skip already merged outputs
     if (!gSystem->AccessPathName(outputFile)) {
       printf("Output file <%s> found. Not merging again.",outputFile.Data());
index 122b3b2..28f5a48 100644 (file)
@@ -175,26 +175,29 @@ struct Setup
   {
     Bool_t asym = grp->IsPA()||grp->IsAP();
     TString& rt = runType;
-    if (rt.EndsWith("perugia0chadr"))     return PythiaHF(0);
-    if (rt.EndsWith("perugia0bchadr"))    return PythiaHF(1);
-    if (rt.EndsWith("perugia0cele"))      return PythiaHF(2);
-    if (rt.EndsWith("perugia0bele"))      return PythiaHF(3);
-    if (rt.EndsWith("perugia0jspi2e"))    return PythiaHF(4);
-    if (rt.EndsWith("perugia0btojspi2e")) return PythiaHF(5);
-    if (rt.BeginsWith("pythia"))          return Pythia(rt);
-    if (rt.BeginsWith("hijing2000hf"))    return HFCocktail(rt);
-    if (rt.BeginsWith("hijing2000"))      return Hijing(asym, 
+    AliGenerator* g = 0;
+    if      (rt.EndsWith("perugia0chadr"))     g=PythiaHF(0);
+    else if (rt.EndsWith("perugia0bchadr"))    g=PythiaHF(1);
+    else if (rt.EndsWith("perugia0cele"))      g=PythiaHF(2);
+    else if (rt.EndsWith("perugia0bele"))      g=PythiaHF(3);
+    else if (rt.EndsWith("perugia0jspi2e"))    g=PythiaHF(4);
+    else if (rt.EndsWith("perugia0btojspi2e")) g=PythiaHF(5);
+    else if (rt.BeginsWith("pythia"))          g=Pythia(rt);
+    else if (rt.BeginsWith("hijing2000hf"))    g=HFCocktail(rt);
+    else if (rt.BeginsWith("hijing2000"))      g=Hijing(asym, 
                                                        false, 2.3);
-    if (rt.BeginsWith("hijing"))          return Hijing(asym, 
+    else if (rt.BeginsWith("hijing"))          g=Hijing(asym, 
                                                        grp->IsAA(), 0);
-    if (rt.BeginsWith("ampthf"))          return HFCocktail(rt);
-    if (rt.BeginsWith("ampt"))            return Ampt();
-    if (rt.BeginsWith("dpmjet"))          return Dpmjet();
-    if (rt.BeginsWith("phojet"))          return Dpmjet();
-    if (rt.BeginsWith("hydjet"))          return Hydjet();
-
-    Fatal("", "Invalid run type \"%s\" specified", runType.Data());
-    return 0;
+    else if (rt.BeginsWith("ampthf"))          g=HFCocktail(rt);
+    else if (rt.BeginsWith("ampt"))            g=Ampt();
+    else if (rt.BeginsWith("dpmjet"))          g=Dpmjet();
+    else if (rt.BeginsWith("phojet"))          g=Dpmjet();
+    else if (rt.BeginsWith("hydjet"))          g=Hydjet();
+
+    if (g) g->SetVertexSmear(AliGenerator::kPerEvent);
+    else 
+      Fatal("", "Invalid run type \"%s\" specified", runType.Data());
+    return g;
   }
   TVirtualMCDecayer* MakeDecayer()
   {
index 08ad68b..c43694b 100644 (file)
@@ -44,21 +44,23 @@ InputFile = {
        "LF:@data@/$4.C",
        "LF:@data@/$4Config.C",
        "LF:@data@/GRP.C",
-       "LF:@data@/fmd_correcions.root,"
+       "LF:@data@/fmd_corrections.root",
        "LF:@out@/$3/$1/$4_Stage_$2.xml"
 };
-OutputDir = "@out@/$3/$1/";
+OutputDir = "@out@/$3/$1";
 OutputArchive = {
    "$4_merge_log_archive.zip:std*,fileinfo*.log@disk=1",
    "$4_merge_archive.zip:*.root,*.stat*@disk=2"
 };
 TTL = "36000";
-Price = "20";
+Price = "1";
 Validationcommand = "/alice/cern.ch/user/a/aliprod/QA/validation_merge.sh";
 Workdirectorysize = {"5000MB"};
-JDLVariables = 
-{
+JDLVariables = {
    "Packages",
    "OutputDir"
 };
 Workdirectorysize = {"10000MB"};
+#
+# EOF
+#
index 0afc572..24bdddc 100644 (file)
@@ -54,7 +54,7 @@ InputDataList="wn.xml";
 OutputDir="@out@/$3/$1/$4_Stage_$2/#alien_counter_03i#";
 OutputArchive={
        "$4_log_archive.zip:std*,fileinfo*.log@disk=1",
-       "$4_archive.zip:*.root,*.stat*@disk=2"
+       "$4_archive.zip:EventStat_temp.root,*$4*.root,*.stat*@disk=2"
 };
 Split="se";
 SplitMaxInputFileNumber="20";
index 98cae1d..81feb1b 100644 (file)
@@ -1,9 +1,23 @@
+/** 
+ * Read an integer valued environment variable 
+ * 
+ * @param name environment variable name 
+ * 
+ * @return Value or 0
+ */
 Int_t getIntEnv(const char* name)
 {
   TString env = gSystem->Getenv(name);
   if (env.IsNull()) return 0;
   return env.Atoi();
 }
+/** 
+ * Set specific storage 
+ * 
+ * @param s   Simlation object
+ * @param key Key to set specific storage for
+ * @param sub Sub-component of storage
+ */
 void SetSpecStore(AliSimulation& s, 
                  const char* key, 
                  const char* sub)
@@ -11,7 +25,12 @@ void SetSpecStore(AliSimulation& s,
   s.SetSpecificStorage(key, Form("alien://Folder=/alice/simulation/%s",sub));
 }
 
-
+/** 
+ * Run the simulation 
+ * 
+ * @param nev Number of events per job
+ * @param run Run number to simulate 
+ */
 void Simulate(Int_t nev=1, UInt_t run=0) 
 {
   // -----------------------------------------------------------------
@@ -20,6 +39,11 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   //
   gROOT->Macro(Form("GRP.C(%d)", run));
 
+  // --- Get GRP to deduce collision system --------------------------
+  Bool_t         isAA  = grp->IsAA();
+  Bool_t         isPP  = grp->IsPP();
+  Bool_t         is10h = grp->period.EqualTo("LHC10h");
+
   // -----------------------------------------------------------------
   // 
   // Basic setup 
@@ -27,6 +51,12 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   AliSimulation steer; 
   steer.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
   steer.SetMakeDigitsFromHits("ITS TPC");
+
+  // -----------------------------------------------------------------
+  // 
+  // Vertex, Mag.field, and trigger from OCDB
+  //
+  steer.SetTriggerConfig(!isAA ? "p-p" : "Pb-Pb");//Replace with "ocdb"
   steer.UseMagFieldFromGRP();
   steer.UseVertexFromCDB();
 
@@ -39,11 +69,6 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   // cdb->SetRun(grp.run);
   steer.SetDefaultStorage(cdb->GetDefaultStorage()->GetURI());
 
-  // --- Get GRP to deduce collision system --------------------------
-  Bool_t         isAA  = grp->IsAA();
-  Bool_t         isPP  = grp->IsPP();
-  Bool_t         is10h = grp->period.EqualTo("LHC10h");
-
   // --- ITS  (1 Total) ----------------------------------------------
   SetSpecStore(steer,"ITS/Align/Data", "2008/v4-15-Release/Ideal");
   
@@ -67,14 +92,6 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   if (is10h)
     SetSpecStore(steer,"ZDC/Align/Data",       "2008/v4-15-Release/Ideal/"); 
 
-  // -----------------------------------------------------------------
-  // 
-  // Vertex, Mag.field, and trigger from OCDB
-  //
-  steer.UseVertexFromCDB();
-  steer.UseMagFieldFromGRP();
-  // steer.SetTriggerConfig("OCDB");
-  steer.SetTriggerConfig(!isAA ? "p-p" : "Pb-Pb");
 
   // -----------------------------------------------------------------
   // 
@@ -89,3 +106,6 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   timer.Stop();
   timer.Print();
 }
+// 
+// EOF
+//  
index 37d0510..cbeee4f 100755 (executable)
@@ -116,11 +116,15 @@ merge()
     local tag=$5 
     local run=$6
     local tmpdir=`mktemp -d` 
-    
+    local pre=$what
+    if test "x$what" = "xAOD" ; then 
+       pre="aod";
+    fi 
+
     local top=${out}/${tag}/${run}
     local bse=${what}_Stage_${stage}.xml 
     local xml=${tmpdir}/${bse}
-    local arc=${what}_archive.zip
+    local arc=${pre}_archive.zip
     local jdl=Merge.jdl
     local ret=0
 
@@ -336,6 +340,7 @@ ahome=/alice/cern.ch/user/`echo $auid | sed 's/^\(.\).*/\1/'`/$auid
 adir=${ahome}/mc
 abin=${ahome}/mc
 aout=${ahome}/test
+stages="AOD QA"
 
 # --- Proces command line options ------------------------------------
 while test $# -gt 0 ; do 
@@ -349,6 +354,7 @@ while test $# -gt 0 ; do
        -n|--jobs)      jobs=$2         ; shift ;;
        -m|--events)    events=$2       ; shift ;;
        -s|--stage)     stage=$2        ; shift ;; 
+       -S|--stages)    stages=$2       ; shift ;; 
        -b|--bin)       abin=$2         ; shift ;; 
        -o|--output)    aout=$2         ; shift ;; 
        -d|--data)      adir=$2         ; shift ;; 
@@ -422,7 +428,9 @@ if test $stage -le 0 ; then
     exit $ret
 fi
 
-merge QA ${stage} ${adir} ${aout} ${id} ${run}
+for s in $stages ; do 
+    merge ${s} ${stage} ${adir} ${aout} ${id} ${run}
+done
 
 #
 # EOF