X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliDAQ.cxx;h=c8dedfb3d19c3b077146686946decde395d047b3;hb=39280342dc1b3419e5c19ebec20e216a7e6a9732;hp=1b8d2542c2503b0b6aad86cae730f593221a4bd7;hpb=0d45e1703f43f8268ca1f19eb60eb79433f50e6f;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliDAQ.cxx b/RAW/AliDAQ.cxx index 1b8d2542c25..c8dedfb3d19 100644 --- a/RAW/AliDAQ.cxx +++ b/RAW/AliDAQ.cxx @@ -50,19 +50,20 @@ const char* AliDAQ::fgkDetectorName[AliDAQ::kNDetectors] = { "TPC", "TRD", "TOF", - "RICH", // Name to be changed to HMPID + "HMPID", "PHOS", "CPV", "PMD", "MUONTRK", "MUONTRG", "FMD", - "START", // Name to be changed to T0 + "T0", "VZERO", // Name to be changed to V0 ? "ZDC", - "CRT", // Name to be changed to ACCORDE + "ACORDE", "TRG", "EMCAL", + "DAQ_TEST", "HLT" }; @@ -86,6 +87,7 @@ Int_t AliDAQ::fgkNumberOfDdls[AliDAQ::kNDetectors] = { 1, 1, 24, + 1, 10 }; @@ -109,6 +111,7 @@ Float_t AliDAQ::fgkNumberOfLdcs[AliDAQ::kNDetectors] = { 1, 1, 4, + 1, 5 }; @@ -176,33 +179,44 @@ Int_t AliDAQ::DdlIDOffset(Int_t detectorID) AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1)); return -1; } + // HLT has a DDL offset = 30 + if (detectorID == (kNDetectors-1)) return (kHLTId << 8); + return (detectorID << 8); } -const char *AliDAQ::DetectorNameFromDdlID(Int_t ddlID) +const char *AliDAQ::DetectorNameFromDdlID(Int_t ddlID,Int_t &ddlIndex) { // Returns the detector name for // a given DDL ID - Int_t detectorID = DetectorIDFromDdlID(ddlID); + ddlIndex = -1; + Int_t detectorID = DetectorIDFromDdlID(ddlID,ddlIndex); if (detectorID < 0) return ""; return DetectorName(detectorID); } -Int_t AliDAQ::DetectorIDFromDdlID(Int_t ddlID) +Int_t AliDAQ::DetectorIDFromDdlID(Int_t ddlID,Int_t &ddlIndex) { - // Returns the detector ID for - // a given DDL ID + // Returns the detector ID and + // the ddl index within the + // detector range for + // a given input DDL ID Int_t detectorID = ddlID >> 8; + + // HLT + if (detectorID == kHLTId) detectorID = kNDetectors-1; + if (detectorID < 0 || detectorID >= kNDetectors) { AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1)); return -1; } - Int_t ddlIndex = ddlID & 0xFF; + ddlIndex = ddlID & 0xFF; if (ddlIndex >= fgkNumberOfDdls[detectorID]) { AliErrorClass(Form("Invalid DDL index %d (%d -> %d) for detector %d", ddlIndex,0,fgkNumberOfDdls[detectorID],detectorID)); + ddlIndex = -1; return -1; } return detectorID; @@ -239,6 +253,45 @@ Int_t AliDAQ::DdlID(Int_t detectorID, Int_t ddlIndex) return ddlID; } +const char *AliDAQ::DdlFileName(const char *detectorName, Int_t ddlIndex) +{ + // Returns the DDL file name + // (used in the simulation) starting from + // the detector name and the DDL + // index inside the detector + Int_t detectorID = DetectorID(detectorName); + if (detectorID < 0) + return ""; + + return DdlFileName(detectorID,ddlIndex); +} + +const char *AliDAQ::DdlFileName(Int_t detectorID, Int_t ddlIndex) +{ + // Returns the DDL file name + // (used in the simulation) starting from + // the detector ID and the DDL + // index inside the detector + Int_t ddlID = DdlIDOffset(detectorID); + if (ddlID < 0) + return ""; + + if (ddlIndex >= fgkNumberOfDdls[detectorID]) { + AliErrorClass(Form("Invalid DDL index %d (%d -> %d) for detector %d", + ddlIndex,0,fgkNumberOfDdls[detectorID],detectorID)); + return ""; + } + + ddlID += ddlIndex; + static TString fileName; + + fileName = DetectorName(detectorID); + fileName += "_"; + fileName += ddlID; + fileName += ".ddl"; + return fileName.Data(); +} + Int_t AliDAQ::NumberOfDdls(const char *detectorName) { // Returns the number of DDLs for