BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TConformalFinder0 Class Reference

A class to find tracks with the conformal method. More...

#include <TConformalFinder0.h>

+ Inheritance diagram for TConformalFinder0:

Public Member Functions

 TConformalFinder0 (float maxSigma, float fraction, float stereoZ3, float stereoZ4, float stereoChisq3, float stereoChisq4, float stereoMaxSigma, unsigned fittingCorrections, float salvageLevel, bool cosmic)
 Constructor.
 
virtual ~TConformalFinder0 ()
 Destructor.
 
std::string name (void) const
 returns name.
 
std::string version (void) const
 returns version.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const AList< TMLink > & axialConformalLinks (void) const
 returns a list of conformal links.
 
const AList< TMLink > & stereoConformalLinks (void) const
 returns a list of conformal links.
 
void clear (void)
 clear internal information.
 
int doit (const AList< TMDCWireHit > &axialHits, const AList< TMDCWireHit > &stereoHits, AList< TTrack > &tracks, AList< TTrack > &tracks3D)
 finds tracks.
 
AList< AList< TSegment0 > > findSegments (const AList< TMLink > &in) const
 finds segments.
 
AList< AList< TSegment0 > > findSegments2 (const AList< TMLink > &in) const
 
AList< TSegment0findClusters (const THistogram &) const
 finds segments. (obsolete functions)
 
AList< TSegment0findClusters2 (const THistogram &) const
 
bool doStereo (bool)
 sets swtich for stereo reconstruction.
 
bool doSalvage (bool)
 sets switch for salvaging.
 
- Public Member Functions inherited from TFinderBase
 TFinderBase ()
 Constructor.
 
virtual ~TFinderBase ()
 Destructor.
 
virtual int debugLevel (void) const
 returns debug level.
 
virtual int debugLevel (int)
 sets debug level.
 

Static Public Member Functions

static void conformalTransformation (const HepPoint3D &center, const AList< TMDCWireHit > &hits, AList< TMLink > &links)
 transforms hits into a conformal plane. 'center' is a center of the transformation. Z position of 'center' must be zero. Transformed positions are newly created, and are stored in 'links'.
 
static void conformalTransformationDriftCircle (const HepPoint3D &center, const AList< TMDCWireHit > &hits, AList< TMLink > &links)
 transforms drift circle of hits into a conformal plane. transformed positions( x0, y0, r) are stored in 'links'.
 
static void conformalTransformationRphi (const HepPoint3D &center, const AList< TMDCWireHit > &hits, AList< TMLink > &links)
 transforms hits into a conformal plane. 'center' is a center of the transformation. Z position of 'center' must be zero. Transformed positions are newly created, and are stored in 'links'.
 

Detailed Description

A class to find tracks with the conformal method.

Definition at line 40 of file TConformalFinder0.h.

Constructor & Destructor Documentation

◆ TConformalFinder0()

TConformalFinder0::TConformalFinder0 ( float maxSigma,
float fraction,
float stereoZ3,
float stereoZ4,
float stereoChisq3,
float stereoChisq4,
float stereoMaxSigma,
unsigned fittingCorrections,
float salvageLevel,
bool cosmic )

Constructor.

Definition at line 33 of file TConformalFinder0.cxx.

43: TFinderBase(),
44 _builder(0),
45 _doStereo(true),
46 _doSalvage(true), //liuqg
47 _fraction(fraction) {
48
49 //...Parameters for a track...
50 _trackSelector.nLinks(4);
51 _trackSelector.nSuperLayers(2);
52 _trackSelector.minPt(0.05);
53 _trackSelector.maxImpact(100.);
54 _trackSelector.maxSigma(maxSigma);
55 _trackSelector.nLinksStereo(3);
56 _trackSelector.maxDistance(30.);
57
58 //...Make a builder...
59 if (cosmic) _builder = new TBuilderCosmic("cosmic builder", salvageLevel);
60 else _builder = new TBuilder0("conformal builder",
61 stereoZ3,
62 stereoZ4,
63 stereoChisq3,
64 stereoChisq4,
65 stereoMaxSigma,
66 fittingCorrections,
67 salvageLevel);
68
69 //...Set up TBuilder...
70 _builder->trackSelector(_trackSelector);
71}
A class to build a track.
Definition TBuilder0.h:35
const TMSelector & trackSelector(void) const
returns a track selector.
Definition TBuilder0.h:131
A class to build a cosmic track.
TFinderBase()
Constructor.
double maxDistance(void) const
returns max. distance required for stereo hits.
Definition TMSelector.h:235
unsigned nSuperLayers(void) const
returns min. # of super layers required.
Definition TMSelector.h:150
double maxImpact(void) const
returns max. impact(2D) required.
Definition TMSelector.h:184
unsigned nLinks(void) const
returns min. # of hits(TMLinks) requried.
Definition TMSelector.h:133
double maxSigma(void) const
returns max. sigma for each TMLink.
Definition TMSelector.h:201
unsigned nLinksStereo(void) const
returns min. # of stereo hits(TMLinks) requried.
Definition TMSelector.h:218
double minPt(void) const
returns min. pt required.
Definition TMSelector.h:167

◆ ~TConformalFinder0()

TConformalFinder0::~TConformalFinder0 ( )
virtual

Destructor.

Definition at line 73 of file TConformalFinder0.cxx.

73 {
74 delete _builder;
75}

Member Function Documentation

◆ axialConformalLinks()

const AList< TMLink > & TConformalFinder0::axialConformalLinks ( void ) const
inline

returns a list of conformal links.

Definition at line 190 of file TConformalFinder0.h.

190 {
191 return _axialConfLinks;
192}

◆ clear()

void TConformalFinder0::clear ( void )
virtual

clear internal information.

Implements TFinderBase.

Definition at line 89 of file TConformalFinder0.cxx.

89 {
90 HepAListDeleteAll(_axialConfLinks);
91 HepAListDeleteAll(_stereoConfLinks);
92 _unusedAxialConfLinks.removeAll();
93 _unusedStereoConfLinks.removeAll();
94 _goodAxialConfLinks.removeAll();
95 HepAListDeleteAll(_circles);
96 _tracks.removeAll();
97}

◆ conformalTransformation()

void TConformalFinder0::conformalTransformation ( const HepPoint3D & center,
const AList< TMDCWireHit > & hits,
AList< TMLink > & links )
static

transforms hits into a conformal plane. 'center' is a center of the transformation. Z position of 'center' must be zero. Transformed positions are newly created, and are stored in 'links'.

Definition at line 100 of file TConformalFinder0.cxx.

102 {
103
104 unsigned nHits = hits.length();
105 if (center == ORIGIN) {
106 for (unsigned i = 0; i < nHits; i++) {
107 TMDCWireHit * h = hits[i];
108 const HepPoint3D & p = h->xyPosition();
109
110//zsl HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2());
111 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
112// std::cout<<" xypo "<<p<<" pos "<<cp<<std::endl;
113 links.append(new TMLink(0, h, cp));
114 }
115 }
116 else {
117 for (unsigned i = 0; i < nHits; i++) {
118 TMDCWireHit * h = hits[i];
119 HepPoint3D p(h->xyPosition() - center);
120 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
121 links.append(new TMLink(0, h, cp));
122 }
123 }
124}
const HepPoint3D ORIGIN
Constants.
Definition TMDCUtil.cxx:47
const HepPoint3D & xyPosition(void) const
returns drift time

◆ conformalTransformationDriftCircle()

void TConformalFinder0::conformalTransformationDriftCircle ( const HepPoint3D & center,
const AList< TMDCWireHit > & hits,
AList< TMLink > & links )
static

transforms drift circle of hits into a conformal plane. transformed positions( x0, y0, r) are stored in 'links'.

Definition at line 127 of file TConformalFinder0.cxx.

129 { //added by Liuqg for Tsf
130 unsigned nHits = hits.length();
131 if (center == ORIGIN) {
132 for (unsigned i = 0; i < nHits; i++) {
133 TMDCWireHit * h = hits[i];
134 const HepPoint3D & p = h->xyPosition();
135
136 const double r = 0.5*(h->drift(0) + h->drift(1));
137 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
138// HepPoint3D cp2(100 * 2. * p.x() / (p.mag2() - r*r), 100 * 2. * p.y() / (p.mag2() - r*r), 0.);
139 HepPoint3D cp2(2. * p.x() / (p.mag2() - r*r), 2. * p.y() / (p.mag2() - r*r), 0.);
140// float cDrift = 100 * 2. * r / (p.mag2() - r*r);
141 double cDrift = 2. * r / (p.mag2() - r*r);
142
143 links.append(new TMLink(0, h, cp, cp2, cDrift));
144 }
145 }
146 else {
147 for (unsigned i = 0; i < nHits; i++) {
148 TMDCWireHit * h = hits[i];
149 HepPoint3D p(h->xyPosition() - center);
150
151 const double r = 0.5*(h->drift(0) + h->drift(1));
152 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
153 //unit of the following is km-1, origin is cm.
154// HepPoint3D cp2(100 * 2. * p.x() / (p.mag2() - r*r), 100 * 2. * p.y() / (p.mag2() - r*r), 0.);
155 HepPoint3D cp2(2. * p.x() / (p.mag2() - r*r), 2. * p.y() / (p.mag2() - r*r), 0.);
156// float cDrift = 100 * 2. * r / (p.mag2() - r*r);
157 double cDrift = 2. * r / (p.mag2() - r*r);
158
159 links.append(new TMLink(0, h, cp, cp2, cDrift));
160 }
161 }
162}
float drift(unsigned) const
returns drift distance.

Referenced by TConformalFinder::doit(), and TrkReco::execute().

◆ conformalTransformationRphi()

void TConformalFinder0::conformalTransformationRphi ( const HepPoint3D & center,
const AList< TMDCWireHit > & hits,
AList< TMLink > & links )
static

transforms hits into a conformal plane. 'center' is a center of the transformation. Z position of 'center' must be zero. Transformed positions are newly created, and are stored in 'links'.

Definition at line 165 of file TConformalFinder0.cxx.

167 {
168
169 unsigned nHits = hits.length();
170 if (center == ORIGIN) {
171 for (unsigned i = 0; i < nHits; i++) {
172 TMDCWireHit * h = hits[i];
173 const HepPoint3D & p = h->xyPosition();
174 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
175 double r = log(cp.mag()) + 4.;
176 double phi = atan2(cp.y(), cp.x()) + M_PI;
177 HepPoint3D cpt(phi, r, 0.);
178 links.append(new TMLink(0, h, cpt));
179 }
180 }
181 else {
182 for (unsigned i = 0; i < nHits; i++) {
183 TMDCWireHit * h = hits[i];
184 HepPoint3D p(h->xyPosition() - center);
185 HepPoint3D cp(2. * p.x() / p.mag2(), 2. * p.y() / p.mag2(), 0.);
186 double r = log(cp.mag()) + 4.;
187 double phi = atan2(cp.y(), cp.x()) + M_PI;
188 HepPoint3D cpt(phi, r, 0.);
189 links.append(new TMLink(0, h, cpt));
190 }
191 }
192}
#define M_PI
Definition TConstant.h:4

Referenced by doit(), and TFastFinder::doit().

◆ doit()

int TConformalFinder0::doit ( const AList< TMDCWireHit > & axialHits,
const AList< TMDCWireHit > & stereoHits,
AList< TTrack > & tracks,
AList< TTrack > & tracks3D )
virtual

finds tracks.

Implements TFinderBase.

Definition at line 560 of file TConformalFinder0.cxx.

563 {
564
565 //...For debug...
566 if (debugLevel()) {
567 std::cout << name() << " ... processing" << std::endl;
568 std::cout << " axialHits=" << axialHits.length();
569 std::cout << ",stereoHits=" << stereoHits.length();
570 std::cout << ",tracks=" << tracks.length();
571 std::cout << std::endl;
572
573 if (debugLevel() > 1)
574 std::cout << name() << " ... conformal transformation0" << std::endl;
575 }
576
577 //...Conformal transformation with IP constraint...
578 conformalTransformationRphi(ORIGIN, axialHits, _axialConfLinks);
579 conformalTransformationRphi(ORIGIN, stereoHits, _stereoConfLinks);
580 _unusedAxialConfLinks.append(_axialConfLinks);
581 _unusedStereoConfLinks.append(_stereoConfLinks);
582 AList<TMLink> unusedConfLinks;
583 if (_doSalvage) {
584 unusedConfLinks.append(_axialConfLinks);
585 unusedConfLinks.append(_stereoConfLinks);
586 }
587
588 //...For debug...
589 if (debugLevel() > 1)
590 std::cout << name() << " ... selecting good hits" << std::endl;
591
592 //...Select good axial hits...
593 AList<TMLink> goodHits;
594 int nLinks = _axialConfLinks.length();
595 for (unsigned i = 0; i < nLinks; i++) {
596 TMLink * l = _axialConfLinks[i];
597 const TMDCWireHit & h = * l->hit();
598//liuqg if ((h.state() & WireHitIsolated) &&
599// (h.state() & WireHitContinuous))
600 goodHits.append(l);
601 }
602 //...Main algorithm...
603 standardFinding(goodHits, unusedConfLinks, _fraction);
604
605 //...Main algorithm for second trial...
606 specialFinding(goodHits, unusedConfLinks, _fraction);
607
608 //...For debug...
609 if (debugLevel()) {
610 std::cout << name() << " ... processed : ";
611 std::cout << "good hits=" << goodHits.length();
612 std::cout << ",tracks=" << _tracks.length();
613 std::cout << std::endl;
614 }
615
616 tracks.append(_tracks);
617 return 0;
618}
static void conformalTransformationRphi(const HepPoint3D &center, const AList< TMDCWireHit > &hits, AList< TMLink > &links)
transforms hits into a conformal plane. 'center' is a center of the transformation....
std::string name(void) const
returns name.
virtual int debugLevel(void) const
returns debug level.
Definition TFinderBase.h:90

◆ doSalvage()

bool TConformalFinder0::doSalvage ( bool a)
inlinevirtual

sets switch for salvaging.

Reimplemented from TFinderBase.

Definition at line 208 of file TConformalFinder0.h.

208 {
209 return _doSalvage = a;
210}

◆ doStereo()

bool TConformalFinder0::doStereo ( bool a)
inlinevirtual

sets swtich for stereo reconstruction.

Reimplemented from TFinderBase.

Definition at line 202 of file TConformalFinder0.h.

202 {
203 return _doStereo = a;
204}

◆ dump()

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

dumps debug information.

Reimplemented from TFinderBase.

Definition at line 78 of file TConformalFinder0.cxx.

78 {
79 std::cout << pre;
81 std::cout << pre;
82 if (msg.find("state") != std::string::npos) {
83 std::cout << "#axialConfPos=" << _axialConfLinks.length();
84 std::cout << ",#stereoConfPos=" << _stereoConfLinks.length();
85 }
86}
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.

◆ findClusters()

AList< TSegment0 > TConformalFinder0::findClusters ( const THistogram & hist) const

finds segments. (obsolete functions)

Definition at line 195 of file TConformalFinder0.cxx.

195 {
196
197 //...Obtain raw clusters...
198 AList<TSegment0> list = hist.clusters0();
199 unsigned n = list.length();
200 if (n == 0) return list;
201
202#ifdef TRKRECO_DEBUG_DETAIL
203 // static TChecker chk0("clusters before splitting");
204 // chk0.check(list);
205 // chk0.dump("detail", " ");
206#endif
207
208 //...Examine each cluster...
209 AList<TSegment0> splitted;
210 for (unsigned i = 0; i < n; i++) {
211 TSegment0 * c = list[i];
212
213 AList<TSegment0> newClusters = c->split();
214 if (newClusters.length() == 0) {
215 c->solveDualHits();
216 continue;
217 }
218
219 list.append(newClusters);
220 splitted.append(c);
221#ifdef TRKRECO_DEBUG_DETAIL
222 c->dump("hits", " ");
223 std::cout << " ... splitted as" << std::endl;
224 for (unsigned j = 0; j < newClusters.length(); j++) {
225 std::cout << " " << j << " : ";
226 newClusters[j]->dump("hits");
227 }
228#endif
229 }
230 list.remove(splitted);
231 HepAListDeleteAll(splitted);
232
233#ifdef TRKRECO_DEBUG_DETAIL
234 // static TChecker chk1("clusters after splitting");
235 // chk1.check(list);
236 // chk1.dump("detail", " ");
237#endif
238
239 return list;
240}
const Int_t n
AList< TSegment0 > clusters0(void) const
returns an AList<TSegment0> of clusters.
A class to relate TMDCWireHit and TTrack objects.
Definition TSegment0.h:41
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition TSegment0.cxx:51
int solveDualHits(void)
AList< TSegment0 > split(void) const
returns a list of sub TSegments in this cluster. If cluster type is 1, 2, or 7, no cluster is returne...

Referenced by findSegments().

◆ findClusters2()

AList< TSegment0 > TConformalFinder0::findClusters2 ( const THistogram & hist) const

Definition at line 243 of file TConformalFinder0.cxx.

243 {
244
245 //...Obtain raw clusters...
246 AList<TSegment0> list = hist.clusters0();
247 unsigned n = list.length();
248 if (n == 0) return list;
249
250#ifdef TRKRECO_DEBUG_DETAIL
251 // static TChecker chk0("clusters before splitting (2)");
252 // chk0.check(list);
253 // chk0.dump("detail", " ");
254#endif
255
256 //...Examine each cluster...
257 for (unsigned i = 0; i < n; i++) {
258 TSegment0 * c = list[i];
259 unsigned type = c->clusterType();
260
261 if ((type == 1) || (type == 2)) {
262 c->dump("hits mc", " ");
263 c->solveDualHits();
264 }
265 }
266
267#ifdef TRKRECO_DEBUG_DETAIL
268 // static TChecker chk1("clusters after splitting (2)");
269 // chk1.check(list);
270 // chk1.dump("detail", " ");
271#endif
272
273 return list;
274}
unsigned clusterType(void) const
returns cluster type. 0:empty, 1:short line, 2:long line, 3:V shage(from outside),...
Definition TSegment0.h:214

◆ findSegments()

AList< AList< TSegment0 > > TConformalFinder0::findSegments ( const AList< TMLink > & in) const

finds segments.

Definition at line 869 of file TConformalFinder0.cxx.

869 {
871
872#ifdef TRKRECO_DEBUG_DETAIL
873 std::cout << name() << " ... finding segments : given hits =" << std::endl;
874 Dump(in, "sort");
875#endif
876
877 //...Create lists of links for each super layer...
878 AList<TMLink> links[5];
879 unsigned n = in.length();
880 for (unsigned i = 0; i < n; i++) {
881 TMLink & l = * in[i];
882// links[l.wire()->superLayerId() / 2].append(l);
883 links[l.wire()->axialStereoLayerId()/4].append(l);
884 }
885
886 //...Create phi hists and clusters for each super layer...
887 THistogram * hist[5];
888 hist[0] = new THistogram(76);
889 hist[1] = new THistogram(100);
890 hist[2] = new THistogram(128);
891 hist[3] = new THistogram(256);
892 hist[4] = new THistogram(288);
893 for (unsigned i = 0; i < 5; i++) {
894 hist[i]->fillX(links[i]);
896 a.append(b);
897 b->append(findClusters(* hist[i]));
898 delete hist[i];
899 }
900
901 return a;
902}
AList< TSegment0 > findClusters(const THistogram &) const
finds segments. (obsolete functions)
A class for a histogram used in tracking.
Definition THistogram.h:34
void fillX(const AList< TMLink > &links)
fills with hits.
unsigned axialStereoLayerId(void) const
returns id of axial or stereo id.
Definition TMDCWire.h:360
const double b
Definition slope.cxx:9

◆ findSegments2()

AList< AList< TSegment0 > > TConformalFinder0::findSegments2 ( const AList< TMLink > & in) const

◆ name()

std::string TConformalFinder0::name ( void ) const
inlinevirtual

returns name.

Implements TFinderBase.

Definition at line 214 of file TConformalFinder0.h.

214 {
215 return "Conformal Finder 0";
216}

Referenced by doit(), and findSegments().

◆ stereoConformalLinks()

const AList< TMLink > & TConformalFinder0::stereoConformalLinks ( void ) const
inline

returns a list of conformal links.

Definition at line 196 of file TConformalFinder0.h.

196 {
197 return _stereoConfLinks;
198}

◆ version()

std::string TConformalFinder0::version ( void ) const
virtual

returns version.

Implements TFinderBase.

Definition at line 29 of file TConformalFinder0.cxx.

29 {
30 return "1.63";
31}

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