]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/STEER/AliSimulation.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / STEER / STEER / AliSimulation.cxx
index aba83883e4da5b934e8de03dcb486760b2d588b9..f254ddb919ae6a1add6c2e4acf474448646bbf74 100644 (file)
 // The number of events per file has to be set before the simulation of      //
 // hits. Otherwise it has no effect.                                         //
 //                                                                           //
+// The trigger configuration is set by the method SetTriggerConfig(X)        //
+// X can take three kinds of values                                          //
+//                                                                           //
+//  - The exact string "none" - case insensitive.  In this case, not trigger //
+//    information is generated from the digits.                              //
+//  - The empty string or "ocdb" - case insensitive.  In this case the       //
+//    trigger configuration is read from OCDB                                //
+//  - Some string - say "p-p" - in which case the configuration is read from //
+//    fixed files in $ALICE_ROOT/GRP/CTP/ - say $ALICE_ROOT/GRP/CTP/p-p.cfg  //
+//                                                                           //
+// Default is to read from OCDB.                                             //
+//                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 #include <TFile.h>
@@ -731,8 +743,13 @@ Bool_t AliSimulation::Run(Int_t nEvents)
   AliSysInfo::AddStamp("Hits2Digits");
   
   
-  // digits -> trigger
-  if (!fTriggerConfig.IsNull() && !RunTrigger(fTriggerConfig,fMakeDigits)) {
+  // digits -> trigger.  Set trigger configuration to "none" - any
+  // case - to not generate the trigger information.  Set the trigger
+  // configuration to some string X to read from file at
+  // $ALICE_ROOT/GRP/CTP/X.  Set the trigger configuration to the
+  // empty string or "ocdb" - any case - to read from OCDB.
+  if (!fTriggerConfig.EqualTo("none",TString::kIgnoreCase) && 
+      !RunTrigger(fTriggerConfig,fMakeDigits)) {
     if (fStopOnError) return kFALSE;
   }
 
@@ -849,7 +866,6 @@ Bool_t AliSimulation::RunLego(const char *setup, Int_t nc1, Float_t c1min,
     AliError("gAlice was already run. Restart aliroot and try again.");
     return kFALSE;
   }
-
   AliInfo(Form("initializing gAlice with config file %s",
           fConfigFileName.Data()));
 
@@ -877,6 +893,17 @@ Bool_t AliSimulation::RunLego(const char *setup, Int_t nc1, Float_t c1min,
 
   gAlice->Announce();
 
+  // - cholm - Add this here for consitency 
+  // If requested set the mag. field from the GRP entry.
+  // After this the field is loccked and cannot be changed by Config.C
+  if (fUseMagFieldFromGRP) {
+    AliGRPManager grpM;
+    grpM.ReadGRPEntry();
+    grpM.SetMagField();
+    AliInfo("Field is locked now. It cannot be changed in Config.C");
+  
+  }
+  
   gROOT->LoadMacro(setup);
   gInterpreter->ProcessLine(gAlice->GetConfigFunction());
 
@@ -1330,7 +1357,7 @@ Bool_t AliSimulation::RunSDigitization(const char* detectors)
       AliCodeTimerStart(Form("creating summable digits for %s", det->GetName()));
       det->Hits2SDigits();
       AliCodeTimerStop(Form("creating summable digits for %s", det->GetName()));
-      AliSysInfo::AddStamp(Form("Digit_%s_%d",det->GetName(),eventNr), 0,1, eventNr);
+      AliSysInfo::AddStamp(Form("SDigit_%s_%d",det->GetName(),eventNr), 0,1, eventNr);
     }
   }
 
@@ -1351,7 +1378,6 @@ Bool_t AliSimulation::RunDigitization(const char* detectors,
                                      const char* excludeDetectors)
 {
 // run the digitization and produce digits from sdigits
-
   AliCodeTimerAuto("",0)
 
   // initialize CDB storage, run number, set CDB lock
@@ -1396,6 +1422,7 @@ Bool_t AliSimulation::RunDigitization(const char* detectors,
     }
     detArr.AddLast(digitizer);    
     AliInfo(Form("Created digitizer from SDigits -> Digits for %s", det->GetName()));    
+
   }
   //
   if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
@@ -1411,11 +1438,14 @@ Bool_t AliSimulation::RunDigitization(const char* detectors,
     digInp.InitEvent(); //this must be after call of Connect Input tress.
     if (outRl) outRl->SetEventNumber(eventsCreated-1);
     static_cast<AliStream*>(digInp.GetInputStream(0))->ImportgAlice(); // use gAlice of the first input stream
-    for (int id=0;id<ndigs;id++) ((AliDigitizer*)detArr[id])->Digitize("");
+    for (int id=0;id<ndigs;id++) {
+      ((AliDigitizer*)detArr[id])->Digitize("");
+      AliSysInfo::AddStamp(Form("Digit_%s_%d",detArr[id]->GetName(),eventsCreated), 0,2, eventsCreated);       
+    }
     digInp.FinishEvent();
   };
   digInp.FinishGlobal();
-  //
+  // 
   return kTRUE;
 }