+
+int AliHLTComponent::LoggingVarargs(AliHLTComponentLogSeverity severity,
+ const char* originClass, const char* originFunc,
+ const char* file, int line, ... ) const
+{
+ // see header file for function documentation
+ int iResult=0;
+
+ va_list args;
+ va_start(args, line);
+
+ // logging function needs to be const in order to be called from const member functions
+ // without problems. But at this point we face the problem with virtual members which
+ // are not necessarily const.
+ AliHLTComponent* nonconst=const_cast<AliHLTComponent*>(this);
+ AliHLTLogging::SetLogString(this, ", %p", "%s (%s_pfmt_): ",
+ fChainId[0]!=0?fChainId.c_str():nonconst->GetComponentID(),
+ nonconst->GetComponentID());
+ iResult=SendMessage(severity, originClass, originFunc, file, line, AliHLTLogging::BuildLogString(NULL, args, true /*append*/));
+ va_end(args);
+
+ return iResult;
+}
+
+int AliHLTComponent::ScanECSParam(const char* ecsParam)
+{
+ // see header file for function documentation
+
+ // format of the parameter string from ECS
+ // <command>;<parameterkey>=<parametervalue>;<parameterkey>=<parametervalue>;...
+ // search for a subset of the parameterkeys
+ // RUN_TYPE=
+ // RUN_NUMBER=
+ // HLT_IN_DDL_LIST=
+ // CTP_TRIGGER_CLASS=
+ // DATA_FORMAT_VERSION=
+ // BEAM_TYPE=
+ // HLT_OUT_DDL_LIST=
+ // HLT_TRIGGER_CODE=
+ // DETECTOR_LIST=
+ // HLT_MODE=
+ // The command apears not to be sent by the online framework
+ int iResult=0;
+ TString string=ecsParam;
+ TObjArray* parameter=string.Tokenize(";");
+ if (parameter) {
+ for (int i=0; i<parameter->GetEntriesFast(); i++) {
+ TString entry=((TObjString*)parameter->At(i))->GetString();
+ HLTDebug("scanning ECS entry: %s", entry.Data());
+ TObjArray* entryParams=entry.Tokenize("=");
+ if (entryParams) {
+ if (entryParams->GetEntriesFast()>1) {
+ if ((((TObjString*)entryParams->At(0))->GetString()).CompareTo("CTP_TRIGGER_CLASS")==0) {
+ int result=InitCTPTriggerClasses((((TObjString*)entryParams->At(1))->GetString()).Data());
+ if (iResult>=0 && result<0) iResult=result;
+ } else {
+ // TODO: scan the other parameters
+ // e.g. consistency check of run number
+ }
+ }
+ delete entryParams;
+ }
+ }
+ delete parameter;
+ }
+
+ return iResult;
+}
+
+int AliHLTComponent::SetupCTPData()
+{
+ // see header file for function documentation
+ if (fpCTPData) delete fpCTPData;
+ fpCTPData=new AliHLTCTPData;
+ if (!fpCTPData) return -ENOMEM;
+ return 0;
+}
+
+int AliHLTComponent::InitCTPTriggerClasses(const char* ctpString)
+{
+ // see header file for function documentation
+ if (!fpCTPData) return 0; // silently accept as the component has to announce that it want's the CTP info
+ return fpCTPData->InitCTPTriggerClasses(ctpString);
+}
+
+bool AliHLTComponent::EvaluateCTPTriggerClass(const char* expression, AliHLTComponentTriggerData& trigData) const
+{
+ // see header file for function documentation
+ if (!fpCTPData) {
+ static bool bWarningThrown=false;
+ if (!bWarningThrown) HLTError("Trigger classes not initialized, use SetupCTPData from DoInit()");
+ bWarningThrown=true;
+ return false;
+ }
+
+ return fpCTPData->EvaluateCTPTriggerClass(expression, trigData);
+}
+
+Double_t AliHLTComponent::GetBz()
+{
+ // Returns Bz.
+ return AliHLTMisc::Instance().GetBz();
+}
+
+Double_t AliHLTComponent::GetBz(const Double_t *r)
+{
+ // Returns Bz (kG) at the point "r" .
+ return AliHLTMisc::Instance().GetBz(r);
+}
+
+void AliHLTComponent::GetBxByBz(const Double_t r[3], Double_t b[3])
+{
+ // Returns Bx, By and Bz (kG) at the point "r" .
+ AliHLTMisc::Instance().GetBxByBz(r, b);
+}