CbmRoot
NicaCbmGlobalEvent.cxx
Go to the documentation of this file.
1 /*
2  * NicaCbmEvent.cxx
3  *
4  * Created on: 3 gru 2018
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
9 #include "NicaCbmGlobalEvent.h"
11 #include "NicaCbmGlobalTrack.h"
12 #include "NicaEvent.h"
13 
14 NicaCbmGlobalEvent::NicaCbmGlobalEvent() : NicaExpEvent("NicaCbmGlobalTrack") {}
15 
16 void NicaCbmGlobalEvent::ShallowCopyTracks(NicaEvent* event) {
17  fTracks->Clear();
18  fTotalTracksNo = event->GetTotalTrackNo();
19  fTracks->ExpandCreateFast(fTotalTracksNo);
20  NicaCbmGlobalEvent* Event = (NicaCbmGlobalEvent*) event;
21  for (int i = 0; i < fTotalTracksNo; i++) {
22  NicaCbmGlobalTrack* from =
23  (NicaCbmGlobalTrack*) Event->fTracks->UncheckedAt(i);
24  NicaCbmGlobalTrack* to = (NicaCbmGlobalTrack*) fTracks->UncheckedAt(i);
25  NicaEvent* temp_event = from->GetEvent();
26  from->SetEvent(this);
27  to->CopyData(from);
28  from->SetEvent(temp_event);
29  to->GetLink()->SetLink(0, i);
30  }
31 }
32 
33 void NicaCbmGlobalEvent::ShallowCopyEvent(NicaEvent* event) {
34  NicaExpEvent::ShallowCopyEvent(event);
35 }
36 
38  fSource = new NicaCbmGlobalEventInterface();
39 }
40 
42  : NicaExpEvent(other) {
43  if (other.fSource) CreateSource();
44 }
45 
47  fTracks->Clear();
48  NicaCbmGlobalEventInterface* interface =
49  (NicaCbmGlobalEventInterface*) fSource;
50  fTotalTracksNo = interface->GetTotalTrackNo();
51  TLorentzVector start = interface->GetVertex();
52  fVertex->SetXYZT(start.X(), start.Y(), start.Z(), start.T());
53  fTracks->ExpandCreateFast(fTotalTracksNo);
54  for (int i = 0; i < fTotalTracksNo; i++) {
55  CbmGlobalTrack* tr_cbm = (CbmGlobalTrack*) interface->GetRawTrackPointer(i);
56  NicaCbmGlobalTrack* tr_nica = (NicaCbmGlobalTrack*) fTracks->UncheckedAt(i);
57  tr_nica->SetEvent(this);
58  tr_nica->Update(tr_cbm, interface);
59  tr_nica->SetEvent(this);
60  tr_nica->GetLink()->SetLink(0, i);
61  }
62 }
63 
65  : NicaExpEvent(classname) {}
66 
68  // TODO Auto-generated destructor stub
69 }
70 
72  return CheckBranches(2, "PrimaryVertex.", "GlobalTrack");
73 }
NicaCbmGlobalEvent::Update
virtual void Update()
Definition: NicaCbmGlobalEvent.cxx:46
NicaCbmGlobalEvent.h
NicaCbmGlobalEvent::ExistInTree
virtual Bool_t ExistInTree() const
Definition: NicaCbmGlobalEvent.cxx:71
NicaCbmGlobalEventInterface.h
NicaCbmGlobalEvent::NicaCbmGlobalEvent
NicaCbmGlobalEvent()
Definition: NicaCbmGlobalEvent.cxx:14
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
NicaCbmGlobalEvent::~NicaCbmGlobalEvent
virtual ~NicaCbmGlobalEvent()
Definition: NicaCbmGlobalEvent.cxx:67
NicaCbmGlobalEventInterface::fVertex
CbmVertex * fVertex
Definition: NicaCbmGlobalEventInterface.h:21
NicaCbmGlobalTrack.h
NicaCbmGlobalEvent::CreateSource
virtual void CreateSource()
Definition: NicaCbmGlobalEvent.cxx:37
NicaCbmGlobalEventInterface
Definition: NicaCbmGlobalEventInterface.h:19
NicaCbmGlobalTrack
Definition: NicaCbmGlobalTrack.h:19
NicaCbmGlobalEventInterface::GetTotalTrackNo
virtual Int_t GetTotalTrackNo() const
Definition: NicaCbmGlobalEventInterface.cxx:67
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
NicaCbmGlobalEvent::ShallowCopyTracks
virtual void ShallowCopyTracks(NicaEvent *event)
Definition: NicaCbmGlobalEvent.cxx:16
NicaCbmGlobalEvent::ShallowCopyEvent
virtual void ShallowCopyEvent(NicaEvent *event)
Definition: NicaCbmGlobalEvent.cxx:33
NicaCbmGlobalEvent
Definition: NicaCbmGlobalEvent.h:14
NicaCbmGlobalTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmGlobalTrack.cxx:33
NicaCbmGlobalEventInterface::fTracks
NicaTrackClones * fTracks
Definition: NicaCbmGlobalEventInterface.h:22
NicaCbmGlobalTrack::CopyData
void CopyData(NicaTrack *other)
Definition: NicaCbmGlobalTrack.cxx:57