BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrackMC Class Reference

A class to have MC information of TTrack. More...

#include <TTrackMC.h>

Public Member Functions

virtual ~TTrackMC ()
 Destructor.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
int hepId (void) const
 returns HEP ID.
 
const TTrackHEP *const hep (void) const
 returns a pointer to TTrackHEP.
 
bool charge (void) const
 returns charge matching.
 
double wireFraction (void) const
 returns wire fraction(F1).
 
double wireFractionHEP (void) const
 returns wire fraction(F2).
 
double ptFraction (void) const
 returns pt fraction.
 
double pzFraction (void) const
 returns pz fraction.
 
const Hep3Vector & residual (void) const
 returns residual of momentum.
 
double ptResidual (void) const
 returns residual of pt.
 
double pzResidual (void) const
 returns residual of pz.
 
double ptPull (void) const
 returns pull of pt.
 
double pzPull (void) const
 returns pull of pz.
 
unsigned state (void) const
 returns state.
 
unsigned quality (void) const
 returns quality.
 
std::string qualityString (void) const
 returns quality.
 
void update (void)
 updates information.
 
virtual ~TTrackMC ()
 Destructor.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
int hepId (void) const
 returns HEP ID.
 
const TTrackHEP *const hep (void) const
 returns a pointer to TTrackHEP.
 
bool charge (void) const
 returns charge matching.
 
double wireFraction (void) const
 returns wire fraction(F1).
 
double wireFractionHEP (void) const
 returns wire fraction(F2).
 
double ptFraction (void) const
 returns pt fraction.
 
double pzFraction (void) const
 returns pz fraction.
 
const Hep3Vector & residual (void) const
 returns residual of momentum.
 
double ptResidual (void) const
 returns residual of pt.
 
double pzResidual (void) const
 returns residual of pz.
 
double ptPull (void) const
 returns pull of pt.
 
double pzPull (void) const
 returns pull of pz.
 
unsigned state (void) const
 returns state.
 
unsigned quality (void) const
 returns quality.
 
std::string qualityString (void) const
 returns quality.
 
void update (void)
 updates information.
 

Friends

class TrkReco
 

Detailed Description

A class to have MC information of TTrack.

Definition at line 54 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

Constructor & Destructor Documentation

◆ ~TTrackMC() [1/2]

TTrackMC::~TTrackMC ( )
virtual

Destructor.

Definition at line 63 of file TTrackMC.cxx.

63 {
64}

◆ ~TTrackMC() [2/2]

virtual TTrackMC::~TTrackMC ( )
virtual

Destructor.

Member Function Documentation

◆ charge() [1/2]

bool TTrackMC::charge ( void  ) const
inline

returns charge matching.

Definition at line 181 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

181 {
182 return _charge;
183}

Referenced by TTrackManager::saveMCTables().

◆ charge() [2/2]

bool TTrackMC::charge ( void  ) const

returns charge matching.

◆ dump() [1/2]

void TTrackMC::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const

dumps debug information.

Definition at line 141 of file TTrackMC.cxx.

141 {
142 std::cout << msg;
143 std::cout << _t.name() << ":";
144 std::cout << "state=" << _state << ":";
145 if (_quality & TTrackGood) std::cout << "good :";
146 else if (_quality & TTrackGhost) std::cout << "ghost :";
147 else if (_quality & TTrackBad) std::cout << "bad :";
148 else if (_quality & TTrackCharge) std::cout << "bad :";
149 else if (_quality & TTrackGarbage) std::cout << "garbage:";
150 else std::cout << "classification error:";
151 bitDisplay(_quality, 23, 15); std::cout << ":";
152 std::cout << _hepID << ":";
153 std::cout << _wireFraction << "," << _wireFractionHEP << ":";
154 std::cout << _ptFraction << "," << _pzFraction;
155 std::cout << std::endl;
156}
void bitDisplay(unsigned)
Definition: TMDCUtil.cxx:85
const std::string & name(void) const
returns/sets name.

◆ dump() [2/2]

void TTrackMC::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const

dumps debug information.

◆ hep() [1/2]

const TTrackHEP *const TTrackMC::hep ( void  ) const
inline

returns a pointer to TTrackHEP.

Definition at line 175 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

175 {
176 return _hep;
177}

Referenced by TTrackManager::saveMCTables().

◆ hep() [2/2]

const TTrackHEP *const TTrackMC::hep ( void  ) const

returns a pointer to TTrackHEP.

◆ hepId() [1/2]

int TTrackMC::hepId ( void  ) const
inline

returns HEP ID.

Definition at line 169 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

169 {
170 return _hepID;
171}

◆ hepId() [2/2]

int TTrackMC::hepId ( void  ) const

returns HEP ID.

◆ ptFraction() [1/2]

double TTrackMC::ptFraction ( void  ) const
inline

returns pt fraction.

Definition at line 187 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

187 {
188 return _ptFraction;
189}

Referenced by TTrackManager::saveMCTables().

◆ ptFraction() [2/2]

double TTrackMC::ptFraction ( void  ) const

returns pt fraction.

◆ ptPull() [1/2]

double TTrackMC::ptPull ( void  ) const
inline

returns pull of pt.

Definition at line 241 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

241 {
242 return _ptPull;
243}

◆ ptPull() [2/2]

double TTrackMC::ptPull ( void  ) const

returns pull of pt.

◆ ptResidual() [1/2]

double TTrackMC::ptResidual ( void  ) const
inline

returns residual of pt.

Definition at line 229 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

229 {
230 return _ptResidual;
231}

◆ ptResidual() [2/2]

double TTrackMC::ptResidual ( void  ) const

returns residual of pt.

◆ pzFraction() [1/2]

double TTrackMC::pzFraction ( void  ) const
inline

returns pz fraction.

Definition at line 193 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

193 {
194 return _pzFraction;
195}

Referenced by TTrackManager::saveMCTables().

◆ pzFraction() [2/2]

double TTrackMC::pzFraction ( void  ) const

returns pz fraction.

◆ pzPull() [1/2]

double TTrackMC::pzPull ( void  ) const
inline

returns pull of pz.

Definition at line 247 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

247 {
248 return _pzPull;
249}

◆ pzPull() [2/2]

double TTrackMC::pzPull ( void  ) const

returns pull of pz.

◆ pzResidual() [1/2]

double TTrackMC::pzResidual ( void  ) const
inline

returns residual of pz.

Definition at line 235 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

235 {
236 return _pzResidual;
237}

◆ pzResidual() [2/2]

double TTrackMC::pzResidual ( void  ) const

returns residual of pz.

◆ quality() [1/2]

unsigned TTrackMC::quality ( void  ) const
inline

returns quality.

Definition at line 217 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

217 {
218 return _quality;
219}

Referenced by TTrackManager::saveMCTables(), and TrackMCStatus().

◆ quality() [2/2]

unsigned TTrackMC::quality ( void  ) const

returns quality.

◆ qualityString() [1/2]

std::string TTrackMC::qualityString ( void  ) const

returns quality.

Definition at line 285 of file TTrackMC.cxx.

285 {
286 return TrackMCQualityString(_quality);
287}
std::string TrackMCQualityString(unsigned quality)
Definition: TTrackMC.cxx:313

◆ qualityString() [2/2]

std::string TTrackMC::qualityString ( void  ) const

returns quality.

◆ residual() [1/2]

const Hep3Vector & TTrackMC::residual ( void  ) const
inline

returns residual of momentum.

Definition at line 223 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

223 {
224 return _residual;
225}

◆ residual() [2/2]

const Hep3Vector & TTrackMC::residual ( void  ) const

returns residual of momentum.

◆ state() [1/2]

unsigned TTrackMC::state ( void  ) const
inline

returns state.

Definition at line 211 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

211 {
212 return _state;
213}

◆ state() [2/2]

unsigned TTrackMC::state ( void  ) const

returns state.

◆ update() [1/2]

void TTrackMC::update ( void  )

updates information.

Definition at line 67 of file TTrackMC.cxx.

67 {
68 _state = 0;
69 _quality = 0;
70/*
71 //...Prepare counters...
72 unsigned nHep = TTrackHEP::list().length();
73 unsigned nTrk = TrkReco::getTrkReco()->tracks().length();
74 unsigned * N1 = (unsigned *) malloc(nHep * sizeof(unsigned));
75 float * F1 = (float *) malloc(nHep * sizeof(float));
76 unsigned N2 = 0;
77 for (unsigned i = 0; i < nHep; i++) {
78 N1[i] = 0;
79 F1[i] = 0.;
80 }
81
82 //...Prepare for fraction F1...
83// const AList<TMLink> & cores = _t.cores();
84 const AList<TMLink> & cores = _t.finalHits();
85 unsigned nCores = cores.length();
86 for (unsigned i = 0; i < nCores; i++) {
87 TMLink * t = cores[i];
88 int hepID = t->hit()->mc()->hep()->id();
89 ++N1[hepID];
90 }
91
92 //...Calculate fraction F1 and find the best HEP...
93 int bestHep = -1;
94 TTrackHEP * hep = 0;
95 float bestF1 = 0.;
96 for (unsigned i = 0; i < nHep; i++) {
97 if (nCores) F1[i] = (float) N1[i] / (float) nCores;
98 if (F1[i] > bestF1) {
99 bestHep = i;
100 bestF1 = F1[i];
101 }
102 }
103
104 //...Check HEP...
105 float F2 = 0.;
106 if (bestHep != -1) {
107 hep = TTrackHEP::list()[bestHep];
108 unsigned nAll = 0;
109 for (unsigned i = 0; i < hep->hits().length(); i++) {
110 const TMDCWireHit * hit = hep->hits()[i]->hit();
111 if (! hit) continue;
112 if (hit->state() & WireHitInvalidForFit) continue;
113
114 ++nAll;
115 if (hit->track() == & _t) ++N2;
116 }
117
118 //...Calculate fraction F2...
119 if (nAll) F2 = (float) N2 / (float) nAll;
120 }
121
122 //...Store results...
123 _hepID = bestHep;
124 _hep = hep;
125 _wireFraction = bestF1;
126 _wireFractionHEP = F2;
127
128 //...Compare charge and momentum...
129 compare();
130
131 //...Classification...
132 classify();
133
134 //...Termination...
135 free(N1);
136 free(F1);
137*/
138}

◆ update() [2/2]

void TTrackMC::update ( void  )

updates information.

◆ wireFraction() [1/2]

double TTrackMC::wireFraction ( void  ) const
inline

returns wire fraction(F1).

Definition at line 199 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

199 {
200 return _wireFraction;
201}

Referenced by TTrackManager::saveMCTables().

◆ wireFraction() [2/2]

double TTrackMC::wireFraction ( void  ) const

returns wire fraction(F1).

◆ wireFractionHEP() [1/2]

double TTrackMC::wireFractionHEP ( void  ) const
inline

returns wire fraction(F2).

Definition at line 205 of file InstallArea/include/TrkReco/TrkReco/TTrackMC.h.

205 {
206 return _wireFractionHEP;
207}

Referenced by TTrackManager::saveMCTables().

◆ wireFractionHEP() [2/2]

double TTrackMC::wireFractionHEP ( void  ) const

returns wire fraction(F2).

Friends And Related Function Documentation

◆ TrkReco

TrkReco
friend

The documentation for this class was generated from the following files: