]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/sim/Simulate.C
Various updates for the production scripts
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / sim / Simulate.C
index 81feb1b059c9f0017014875f48dfaec61ff5ba3f..4910a07643cae51e9d692ee24b593036c9ac6c89 100644 (file)
@@ -1,30 +1,3 @@
-/** 
- * 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)
-{
-  s.SetSpecificStorage(key, Form("alien://Folder=/alice/simulation/%s",sub));
-}
-
 /** 
  * Run the simulation 
  * 
@@ -38,6 +11,8 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   // Get GRP parameters.  Defines global "grp" as a pointer to GRPData
   //
   gROOT->Macro(Form("GRP.C(%d)", run));
+  gROOT->Macro("DetConfig.C");
+  gROOT->Macro("OCDBConfig.C");
 
   // --- Get GRP to deduce collision system --------------------------
   Bool_t         isAA  = grp->IsAA();
@@ -49,8 +24,11 @@ void Simulate(Int_t nev=1, UInt_t run=0)
   // Basic setup 
   //
   AliSimulation steer; 
-  steer.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
-  steer.SetMakeDigitsFromHits("ITS TPC");
+  TString sDigits, fromHits;
+  detCfg->GetSDigitString(sDigits);
+  detCfg->GetHits2DigitsString(fromHits);
+  steer.SetMakeSDigits(sDigits);
+  steer.SetMakeDigitsFromHits(fromHits);
 
   // -----------------------------------------------------------------
   // 
@@ -62,44 +40,19 @@ void Simulate(Int_t nev=1, UInt_t run=0)
 
   // -----------------------------------------------------------------
   //
-  // Raw OCDB
+  // OCDB and specific storages 
   // 
   AliCDBManager* cdb = AliCDBManager::Instance();
   cdb->SetDefaultStorageFromRun(grp->run);
-  // cdb->SetRun(grp.run);
-  steer.SetDefaultStorage(cdb->GetDefaultStorage()->GetURI());
-
-  // --- ITS  (1 Total) ----------------------------------------------
-  SetSpecStore(steer,"ITS/Align/Data", "2008/v4-15-Release/Ideal");
-  
-  // --- MUON (1 object) ---------------------------------------------
-  SetSpecStore(steer,"MUON/Align/Data",        "2008/v4-15-Release/Ideal"); 
-
-  // ---- TPC (6 total) ----------------------------------------------
-  SetSpecStore(steer,"TPC/Calib/TimeGain",     "2008/v4-15-Release/Ideal/");
-  SetSpecStore(steer,"TPC/Calib/ClusterParam", "2008/v4-15-Release/Ideal/");
-  SetSpecStore(steer,"TPC/Calib/AltroConfig",  "2008/v4-15-Release/Ideal/");
-  SetSpecStore(steer,"TPC/Calib/Correction",   "2008/v4-15-Release/Ideal/");
-  SetSpecStore(steer,"TPC/Align/Data",         "2008/v4-15-Release/Ideal/");
-  SetSpecStore(steer,"TPC/Calib/RecoParam",    "2008/v4-15-Release/Residual");
-  if (is10h)
-    SetSpecStore(steer,"TPC/Calib/TimeDrift",  "2008/v4-15-Release/Residual/");
-  else 
-    SetSpecStore(steer,"TPC/Calib/TimeDrift",  "2008/v4-15-Release/Ideal/");
-    
-  // --- ZDC for 2010 the following is needed ------------------------
-  // (https://savannah.cern.ch/task/?func=detailitem&item_id=33180#comment46)
-  if (is10h)
-    SetSpecStore(steer,"ZDC/Align/Data",       "2008/v4-15-Release/Ideal/"); 
-
+  ocdbCfg->Init(true);
 
   // -----------------------------------------------------------------
   // 
-  // The rest - disable QA for PbPb
+  // The rest - disable QA and HLT (memory heavy) for PbPb
   //
   if (isAA) steer.SetRunQA(":");
-  // gInterpreter->UnloadFile("GetGRP.C");
-
+  if (is10h) steer.SetRunHLT("");
+  
   TStopwatch timer;
   timer.Start();
   steer.Run(nev);