Skip to content
Snippets Groups Projects
Commit 949eb8e5 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'ctpx_update' into 'main'

TrigConfData, TrigConfIO: update of the L1CTPFiles structure to add CTPX switch matrix.

See merge request !67862
parents 96ff000c b12d2b9d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@ namespace TrigConf {
enum MuctpiAccess { RoiMaskA, RoiMaskC, PtLutBarrel, PtLutEndcap };
static const std::map<MuctpiAccess, std::string> s_keyMap;
// Register the multiplexed inputs (phase) to the CTPCORE (direct electrical and from CTPIN)
class CTPCoreInput {
public:
enum InputType { PIT, DIR, NONE };
......@@ -58,11 +59,28 @@ namespace TrigConf {
size_t phase() const { return m_phase; }
InputType inputType() const { return m_inputType; }
private:
size_t m_inputNumber;
std::string m_name;
size_t m_bit;
size_t m_phase;
InputType m_inputType;
size_t m_inputNumber; // internal Trigger Menu Compiler index
std::string m_name; // trigger threshold name, a label for input to the CTP
size_t m_bit; // number of multiplicity bits of the threshold (it can typically have multiplicity up to 7, so up to 3 bits)
size_t m_phase; // double data rate flag, a parameter saying if the input comes on the rising or falling edge
InputType m_inputType; // input tag, clarifying the origin or a group of the inputs
};
// Register the CTPCORE inputs to the CTPCORE switch matrix
class CTPCoreCTPXInput {
public:
enum InputType { CTPX, NONE };
CTPCoreCTPXInput(size_t inputNumber, const std::string& name, size_t bit, InputType inputType) :
m_inputNumber(inputNumber), m_name(name), m_bit(bit), m_inputType(inputType) {}
size_t inputNumber() const { return m_inputNumber; }
std::string name() const { return m_name; }
size_t bit() const { return m_bit; }
InputType inputType() const { return m_inputType; }
private:
size_t m_inputNumber; // internal Trigger Menu Compiler index
std::string m_name; // trigger threshold name, a label for input to the CTP
size_t m_bit; // number of multiplicity bits of the threshold (it can typically have multiplicity up to 7, so up to 3 bits)
InputType m_inputType; // input tag, clarifying the origin or a group of the inputs
};
class CTPInCounter {
......@@ -170,6 +188,7 @@ namespace TrigConf {
void set_Muctpi_Nbits(std::vector<uint32_t> data);
void set_Tmc_CtpcoreInputs(std::vector<TrigConf::L1CTPFiles::CTPCoreInput> data);
void set_Tmc_CtpcoreCTPXInputs(std::vector<TrigConf::L1CTPFiles::CTPCoreCTPXInput> data);
void set_Tmc_CtpinCounters(std::vector<TrigConf::L1CTPFiles::CTPInCounter> data);
void set_Tmc_CtpmonCounters(std::vector<TrigConf::L1CTPFiles::CTPMonCounter> data);
......@@ -226,6 +245,7 @@ namespace TrigConf {
* L1 TMC output informaion
*/
std::vector<TrigConf::L1CTPFiles::CTPCoreInput> m_Tmc_CtpcoreInputs;
std::vector<TrigConf::L1CTPFiles::CTPCoreCTPXInput> m_Tmc_CtpcoreCTPXInputs;
std::vector<TrigConf::L1CTPFiles::CTPInCounter> m_Tmc_CtpinCounters;
std::vector<TrigConf::L1CTPFiles::CTPMonCounter> m_Tmc_CtpmonCounters;
DataStructure m_Tmc;
......
......@@ -350,6 +350,11 @@ TrigConf::L1CTPFiles::set_Tmc_CtpcoreInputs(std::vector<TrigConf::L1CTPFiles::CT
m_Tmc_CtpcoreInputs = std::move(data);
}
void
TrigConf::L1CTPFiles::set_Tmc_CtpcoreCTPXInputs(std::vector<TrigConf::L1CTPFiles::CTPCoreCTPXInput> data) {
m_Tmc_CtpcoreCTPXInputs = std::move(data);
}
void
TrigConf::L1CTPFiles::set_Tmc_CtpinCounters(std::vector<TrigConf::L1CTPFiles::CTPInCounter> data) {
m_Tmc_CtpinCounters = std::move(data);
......
......@@ -387,6 +387,10 @@ TrigConf::TrigDBCTPFilesLoader::loadTMC(L1CTPFiles & ctpfiles, std::unique_ptr<c
{
inpEnum = TrigConf::L1CTPFiles::CTPCoreInput::DIR;
}
else if (inputType == "CTPX")
continue;
else
continue;
ctpcoreInputs.push_back(
TrigConf::L1CTPFiles::CTPCoreInput(
inp.getAttribute<size_t>("number"), inp.getAttribute<std::string>("name"),
......@@ -397,6 +401,33 @@ TrigConf::TrigDBCTPFilesLoader::loadTMC(L1CTPFiles & ctpfiles, std::unique_ptr<c
ctpfiles.set_Tmc_CtpcoreInputs(std::move(ctpcoreInputs));
}
// read the ctpcore CTPX inputs
if (auto dv = ds.getObject_optional("CTPCORE.TriggerInputs"))
{
std::vector<TrigConf::L1CTPFiles::CTPCoreCTPXInput> ctpcoreCTPXInputs;
for (const std::string &k : dv->getKeys())
{
const TrigConf::DataStructure &inp = dv->getObject(k);
const std::string &inputType = inp["type"];
TrigConf::L1CTPFiles::CTPCoreCTPXInput::InputType inpEnum = TrigConf::L1CTPFiles::CTPCoreCTPXInput::NONE;
if (inputType == "CTPX")
{
inpEnum = TrigConf::L1CTPFiles::CTPCoreCTPXInput::CTPX;
}
else if (inputType == "PIT" || inputType == "DIR")
continue;
else
continue;
ctpcoreCTPXInputs.push_back(
TrigConf::L1CTPFiles::CTPCoreCTPXInput(
inp.getAttribute<size_t>("number"), inp.getAttribute<std::string>("name"),
inp.getAttribute<size_t>("bit"),
inpEnum));
}
TRG_MSG_INFO("Loading ctpcore CTPX inputs " << ctpcoreCTPXInputs.size());
ctpfiles.set_Tmc_CtpcoreCTPXInputs(std::move(ctpcoreCTPXInputs));
}
// read the ctpin map
std::vector<TrigConf::L1CTPFiles::CTPInCounter> ctpinCounters;
for (size_t slot : {7, 8, 9})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment