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
20
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
32class CbmTimeSlice; // added to access timeslice info and TimeSliceMetaData does not work
33
35 public:
43 CbmSeedFinderSlidingWindow(std::vector<double>* vSeedTimes, int32_t minDigis, double dWindDur, double dDeadT)
44 : fvSeedTimes(vSeedTimes)
45 , fminDigis(minDigis)
46 , fdWindDur(dWindDur)
47 , fdDeadT(dDeadT){};
48
52
54 void SetQa(bool doQA = true);
56 void OutputQa();
57
60
65 template<class inType>
66 void FillSeedTimes(const std::vector<inType>* vIn, const std::vector<CbmMatch>* vDigiMatch = nullptr);
67
70 void FillSeedTimes();
71
75 void SetOffset(double offset) { fdOffset = offset; }
76
80 void SetIdealMode(const int32_t fileId = -1)
81 {
82 fbIdealMode = true;
83 fIdealModeFileId = fileId;
84 }
85
87 bool IsIdealMode() { return fbIdealMode; }
88
90 size_t GetNofSeeds() { return fvSeedTimes->size(); }
91
93 void Init();
94
95 private:
97 CbmSeedFinderQa* fQa = nullptr;
98
100 std::vector<double>* fvSeedTimes = nullptr;
101
103 int32_t fminDigis = 0;
105 double fdWindDur = 0.;
107 double fdDeadT = 0.;
108
110 double fdOffset = 0.;
111
113 bool fbIdealMode = false;
114
116 int32_t fIdealModeFileId = -1;
117
120
121 // accessing time slice info (because TimeSliceMetaData does not work)
123
125 template<class inType>
126 double GetTime(const std::vector<inType>* vIn, int32_t i);
127};
128#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.
Bookkeeping of time-slice content.