CbmRoot
Loading...
Searching...
No Matches
CbmSeedFinderSlidingWindow.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer] */
4
21#ifndef CbmSeedFinderSlidingWindow_h
22#define CbmSeedFinderSlidingWindow_h
23
24#include <cstddef>
25#include <cstdint>
26#include <vector>
27
28class CbmMatch;
29class CbmMCEventList;
30class CbmSeedFinderQa;
31
33 public:
41 CbmSeedFinderSlidingWindow(std::vector<double>* vSeedTimes, int32_t minDigis, double dWindDur, double dDeadT)
42 : fvSeedTimes(vSeedTimes)
43 , fminDigis(minDigis)
44 , fdWindDur(dWindDur)
45 , fdDeadT(dDeadT){};
46
50
52 void SetQa(bool doQA = true);
54 void OutputQa();
55
58
63 template<class inType>
64 void FillSeedTimes(const std::vector<inType>* vIn, const std::vector<CbmMatch>* vDigiMatch = nullptr);
65
68 void FillSeedTimes();
69
73 void SetOffset(double offset) { fdOffset = offset; }
74
78 void SetIdealMode(const int32_t fileId = -1)
79 {
80 fbIdealMode = true;
81 fIdealModeFileId = fileId;
82 }
83
85 bool IsIdealMode() { return fbIdealMode; }
86
88 size_t GetNofSeeds() { return fvSeedTimes->size(); }
89
91 void Init();
92
93 private:
95 CbmSeedFinderQa* fQa = nullptr;
96
98 std::vector<double>* fvSeedTimes = nullptr;
99
101 int32_t fminDigis = 0;
103 double fdWindDur = 0.;
105 double fdDeadT = 0.;
106
108 double fdOffset = 0.;
109
111 bool fbIdealMode = false;
112
114 int32_t fIdealModeFileId = -1;
115
118
120 template<class inType>
121 double GetTime(const std::vector<inType>* vIn, int32_t i);
122};
123#endif //CbmSeedFinderSlidingWindow_h
Container class for MC events with number, file and start time.
void SetIdealMode(const int32_t fileId=-1)
Switches to `‘ideal mode’' in which event times from MC data are used as triggers (no algorithm is ru...
CbmSeedFinderSlidingWindow operator=(const CbmSeedFinderSlidingWindow &)=delete
bool IsIdealMode()
Is `‘ideal mode’' switched on?
void OutputQa()
Output QA Information.
double fdOffset
Global time offset which is applied to each trigger time.
int32_t fminDigis
Minimum number of digis which must be found in the seed window.
void SetOffset(double offset)
Sets a global constant offset which is applied to each trigger time @params Value of offset.
CbmSeedFinderSlidingWindow(const CbmSeedFinderSlidingWindow &)=delete
CbmSeedFinderQa * fQa
Processes QA info.
size_t GetNofSeeds()
Returns number of seed times currently stored in buffer.
void SetQa(bool doQA=true)
Enable or disable the generation of QA information.
int32_t fIdealModeFileId
If only a single file is to be used in `‘ideal mode’' (-1 = all files).
std::vector< double > * fvSeedTimes
Output of the algorithm. Stores seed times for current time slice.
void Init()
Initializes QA object if set.
CbmSeedFinderSlidingWindow(std::vector< double > *vSeedTimes, int32_t minDigis, double dWindDur, double dDeadT)
Create the CbmSeedFinderSlidingWindow object.
double fdDeadT
`‘Dead time’' i.e. time interval which is discarded after a seed is found.
void FillSeedTimes()
Function which builds event seeds without digi input. Can only be used in ideal mode.
double GetTime(const std::vector< inType > *vIn, int32_t i)
Fetches time at position i of either a digi vector or vector of times.
double fdWindDur
Size of sliding window.
CbmMCEventList * fEventList
To access MC truth in `‘ideal mode’'.
bool fbIdealMode
`‘ideal mode’' uses MC truth as trigger times.