X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=RAW%2FAliDAQ.cxx;h=a82473a06fd83f1005e26bec4e372405c4c0c09f;hb=20e6c4f44f51cbad386fffb7ed2c24ab257d0a69;hp=98d1c79cfc1b82c0d0da01c3435e19dc912a0d76;hpb=ababa197709bb902695a4f6f5e8474dfd0bf11b3;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliDAQ.cxx b/RAW/AliDAQ.cxx index 98d1c79cfc1..a82473a06fd 100644 --- a/RAW/AliDAQ.cxx +++ b/RAW/AliDAQ.cxx @@ -60,9 +60,10 @@ const char* AliDAQ::fgkDetectorName[AliDAQ::kNDetectors] = { "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,9 +111,58 @@ Float_t AliDAQ::fgkNumberOfLdcs[AliDAQ::kNDetectors] = { 1, 1, 4, + 1, 5 }; +const char* AliDAQ::fgkOfflineModuleName[AliDAQ::kNDetectors] = { + "ITS", + "ITS", + "ITS", + "TPC", + "TRD", + "TOF", + "HMPID", + "PHOS", + "CPV", + "PMD", + "MUON", + "MUON", + "FMD", + "T0", + "VZERO", + "ZDC", + "ACORDE", + "CTP", + "EMCAL", + "", + "HLT" +}; + +const char* AliDAQ::fgkOnlineName[AliDAQ::kNDetectors] = { + "SPD", + "SDD", + "SSD", + "TPC", + "TRD", + "TOF", + "HMP", + "PHS", + "CPV", + "PMD", + "MCH", + "MTR", + "FMD", + "T00", + "V00", + "ZDC", + "ACO", + "TRI", + "EMC", + "TST", + "HLT" +}; + AliDAQ::AliDAQ(const AliDAQ& source) : TObject(source) { @@ -176,6 +227,9 @@ 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); } @@ -198,6 +252,10 @@ Int_t AliDAQ::DetectorIDFromDdlID(Int_t ddlID,Int_t &ddlIndex) // 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; @@ -273,7 +331,9 @@ const char *AliDAQ::DdlFileName(Int_t detectorID, Int_t ddlIndex) } ddlID += ddlIndex; - TString fileName = DetectorName(detectorID); + static TString fileName; + + fileName = DetectorName(detectorID); fileName += "_"; fileName += ddlID; fileName += ".ddl"; @@ -330,15 +390,110 @@ void AliDAQ::PrintConfig() { // Print the DAQ configuration // for all the detectors - printf("====================================================================\n" - "| ALICE Data Acquisition Configuration |\n" - "====================================================================\n" - "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs |\n" - "====================================================================\n"); + printf("===================================================================================================\n" + "| ALICE Data Acquisition Configuration |\n" + "===================================================================================================\n" + "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs | Online Name | AliRoot Module |\n" + "===================================================================================================\n"); for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { - printf("|%11d |%13s |%10d |%9d |%9.1f |\n", - iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet)); + printf("|%11d |%13s |%10d |%9d |%9.1f |%11s |%14s |\n", + iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet), + OnlineName(iDet),OfflineModuleName(iDet)); } - printf("====================================================================\n"); + printf("===================================================================================================\n"); } + +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]; +} +