PandaRoot
PndGemEventBuilderOnTracks.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //* $Id: */
14 
15 // -------------------------------------------------------------------------
16 // ----- PndGemEventBuilderOnTracks header file -----
17 // ----- Created 22/08/2013 by R. Karabowicz -----
18 // -------------------------------------------------------------------------
19 
29 #ifndef PNDGEMEVENTBUILDERONTRACKS_H
30 #define PNDGEMEVENTBUILDERONTRACKS_H 1
31 
32 #include "PndTrack.h"
33 
34 #include "FairEventBuilder.h"
35 
36 #include "TStopwatch.h"
37 
38 #include <map>
39 #include <set>
40 #include <vector>
41 
42 class TClonesArray;
43 
44 class FairRecoEventHeader;
45 
46 struct RecoEvent {
47  std::vector<Int_t> trackIndex;
48  Int_t nofTracks;
49  Double_t meanTime;
50 };
51 
52 class PndGemEventBuilderOnTracks : public FairEventBuilder {
53 
54  public:
57 
59  PndGemEventBuilderOnTracks(const char *name, Int_t iVerbose = 0);
60 
62  virtual ~PndGemEventBuilderOnTracks();
63 
64  virtual void StoreEventData(FairRecoEventHeader *recoEvent);
65 
66  std::vector<std::pair<double, FairRecoEventHeader *>> FindEvents();
67 
68  std::vector<std::pair<double, PndTrack *>> Modify(std::pair<double, PndTrack *> oldData, std::pair<double, PndTrack *> newData);
69  void AddNewDataToTClonesArray(FairTimeStamp *data);
70  double FindTimeForData(FairTimeStamp *data);
71  void FillDataMap(FairTimeStamp *data, double activeTime);
72  void EraseDataFromDataMap(FairTimeStamp *data);
73 
74  private:
75  TClonesArray *fGemTracks;
76  TClonesArray *fGemOutTracks;
77 
78  Int_t fTNofEvents;
79  Int_t fTNofTracks;
80  Int_t fTNofRecoEvents;
81 
82  Double_t fGemTrackDelay;
83  TStopwatch fTimer;
84  Double_t fExecTime;
85  std::vector<RecoEvent> fRecoEvents;
86 
87  std::map<FairRecoEventHeader, double> fEvent_map;
88  std::map<PndTrack, double> fData_map;
89 
91  virtual void SetParContainers();
92 
94  virtual Bool_t Init();
95 
97  virtual Bool_t ReInit();
98 
99  virtual void Print();
100 
102  virtual void Finish();
103 
104  Int_t CompareTrackToPreviousEvents(Int_t trackId, PndTrack *tempTrack);
105 
106  ClassDef(PndGemEventBuilderOnTracks, 1);
107 };
108 
109 #endif
std::vector< Int_t > trackIndex