BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSeg Class Reference

#include <MdcSeg.h>

+ Inheritance diagram for MdcSeg:

Public Member Functions

 MdcSeg (double bunchT)
 
virtual ~MdcSeg ()
 
double phi () const
 
double slope () const
 
double chisq () const
 
unsigned int quality () const
 
const double * errmat () const
 
const MdcSuperLayersuperlayer () const
 
MdcSegInfoinfo () const
 
void setInfo (MdcSegInfo *ptr)
 
void setAmbig ()
 
void setUsed ()
 
void setFull ()
 
void setPattern (unsigned thePatt)
 
int segAmbig ()
 
int segUsed ()
 
int segFull ()
 
unsigned segPattern () const
 
double bunchTime ()
 
void plotSeg () const
 
void plotSegAll () const
 
void setValues (int nInPatt, int nhit, MdcHit *hits[], MdcLine *span, const MdcSuperLayer *slay, int ambig[])
 
void setValues (int nInPatt, double inPhi, double inSlope, double chi2, double inError[3], const MdcSuperLayer *slay)
 
int addHits (MdcLine *span, MdcHit *hits[], const MdcHitMap *, double corr)
 
void markHits (const MdcMap< const MdcHit *, MdcSegUsage * > &usedHits) const
 
void append (MdcHitUse *)
 
void remove (MdcHitUse *)
 
int nHit () const
 
MdcHitUsehit (int i) const
 
double testCombSeg (const MdcSeg *) const
 
double testCombSegPt () const
 
double testCombSegTheta () const
 
double testCombSegPhi () const
 
double testCombSegAmbig () const
 
MdcSegoperator= (const MdcSeg &)
 
 MdcSeg (const MdcSeg &)
 
 MdcSeg (double bunchT)
 
virtual ~MdcSeg ()
 
double phi () const
 
double slope () const
 
double chisq () const
 
unsigned int quality () const
 
const double * errmat () const
 
const MdcSuperLayersuperlayer () const
 
MdcSegInfoinfo () const
 
void setInfo (MdcSegInfo *ptr)
 
void setAmbig ()
 
void setUsed ()
 
void setFull ()
 
void setPattern (unsigned thePatt)
 
int segAmbig ()
 
int segUsed ()
 
int segFull ()
 
unsigned segPattern () const
 
double bunchTime ()
 
void plotSeg () const
 
void plotSegAll () const
 
void setValues (int nInPatt, int nhit, MdcHit *hits[], MdcLine *span, const MdcSuperLayer *slay, int ambig[])
 
void setValues (int nInPatt, double inPhi, double inSlope, double chi2, double inError[3], const MdcSuperLayer *slay)
 
int addHits (MdcLine *span, MdcHit *hits[], const MdcHitMap *, double corr)
 
void markHits (const MdcMap< const MdcHit *, MdcSegUsage * > &usedHits) const
 
void append (MdcHitUse *)
 
void remove (MdcHitUse *)
 
int nHit () const
 
MdcHitUsehit (int i) const
 
double testCombSeg (const MdcSeg *) const
 
double testCombSegPt () const
 
double testCombSegTheta () const
 
double testCombSegPhi () const
 
double testCombSegAmbig () const
 
MdcSegoperator= (const MdcSeg &)
 
 MdcSeg (const MdcSeg &)
 

Static Public Member Functions

static MdcSegParamssegPar ()
 
static void setParam (MdcSegParams *segpar)
 
static MdcSegParamssegPar ()
 
static void setParam (MdcSegParams *segpar)
 

Additional Inherited Members

Detailed Description

Constructor & Destructor Documentation

◆ MdcSeg() [1/4]

MdcSeg::MdcSeg ( double  bunchT)

Definition at line 35 of file MdcSeg.cxx.

35 {
36//------------------------------------------------------------------------
37 _info = 0;
38 _bunchTime = bt;
39}

◆ ~MdcSeg() [1/2]

MdcSeg::~MdcSeg ( )
virtual

Definition at line 42 of file MdcSeg.cxx.

42 {
43//------------------------------------------------------------------------
44 if (_info != 0) delete _info;
45 reset(); // delete Hots
46}

◆ MdcSeg() [2/4]

MdcSeg::MdcSeg ( const MdcSeg other)

Definition at line 49 of file MdcSeg.cxx.

49 :
50 GmsListLink(), _slayer(other._slayer), _phi(other._phi), _slope(other._slope), _chisq(other._chisq), _qual(other._qual), _pattern(other._pattern), _info(other._info), _bunchTime(other._bunchTime)
51 //------------------------------------------------------------------------
52{
53 HepAListDeleteAll(_theList);
54 for(int i=0; i<other.nHit(); i++){
55 _theList.append(other.hit(i));
56 }
57 for(int j=0; j<3; j++){
58 _errmat[0] = other._errmat[0];
59 _errmat[1] = other._errmat[1];
60 _errmat[2] = other._errmat[2];
61 }
62 segParam = other.segParam;
63}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ MdcSeg() [3/4]

MdcSeg::MdcSeg ( double  bunchT)

◆ ~MdcSeg() [2/2]

virtual MdcSeg::~MdcSeg ( )
virtual

◆ MdcSeg() [4/4]

MdcSeg::MdcSeg ( const MdcSeg )

Member Function Documentation

◆ addHits() [1/2]

int MdcSeg::addHits ( MdcLine span,
MdcHit hits[],
const MdcHitMap ,
double  corr 
)

◆ addHits() [2/2]

int MdcSeg::addHits ( MdcLine span,
MdcHit hits[],
const MdcHitMap ,
double  corr 
)

◆ append() [1/2]

void MdcSeg::append ( MdcHitUse theHitUse)

Definition at line 353 of file MdcSeg.cxx.

353 {
354 //------------------------------------------------------------------------
355 _theList.append(theHitUse);
356}

Referenced by setValues().

◆ append() [2/2]

void MdcSeg::append ( MdcHitUse )

◆ bunchTime() [1/2]

double MdcSeg::bunchTime ( )
inline

Definition at line 62 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

62{return _bunchTime;}

Referenced by MdcSegGrouper::calcParByHits(), and MdcSegInfoSterO::calcStereo().

◆ bunchTime() [2/2]

double MdcSeg::bunchTime ( )
inline

Definition at line 62 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-48/MdcTrkRecon/MdcSeg.h.

62{return _bunchTime;}

◆ chisq() [1/2]

double MdcSeg::chisq ( ) const
inline

Definition at line 48 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

48{return _chisq;}

Referenced by plotSegAll().

◆ chisq() [2/2]

double MdcSeg::chisq ( ) const
inline

◆ errmat() [1/2]

const double * MdcSeg::errmat ( ) const
inline

◆ errmat() [2/2]

const double * MdcSeg::errmat ( ) const
inline

◆ hit() [1/2]

◆ hit() [2/2]

MdcHitUse * MdcSeg::hit ( int  i) const
inline

Definition at line 77 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-48/MdcTrkRecon/MdcSeg.h.

77{return _theList[i];}

◆ info() [1/2]

◆ info() [2/2]

MdcSegInfo * MdcSeg::info ( ) const
inline

◆ markHits() [1/2]

void MdcSeg::markHits ( const MdcMap< const MdcHit *, MdcSegUsage * > &  usedHits) const

Definition at line 148 of file MdcSeg.cxx.

148 {
149 //------------------------------------------------------------------------
150 for (int i = 0; i < nHit(); i++) {
151 MdcHitUse *alink = _theList[i];
152 MdcSegUsage *x ;
153 if ( usedHits.get( alink->mdcHit() , x) ) x->setUsedAmbig( alink->ambig() );
154 }
155}
Double_t x[10]
const MdcHit * mdcHit() const
Definition: MdcHitUse.cxx:69
bool get(const K &theKey, V &theAnswer) const
int nHit() const
Definition: MdcSeg.cxx:368

◆ markHits() [2/2]

void MdcSeg::markHits ( const MdcMap< const MdcHit *, MdcSegUsage * > &  usedHits) const

◆ nHit() [1/2]

int MdcSeg::nHit ( ) const

◆ nHit() [2/2]

int MdcSeg::nHit ( ) const

◆ operator=() [1/2]

MdcSeg & MdcSeg::operator= ( const MdcSeg other)

Definition at line 67 of file MdcSeg.cxx.

67 {
68 //------------------------------------------------------------------------
69 if(&other != this){
70
71 HepAListDeleteAll(_theList);
72 for(int i=0; i<other.nHit(); i++){
73 _theList.append(other.hit(i));
74 }
75 _slayer = other._slayer;
76 _phi = other._phi;
77 _slope= other._slope;
78 _errmat[0] = other._errmat[0];
79 _errmat[1] = other._errmat[1];
80 _errmat[2] = other._errmat[2];
81 _chisq = other._chisq;
82 _qual = other._qual;
83 _pattern = other._pattern;
84 _info = other._info;
85 _bunchTime = other._bunchTime;
86 segParam = other.segParam;
87 }
88
89 return *this;
90}

◆ operator=() [2/2]

MdcSeg & MdcSeg::operator= ( const MdcSeg )

◆ phi() [1/2]

◆ phi() [2/2]

double MdcSeg::phi ( ) const
inline

◆ plotSeg() [1/2]

void MdcSeg::plotSeg ( ) const

Definition at line 194 of file MdcSeg.cxx.

194 {
195 //------------------------------------------------------------------------
196 std::cout<<superlayer()->slayNum()<<" pat"<<segPattern()<<" ";
197 for (int ihit=0 ; ihit< nHit() ; ihit++){
198 hit(ihit)->mdcHit()->print(std::cout);//print hit
199 std::cout <<hit(ihit)->ambig()<<" ";
200 }
201 if (info()!=NULL){
202 cout<< " . ";
203 }
204 //std::cout << std::endl;
205}
void print(std::ostream &o) const
const MdcSuperLayer * superlayer() const

Referenced by MdcSegInfoSterO::calcStereo(), MdcSegGrouperSt::fillWithSegs(), and MdcSegGrouperSt::incompWithGroup().

◆ plotSeg() [2/2]

void MdcSeg::plotSeg ( ) const

◆ plotSegAll() [1/2]

void MdcSeg::plotSegAll ( ) const

Definition at line 159 of file MdcSeg.cxx.

159 {
160 //------------------------------------------------------------------------
161 //print hit
162 //if(superlayer()!=NULL) std::cout<<"sl"<<superlayer()->slayNum()<<" p"<<segPattern()<<" st"<<quality();
163 for (int ihit=0 ; ihit< nHit() ; ihit++){
164 hit(ihit)->mdcHit()->print(std::cout);
165 std::cout << setw(2)<<hit(ihit)->ambig()<<" ";
166 }
167
168 cout<<setiosflags(ios::fixed);
169 if (info()!=NULL){
170 std::cout<< " phi " << setprecision(2) << phi()
171 << " slope " <<std::setw(2)<< setprecision(2) <<slope()<<" ";
172 if(superlayer()->whichView()==0){
173 std::cout <<setprecision (2) <<"phi0="<<info()->par(0);
174 cout<<setprecision(5)<<" cpa="<<info()->par(1);
175 }else{
176 std::cout <<setprecision(2)<<"z0="<<info()->par(0)
177 <<setprecision(2)<<" ct="<<info()->par(1);
178 }
179 if(fabs(info()->arc())>0.0001){
180 std::cout<<setprecision(2)<<" arc="<<info()->arc();
181 }
182 std::cout<<setprecision(3)<<" chi2="<<_chisq;
183 }else{
184 std::cout<< " phi " << setprecision(2) << phi()
185 << " slope " <<std::setw(2)<< setprecision(2) <<slope()
186 << " chi2 "<<setprecision(3) <<chisq();
187 }
188
189 cout<<setprecision(6);
190 cout<<setiosflags(ios::scientific);
191}

Referenced by MdcSegGrouper::combineSegs(), MdcTrackList::dumpSeed(), MdcSegGrouperAx::incompWithSeg(), MdcSegList::plot(), and MdcSegGrouper::transferHits().

◆ plotSegAll() [2/2]

void MdcSeg::plotSegAll ( ) const

◆ quality() [1/2]

unsigned int MdcSeg::quality ( ) const
inline

Definition at line 49 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

49{return _qual;}

Referenced by MdcSegGrouperAx::incompWithSeg().

◆ quality() [2/2]

unsigned int MdcSeg::quality ( ) const
inline

◆ remove() [1/2]

void MdcSeg::remove ( MdcHitUse theHitUse)

Definition at line 360 of file MdcSeg.cxx.

360 {
361 //------------------------------------------------------------------------
362 _theList.remove(theHitUse);
363 delete theHitUse;
364}

◆ remove() [2/2]

void MdcSeg::remove ( MdcHitUse )

◆ segAmbig() [1/2]

int MdcSeg::segAmbig ( )
inline

◆ segAmbig() [2/2]

int MdcSeg::segAmbig ( )
inline

◆ segFull() [1/2]

int MdcSeg::segFull ( )
inline

◆ segFull() [2/2]

int MdcSeg::segFull ( )
inline

◆ segPar() [1/2]

static MdcSegParams * MdcSeg::segPar ( )
inlinestatic

◆ segPar() [2/2]

static MdcSegParams * MdcSeg::segPar ( )
inlinestatic

◆ segPattern() [1/2]

unsigned MdcSeg::segPattern ( ) const
inline

Definition at line 61 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

61{return _pattern;}

Referenced by plotSeg().

◆ segPattern() [2/2]

unsigned MdcSeg::segPattern ( ) const
inline

◆ segUsed() [1/2]

int MdcSeg::segUsed ( )
inline

◆ segUsed() [2/2]

int MdcSeg::segUsed ( )
inline

◆ setAmbig() [1/2]

void MdcSeg::setAmbig ( )
inline

Definition at line 54 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

54{_qual |= segAmbigFlag;}

◆ setAmbig() [2/2]

void MdcSeg::setAmbig ( )
inline

◆ setFull() [1/2]

void MdcSeg::setFull ( )
inline

Definition at line 56 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

56{_qual |= segFullFlag;}

◆ setFull() [2/2]

void MdcSeg::setFull ( )
inline

◆ setInfo() [1/2]

void MdcSeg::setInfo ( MdcSegInfo ptr)

Definition at line 96 of file MdcSeg.cxx.

96 {
97 //------------------------------------------------------------------------
98 delete _info; // if any
99 _info = newInfo;
100}

Referenced by MdcSegGrouperAx::fillWithSegs(), MdcSegGrouperCsmc::fillWithSegs(), and MdcSegGrouperSt::fillWithSegs().

◆ setInfo() [2/2]

void MdcSeg::setInfo ( MdcSegInfo ptr)

◆ setParam() [1/2]

static void MdcSeg::setParam ( MdcSegParams segpar)
inlinestatic

Definition at line 80 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

80{segParam = segpar;}

Referenced by MdcSegList::MdcSegList().

◆ setParam() [2/2]

static void MdcSeg::setParam ( MdcSegParams segpar)
inlinestatic

Definition at line 80 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-48/MdcTrkRecon/MdcSeg.h.

80{segParam = segpar;}

◆ setPattern() [1/2]

void MdcSeg::setPattern ( unsigned  thePatt)
inline

Definition at line 57 of file InstallArea/include/MdcTrkRecon/MdcTrkRecon/MdcSeg.h.

57{_pattern = thePatt;}

◆ setPattern() [2/2]

void MdcSeg::setPattern ( unsigned  thePatt)
inline

Definition at line 57 of file Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-48/MdcTrkRecon/MdcSeg.h.

57{_pattern = thePatt;}

◆ setUsed() [1/2]

void MdcSeg::setUsed ( )
inline

◆ setUsed() [2/2]

void MdcSeg::setUsed ( )
inline

◆ setValues() [1/4]

void MdcSeg::setValues ( int  nInPatt,
double  inPhi,
double  inSlope,
double  chi2,
double  inError[3],
const MdcSuperLayer slay 
)

Definition at line 128 of file MdcSeg.cxx.

129 {
130 //------------------------------------------------------------------------
131 // Sets segment values with no associated hits
132 _qual = 0;
133 if (nInPatt == 4) _qual |= segFullFlag;
134 _phi = inPhi;
135 _slope = inSlope;
136 _chisq = chi2;
137 _errmat[0] = inError[0];
138 _errmat[1] = inError[1];
139 _errmat[2] = inError[2];
140 _slayer = slay;
141 reset(); // clears hit list
142
143 return;
144}

◆ setValues() [2/4]

void MdcSeg::setValues ( int  nInPatt,
double  inPhi,
double  inSlope,
double  chi2,
double  inError[3],
const MdcSuperLayer slay 
)

◆ setValues() [3/4]

void MdcSeg::setValues ( int  nInPatt,
int  nhit,
MdcHit hits[],
MdcLine span,
const MdcSuperLayer slay,
int  ambig[] 
)

Definition at line 104 of file MdcSeg.cxx.

105 {
106 //------------------------------------------------------------------------
107 _qual = 0;
108 if (nInPatt == 4) _qual |= segFullFlag;
109 _phi = BesAngle(span->intercept);
110 _slope = span->slope;
111 _chisq = span->chisq;
112 _errmat[0] = span->errmat[0];
113 _errmat[1] = span->errmat[1];
114 _errmat[2] = span->errmat[2];
115 reset();
116 _slayer = slay;
117 for (int i = 0; i < nhit; i++) {
118 MdcHitUse *alink = new MdcHitUse(*(hits[i]), superlayer()->rad0(),
119 ambig[i]);
120 append(alink);
121 }
122
123 return;
124}
void append(MdcHitUse *)
Definition: MdcSeg.cxx:353

◆ setValues() [4/4]

void MdcSeg::setValues ( int  nInPatt,
int  nhit,
MdcHit hits[],
MdcLine span,
const MdcSuperLayer slay,
int  ambig[] 
)

◆ slope() [1/2]

double MdcSeg::slope ( ) const
inline

◆ slope() [2/2]

double MdcSeg::slope ( ) const
inline

◆ superlayer() [1/2]

◆ superlayer() [2/2]

const MdcSuperLayer * MdcSeg::superlayer ( ) const
inline

◆ testCombSeg() [1/2]

double MdcSeg::testCombSeg ( const MdcSeg testSeg) const

Definition at line 376 of file MdcSeg.cxx.

376 {
377 //------------------------------------------------------------------------
378 int tkId= -1;
379 for (int i=0; i<nHit(); i++){
380 const MdcHit* h = hit(i)->mdcHit();
381 unsigned int l = h->layernumber();
382 unsigned int w = h->wirenumber();
383 //std::cout<< __FILE__ << " ref " << i << " haveDigiTk("<<l<<","<<w<<")"<<haveDigiTk[l][w]<<std::endl;
384 if ( haveDigiTk[l][w]<0 || haveDigiTk[l][w]>100 ) continue;
385 if (tkId<0){
386 tkId = haveDigiTk[l][w];
387 }else if (haveDigiTk[l][w] != tkId){
388 return -1;//hits in this seg not in same mc track
389 }
390 }//end for
391
392 double nSame = 0.;
393 for (int i=0; i<testSeg->nHit(); i++){
394 const MdcHit* h = testSeg->hit(i)->mdcHit();
395 unsigned int l = h->layernumber();
396 unsigned int w = h->wirenumber();
397 if (haveDigiTk[l][w] == tkId){
398 ++nSame;
399 }
400 }
401
402 return nSame/testSeg->nHit();
403}
double w

Referenced by MdcSegGrouperAx::incompWithSeg().

◆ testCombSeg() [2/2]

double MdcSeg::testCombSeg ( const MdcSeg ) const

◆ testCombSegAmbig() [1/2]

double MdcSeg::testCombSegAmbig ( ) const

Definition at line 458 of file MdcSeg.cxx.

458 {
459 //------------------------------------------------------------------------
460 double ambigOk = 0.;
461 for (int i=0; i<nHit(); i++){
462 const MdcHit* h = hit(i)->mdcHit();
463 unsigned int l = h->layernumber();
464 unsigned int w = h->wirenumber();
465 if( hit(i)->ambig() == haveDigiAmbig[l][w] ) ambigOk++;
466 }//end for
467
468 return ambigOk/nHit();
469}

Referenced by MdcSegGrouperAx::incompWithSeg().

◆ testCombSegAmbig() [2/2]

double MdcSeg::testCombSegAmbig ( ) const

◆ testCombSegPhi() [1/2]

double MdcSeg::testCombSegPhi ( ) const

Definition at line 441 of file MdcSeg.cxx.

441 {
442 //------------------------------------------------------------------------
443 double truthPhi = -999.;
444 for (int i=0; i<nHit(); i++){
445 const MdcHit* h = hit(i)->mdcHit();
446 unsigned int l = h->layernumber();
447 unsigned int w = h->wirenumber();
448 if ( haveDigiPhi[l][w]<-998. ) continue;
449 //std::cout<< __FILE__ << " " << __LINE__ << " haveDigiPhi("<<l<<","<<w<<")"<<haveDigiPhi[l][w]<<std::endl;
450 if (truthPhi<-998.){ truthPhi = haveDigiPhi[l][w]; }
451 }//end for
452
453 return truthPhi;
454}

◆ testCombSegPhi() [2/2]

double MdcSeg::testCombSegPhi ( ) const

◆ testCombSegPt() [1/2]

double MdcSeg::testCombSegPt ( ) const

Definition at line 407 of file MdcSeg.cxx.

407 {
408 //------------------------------------------------------------------------
409 double truthPt = -1.;
410 for (int i=0; i<nHit(); i++){
411 const MdcHit* h = hit(i)->mdcHit();
412 unsigned int l = h->layernumber();
413 unsigned int w = h->wirenumber();
414 if ( haveDigiPt[l][w]<0 ) continue;
415 //std::cout<< __FILE__ << " " << __LINE__ << " haveDigiPt("<<l<<","<<w<<")"<<haveDigiPt[l][w]<<std::endl;
416 if (truthPt<0){ truthPt = haveDigiPt[l][w]; }
417 }//end for
418
419 return truthPt;
420}

Referenced by MdcSegGrouperAx::incompWithSeg().

◆ testCombSegPt() [2/2]

double MdcSeg::testCombSegPt ( ) const

◆ testCombSegTheta() [1/2]

double MdcSeg::testCombSegTheta ( ) const

Definition at line 424 of file MdcSeg.cxx.

424 {
425 //------------------------------------------------------------------------
426 double truthTheta = -999.;
427 for (int i=0; i<nHit(); i++){
428 const MdcHit* h = hit(i)->mdcHit();
429 unsigned int l = h->layernumber();
430 unsigned int w = h->wirenumber();
431 if ( haveDigiTheta[l][w]<-998. ) continue;
432 //std::cout<< __FILE__ << " " << __LINE__ << " haveDigiTheta("<<l<<","<<w<<")"<<haveDigiTheta[l][w]<<std::endl;
433 if (truthTheta<-998.){ truthTheta = haveDigiTheta[l][w]; }
434 }//end for
435
436 return truthTheta;
437}

Referenced by MdcSegGrouperAx::incompWithSeg().

◆ testCombSegTheta() [2/2]

double MdcSeg::testCombSegTheta ( ) const

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