CbmRoot
Loading...
Searching...
No Matches
CbmTaskBuildEvents.h
Go to the documentation of this file.
1/* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
5#ifndef CBMTASKBUILDEVENTS_H
6#define CBMTASKBUILDEVENTS_H 1
7
8#include "CbmDefs.h"
9#include "CbmDigiEvent.h"
10#include "CbmDigiTimeslice.h"
11#include "DigiEventSelector.h"
13#include "EventBuilder.h"
14
15#include <FairTask.h>
16
17#include <vector>
18
19class CbmDigiManager;
20
32class CbmTaskBuildEvents : public FairTask {
33
34 public:
37
38
41
42
44 virtual ~CbmTaskBuildEvents();
45
46
48 virtual void Exec(Option_t* opt);
49
50
52 virtual void Finish();
53
54
57
58
64
65
74
75
76 private: // methods
78 virtual InitStatus Init();
79
80
83
84
90 size_t GetNumDigis(const CbmDigiData& data, ECbmModuleId system);
91
92 private: // members
93 const CbmDigiTimeslice* fTimeslice = nullptr;
95 const std::vector<double>* fTriggers = nullptr;
96 std::vector<CbmDigiEvent>* fEvents = nullptr;
97 std::unique_ptr<cbm::algo::evbuild::DigiEventSelector> fSelector;
98 std::unique_ptr<cbm::algo::evbuild::EventBuilder> fAlgo;
99 std::unique_ptr<cbm::algo::evbuild::EventBuilderConfig> fConfig;
100
101 // for diagnostics
102 std::map<ECbmModuleId, size_t> fNumDigisTs; // Number of digis in timeslices
103 std::map<ECbmModuleId, size_t> fNumDigisEv; // Number of digis in events
104 size_t fNumTs = 0; // Number of processed time slices
105 size_t fNumTriggers = 0; // Number of triggers
106 size_t fNumEvents = 0; // Number of produced events
107 double fTimeFillTs = 0.;
108 double fTimeBuildEvt = 0.;
109 double fTimeSelectorEvt = 0.;
110 double fTimeTot = 0.;
111
113};
114
115#endif /* CBMTASKBUILDEVENTS_H */
ECbmModuleId
Definition CbmDefs.h:39
Collection of digis from all detector systems.
Definition CbmDigiData.h:32
CbmDigiManager.
Collection of digis from all detector systems within one timeslice.
Task class for associating digis to events.
std::map< ECbmModuleId, size_t > fNumDigisTs
Event builder configuration.
virtual InitStatus Init()
Task initialisation.
const CbmDigiTimeslice * fTimeslice
CbmDigiTimeslice FillTimeSlice()
Construct a DigiTimeslice from the data in CbmDigiManager.
CbmTaskBuildEvents()
Constructor.
std::unique_ptr< cbm::algo::evbuild::EventBuilder > fAlgo
Event selector.
size_t GetNumDigis(const CbmDigiData &data, ECbmModuleId system)
Number of digis for a given system.
virtual ~CbmTaskBuildEvents()
Destructor.
const std::vector< double > * fTriggers
Input data (from simulation)
std::map< ECbmModuleId, size_t > fNumDigisEv
std::vector< CbmDigiEvent > * fEvents
Input data (triggers)
virtual void Finish()
Finish timeslice.
void SetConfig(const cbm::algo::evbuild::EventBuilderConfig &config)
Configure the event builder algorithm.
void SetDigiEventSelector(cbm::algo::evbuild::DigiEventSelectorConfig config)
Activate event selector which requires a minimum number of fired layers.
std::unique_ptr< cbm::algo::evbuild::DigiEventSelector > fSelector
Output data (events)
ClassDef(CbmTaskBuildEvents, 1)
virtual void Exec(Option_t *opt)
Task execution.
CbmDigiManager * fDigiMan
Input data (from unpacking)
std::unique_ptr< cbm::algo::evbuild::EventBuilderConfig > fConfig
Algorithm.
CbmTaskBuildEvents & operator=(const CbmTaskBuildEvents &)=delete
Assignment operator (disabled)
CbmTaskBuildEvents(const CbmTaskBuildEvents &)=delete
Copy constructor (disabled)
Configuration of the DigiEventSelector class.
Algorithm to select CbmDigiEvents based on the number of digis and the number of activated layers in ...
Configuration of the EventBuilder class.