Skip to content
Snippets Groups Projects
Commit a279fa8b authored by Felix Weiglhofer's avatar Felix Weiglhofer Committed by Volker Friese
Browse files

algo::Unpack: Add option to mask detectors.

parent efab3620
No related branches found
No related tags found
1 merge request!1201cbmreco: Integrate algo::Unpack
...@@ -28,6 +28,8 @@ namespace cbm::algo ...@@ -28,6 +28,8 @@ namespace cbm::algo
// System ID of current component // System ID of current component
const auto systemId = static_cast<fles::SubsystemIdentifier>(timeslice->descriptor(comp, 0).sys_id); const auto systemId = static_cast<fles::SubsystemIdentifier>(timeslice->descriptor(comp, 0).sys_id);
if (!DetectorEnabled(systemId)) continue;
// Equipment ID of current component // Equipment ID of current component
const uint16_t equipmentId = timeslice->descriptor(comp, 0).eq_id; const uint16_t equipmentId = timeslice->descriptor(comp, 0).eq_id;
...@@ -128,8 +130,18 @@ namespace cbm::algo ...@@ -128,8 +130,18 @@ namespace cbm::algo
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// ----- Initialisation --------------------------------------------------- // ----- Initialisation ---------------------------------------------------
bool Unpack::Init() bool Unpack::Init(std::optional<std::vector<fles::SubsystemIdentifier>> subIds)
{ {
if (!subIds) {
fSubIds = {
fles::SubsystemIdentifier::STS, fles::SubsystemIdentifier::MUCH, fles::SubsystemIdentifier::RPC,
fles::SubsystemIdentifier::T0, fles::SubsystemIdentifier::TRD, fles::SubsystemIdentifier::TRD2D,
};
}
else {
fSubIds = *subIds;
}
// --- Common parameters for all components for STS // --- Common parameters for all components for STS
uint32_t numChansPerAsicSts = 128; // R/O channels per ASIC for STS uint32_t numChansPerAsicSts = 128; // R/O channels per ASIC for STS
uint32_t numAsicsPerModuleSts = 16; // Number of ASICs per module for STS uint32_t numAsicsPerModuleSts = 16; // Number of ASICs per module for STS
...@@ -285,5 +297,4 @@ namespace cbm::algo ...@@ -285,5 +297,4 @@ namespace cbm::algo
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
} /* namespace cbm::algo */ } /* namespace cbm::algo */
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "trd2d/Trd2dReadoutConfig.h" #include "trd2d/Trd2dReadoutConfig.h"
#include "trd2d/UnpackTrd2d.h" #include "trd2d/UnpackTrd2d.h"
#include <optional>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
...@@ -100,8 +101,16 @@ namespace cbm::algo ...@@ -100,8 +101,16 @@ namespace cbm::algo
/** @brief Parameters for RICH unpackers **/ /** @brief Parameters for RICH unpackers **/
RichReadoutConfig fRichConfig {}; RichReadoutConfig fRichConfig {};
/** @brief Initialize unpackers and fill parameters from config objects **/ /** @brief Initialize unpackers and fill parameters from config objects
bool Init(); * @param subIds: vector of subsystem identifiers to unpack, default: all
* @see Init()
**/
bool Init(std::optional<std::vector<fles::SubsystemIdentifier>> subIds = {});
bool DetectorEnabled(fles::SubsystemIdentifier subId)
{
return std::find(fSubIds.begin(), fSubIds.end(), subId) != fSubIds.end();
}
private: // methods private: // methods
/** @brief Microslice loop **/ /** @brief Microslice loop **/
...@@ -111,7 +120,9 @@ namespace cbm::algo ...@@ -111,7 +120,9 @@ namespace cbm::algo
std::vector<MonitorData>* monitorMs, uint8_t sys_ver); std::vector<MonitorData>* monitorMs, uint8_t sys_ver);
private: // members private: // members
std::vector<fles::SubsystemIdentifier> fSubIds = {}; ///< Detector identifiers to unpack
/** @brief STS unpackers **/ /** @brief STS unpackers **/
std::map<uint16_t, UnpackSts> fAlgoSts = {}; std::map<uint16_t, UnpackSts> fAlgoSts = {};
......
...@@ -7,8 +7,25 @@ using namespace cbm::algo; ...@@ -7,8 +7,25 @@ using namespace cbm::algo;
void UnpackChain::Init() void UnpackChain::Init()
{ {
bool ok = fUnpack.Init(); bool ok = fUnpack.Init(std::vector<fles::SubsystemIdentifier> {
fles::SubsystemIdentifier::STS,
// fles::SubsystemIdentifier::MUCH,
fles::SubsystemIdentifier::RPC, fles::SubsystemIdentifier::T0,
// fles::SubsystemIdentifier::TRD,
// fles::SubsystemIdentifier::TRD2D,
});
if (!ok) throw std::runtime_error("Unpack::Init failed"); if (!ok) throw std::runtime_error("Unpack::Init failed");
} }
Unpack::resultType UnpackChain::Run(const fles::Timeslice& timeslice) { return fUnpack(&timeslice); } Unpack::resultType UnpackChain::Run(const fles::Timeslice& timeslice)
{
auto result = fUnpack(&timeslice);
auto& digis = result.first.fData;
L_(info) << "Timeslice contains " << digis.fSts.Size() << " STS Digis";
L_(info) << "Timeslice contains " << digis.fTof.Size() << " TOF Digis";
L_(info) << "Timeslice contains " << digis.fT0.Size() << " RPC Digis";
return result;
}
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