X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2Ftrigger%2FAliHLTGlobalTriggerConfig.cxx;h=6f9b62b35d831a03932a1a83a0359f133f06bfb1;hb=3f71076bf53c415c4c5ff2dd89561e85c280c361;hp=4a0e8d3dbffd04121d98f7f4a08befc41bc97cbe;hpb=4d40957a1b27b9d1e621c47e4426b8fe3936c0b5;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/trigger/AliHLTGlobalTriggerConfig.cxx b/HLT/trigger/AliHLTGlobalTriggerConfig.cxx index 4a0e8d3dbff..6f9b62b35d8 100644 --- a/HLT/trigger/AliHLTGlobalTriggerConfig.cxx +++ b/HLT/trigger/AliHLTGlobalTriggerConfig.cxx @@ -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.