Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
OTFRecoEvent.cxx
1/*
2 * OTFRecoEvent.cxx
3 *
4 * Created on: 28 maj 2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "OTFRecoEvent.h"
11#include "OTFData.h"
12#include "OTFRecoEventInterface.h"
13
14#include "DataManager.h"
15
16#include <TClonesArray.h>
17#include <TLorentzVector.h>
18#include <TObjArray.h>
19#include <TObject.h>
20#include <TVector3.h>
21
22
23namespace HalOTF {
24 RecoEvent::RecoEvent() : Hal::ExpEvent("HalOTF::RecoTrack") {}
25
26 Hal::EventInterface* RecoEvent::CreateInterface() const { return new RecoEventInterface(); }
27
28 void RecoEvent::Update(Hal::EventInterface* interface) {
29 Clear();
30 RecoEventInterface* s = (RecoEventInterface*) interface;
31 fTotalTracksNo = s->GetEvent()->GetNTracks();
32 fMultiplicity = fTotalTracksNo;
33 fTracks->ExpandCreateFast(fTotalTracksNo);
34 OTF::RecoEvent* ev = s->GetEvent();
35 TVector3 v = ev->GetVertex();
36 fVertex->SetXYZT(v.X(), v.Y(), v.Z(), 0);
37 fPhi = ev->GetPhi();
38
39 for (int i = 0; i < fTotalTracksNo; i++) {
40 RecoTrack* track = (RecoTrack*) fTracks->UncheckedAt(i);
41 OTF::RecoTrack* mc = (OTF::RecoTrack*) ev->GetTrack(i);
42 track->ResetTrack(i, this);
43 track->SetMomentum(mc->GetMom().Px(), mc->GetMom().Py(), mc->GetMom().Pz(), mc->GetMom().E());
44 track->SetMotherIndex(-1);
45 track->SetMatch(mc->GetMcIndex());
46 Int_t dau1, dau2;
47 mc->GetDaughters(dau1, dau2);
48 if (dau1 != -1) {
49 track->EnableV0(1, 1);
50 track->GetV0Info()->SetPosId(dau1);
51 track->GetV0Info()->SetNegId(dau2);
52 }
53 }
54 }
55
56 Bool_t RecoEvent::ExistInTree() const {
57 Hal::DataManager* manager = Hal::DataManager::Instance();
58 if (manager->CheckBranch("OTF::RecoEvent.")) { return kTRUE; }
59 return kFALSE;
60 }
61} // namespace HalOTF
Bool_t CheckBranch(const char *BrName)
virtual void ResetTrack(Int_t thisID=-1, Event *event=nullptr)
Definition Track.cxx:295
void EnableV0(Bool_t v0, Bool_t daughters=kTRUE)
Definition Track.cxx:192
V0Track * GetV0Info() const
Definition Track.cxx:290
void SetMotherIndex(Int_t index)
Definition Track.h:170
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
Definition Track.h:152
void SetPosId(Int_t posId)
Definition V0Track.h:141
void SetNegId(Int_t negId)
Definition V0Track.h:136