13#ifdef TRKRECO_DEBUG_DETAIL
25:
TBuilder0(name, salvageLevel), _fitter(
"TBuilderCosmic Fitter") {
33#ifdef TRKRECO_DEBUG_DETAIL
34 std::cout <<
name() <<
"(stereo) ... dump of stereo candidate hits" << std::endl;
38 for (
unsigned i = 0; i < tmp.length(); i++) {
43 std::cout << std::endl;
48#ifdef TRKRECO_DEBUG_DETAIL
49 std::cout <<
name() <<
"(stereo) ... rejected by nLinks(";
50 std::cout << list.length() <<
") < ";
57 unsigned n = list.length();
59 for (
unsigned i = 0; i < n; i++) {
80#ifdef TRKRECO_DEBUG_DETAIL
81 std::cout <<
name() <<
"(stereo) ... dump of sz links" << std::endl;
85 for (
unsigned i = 0; i < tmp.length(); i++) {
90 std::cout << std::endl;
95#ifdef TRKRECO_DEBUG_DETAIL
96 std::cout <<
name() <<
"(stereo) ... rejected by sz nLinks(";
97 std::cout << forLine.length() <<
") < ";
100 HepAListDeleteAll(forLine);
105 unsigned nLine = forLine.length();
107 int err = line.
fit();
111#ifdef TRKRECO_DEBUG_DETAIL
112 std::cout <<
name() <<
"(stereo) ... linear fit failure. nLinks(";
113 std::cout << forLine.length() <<
")" << std::endl;
115 HepAListDeleteAll(forLine);
119#ifdef TRKRECO_DEBUG_DETAIL
120 std::cout <<
name() <<
"(stereo) ... dump of left-right" << std::endl;
125 for (
unsigned i = 0; i < nLine; i++) {
143 if ((tl == NULL) && (
tr == NULL))
continue;
146 if (tl == NULL) best =
tr;
147 else if (
tr == NULL) best = tl;
159#ifdef TRKRECO_DEBUG_DETAIL
161 std::cout <<
t->wire()->layerId() <<
"-";
162 std::cout <<
t->wire()->localId();
166 std::cout <<
",right " <<
tr->position() <<
"," << line.
distance(*
tr);
167 std::cout << std::endl;
170 best->
link(
t->link());
171 forNewLine.append(best);
176#ifdef TRKRECO_DEBUG_DETAIL
177 std::cout <<
name() <<
"(stereo) ... rejected by lr nLinks(";
178 std::cout << forNewLine.length() <<
") < ";
181 HepAListDeleteAll(forLine);
182 HepAListDeleteAll(forNewLine);
187#ifdef TRKRECO_DEBUG_DETAIL
188 std::cout <<
name() <<
"(stereo) ... creating a new line" << std::endl;
190 unsigned nNewLine = forNewLine.length();
191 TLine0 newLine(forNewLine);
198#ifdef TRKRECO_DEBUG_DETAIL
199 std::cout <<
name() <<
"(stereo) ... 2nd linear fit failure. nLinks(";
200 std::cout << forNewLine.length() <<
")" << std::endl;
202 HepAListDeleteAll(forLine);
203 HepAListDeleteAll(forNewLine);
218 HepAListDeleteAll(forLine);
219 HepAListDeleteAll(forNewLine);
220#ifdef TRKRECO_DEBUG_DETAIL
221 std::cout <<
" appendStereo cut ... new line 2nd linear fit failure. ";
222 std::cout <<
"# of links = " << n <<
"," << nLine;
223 std::cout <<
"," << nNewLine << std::endl;
230 unsigned nn = good.length();
231 for (
unsigned i = 0; i < nn; i++) {
232 track.
append(* good[i]->link());
237 a[4] = track.
charge() * newLine.
a();
244 err = _fitter.
fit(*Ltrack);
246 err = _fitter.
fit(*Ltrack);
248 err = _fitter.
fit(*Ltrack);
251 err = _fitter.
fit(*Ltrack);
262 HepAListDeleteAll(forLine);
263 HepAListDeleteAll(forNewLine);
274 err = _fitter.
fit(track);
276 err = _fitter.
fit(track);
278 err = _fitter.
fit(track);
281 err = _fitter.
fit(track);
284 HepAListDeleteAll(forLine);
285 HepAListDeleteAll(forNewLine);
290 HepAListDeleteAll(forLine);
291 HepAListDeleteAll(forNewLine);
#define WireHitFittingValid
int SortByWireId(const void *av, const void *bv)
Sorter.
const HepVector & a(void) const
returns helix parameters.
A class to represent a track in tracking.
Helix helix(void) const
approximated helix class
A class to build a track.
TMSelector _trackSelector
const std::string & name(void) const
returns name.
virtual ~TBuilderCosmic()
Destructor.
TTrack * buildStereo(TTrack &track, const AList< TMLink > &) const
appends stereo hits to a track.
TBuilderCosmic(const std::string &name, float salvageLevel)
Constructor.
int fit(TTrackBase &) const
A class to represent a track in tracking.
double distance(const TMLink &) const
returns distance to a position of TMLink itself. (not to a wire)
double b(void) const
returns coefficient b.
double a(void) const
returns coefficient a.
unsigned state(void) const
returns state.
unsigned localId(void) const
returns local id in a wire layer.
unsigned layerId(void) const
returns layer id.
A class to relate TMDCWireHit and TTrack objects.
TMLink * link(void) const
returns a pointer to a TMLink.
unsigned leftRight(void) const
returns left-right. 0:left, 1:right, 2:wire
const TMDCWireHit * hit(void) const
returns a pointer to a hit.
const HepPoint3D & position(void) const
returns position.
const TMDCWire *const wire(void) const
returns a pointer to a wire.
unsigned nLinks(void) const
returns min. # of hits(TMLinks) requried.
double maxSigma(void) const
returns max. sigma for each TMLink.
unsigned nLinksStereo(void) const
returns min. # of stereo hits(TMLinks) requried.
bool select(TTrackBase &) const
returns true if given track satisfys criteria after fitting.
virtual int fit(void)
fits itself by a default fitter. Error was happened if return value is not zero.
virtual void refine(AList< TMLink > &list, double maxSigma)
removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
virtual void removeLinks(void)
void append(TMLink &)
appends a TMLink.
const AList< TMLink > & links(unsigned mask=0) const
returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
A class to represent a track in tracking.
const Helix & helix(void) const
returns helix parameter.
int szPosition(TMLink &link) const
calculates arc length and z for a stereo hit.
double charge(void) const
returns charge.