+ // see header file for function documentation
+
+ // BAD: unit test fails if I call TGeoGlobalMagField::Instance()
+ // at this point. Something goes wrong in the cleaning of the global
+ // ROOT onject
+ /*
+ if (TGeoGlobalMagField::Instance()->GetField()) {
+ // everything set, but think about storing the currents for
+ // a cross-check
+ return 0;
+ }
+ */
+
+ // The magnetic field is initialized once at the start
+ // of run. The fields are supposed to be constant througout the
+ // data taking of one run. The run is aborted if the changes
+ // exceed a certain limit.
+ AliGRPManager grpman;
+ if (grpman.ReadGRPEntry() && grpman.SetMagField()) {
+ return 0;
+ }
+
+ return -ENOENT;
+}
+
+AliHLTUInt64_t AliHLTMiscImplementation::GetTriggerMask(AliRawReader* rawReader) const
+{
+ // see header file for function documentation
+ if (!rawReader) return 0;
+ AliHLTUInt64_t trgMask=0;
+ if (rawReader) {
+ const UInt_t* pattern=rawReader->GetTriggerPattern();
+ trgMask=pattern[1]&0xfffffff; // 28 upper bits of the 50 bit mask
+ trgMask<<=32;
+ trgMask|=pattern[0]; // 32 lower bits of the mask
+ }
+ return trgMask;
+}
+
+AliHLTUInt32_t AliHLTMiscImplementation::GetTimeStamp(AliRawReader* rawReader) const
+{
+ // extract time stamp of the event from the event header
+ if (!rawReader) return 0;
+ const AliRawEventHeaderBase* eventHeader = rawReader->GetEventHeader();
+ if (!eventHeader) return 0;
+ return eventHeader->Get("Timestamp");
+}
+
+AliHLTUInt32_t AliHLTMiscImplementation::GetEventType(AliRawReader* rawReader) const
+{
+ // extract event type from the event header
+ if (!rawReader) return 0;
+ const AliRawEventHeaderBase* eventHeader = rawReader->GetEventHeader();
+ if (!eventHeader) return 0;
+ return eventHeader->Get("Type");
+}
+
+const char* AliHLTMiscImplementation::GetBeamTypeFromGRP() const
+{
+ // get beam type from GRP
+ return NULL;
+}
+
+Double_t AliHLTMiscImplementation::GetBz()
+{
+ // Returns Bz.
+ return AliTracker::GetBz();
+}
+
+Double_t AliHLTMiscImplementation::GetBz(const Double_t *r)
+{
+ // Returns Bz (kG) at the point "r" .
+ return AliTracker::GetBz(r);
+}
+
+void AliHLTMiscImplementation::GetBxByBz(const Double_t r[3], Double_t b[3])
+{
+ // Returns Bx, By and Bz (kG) at the point "r" .
+ return AliTracker::GetBxByBz(r, b);
+}
+
+const TClass* AliHLTMiscImplementation::IsAliESDHLTDecision() const
+{
+ // Return the IsA of the AliESDHLTDecision class
+#ifndef HAVE_NOT_ALIESDHLTDECISION
+ return AliESDHLTDecision::Class();
+#else // HAVE_NOT_ALIESDHLTDECISION
+ return NULL;
+#endif // HAVE_NOT_ALIESDHLTDECISION
+}
+
+int AliHLTMiscImplementation::Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* object) const
+{
+ // Copy HLT global trigger decision to AliESDHLTDecision container
+ if (!pDecision || !object) return -EINVAL;
+#ifndef HAVE_NOT_ALIESDHLTDECISION
+ AliESDHLTDecision* pESDHLTDecision=NULL;
+ if (object->IsA()==NULL ||
+ object->IsA() != AliESDHLTDecision::Class() ||
+ (pESDHLTDecision=dynamic_cast<AliESDHLTDecision*>(object))==NULL) {
+// HLTError("can not copy HLT global decision to object of class \"%s\"",
+// object->IsA()?object->IsA()->GetName():"NULL");
+ return -EINVAL;
+ }
+
+ pESDHLTDecision->~AliESDHLTDecision();
+ new (pESDHLTDecision) AliESDHLTDecision(pDecision->Result(), pDecision->GetTitle());
+
+#endif // HAVE_NOT_ALIESDHLTDECISION
+ return 0;
+}
+
+int AliHLTMiscImplementation::InitStreamerInfos(const char* ocdbEntry) const
+{
+ // init streamer infos for HLT reconstruction
+ // Root schema evolution is not enabled for AliHLTMessage and all streamed objects.
+ // Objects in the raw data payload rely on the availability of the correct stream info.
+ // The relevant streamer info for a specific run is stored in the OCDB.