EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbmTrack.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CbmTrack.cxx
1 // -------------------------------------------------------------------------
2 // ----- CbmTrack source file -----
3 // ----- Created 29/11/07 by V. Friese -----
4 // ----- Modified 26/05/09 by A. Lebedev -----
5 // -------------------------------------------------------------------------
6 
7 #include "CbmTrack.h"
8 
9 #include "FairMultiLinkedData.h"
10 
11 #include <iostream>
12 #include <memory>
13 using std::cout;
14 using std::endl;
15 
16 // ----- Default constructor -------------------------------------------
18  TObject(),
19  fHitIndex(),
20  fHitType(),
21  fPidHypo(0),
22  fParamFirst(),
23  fParamLast(),
24  fFlag(0),
25  fChiSq(0.),
26  fNDF(0),
27  fPreviousTrackId(-1),
28  fLinks(NULL)
29 {
30 }
31 // -------------------------------------------------------------------------
32 
34  : TObject(rhs),
35  fHitIndex(rhs.fHitIndex),
36  fHitType(rhs.fHitType),
37  fPidHypo(rhs.fPidHypo),
38  fParamFirst(rhs.fParamFirst),
39  fParamLast(rhs.fParamLast),
40  fFlag(rhs.fFlag),
41  fChiSq(rhs.fChiSq),
42  fNDF(rhs.fNDF),
43  fPreviousTrackId(rhs.fPreviousTrackId),
44  fLinks(NULL)
45 {
46  if (NULL != rhs.fLinks) {
47  fLinks = new FairMultiLinkedData(*(rhs.fLinks));
48  }
49 }
50 
52 {
53 
54  if (this != &rhs) {
55 
56  TObject::operator=(rhs);
57  fHitIndex = rhs.fHitIndex;
58  fHitType = rhs.fHitType;
59  fPidHypo = rhs.fPidHypo;
61  fParamLast = rhs.fParamLast;
62  fFlag = rhs.fFlag;
63  fChiSq = rhs.fChiSq;
64  fNDF = rhs.fNDF;
66 
67  if (NULL != rhs.fLinks) {
68  std::auto_ptr<FairMultiLinkedData> tmp(new FairMultiLinkedData(*rhs.fLinks));
69  delete fLinks;
70  fLinks = tmp.release();
71  } else {
72  fLinks = NULL;
73  }
74  }
75  return *this;
76 }
77 
78 
79 
80 // ----- Destructor ----------------------------------------------------
82 {
83 }
84 // -------------------------------------------------------------------------
85 
86 // ----- Public method AddHit ------------------------------------------
88  Int_t index,
89  HitType type)
90 {
91  fHitIndex.push_back(index);//std::make_pair(type, index));
92  fHitType.push_back(type);
93 }
94 // -------------------------------------------------------------------------
95 
96 // ----- Public method Print -------------------------------------------
97 void CbmTrack::Print() const
98 {
99  cout << "CbmTrack: nof hits=" << fHitIndex.size() << ", chiSq=" << fChiSq
100  << ", NDF=" << fNDF << ", pidHypo=" << fPidHypo
101  << ", previousTrackId=" << fPreviousTrackId << ", flag=" << fFlag << endl;
102 // fParamFirst.Print();
103 // fParamLast.Print();
104 }
105 // -------------------------------------------------------------------------
106