+bool AliHLTMUONAgent::IsMuonModuleLoaded()
+{
+ // Checks to see if the MUON module is loaded or not.
+
+ // If the check was already done then use the cached value.
+ if (fgMuonModuleLoaded > 0) return true;
+ if (fgMuonModuleLoaded < 0) return false;
+
+ bool haveMuonModule = false;
+ if (gAlice != NULL)
+ {
+ // Search for a module in gAlice deriving from AliMUON.
+ TIter next(gAlice->Modules());
+ TObject* mod = NULL;
+ while ((mod = next()) != NULL)
+ {
+ if (mod->IsA() == AliMUON::Class())
+ {
+ fgMuonModuleLoaded = 1;
+ return true;
+ }
+ }
+ }
+ else
+ {
+ fgMuonModuleLoaded = -1;
+ return false;
+ }
+}
+
+