]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/trigger/AliHLTGlobalTriggerConfig.cxx
AliHLTTPCCATrackerComponent: seg fault protection
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTriggerConfig.cxx
index 4a0e8d3dbffd04121d98f7f4a08befc41bc97cbe..6f9b62b35d831a03932a1a83a0359f133f06bfb1 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        *
  * ALICE Experiment at CERN, All rights reserved.                         *
@@ -71,6 +72,24 @@ void AliHLTGlobalTriggerConfig::Clear()
 }
 
 
+void AliHLTGlobalTriggerConfig::AddSymbol(
+    const char* name, const char* type, const char* defaultExpr
+  )
+{
+  // Adds a new constant symbol to the trigger menu.
+  
+  if (fgMenu == NULL) NewMenu("");
+  
+  AliHLTTriggerMenuSymbol entry;
+  entry.Name(name);
+  entry.Type(type);
+  entry.ObjectClass("");
+  entry.AssignExpression("");
+  entry.DefaultValue(defaultExpr);
+  fgMenu->AddSymbol(entry);
+}
+
+
 void AliHLTGlobalTriggerConfig::AddSymbol(
     const char* name, const char* type, const char* assignExpr,
     const char* defaultExpr, const char* className
@@ -172,6 +191,59 @@ void AliHLTGlobalTriggerConfig::AddSymbol(
   entry.BlockType(blockType, origin, spec);
   fgMenu->AddSymbol(entry);
 }
+    
+    
+void AliHLTGlobalTriggerConfig::AddItem(
+    UInt_t priority, const char* conditionExpr, const char* domainExpr,
+    UInt_t prescalar, const char* description, bool defaultResult
+  )
+{
+  // Adds a new entry to the trigger menu with a particular priority.
+  
+  if (fgMenu == NULL) NewMenu("");
+  
+  AliHLTTriggerMenuItem entry;
+  entry.TriggerCondition(conditionExpr);
+  entry.MergeExpression(domainExpr);
+  entry.PreScalar(prescalar);
+  entry.Priority(priority);
+  entry.DefaultResult(defaultResult);
+  if (description != NULL) entry.Description(description);
+  fgMenu->AddItem(entry);
+}
+
+
+void AliHLTGlobalTriggerConfig::AddItem(
+    UInt_t priority, const char* conditionExpr, const char* domainExpr,
+    const char* description, Double_t scaledown, bool defaultResult
+  )
+{
+  // Adds a new entry to the trigger menu with a particular priority.
+  
+  if (scaledown < 0)
+  {
+    cerr << "ERROR: Cannot have a scale-down value smaller than 0. But a value of "
+         << scaledown << " was specified. The valid range is [0..100]." << endl;
+    return;
+  }
+  if (scaledown < 0)
+  {
+    cerr << "ERROR: Cannot have a scale-down value larger than 100. But a value of "
+         << scaledown << " was specified. The valid range is [0..100]." << endl;
+    return;
+  }
+  
+  if (fgMenu == NULL) NewMenu("");
+  
+  AliHLTTriggerMenuItem entry;
+  entry.TriggerCondition(conditionExpr);
+  entry.MergeExpression(domainExpr);
+  entry.Priority(priority);
+  entry.ScaleDown(scaledown / 100.);
+  entry.DefaultResult(defaultResult);
+  if (description != NULL) entry.Description(description);
+  fgMenu->AddItem(entry);
+}
 
 
 void AliHLTGlobalTriggerConfig::AddItem(
@@ -184,7 +256,7 @@ void AliHLTGlobalTriggerConfig::AddItem(
   if (fgMenu == NULL) NewMenu("");
   
   AliHLTTriggerMenuItem entry;
-  entry.TriggerCondision(conditionExpr);
+  entry.TriggerCondition(conditionExpr);
   entry.MergeExpression(domainExpr);
   entry.PreScalar(prescalar);
   if (description != NULL) entry.Description(description);
@@ -201,13 +273,67 @@ void AliHLTGlobalTriggerConfig::AddItem(
   if (fgMenu == NULL) NewMenu("");
   
   AliHLTTriggerMenuItem entry;
-  entry.TriggerCondision(conditionExpr);
+  entry.TriggerCondition(conditionExpr);
   entry.MergeExpression(domainExpr);
   if (description != NULL) entry.Description(description);
   fgMenu->AddItem(entry);
 }
 
 
+void AliHLTGlobalTriggerConfig::SetDefaultTriggerDescription(const char* description)
+{
+  // Sets the default trigger decription.
+  
+  if (fgMenu == NULL) NewMenu("");
+  fgMenu->DefaultDescription(description);
+}
+
+
+void AliHLTGlobalTriggerConfig::SetDefaultTriggerDomain(const AliHLTTriggerDomain& domain)
+{
+  // Sets the default trigger domain.
+  
+  if (fgMenu == NULL) NewMenu("");
+  fgMenu->DefaultTriggerDomain(domain);
+}
+
+
+AliHLTTriggerDomain& AliHLTGlobalTriggerConfig::DefaultTriggerDomain()
+{
+  // Returns the default trigger domain for the current trigger menu.
+  
+  if (fgMenu == NULL) NewMenu("");
+  return fgMenu->DefaultTriggerDomain();
+}
+
+
+void AliHLTGlobalTriggerConfig::SetDefaultConditionOperator(const char* op)
+{
+  // Sets the default operator for trigger condition merging.
+  
+  if (fgMenu == NULL) NewMenu("");
+  fgMenu->DefaultConditionOperator(op);
+}
+
+
+void AliHLTGlobalTriggerConfig::SetDefaultDomainOperator(const char* op)
+{
+  // Sets the default operator for trigger domain merging.
+  
+  if (fgMenu == NULL) NewMenu("");
+  fgMenu->DefaultDomainOperator(op);
+}
+
+
+void AliHLTGlobalTriggerConfig::SetDefaultResult(bool value)
+{
+  // Sets the default result when no item is matched.
+  
+  if (fgMenu == NULL) NewMenu("");
+  fgMenu->DefaultResult(value);
+}
+
+
 void AliHLTGlobalTriggerConfig::Print(Option_t* option) const
 {
   // Prints the contents of the current trigger menu being manipulated.