]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the possibility to specify the trigger configuration in the Config.C and then...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Apr 2006 13:44:16 +0000 (13:44 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Apr 2006 13:44:16 +0000 (13:44 +0000)
STEER/AliSimulation.cxx

index 61bdac1ef8ff5d50091bfbcbe4f022294a2e1070..a18a2e0022bbbeea0691c600d4664b5eac1a71a4 100644 (file)
@@ -613,10 +613,8 @@ Bool_t AliSimulation::Run(Int_t nEvents)
   }
 
   // digits -> trigger
-  if (!fMakeTrigger.IsNull()) {
-    if (!RunTrigger(fMakeTrigger)) {
-      if (fStopOnError) return kFALSE;
-    }
+  if (!RunTrigger(fMakeTrigger)) {
+    if (fStopOnError) return kFALSE;
   }
 
   // digits -> raw data
@@ -642,6 +640,16 @@ Bool_t AliSimulation::RunTrigger(const char* descriptors)
    if (!runLoader) return kFALSE;
    TString des = descriptors;
 
+   if (des.IsNull()) {
+     if (gAlice->GetTriggerDescriptor() != "") {
+       des = gAlice->GetTriggerDescriptor();
+     }
+     else {
+       AliWarning("No trigger descriptor is specified. Skipping the trigger simulation...");
+       return kTRUE;
+     }
+   }
+
    runLoader->MakeTree( "CT" );
    AliCentralTrigger* aCTP = runLoader->GetTrigger();
   // Load Descriptors
@@ -698,6 +706,16 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents)
     gAlice->Init(fConfigFileName.Data());
   ););
 
+  // Get the trigger descriptor string
+  // Either from AliSimulation or from
+  // gAlice
+  if (fMakeTrigger.IsNull()) {
+    if (gAlice->GetTriggerDescriptor() != "")
+      fMakeTrigger = gAlice->GetTriggerDescriptor();
+  }
+  else
+    gAlice->SetTriggerDescriptor(fMakeTrigger.Data());
+
   // Set run number in CDBManager
   AliCDBManager::Instance()->SetRun(gAlice->GetRunNumber());
   AliInfo(Form("Run number: %d",AliCDBManager::Instance()->GetRun()));