CbmRoot
Loading...
Searching...
No Matches
CbmDevTrigger.h
Go to the documentation of this file.
1
/* Copyright (C) 2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Dominik Smith[committer] */
4
12
#ifndef CBMDEVICETRIGGER_H_
13
#define CBMDEVICETRIGGER_H_
14
16
#include "
CbmDefs.h
"
17
#include "
TimeClusterTrigger.h
"
18
20
#include "FairMQDevice.h"
21
23
#include "Rtypes.h"
24
#include "TObjArray.h"
25
27
#include <chrono>
28
#include <gsl/span>
29
#include <vector>
30
31
class
CbmDigiTimeslice
;
32
class
CbmTsEventHeader
;
33
class
TimesliceMetaData
;
34
35
class
CbmDevTrigger
:
public
FairMQDevice {
36
public
:
37
CbmDevTrigger
();
38
virtual
~CbmDevTrigger
(){};
39
40
protected
:
41
virtual
void
InitTask
();
42
bool
HandleData
(FairMQParts&,
int
);
43
44
private
:
47
ECbmModuleId
fTriggerDet
=
ECbmModuleId::kNotExist
;
48
50
std::string
fChannelNameDataInput
=
""
;
51
std::string
fChannelNameDataOutput
=
""
;
52
54
uint64_t
fNumMessages
= 0;
55
57
std::unique_ptr<cbm::algo::evbuild::TimeClusterTrigger>
fTriggerAlgo
;
58
59
// Trigger algorithm params
60
double
fTriggerWindow
= 0.;
61
int32_t
fMinNumDigis
= 0;
62
double
fDeadTime
= 0.;
63
64
bool
SendTriggers
(
const
std::vector<double>& vTriggers, FairMQParts& partsIn);
65
66
// --- Extract digi times into to a vector
67
template
<
class
TDigi>
68
std::vector<double>
GetDigiTimes
(gsl::span<const TDigi> digiVec)
69
{
70
std::vector<double> digiTimes(digiVec.size());
71
std::transform(digiVec.begin(), digiVec.end(), digiTimes.begin(), [](
const
TDigi& digi) { return digi.GetTime(); });
72
return
digiTimes;
73
}
74
75
// Get trigger times using trigger algorithm
76
std::vector<double>
GetTriggerTimes
(
const
CbmDigiTimeslice
& ts);
77
78
// Get detector type from string containing name
79
ECbmModuleId
GetDetectorId
(std::string detName);
80
};
81
82
#endif
/* CBMDEVICETRIGGER_H_ */
CbmDefs.h
ECbmModuleId
ECbmModuleId
Definition
CbmDefs.h:39
ECbmModuleId::kNotExist
@ kNotExist
If not found.
TimeClusterTrigger.h
CbmDevTrigger
Definition
CbmDevTrigger.h:35
CbmDevTrigger::fChannelNameDataOutput
std::string fChannelNameDataOutput
Definition
CbmDevTrigger.h:51
CbmDevTrigger::GetTriggerTimes
std::vector< double > GetTriggerTimes(const CbmDigiTimeslice &ts)
Definition
CbmDevTrigger.cxx:120
CbmDevTrigger::GetDetectorId
ECbmModuleId GetDetectorId(std::string detName)
Definition
CbmDevTrigger.cxx:65
CbmDevTrigger::fTriggerAlgo
std::unique_ptr< cbm::algo::evbuild::TimeClusterTrigger > fTriggerAlgo
Processing algos.
Definition
CbmDevTrigger.h:57
CbmDevTrigger::~CbmDevTrigger
virtual ~CbmDevTrigger()
Definition
CbmDevTrigger.h:38
CbmDevTrigger::InitTask
virtual void InitTask()
Definition
CbmDevTrigger.cxx:36
CbmDevTrigger::fNumMessages
uint64_t fNumMessages
Statistics.
Definition
CbmDevTrigger.h:54
CbmDevTrigger::HandleData
bool HandleData(FairMQParts &, int)
Definition
CbmDevTrigger.cxx:84
CbmDevTrigger::SendTriggers
bool SendTriggers(const std::vector< double > &vTriggers, FairMQParts &partsIn)
Definition
CbmDevTrigger.cxx:162
CbmDevTrigger::fDeadTime
double fDeadTime
Definition
CbmDevTrigger.h:62
CbmDevTrigger::fTriggerDet
ECbmModuleId fTriggerDet
Definition
CbmDevTrigger.h:47
CbmDevTrigger::fMinNumDigis
int32_t fMinNumDigis
Definition
CbmDevTrigger.h:61
CbmDevTrigger::CbmDevTrigger
CbmDevTrigger()
Definition
CbmDevTrigger.cxx:34
CbmDevTrigger::fChannelNameDataInput
std::string fChannelNameDataInput
message queues
Definition
CbmDevTrigger.h:50
CbmDevTrigger::fTriggerWindow
double fTriggerWindow
Definition
CbmDevTrigger.h:60
CbmDevTrigger::GetDigiTimes
std::vector< double > GetDigiTimes(gsl::span< const TDigi > digiVec)
Definition
CbmDevTrigger.h:68
CbmDigiTimeslice
Collection of digis from all detector systems within one timeslice.
Definition
CbmDigiTimeslice.h:21
CbmTsEventHeader
Definition
CbmTsEventHeader.h:13
TimesliceMetaData
Definition
TimesliceMetaData.h:14
reco
mq
CbmDevTrigger.h
Generated on Sun Dec 22 2024 23:04:17 for CbmRoot by
1.12.0