BmnRoot
Loading...
Searching...
No Matches
BmnEvent.h
Go to the documentation of this file.
1
8#ifndef BMNEVENT_H
9#define BMNEVENT_H 1
10
11#include <map>
12#include <string>
13#include <vector>
14#include <TObject.h>
15#include "BmnDetectorList.h" //#include "CbmDefs.h"
16#include "BmnMatch.h"
17#include "BmnVertex.h"
18
19
26class BmnEvent: public TObject {
27
28 public:
29
31 BmnEvent() : BmnEvent(-1, 0., 0.) {};
32
38 BmnEvent(Int_t number, Double_t startTime = 0., Double_t endTime = 0.) :
39 TObject(), fNumber(number), fTimeStart(startTime), fTimeEnd(endTime),
40 fNofData(0), fVertex(), fMatch(NULL), fIndexMap() {
41 }
42
44 virtual ~BmnEvent() {
45 if ( fMatch ) delete fMatch;
46 }
47
48
53 void AddData(DataType type, UInt_t index);
54
55
59 void AddSsdTrack(UInt_t index) { AddData(kSsdTrack, index); }
60
61
67 UInt_t GetIndex(DataType type, UInt_t iData);
68
69
73 BmnMatch* GetMatch() const { return fMatch; }
74
75
77 Int_t GetNofData() const { return fNofData; }
78
79
85 Int_t GetNofData(DataType type) const;
86
87
91 Int_t GetNofSsdTracks() const { return GetNofData(kSsdTrack); }
92
93
97 Int_t GetNumber() const { return fNumber; }
98
99
104 Int_t GetSsdTrackIndex(Int_t iTrack) {
105 return GetIndex(kSsdTrack, iTrack);
106 }
107
108
112 Double_t GetEndTime() const { return fTimeEnd; }
113
114
118 Double_t GetStartTime() const { return fTimeStart; }
119
120
124 void SetEndTime(Double_t endTime) { fTimeEnd = endTime; }
125
126
130 void SetMatch(BmnMatch* match) { fMatch = match; }
131
132
136 void SetStartTime(Double_t startTime) { fTimeStart = startTime; }
137
138
144 void SetSsdTracks(std::vector<UInt_t>& indexVector) {
145 fNofData -= fIndexMap[kSsdTrack].size();
146 fIndexMap[kSsdTrack] = indexVector;
147 fNofData += fIndexMap[kSsdTrack].size();
148 }
149
150
160 void SetVertex(Double_t x, Double_t y, Double_t z, Double_t chi2,
161 Int_t ndf, Int_t nTracks, const TMatrixFSym& covMat);
162
163
165 std::string ToString() const;
166
167
171 BmnVertex* GetVertex() { return &fVertex; }
172
173
174
175
176 private:
177
179 Int_t fNumber;
180 Double_t fTimeStart;
181 Double_t fTimeEnd;
182 Int_t fNofData;
183 BmnVertex fVertex;
184 BmnMatch* fMatch;
185
187 std::map<DataType, std::vector<UInt_t>> fIndexMap;
188
189 BmnEvent(const BmnEvent&) = delete;
190 BmnEvent& operator=(const BmnEvent&) = delete;
191
192
193 ClassDef(BmnEvent, 2);
194};
195
196#endif /* BMNEVENT_H_ */
DataType
@ kSsdTrack
Class characterising one event by a collection of links (indices) to data objects,...
Definition BmnEvent.h:26
Int_t GetSsdTrackIndex(Int_t iTrack)
Definition BmnEvent.h:104
Double_t GetEndTime() const
Definition BmnEvent.h:112
UInt_t GetIndex(DataType type, UInt_t iData)
Definition BmnEvent.cxx:28
Int_t GetNofSsdTracks() const
Definition BmnEvent.h:91
virtual ~BmnEvent()
Definition BmnEvent.h:44
Int_t GetNumber() const
Definition BmnEvent.h:97
void SetStartTime(Double_t startTime)
Definition BmnEvent.h:136
void AddData(DataType type, UInt_t index)
Definition BmnEvent.cxx:17
BmnVertex * GetVertex()
Definition BmnEvent.h:171
void SetVertex(Double_t x, Double_t y, Double_t z, Double_t chi2, Int_t ndf, Int_t nTracks, const TMatrixFSym &covMat)
Definition BmnEvent.cxx:51
Double_t GetStartTime() const
Definition BmnEvent.h:118
BmnEvent()
Definition BmnEvent.h:31
Int_t GetNofData() const
Definition BmnEvent.h:77
void AddSsdTrack(UInt_t index)
Definition BmnEvent.h:59
BmnEvent(Int_t number, Double_t startTime=0., Double_t endTime=0.)
Definition BmnEvent.h:38
BmnMatch * GetMatch() const
Definition BmnEvent.h:73
void SetEndTime(Double_t endTime)
Definition BmnEvent.h:124
std::string ToString() const
Definition BmnEvent.cxx:60
void SetMatch(BmnMatch *match)
Definition BmnEvent.h:130
void SetSsdTracks(std::vector< UInt_t > &indexVector)
Sets the index array for SSD tracks. Old content will be overwritten.
Definition BmnEvent.h:144