CbmRoot
NicaCbmMatchedTrack.cxx
Go to the documentation of this file.
1 /*
2  * NicaCbmMatchedTrack.cxx
3  *
4  * Created on: 12 lip 2019
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
9 #include "NicaCbmMatchedTrack.h"
10 #include "NicaCbmEvent.h"
12 
14  : fStsMCIndex(-1)
15  , fTrdMCIndex(-1)
16  , fTofMCIndex(-1)
17  , fRichMCIndex(-1)
18  , fMuchMCIndex(-1) {}
19 
21 
23  NicaCbmGlobalEventInterface* interface) {
24  NicaCbmTrack::Update(track, interface);
26  CbmTrackMatchNew* match_sts = NULL;
27  CbmTrackMatchNew* match_tof = NULL;
28  CbmTrackMatchNew* match_trd = NULL;
29  CbmTrackMatchNew* match_rich = NULL;
30  CbmTrackMatchNew* match_much = NULL;
31 
32  if (GetStsTrackIndex() >= 0)
33  match_sts =
34  (CbmTrackMatchNew*) ev->GetStsMatches()->UncheckedAt(GetStsTrackIndex());
35  if (GetTofTrackIndex() >= 0)
36  match_tof =
37  (CbmTrackMatchNew*) ev->GetTofMatches()->UncheckedAt(GetTofTrackIndex());
38  if (GetTrdTrackIndex() >= 0)
39  match_trd =
40  (CbmTrackMatchNew*) ev->GetTrdMatches()->UncheckedAt(GetTrdTrackIndex());
41  if (match_sts) {
42  fStsMCIndex = match_sts->GetMatchedLink().GetIndex();
43  } else {
44  fStsMCIndex = -1;
45  }
46  if (match_tof) {
47  fTofMCIndex = match_tof->GetMatchedLink().GetIndex();
48  } else {
49  fTofMCIndex = -1;
50  }
51  if (match_trd) {
52  fTrdMCIndex = match_trd->GetMatchedLink().GetIndex();
53  } else {
54  fTrdMCIndex = -1;
55  }
56  NicaCbmSetup mode = ev->GetMode();
57  switch (mode) {
58  case kSis100Electron: {
59  if (GetRichRingIndex() >= 0)
60  match_rich = (CbmTrackMatchNew*) ev->GetRichMatches()->UncheckedAt(
62  if (match_rich) {
63  fRichMCIndex = match_rich->GetMatchedLink().GetIndex();
64  } else {
65  fRichMCIndex = -1;
66  }
67  } break;
68  case kSis100Hadron: break;
69  case kSis100Muon: {
70  if (GetMuchIndex() >= 0)
71  match_much =
72  (CbmTrackMatchNew*) ev->GetMuchMatches()->UncheckedAt(GetMuchIndex());
73  if (match_much) {
74  fMuchMCIndex = match_much->GetMatchedLink().GetIndex();
75  } else {
76  fMuchMCIndex = -1;
77  }
78  } break;
79  }
80 }
81 
82 void NicaCbmMatchedTrack::CopyData(NicaTrack* track) {
85  fStsMCIndex = tr->GetStsMcIndex();
86  fTofMCIndex = tr->GetTofMcIndex();
87  fTrdMCIndex = tr->GetTrdMcIndex();
90 }
NicaCbmEventInterface::GetMode
NicaCbmSetup GetMode() const
Definition: NicaCbmEventInterface.h:41
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
NicaCbmMatchedEventInterface::GetTrdMatches
TClonesArray * GetTrdMatches() const
Definition: NicaCbmMatchedEventInterface.h:32
NicaCbmTrack::GetMuchIndex
Int_t GetMuchIndex() const
Definition: NicaCbmTrack.h:46
NicaCbmMatchedTrack::fTofMCIndex
Int_t fTofMCIndex
Definition: NicaCbmMatchedTrack.h:18
NicaCbmMatchedEventInterface::GetStsMatches
TClonesArray * GetStsMatches() const
Definition: NicaCbmMatchedEventInterface.h:30
NicaCbmEvent.h
NicaCbmMatchedEventInterface
Definition: NicaCbmMatchedEventInterface.h:16
NicaCbmMatchedTrack::fMuchMCIndex
Int_t fMuchMCIndex
Definition: NicaCbmMatchedTrack.h:20
NicaCbmMatchedEventInterface::GetMuchMatches
TClonesArray * GetMuchMatches() const
Definition: NicaCbmMatchedEventInterface.h:34
NicaCbmMatchedTrack::GetTrdMcIndex
Int_t GetTrdMcIndex() const
Definition: NicaCbmMatchedTrack.h:29
kSis100Electron
@ kSis100Electron
Definition: CbmDetectorID.h:25
NicaCbmTrack::GetTofTrackIndex
Int_t GetTofTrackIndex() const
Definition: NicaCbmTrack.h:43
NicaCbmMatchedTrack::GetTofMcIndex
Int_t GetTofMcIndex() const
Definition: NicaCbmMatchedTrack.h:28
NicaCbmGlobalEventInterface
Definition: NicaCbmGlobalEventInterface.h:19
NicaCbmMatchedTrack::NicaCbmMatchedTrack
NicaCbmMatchedTrack()
Definition: NicaCbmMatchedTrack.cxx:13
NicaCbmMatchedEventInterface::GetTofMatches
TClonesArray * GetTofMatches() const
Definition: NicaCbmMatchedEventInterface.h:31
NicaCbmMatchedTrack::fTrdMCIndex
Int_t fTrdMCIndex
Definition: NicaCbmMatchedTrack.h:17
kSis100Hadron
@ kSis100Hadron
Definition: CbmDetectorID.h:25
NicaCbmTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: NicaCbmTrack.h:45
NicaCbmSetup
NicaCbmSetup
Definition: CbmDetectorID.h:25
NicaCbmTrack::CopyData
virtual void CopyData(NicaTrack *track)
Definition: NicaCbmTrack.cxx:79
NicaCbmMatchedTrack.h
NicaCbmMatchedTrack::~NicaCbmMatchedTrack
virtual ~NicaCbmMatchedTrack()
Definition: NicaCbmMatchedTrack.cxx:20
NicaCbmMatchedEventInterface::GetRichMatches
TClonesArray * GetRichMatches() const
Definition: NicaCbmMatchedEventInterface.h:33
NicaCbmMatchedTrack::GetRichMcIndex
Int_t GetRichMcIndex() const
Definition: NicaCbmMatchedTrack.h:30
NicaCbmMatchedTrack::GetMuchMcIndex
Int_t GetMuchMcIndex() const
Definition: NicaCbmMatchedTrack.h:31
NicaCbmMatchedTrack::fStsMCIndex
Int_t fStsMCIndex
Definition: NicaCbmMatchedTrack.h:16
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
NicaCbmMatchedTrack::CopyData
virtual void CopyData(NicaTrack *track)
Definition: NicaCbmMatchedTrack.cxx:82
NicaCbmMatchedTrack
Definition: NicaCbmMatchedTrack.h:15
NicaCbmMatchedTrack::fRichMCIndex
Int_t fRichMCIndex
Definition: NicaCbmMatchedTrack.h:19
NicaCbmTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: NicaCbmTrack.h:44
NicaCbmTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmTrack.cxx:28
NicaCbmMatchedTrack::GetStsMcIndex
Int_t GetStsMcIndex() const
Definition: NicaCbmMatchedTrack.h:27
kSis100Muon
@ kSis100Muon
Definition: CbmDetectorID.h:25
NicaCbmMatchedEventInterface.h
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
NicaCbmTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: NicaCbmTrack.h:42
NicaCbmMatchedTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmMatchedTrack.cxx:22