+
+const char *AliDAQ::ListOfTriggeredDetectors(UInt_t detectorPattern)
+{
+ // Returns a string with the list of
+ // active detectors. The input is the
+ // trigger pattern word contained in
+ // the raw-data event header.
+
+ static TString detList;
+ detList = "";
+ for(Int_t iDet = 0; iDet < (kNDetectors-1); iDet++) {
+ if ((detectorPattern >> iDet) & 0x1) {
+ detList += fgkDetectorName[iDet];
+ detList += " ";
+ }
+ }
+
+ // Always remember HLT
+ if ((detectorPattern >> kHLTId) & 0x1) detList += fgkDetectorName[kNDetectors-1];
+
+ return detList.Data();
+}
+
+UInt_t AliDAQ::DetectorPattern(const char *detectorList)
+{
+ // Returns a 32-bit word containing the
+ // the detector pattern corresponding to a given
+ // list of detectors
+ UInt_t pattern = 0;
+ TString detList = detectorList;
+ for(Int_t iDet = 0; iDet < (kNDetectors-1); iDet++) {
+ TString det = fgkDetectorName[iDet];
+ if((detList.CompareTo(det) == 0) ||
+ detList.BeginsWith(det) ||
+ detList.EndsWith(det) ||
+ detList.Contains( " "+det+" " )) pattern |= (1 << iDet) ;
+ }
+
+ // HLT
+ TString hltDet = fgkDetectorName[kNDetectors-1];
+ if((detList.CompareTo(hltDet) == 0) ||
+ detList.BeginsWith(hltDet) ||
+ detList.EndsWith(hltDet) ||
+ detList.Contains( " "+hltDet+" " )) pattern |= (1 << kHLTId) ;
+
+ return pattern;
+}
+
+const char *AliDAQ::OfflineModuleName(const char *detectorName)
+{
+ // Returns the name of the offline module
+ // for a given detector (online naming convention)
+ Int_t detectorID = DetectorID(detectorName);
+ if (detectorID < 0)
+ return "";
+
+ return OfflineModuleName(detectorID);
+}
+
+const char *AliDAQ::OfflineModuleName(Int_t detectorID)
+{
+ // Returns the name of the offline module
+ // for a given detector (online naming convention)
+ if (detectorID < 0 || detectorID >= kNDetectors) {
+ AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1));
+ return "";
+ }
+
+ return fgkOfflineModuleName[detectorID];
+}
+
+const char *AliDAQ::OnlineName(const char *detectorName)
+{
+ // Returns the name of the online detector name (3 characters)
+ // for a given detector
+ Int_t detectorID = DetectorID(detectorName);
+ if (detectorID < 0)
+ return "";
+
+ return OnlineName(detectorID);
+}
+
+const char *AliDAQ::OnlineName(Int_t detectorID)
+{
+ // Returns the name of the online detector name (3 characters)
+ // for a given detector
+ if (detectorID < 0 || detectorID >= kNDetectors) {
+ AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1));
+ return "";
+ }
+
+ return fgkOnlineName[detectorID];
+}
+