19#include "FairRootManager.h"
46 std::vector<CbmMatch> eventMatches;
60 eventMatch.
AddLink(1.0, 0, eventId, fileId);
61 eventMatches.push_back(eventMatch);
65 for (uint32_t i = 0; i <
fvSeedTimes->size(); i++) {
73 const int32_t nDigisTot = vIn->size();
74 int32_t nDigisWin = 0;
75 int32_t winStartN = 0;
76 double winStartT = -1111;
80 for (int32_t i = 0; i < nDigisTot; i++) {
81 const double currentT =
GetTime(vIn, i);
85 if (winStartT == -1111) {
90 for (j = winStartN; j < i; j++) {
101 winStartT = currentT;
107 const double seedTime =
108 fdOffset + (currentT + winStartT) / 2.;
111 if (vDigiMatch &&
fQa) {
116 for (j = i + 1; j < nDigisTot; j++) {
117 const double newStartT =
GetTime(vIn, j);
118 if (newStartT - currentT >
fdDeadT)
break;
120 if (j == nDigisTot) {
141 const std::vector<CbmMatch>*);
154 std::cout <<
"CbmSeedFinderSlidingWindow: Error, called algo without digi input, but ideal mode is not set."
161template<
class inType>
164 const inType* digi = &(vIn->at(i));
165 if (digi ==
nullptr) {
166 std::cout <<
"CbmSeedFinderSlidingWindow: Error, non-allocated digi in input vector at position: " << i
169 return digi->GetTime();
181 if (
fQa ==
nullptr) {
186 if (
fQa !=
nullptr) {
199 if (!FairRootManager::Instance() || !FairRootManager::Instance()->GetObject(
"MCEventList.")) {
200 LOG(error) <<
"No MC event list found";
Class for sliding window seed finder.
Class for sliding window seed finder.
Container class for MC events with number, file and start time.
int32_t GetFileIdByIndex(uint32_t index)
File number by index @value File number for event at given index in list.
double GetEventTimeByIndex(uint32_t index)
Event time by index @value Event time for event at given index in list.
int32_t GetEventIdByIndex(uint32_t index)
Event number by index @value Event number for event at given index in list.
std::size_t GetNofEvents() const
Number of events in the list @value Number of events.
void AddLink(const CbmLink &newLink)
void FillQaSeedInfo(const int32_t WinStart, const int32_t WinEnd, const std::vector< CbmMatch > *vDigiMatch, const double seedTime)
Gather QA Information. @params WinStart Starting position of seed window. @params WinStart End positi...
void Init()
Initialize communication with FairRootManager (needed for MC events).
void OutputQa()
Output QA Information.
void ResetPerTsStorage()
Reset containers that are persistent for one TS.
void FillQaMCInfo()
Fill QA Information that uses the full list of MC events per TS.
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.
CbmSeedFinderQa * fQa
Processes QA info.
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.
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’'.
~CbmSeedFinderSlidingWindow()
Destructor.
bool fbIdealMode
`‘ideal mode’' uses MC truth as trigger times.