9#include "ComplexTrack.h"
10#include "ComplexEvent.h"
11#include "DataFormat.h"
16 ComplexTrack::ComplexTrack() : Track(), fMatchID(-1), fRealTrack(NULL), fImgTrack(NULL) {}
18 ComplexTrack::~ComplexTrack() {}
20 void ComplexTrack::CopyData(
Track* other) {
21 Track::CopyData(other);
26 Track(other), fMatchID(other.fMatchID), fRealTrack(other.fRealTrack), fImgTrack(other.fImgTrack) {}
28 ComplexTrack& ComplexTrack::operator=(
const ComplexTrack& other) {
31 fMatchID = other.fMatchID;
32 fRealTrack = other.fRealTrack;
33 fImgTrack = other.fImgTrack;
39 if (fieldID >= DataFieldID::Internal::EventStart) {
44 }
else if (fieldID >= DataFieldID::ImStep) {
45 if (GetImgTrack() ==
nullptr)
return FLT_MIN;
46 return GetImgTrack()->
GetFieldVal(fieldID - DataFieldID::ImStep);
47 }
else if (fieldID >= DataFieldID::ReStep) {
48 return GetRealTrack()->
GetFieldVal(fieldID - DataFieldID::ReStep);
50 Track* mc = GetImgTrack();
51 Track* reco = GetRealTrack();
52 if (mc ==
nullptr)
return FLT_MIN;
54 case DataFieldID::Track::EComplex::kDeltaPt:
return mc->
GetMomentum().Pt() - reco->
GetMomentum().Pt();
break;
55 case DataFieldID::Track::EComplex::kDeltaPz:
return mc->
GetMomentum().Pz() - reco->
GetMomentum().Pz();
break;
57 case DataFieldID::Track::EComplex::kDeltaPx:
return mc->
GetMomentum().Px() - reco->
GetMomentum().Px();
break;
58 case DataFieldID::Track::EComplex::kDeltaPy:
return mc->
GetMomentum().Py() - reco->
GetMomentum().Py();
break;
59 case DataFieldID::Track::EComplex::kDeltaPhi:
62 case DataFieldID::Track::EComplex::kDeltaTheta:
65 case DataFieldID::Track::EComplex::kDeltaEta:
return mc->
GetMomentum().Eta() - reco->
GetMomentum().Eta();
break;
73 if (fieldID >= DataFieldID::Internal::EventStart) {
78 }
else if (fieldID >= DataFieldID::ImStep) {
82 TString name = tr->
GetFieldName(fieldID - DataFieldID::ImStep) +
" (im)";
86 }
else if (fieldID >= DataFieldID::ReStep) {
90 TString name = tr->
GetFieldName(fieldID - DataFieldID::ReStep) +
" (re)";
95 case DataFieldID::Track::EComplex::kDeltaPt:
return "#Delta p_{T} [GeV/c]";
break;
96 case DataFieldID::Track::EComplex::kDeltaPz:
return "#Delta p_{z} [GeV/c]";
break;
97 case DataFieldID::Track::EComplex::kDeltaP:
return "#Delta p [GeV/c]";
break;
98 case DataFieldID::Track::EComplex::kDeltaPx:
return "#Delta p_{x} [GeV/c]";
break;
99 case DataFieldID::Track::EComplex::kDeltaPy:
return "#Delta p_{y} [GeV/c]";
break;
100 case DataFieldID::Track::EComplex::kDeltaPhi:
return "#Delta #phi [rad]";
break;
101 case DataFieldID::Track::EComplex::kDeltaTheta:
return "#Delta #theta [rad]";
break;
102 case DataFieldID::Track::EComplex::kDeltaEta:
return "#Delta #eta []";
break;
111 if (fRealTrack) fRealTrack->
Clear();
112 if (fImgTrack) fImgTrack->
Clear();
117 fRealTrack =
nullptr;
Track * GetNewTrack() const
virtual Float_t GetFieldVal(Int_t fieldID) const
virtual void ResetTrack(Int_t thisID=-1, Event *event=nullptr)
Track & operator=(const Track &track)=default
const TLorentzVector & GetMomentum() const
void SetEvent(Event *event)
virtual Float_t GetFieldVal(Int_t fieldID) const
virtual TString GetFieldName(Int_t fieldID) const
virtual void CopyAllData(Track *other)
virtual void Clear(Option_t *opt="")