Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Event.h
1/*
2 Get * Event.h
3 *
4 * Created on: 04-05-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#ifndef HALEVENT_H_
11#define HALEVENT_H_
12
13#include "EventInterface.h"
14#include "Track.h"
15
16#include <TClonesArray.h>
17#include <TNamed.h>
18#include <TObjArray.h>
19#include <TString.h>
20
21#include "Std.h"
22
23class TDatabasePDG;
24namespace Hal {
25 class CompressionMap;
26 class Package;
27 class McEvent;
28 class ComplexEvent;
29 class SmearedEvent;
30
50 class Event : public TNamed {
51 private:
52 friend class SmearedEvent;
53 friend class ComplexEvent;
54 friend class Track;
55 Int_t fTotalV0s;
56 Int_t fTotalXis;
57
58 protected:
59 TDatabasePDG* fPDG;
60 TClonesArray* fTracks;
61 TClonesArray* fV0sHiddenInfo;
62 TClonesArray* fXisHiddenInfo;
63 TLorentzVector* fVertex;
64 Double_t fPhi, fPhiError;
65 Int_t fEventId;
66 Int_t fTotalTracksNo;
67 Int_t fMultiplicity;
73 Double_t CalculateCharge(Int_t pdg) const;
77 void ResetHiddenInfoCounter() { fTotalV0s = 0; };
82 void CopyData(Event* event);
90 void CopyCompress(Event* event, const CompressionMap& map);
96 void Compress(TClonesArray* array, const CompressionMap& map);
101 virtual void ShallowCopyTracks(Event* event);
107 virtual void ShallowCopyCompressTracks(Event* event, const CompressionMap& map);
112 virtual void ShallowCopyEvent(Event* event);
118 [[deprecated("Use CheckBranches({std::initializer_list}) instead.")]] Bool_t CheckBranches(Int_t n...) const;
124 Bool_t CheckBranches(std::initializer_list<TString> list) const;
125
134 Event(TString track_class, TString v0_class = "Hal::V0Track", TString xi_class = "Hal::XiTrack");
135
136 public:
140 Event();
145 Event(const Event& other);
153 void Build(Event* event, const CompressionMap& map);
161 void Build(Event* event);
167 void Compress(const CompressionMap& map);
175 virtual void Update(EventInterface* interface);
180 virtual void Clear(Option_t* opt = " ");
185 inline void SetEventID(Int_t newID) { fEventId = newID; }
191 inline void SetPhi(Double_t phi, Double_t phi_error = 0) {
192 fPhi = phi;
193 fPhiError = phi_error;
194 };
199 virtual void RotateZ(Double_t phi);
203 virtual void Print(Option_t* opt = "") const;
208 inline Track* GetTrack(Int_t i) const { return (Track*) fTracks->UncheckedAt(i); };
213 Track* AddTrack();
218 virtual Bool_t ExistInTree() const { return kFALSE; };
226 virtual Bool_t IsCompatible(const Event* non_buffered) const;
231 inline Int_t GetEventID() const { return fEventId; };
236 inline Int_t GetTotalTrackNo() const { return fTotalTracksNo; };
241 inline Int_t GetTotalV0No() const { return fTotalV0s; };
246 inline Int_t GetMutliplicity() const { return fMultiplicity; }
251 inline Double_t GetPhi() const { return fPhi; };
256 inline Double_t GetPhiError() const { return fPhiError; };
261 inline TLorentzVector* GetVertex() const { return fVertex; };
266 virtual EFormatType GetFormatType() const { return EFormatType::kReco; };
272 virtual TString GetFormatName() const;
277 Track* GetNewTrack() const;
282 virtual EventInterface* CreateInterface() const = 0;
288 virtual Float_t GetFieldVal(Int_t fieldID) const;
294 virtual TString GetFieldName(Int_t fieldID) const;
299 inline TClonesArray* GetV0HiddenInfo() const { return fV0sHiddenInfo; };
303 virtual ~Event();
304 /*******************************************************************************************************************************
305 * functions below that are rarely used and used rather should not overwrite them
306 ******************************************************************************************************************************/
311 virtual void CopyHiddenSettings(const Event* /*event*/) {};
318 virtual void Boost(Double_t vx, Double_t vy, Double_t vz);
325 virtual Event* GetNewEvent() const;
330 virtual Int_t GetMaxExpectedLinks() const { return 10; }
337 virtual Bool_t HasHiddenSettings() const { return kTRUE; };
343 virtual Package* Report() const;
344 ClassDef(Event, 2)
345 };
346} // namespace Hal
347#endif /* HALEVENT_H_ */
virtual void ShallowCopyTracks(Event *event)
Definition Event.cxx:111
void Build(Event *event, const CompressionMap &map)
Definition Event.cxx:96
virtual Bool_t IsCompatible(const Event *non_buffered) const
Definition Event.cxx:245
virtual EFormatType GetFormatType() const
Definition Event.h:266
virtual void Boost(Double_t vx, Double_t vy, Double_t vz)
Definition Event.cxx:124
virtual void ShallowCopyEvent(Event *event)
Definition Event.cxx:100
virtual ~Event()
Definition Event.cxx:73
Track * GetNewTrack() const
Definition Event.cxx:204
virtual Package * Report() const
Definition Event.cxx:252
virtual void Update(EventInterface *interface)
Definition Event.cxx:157
virtual Bool_t HasHiddenSettings() const
Definition Event.h:337
Int_t GetTotalTrackNo() const
Definition Event.h:236
void ResetHiddenInfoCounter()
Definition Event.h:77
virtual EventInterface * CreateInterface() const =0
virtual void Print(Option_t *opt="") const
Definition Event.cxx:91
Double_t GetPhiError() const
Definition Event.h:256
void CopyCompress(Event *event, const CompressionMap &map)
Definition Event.cxx:141
void SetEventID(Int_t newID)
Definition Event.h:185
virtual Bool_t ExistInTree() const
Definition Event.h:218
Int_t GetMutliplicity() const
Definition Event.h:246
virtual void ShallowCopyCompressTracks(Event *event, const CompressionMap &map)
Definition Event.cxx:190
virtual void Clear(Option_t *opt=" ")
Definition Event.cxx:82
virtual Float_t GetFieldVal(Int_t fieldID) const
Definition Event.cxx:254
void CopyData(Event *event)
Definition Event.cxx:136
void Compress(TClonesArray *array, const CompressionMap &map)
Double_t CalculateCharge(Int_t pdg) const
Definition Event.cxx:146
Int_t GetTotalV0No() const
Definition Event.h:241
void SetPhi(Double_t phi, Double_t phi_error=0)
Definition Event.h:191
virtual void CopyHiddenSettings(const Event *)
Definition Event.h:311
virtual Event * GetNewEvent() const
Definition Event.cxx:215
Double_t GetPhi() const
Definition Event.h:251
TLorentzVector * GetVertex() const
Definition Event.h:261
virtual TString GetFormatName() const
Definition Event.cxx:155
TClonesArray * GetV0HiddenInfo() const
Definition Event.h:299
virtual Int_t GetMaxExpectedLinks() const
Definition Event.h:330
virtual TString GetFieldName(Int_t fieldID) const
Definition Event.cxx:272
Bool_t CheckBranches(Int_t n...) const
Definition Event.cxx:221
Track * AddTrack()
Definition Event.cxx:209
Int_t GetEventID() const
Definition Event.h:231
virtual void RotateZ(Double_t phi)
Definition Event.cxx:290
Track * GetTrack(Int_t i) const
Definition Event.h:208