BOSS 6.6.4.p01
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.
 

Friends

class TrkReco
 

Detailed Description

A class to have MC information of TTrack.

Definition at line 54 of file TTrackMC.h.

Constructor & Destructor Documentation

◆ ~TTrackMC()

TTrackMC::~TTrackMC ( )
virtual

Destructor.

Definition at line 63 of file TTrackMC.cxx.

63 {
64}

Member Function Documentation

◆ charge()

bool TTrackMC::charge ( void  ) const
inline

returns charge matching.

Definition at line 181 of file TTrackMC.h.

181 {
182 return _charge;
183}

Referenced by TTrackManager::saveMCTables().

◆ dump()

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 val)
Definition: TMDCUtil.cxx:85
#define TTrackGhost
Definition: TTrackMC.h:21
#define TTrackBad
Definition: TTrackMC.h:20
#define TTrackGarbage
Definition: TTrackMC.h:18
#define TTrackCharge
Definition: TTrackMC.h:19
#define TTrackGood
Definition: TTrackMC.h:22
const std::string & name(void) const
returns/sets name.
Definition: TTrack.h:516

◆ hep()

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

returns a pointer to TTrackHEP.

Definition at line 175 of file TTrackMC.h.

175 {
176 return _hep;
177}

Referenced by TTrackManager::saveMCTables().

◆ hepId()

int TTrackMC::hepId ( void  ) const
inline

returns HEP ID.

Definition at line 169 of file TTrackMC.h.

169 {
170 return _hepID;
171}

◆ ptFraction()

double TTrackMC::ptFraction ( void  ) const
inline

returns pt fraction.

Definition at line 187 of file TTrackMC.h.

187 {
188 return _ptFraction;
189}

Referenced by TTrackManager::saveMCTables().

◆ ptPull()

double TTrackMC::ptPull ( void  ) const
inline

returns pull of pt.

Definition at line 241 of file TTrackMC.h.

241 {
242 return _ptPull;
243}

◆ ptResidual()

double TTrackMC::ptResidual ( void  ) const
inline

returns residual of pt.

Definition at line 229 of file TTrackMC.h.

229 {
230 return _ptResidual;
231}

◆ pzFraction()

double TTrackMC::pzFraction ( void  ) const
inline

returns pz fraction.

Definition at line 193 of file TTrackMC.h.

193 {
194 return _pzFraction;
195}

Referenced by TTrackManager::saveMCTables().

◆ pzPull()

double TTrackMC::pzPull ( void  ) const
inline

returns pull of pz.

Definition at line 247 of file TTrackMC.h.

247 {
248 return _pzPull;
249}

◆ pzResidual()

double TTrackMC::pzResidual ( void  ) const
inline

returns residual of pz.

Definition at line 235 of file TTrackMC.h.

235 {
236 return _pzResidual;
237}

◆ quality()

unsigned TTrackMC::quality ( void  ) const
inline

returns quality.

Definition at line 217 of file TTrackMC.h.

217 {
218 return _quality;
219}

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

◆ qualityString()

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

◆ residual()

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

returns residual of momentum.

Definition at line 223 of file TTrackMC.h.

223 {
224 return _residual;
225}

◆ state()

unsigned TTrackMC::state ( void  ) const
inline

returns state.

Definition at line 211 of file TTrackMC.h.

211 {
212 return _state;
213}

◆ update()

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}

◆ wireFraction()

double TTrackMC::wireFraction ( void  ) const
inline

returns wire fraction(F1).

Definition at line 199 of file TTrackMC.h.

199 {
200 return _wireFraction;
201}

Referenced by TTrackManager::saveMCTables().

◆ wireFractionHEP()

double TTrackMC::wireFractionHEP ( void  ) const
inline

returns wire fraction(F2).

Definition at line 205 of file TTrackMC.h.

205 {
206 return _wireFractionHEP;
207}

Referenced by TTrackManager::saveMCTables().

Friends And Related Function Documentation

◆ TrkReco

friend class TrkReco
friend

Definition at line 144 of file TTrackMC.h.


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