Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
DbgRecoEvent.cxx
1/*
2 * DbgRecoEvent.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 "DbgRecoEvent.h"
11#include "DbgData.h"
12#include "DbgRecoEventInterface.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 HalDbg {
24 RecoEvent::RecoEvent() : Hal::ExpEvent("HalDbg::RecoTrack") {}
25
26 Hal::EventInterface* RecoEvent::CreateInterface() const { return new RecoEventInterface(); }
27
28 void RecoEvent::Update(Hal::EventInterface* interface) {
29 RecoEventInterface* s = (RecoEventInterface*) interface;
30 fTotalTracksNo = s->GetEvent()->GetNTracks();
31 fEventId = s->GetEvent()->GetEventId();
32 fMultiplicity = fTotalTracksNo;
33 fTracks->Clear();
34 fTracks->ExpandCreateFast(fTotalTracksNo);
35 Dbg::RecoEvent* ev = s->GetEvent();
36 TVector3 v = ev->GetVertex();
37 fVertex->SetXYZT(v.X(), v.Y(), v.Z(), 0);
38
39 for (int i = 0; i < fTotalTracksNo; i++) {
40 RecoTrack* track = (RecoTrack*) fTracks->UncheckedAt(i);
41 Dbg::RecoTrack* mc = (Dbg::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("Dbg::RecoEvent.")) { return kTRUE; }
59 return kFALSE;
60 }
61} // namespace HalDbg
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