Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions Detectors/HMPID/base/include/HMPIDBase/Geo.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,32 @@ class ReadOut
uint8_t Cru;
uint8_t Lnk;
uint8_t Flp;
std::string_view FlpHostName;
};
union Lnk {
LinkAddr Id;
uint32_t LinkUId;
};
static constexpr Lnk mEq[Geo::MAXEQUIPMENTS] = {{0, 0, 0, 160},
{1, 0, 1, 160},
{2, 0, 2, 160},
{3, 0, 3, 160},
{4, 1, 0, 160},
{5, 1, 1, 160},
{8, 1, 2, 160},
{9, 1, 3, 160},
{6, 2, 0, 161},
{7, 2, 1, 161},
{10, 2, 2, 161},
{11, 3, 0, 161},
{12, 3, 1, 161},
{13, 3, 2, 161}};
static constexpr Lnk mEq[Geo::MAXEQUIPMENTS] = {{0, 0, 0, 160, "alio-cr1-flp160"},
{1, 0, 1, 160, "alio-cr1-flp160"},
{2, 0, 2, 160, "alio-cr1-flp160"},
{3, 0, 3, 160, "alio-cr1-flp160"},
{4, 1, 0, 160, "alio-cr1-flp160"},
{5, 1, 1, 160, "alio-cr1-flp160"},
{8, 1, 2, 160, "alio-cr1-flp160"},
{9, 1, 3, 160, "alio-cr1-flp160"},
{6, 2, 0, 161, "alio-cr1-flp161"},
{7, 2, 1, 161, "alio-cr1-flp161"},
{10, 2, 2, 161, "alio-cr1-flp161"},
{11, 3, 0, 161, "alio-cr1-flp161"},
{12, 3, 1, 161, "alio-cr1-flp161"},
{13, 3, 2, 161, "alio-cr1-flp161"}};

static inline int FeeId(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Fee; };
static inline int CruId(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Cru; };
static inline int LnkId(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Lnk; };
static inline int FlpId(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].Id.Flp; };
static inline std::string_view FlpHostName(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? "" : mEq[idx].Id.FlpHostName; };
static inline uint32_t UniqueId(unsigned int idx) { return (idx > Geo::MAXEQUIPMENTS) ? -1 : mEq[idx].LinkUId; };

static unsigned int searchIdx(int FeeId)
Expand Down
6 changes: 4 additions & 2 deletions Detectors/HMPID/simulation/src/HmpidCoder2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ void HmpidCoder2::openOutputStream(const std::string& outputFileName, const std:
rdh.endPointID = 0;
std::string outfname;
if (fileFor == "link") {
outfname = fmt::format("{}_L{}.raw", outputFileName, ReadOut::FeeId(eq));
outfname = fmt::format("{}_{}_feeid{}.raw", outputFileName, ReadOut::FlpHostName(eq), ReadOut::FeeId(eq));
} else if (fileFor == "flp") {
outfname = fmt::format("{}_flp{}.raw", outputFileName, ReadOut::FlpId(eq));
outfname = fmt::format("{}_{}.raw", outputFileName, ReadOut::FlpHostName(eq));
} else if (fileFor == "all") {
outfname = fmt::format("{}.raw", outputFileName);
} else if (fileFor == "cru") {
outfname = fmt::format("{}_{}.raw", outputFileName, ReadOut::FlpHostName(eq));
} else {
throw std::runtime_error(fmt::format("unknown raw file grouping option {}", fileFor));
}
Expand Down
2 changes: 1 addition & 1 deletion Detectors/HMPID/workflow/src/DigitsToRawSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ o2::framework::DataProcessorSpec getDigitsToRawSpec()
outputs,
AlgorithmSpec{adaptFromTask<DigitsToRawSpec>()},
Options{{"outdir", VariantType::String, "./", {"base dir for output file"}},
{"file-for", VariantType::String, "all", {"single file per: all,flp,link"}},
{"file-for", VariantType::String, "all", {"single file per: all,flp,link,cru"}},
{"outfile", VariantType::String, "hmpid", {"base name for output file"}},
{"in-file", VariantType::String, "hmpiddigits.root", {"name of the input sim root file"}},
{"dump-digits", VariantType::Bool, false, {"out the digits file in /tmp/hmpDumpDigits.dat"}},
Expand Down