CbmRoot
NicaCbmTrack.cxx
Go to the documentation of this file.
1 /*
2  * NicaCbmTrack.cxx
3  *
4  * Created on: 11 lip 2019
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
9 #include "NicaCbmTrack.h"
10 #include "NicaCbmEvent.h"
11 #include "NicaCbmEventInterface.h"
12 #include "NicaTrackClones.h"
13 
15  : fStsTrack(NULL)
16  , fTofTrack(NULL)
17  , fTrdTrack(NULL)
18  , fRichRing(NULL)
19  , fMuchTrack(NULL)
20  , fStsTrackIndex(-1)
21  , fTofTrackIndex(-1)
22  , fTrdTrackIndex(-1)
23  , fRichRingIndex(-1)
24  , fMuchTrackIndex(-1) {}
25 
27 
29  NicaCbmGlobalEventInterface* interface) {
30  NicaCbmEventInterface* evint = (NicaCbmEventInterface*) interface;
31  NicaCbmGlobalTrack::Update(track, interface);
33  fTofTrackIndex = track->GetTofHitIndex();
35  NicaCbmSetup mode = evint->GetMode();
36  if (mode == kSis100Electron)
38  else if (mode == kSis100Muon)
40  if (fStsTrackIndex >= 0)
42  (CbmStsTrack*) evint->GetStsTracks()->UncheckedAt(fStsTrackIndex));
43  else
44  SetStsTrack(NULL);
45  if (fTofTrackIndex >= 0) {
46  CbmTofHit* hit =
47  (CbmTofHit*) evint->GetTofHits()->UncheckedAt(fTofTrackIndex);
48  SetTofTrack(hit);
49  Double_t t = hit->GetTime();
50  Double_t beta = GetTrackLenght() / t / (29.9792458);
51  Double_t p = GetMomentum()->P();
52  Double_t m2 = p * p * (1. / beta / beta - 1.);
53  if (m2 > 0) {
54  SetMass(TMath::Sqrt(m2));
55  } else {
56  SetMass(TMath::Sqrt(-m2));
57  }
58  } else {
59  SetTofTrack(NULL);
60  SetMass(-2);
61  }
62  if (fTrdTrackIndex >= 0)
64  (CbmTrdTrack*) evint->GetTrdTracks()->UncheckedAt(fTrdTrackIndex));
65  else
66  SetTrdTrack(NULL);
67  if (fRichRingIndex >= 0)
69  (CbmRichRing*) evint->GetRichRings()->UncheckedAt(fRichRingIndex));
70  else
71  SetRichRing(NULL);
72  if (fMuchTrackIndex >= 0)
74  (CbmMuchTrack*) evint->GetMuchTracks()->UncheckedAt(fMuchTrackIndex));
75  else
76  SetMuchTrack(NULL);
77 }
78 
79 void NicaCbmTrack::CopyData(NicaTrack* track) {
81  NicaCbmTrack* other = (NicaCbmTrack*) track;
87  NicaCbmEvent* ev = (NicaCbmEvent*) GetEvent();
88  if (fStsTrackIndex >= 0)
89  fStsTrack = (CbmStsTrack*) ev->GetStsTracks()->UncheckedAt(fStsTrackIndex);
90  else
91  fStsTrack = NULL;
92  if (fTofTrackIndex >= 0)
93  fTofTrack = (CbmTofHit*) ev->GetTofHits()->UncheckedAt(fTofTrackIndex);
94  else
95  fTofTrack = NULL;
96  if (fTrdTrackIndex >= 0)
97  fTrdTrack = (CbmTrdTrack*) ev->GetTrdTracks()->UncheckedAt(fTrdTrackIndex);
98  else
99  fTrdTrack = NULL;
100  if (fRichRingIndex >= 0)
101  fRichRing = (CbmRichRing*) ev->GetRichRings()->UncheckedAt(fRichRingIndex);
102  else
103  fRichRing = NULL;
104  if (fMuchTrackIndex >= 0)
105  fMuchTrack =
106  (CbmMuchTrack*) ev->GetMuchTracks()->UncheckedAt(fMuchTrackIndex);
107  else
108  fMuchTrack = NULL;
109 }
NicaCbmEventInterface::GetMode
NicaCbmSetup GetMode() const
Definition: NicaCbmEventInterface.h:41
NicaCbmTrack::fStsTrackIndex
Int_t fStsTrackIndex
Definition: NicaCbmTrack.h:26
CbmGlobalTrack::GetMuchTrackIndex
Int_t GetMuchTrackIndex() const
Definition: CbmGlobalTrack.h:40
NicaCbmEvent.h
NicaCbmTrack::~NicaCbmTrack
virtual ~NicaCbmTrack()
Definition: NicaCbmTrack.cxx:26
NicaCbmTrack::SetStsTrack
void SetStsTrack(CbmStsTrack *stsTrack)
Definition: NicaCbmTrack.h:52
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
NicaCbmEvent::GetStsTracks
NicaTrackClones * GetStsTracks() const
Definition: NicaCbmEvent.h:33
NicaCbmTrack::fStsTrack
CbmStsTrack * fStsTrack
Definition: NicaCbmTrack.h:21
NicaCbmEventInterface::GetTofHits
NicaTrackClones * GetTofHits() const
Definition: NicaCbmEventInterface.h:39
kSis100Electron
@ kSis100Electron
Definition: CbmDetectorID.h:25
NicaCbmEventInterface::GetStsTracks
NicaTrackClones * GetStsTracks() const
Definition: NicaCbmEventInterface.h:36
CbmRichRing
Definition: CbmRichRing.h:17
NicaCbmTrack::fTofTrack
CbmTofHit * fTofTrack
Definition: NicaCbmTrack.h:22
NicaCbmEventInterface
Definition: NicaCbmEventInterface.h:20
NicaCbmTrack::fTofTrackIndex
Int_t fTofTrackIndex
Definition: NicaCbmTrack.h:27
NicaCbmEvent
Definition: NicaCbmEvent.h:15
NicaCbmTrack
Definition: NicaCbmTrack.h:20
CbmMuchTrack
Definition: CbmMuchTrack.h:16
NicaCbmEventInterface.h
NicaCbmGlobalEventInterface
Definition: NicaCbmGlobalEventInterface.h:19
NicaCbmTrack::fMuchTrack
CbmMuchTrack * fMuchTrack
Definition: NicaCbmTrack.h:25
NicaCbmTrack::fRichRing
CbmRichRing * fRichRing
Definition: NicaCbmTrack.h:24
NicaCbmTrack::fTrdTrackIndex
Int_t fTrdTrackIndex
Definition: NicaCbmTrack.h:28
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
NicaCbmTrack::SetTofTrack
void SetTofTrack(CbmTofHit *tofTrack)
Definition: NicaCbmTrack.h:53
NicaCbmTrack::fRichRingIndex
Int_t fRichRingIndex
Definition: NicaCbmTrack.h:29
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
NicaCbmSetup
NicaCbmSetup
Definition: CbmDetectorID.h:25
NicaCbmTrack::CopyData
virtual void CopyData(NicaTrack *track)
Definition: NicaCbmTrack.cxx:79
CbmGlobalTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: CbmGlobalTrack.h:39
NicaCbmTrack::fTrdTrack
CbmTrdTrack * fTrdTrack
Definition: NicaCbmTrack.h:23
NicaCbmTrack::SetRichRing
void SetRichRing(CbmRichRing *tr)
Definition: NicaCbmTrack.h:55
NicaCbmEvent::GetTrdTracks
NicaTrackClones * GetTrdTracks() const
Definition: NicaCbmEvent.h:35
NicaCbmEventInterface::GetTrdTracks
NicaTrackClones * GetTrdTracks() const
Definition: NicaCbmEventInterface.h:37
CbmTrdTrack
Definition: CbmTrdTrack.h:22
NicaCbmTrack.h
NicaCbmEventInterface::GetRichRings
NicaTrackClones * GetRichRings() const
Definition: NicaCbmEventInterface.h:40
NicaCbmEvent::GetTofHits
NicaTrackClones * GetTofHits() const
Definition: NicaCbmEvent.h:34
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
NicaCbmEventInterface::GetMuchTracks
NicaTrackClones * GetMuchTracks() const
Definition: NicaCbmEventInterface.h:38
NicaCbmTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmTrack.cxx:28
NicaCbmTrack::SetMuchTrack
void SetMuchTrack(CbmMuchTrack *tr)
Definition: NicaCbmTrack.h:56
kSis100Muon
@ kSis100Muon
Definition: CbmDetectorID.h:25
NicaCbmTrack::SetTrdTrack
void SetTrdTrack(CbmTrdTrack *trdTrack)
Definition: NicaCbmTrack.h:54
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
NicaCbmTrack::NicaCbmTrack
NicaCbmTrack()
Definition: NicaCbmTrack.cxx:14
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
NicaCbmTrack::fMuchTrackIndex
Int_t fMuchTrackIndex
Definition: NicaCbmTrack.h:30
CbmStsTrack
Definition: CbmStsTrack.h:37
NicaCbmGlobalTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmGlobalTrack.cxx:33
NicaCbmEvent::GetRichRings
NicaTrackClones * GetRichRings() const
Definition: NicaCbmEvent.h:36
NicaCbmEvent::GetMuchTracks
NicaTrackClones * GetMuchTracks() const
Definition: NicaCbmEvent.h:37
NicaCbmGlobalTrack::CopyData
void CopyData(NicaTrack *other)
Definition: NicaCbmGlobalTrack.cxx:57