19#include <FairRootManager.h>
48 std::vector<double> digiTimes;
52 for (
const auto& system :
fSystems) {
53 std::vector<double> systemDigiTimes =
GetDigiTimes(system);
54 digiTimes.insert(digiTimes.end(), systemDigiTimes.begin(), systemDigiTimes.end());
57 std::sort(digiTimes.begin(), digiTimes.end());
63 for (
const auto& system :
fSystems) {
65 std::vector<double> locDigiTimes;
96 LOG(error) << GetName() <<
": Unknown detector type!";
100 digiTimes.insert(digiTimes.end(), locDigiTimes.begin(), locDigiTimes.end());
103 std::sort(digiTimes.begin(), digiTimes.end());
114 size_t numDigis = digiTimes.size();
121 logOut << setw(15) << left << GetName() <<
" [";
122 logOut << fixed << setw(8) << setprecision(1) << right << timerTot.RealTime() * 1000. <<
" ms] ";
123 logOut <<
"TS " <<
fNumTs <<
", digis " << numDigis <<
", triggers " << numTriggers;
124 LOG(info) << logOut.str();
138 std::vector<double> result;
144 std::transform(it1, it2, result.begin(), [](
const CbmStsDigi& digi) { return digi.GetTime(); });
151 std::transform(it1, it2, result.begin(), [](
const CbmRichDigi& digi) { return digi.GetTime(); });
158 std::transform(it1, it2, result.begin(), [](
const CbmMuchDigi& digi) { return digi.GetTime(); });
165 std::transform(it1, it2, result.begin(), [](
const CbmTrdDigi& digi) { return digi.GetTime(); });
172 std::transform(it1, it2, result.begin(), [](
const CbmTofDigi& digi) { return digi.GetTime(); });
179 std::transform(it1, it2, result.begin(), [](
const CbmPsdDigi& digi) { return digi.GetTime(); });
186 std::transform(it1, it2, result.begin(), [](
const CbmTofDigi& digi) { return digi.GetTime(); });
190 LOG(error) << GetName() <<
": Unknown system " << system;
203 LOG(info) <<
"=====================================";
204 LOG(info) << GetName() <<
": Run summary";
205 LOG(info) <<
"Timeslices : " <<
fNumTs;
208 LOG(info) <<
"Time / TS : " << fixed << setprecision(2) << 1000. *
fTimeTot / double(
fNumTs) <<
" ms";
209 LOG(info) <<
"Time extract : " << fixed << setprecision(2) << 1000. *
fTimeExtract / double(
fNumTs)
211 LOG(info) <<
"Time find trigger : " << fixed << setprecision(2) << 1000. *
fTimeFind / double(
fNumTs)
213 LOG(info) <<
"=====================================";
223 FairRootManager* ioman = FairRootManager::Instance();
226 LOG(info) <<
"==================================================";
227 LOG(info) << GetName() <<
": Initialising...";
233 LOG(info) <<
"--- Found branch DigiTimeslice.";
239 for (
const auto& system :
fSystems) {
249 if (ioman->GetObject(
"Trigger")) {
250 LOG(fatal) << GetName() <<
": Branch Trigger already exists!";
254 ioman->RegisterAny(
"Trigger",
fTriggers, IsOutputBranchPersistent(
"Trigger"));
256 LOG(fatal) << GetName() <<
": Output branch could not be created!";
259 LOG(info) <<
"--- Registered branch Trigger";
264 LOG(info) <<
fAlgo->ToString();
266 LOG(info) <<
"==================================================";
ClassImp(CbmConverterManager)
std::string ToString(ECbmModuleId modId)
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kRich
Ring-Imaging Cherenkov Detector.
std::vector< CbmBmonDigi > fDigis
Data vector.
Abstract base class for CBM digi branches.
CbmPsdDigiData fPsd
PSD data.
CbmTrdDigiData fTrd
TRD data.
CbmTofDigiData fTof
TOF data.
CbmStsDigiData fSts
STS data.
CbmRichDigiData fRich
RICH data.
CbmMuchDigiData fMuch
MUCH data.
CbmBmonDigiData fBmon
Beam monitor data.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
CbmDigiBranchBase * GetBranch(ECbmModuleId system)
Access to a digi branch.
InitStatus Init()
Initialisation.
static CbmDigiManager * Instance()
Static instance.
Collection of digis from all detector systems within one timeslice.
CbmDigiData fData
Timeslice data.
static TString GetModuleNameCaps(ECbmModuleId moduleId)
std::vector< CbmMuchDigi > fDigis
Data vector.
std::vector< CbmPsdDigi > fDigis
Data vector.
Data class for PSD digital information.
std::vector< CbmRichDigi > fDigis
Data vector.
std::vector< CbmStsDigi > fDigis
Data vector.
Data class for a single-channel message in the STS.
Task class for minimum-bias event trigger from time-distribution of digi data.
CbmDigiManager * fDigiMan
Input data (from unpacking)
std::vector< ECbmModuleId > fSystems
Input data (from simulation)
std::vector< double > * fTriggers
std::unique_ptr< cbm::algo::evbuild::TimeClusterTrigger > fAlgo
Output data.
virtual void Exec(Option_t *opt)
Task execution.
virtual void Finish()
Finish timeslice.
virtual ~CbmTaskTriggerDigi()
Destructor.
const CbmDigiTimeslice * fTimeslice
std::unique_ptr< cbm::algo::evbuild::DigiTriggerConfig > fConfig
Algorithm.
CbmTaskTriggerDigi()
Constructor.
std::vector< double > GetDigiTimes(const CbmDigiBranchBase *digiBranch)
Extract digi times from digi branch.
virtual InitStatus Init()
Task initialisation.
std::vector< CbmTofDigi > fDigis
Data vector.
Data class for expanded digital TOF information.
std::vector< CbmTrdDigi > fDigis
Data vector.
Finds clusters in time-series data.