]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Uniformize macros and scripts to official productions
authordstocco <diego.stocco@cern.ch>
Thu, 18 Dec 2014 14:37:01 +0000 (15:37 +0100)
committerlaphecet <laurent.aphecetche@subatech.in2p3.fr>
Mon, 12 Jan 2015 14:58:05 +0000 (15:58 +0100)
CAVEAT: JDL and simrun.sh are modified so that it is still possible to
pass the number of events per job as an argument.
This is however not possible in official productions, where the number of events
is proportional to the default value in sim.C

PWG/muondep/AccEffTemplates/sim.C
PWG/muondep/AccEffTemplates/simrun.sh
PWG/muondep/AliMuonAccEffSubmitter.cxx
PWG/muondep/AliMuonAccEffSubmitter.h
PWG/muondep/AliMuonGridSubmitter.cxx

index 5a38e41e6f1aa92696bf5ab84aa6744b0fbe7fd4..03f68470b47a154b29d370c851a134143c733791 100644 (file)
@@ -1,4 +1,4 @@
-void sim(Int_t nev=100) 
+void sim(Int_t nev=VAR_EVENTS_PER_JOB)
 {
   if ( VAR_PURELY_LOCAL) {
     TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
index 786ef8aad441943f8863860a771637f55e5212c5..b547b09fa4de2c0cfd31288aba8fc10d8c551c4b 100644 (file)
@@ -43,6 +43,7 @@ CONFIG_PTHARDMAX=""
 CONFIG_QUENCHING=""
 DC_RUN=""
 DC_EVENT=""
+EVENTS_PER_JOB=""
 
 RUNMODE=""
 
@@ -82,6 +83,9 @@ while [ ! -z "$1" ]; do
             shift
     elif [ "$option" = "--sdd" ]; then
             RUNMODE="SDD"
+    elif [ "$option" = "--eventsPerJob" ]; then
+            EVENTS_PER_JOB="$1"
+            shift
     fi
 done
 
@@ -129,7 +133,12 @@ fi
 
 echo "SIMRUN:: Run $DC_RUN Event $DC_EVENT Generator $CONFIG_RUN_TYPE Field $CONFIG_FIELD Energy $CONFIG_ENERGY Physicslist $CONFIG_PHYSICSLIST"
 
-runcommand "SIMULATION" "sim.C" sim.log 5
+simCommand="sim.C"
+if [ ! -z $EVENTS_PER_JOB ]; then
+  simCommand="sim.C($EVENTS_PER_JOB)"
+fi
+
+runcommand "SIMULATION" "$simCommand" sim.log 5
 mv syswatch.log simwatch.log
 
 runcommand "RECONSTRUCTION" "rec.C" rec.log 10
index e843f3a3177f230997d1697e853219a682f7a7bb..c262a37f71a5d94c34977cba89a8ce7800b20f22 100644 (file)
@@ -285,6 +285,8 @@ fUseAODMerging(kFALSE)
     SetVar("VAR_TRIGGER_CONFIGURATION","p-p");
   }
 
+  SetVar("VAR_EVENTS_PER_JOB",Form("%i",fMaxEventsPerChunk));
+
   SetGenerator(generator);
   
   if (localOnly)
@@ -426,7 +428,7 @@ Bool_t AliMuonAccEffSubmitter::GenerateRunJDL(const char* name) const
               
   OutputToJDL(*os,"Jobtag","comment: AliMuonAccEffSubmitter RUN $1");
 
-  OutputToJDL(*os,"split","production:1-$2");
+  OutputToJDL(*os,"split","production:$2-$3");
 
   OutputToJDL(*os,"Price","1");
   
@@ -441,7 +443,7 @@ Bool_t AliMuonAccEffSubmitter::GenerateRunJDL(const char* name) const
   
   while ( ( file = static_cast<TObjString*>(next())) )
   {
-    if ( !file->String().Contains(".jdl",TString::kIgnoreCase) &&
+    if ( !file->String().Contains("jdl",TString::kIgnoreCase) &&
          !file->String().Contains("OCDB_") )
     {
       files.Add(new TObjString(Form("LF:%s/%s",RemoteDir().Data(),file->String().Data())));
@@ -481,7 +483,7 @@ Bool_t AliMuonAccEffSubmitter::GenerateRunJDL(const char* name) const
     return kFALSE;
   }
   
-  OutputToJDL(*os,"splitarguments","--run $1 --chunk #alien_counter# --event $3");
+  OutputToJDL(*os,"splitarguments","--run $1 --event #alien_counter# --eventsPerJob $4");
   
   OutputToJDL(*os,"Workdirectorysize","5000MB");
   
@@ -956,12 +958,14 @@ Int_t AliMuonAccEffSubmitter::LocalTest()
 //  out.close();
 
   gSystem->Exec("chmod +x simrun.sh");
+  gSystem->Exec("alien_cp alien:///alice/bin/aliroot_new file:");
+  gSystem->Exec("chmod u+x aliroot_new");
 
   std::cout << "Cleaning up left-over files from previous simulation/reconstructions" << std::endl;
-  
+
   gSystem->Exec("rm -rf TrackRefs.root *.SDigits*.root Kinematics.root *.Hits.root geometry.root gphysi.dat Run*.tag.root HLT*.root *.ps *.Digits.root *.RecPoints.root galice.root *QA*.root Trigger.root *.log AliESD* AliAOD* *.d *.so *.stat");
 
-  TString command = Form("./simrun.sh --run %i --event %i", runs[0], fFixedNofEvents);
+  TString command = Form("./aliroot_new --run %i --event 1 --eventsPerJob %i", runs[0], fFixedNofEvents);
 
   std::cout << "Executing the script : " << command.Data() << std::endl;
 
@@ -1118,7 +1122,7 @@ Int_t AliMuonAccEffSubmitter::Submit(Bool_t dryRun)
   //  cout << "number of generated events per MB event = " << ratio << endl;
   //  cout << endl;
   
-  std::cout << "run\tchunks\tevents" << std::endl;
+  std::cout << "run\tfirstChunk\tlastChunk\teventsPerJob" << std::endl;
   std::cout << "----------------------" << std::endl;
   
   Int_t nJobs(0);
@@ -1163,9 +1167,9 @@ Int_t AliMuonAccEffSubmitter::Submit(Bool_t dryRun)
     
     nEvts += nChunk*nEvtChunk;
     
-    std::cout << runNumber << "\t" << nChunk << "\t" << nEvtChunk << std::endl;
+    std::cout << runNumber << "\t1\t" << nChunk << "\t" << nEvtChunk << std::endl;
     
-    TString query(Form("submit %s %d %d %d", RunJDLName().Data(), runNumber, nChunk, nEvtChunk));
+    TString query(Form("submit %s %d %d %d", RunJDLName().Data(), runNumber, nChunk, nEvtChunk));
     
     std::cout << query.Data() << " ..." << std::flush;
     
index ef8df26e4f7133d783c042c84dac9381a5502c4f..1472879e3507f877a3bbdb991049ec039f0108af 100644 (file)
@@ -38,7 +38,7 @@ public:
   
   Int_t LocalTest();
   
-  TString RunJDLName() const { return "run.jdl"; }
+  TString RunJDLName() const { return "JDL"; }
 
   TString MergeJDLName(Bool_t final) const { return (final ? "AOD_merge_final.jdl" : "AOD_merge.jdl"); }
 
@@ -61,7 +61,7 @@ public:
   Bool_t SetGenerator(const char* generator);
 
   Int_t MaxEventsPerChunk() const { return fMaxEventsPerChunk; }
-  void SetMaxEventsPerChunk(Int_t n) { fMaxEventsPerChunk = n; }
+  void SetMaxEventsPerChunk(Int_t n) { fMaxEventsPerChunk = n; SetVar("VAR_EVENTS_PER_JOB", Form("%i",n)); }
 
   TString OCDBPath() const { return GetMapValue("OCDBPath"); }
   
index b84fd6a1fdfc6487c17acf88afe8816f2e4563db..cd5756fbf8cf1699cc959ee292ddb770e8122eba 100644 (file)
@@ -369,7 +369,7 @@ Bool_t AliMuonGridSubmitter::CopyTemplateFilesToLocal()
       if ( c )
       {
         Bool_t ok(kFALSE);
-        if ( stemplate.Contains(".jdl",TString::kIgnoreCase) )
+        if ( stemplate.EndsWith("jdl",TString::kIgnoreCase) )
         {
           ok = Generate(file->String().Data());
         }