13#define TRGCDC_SHORT_NAMES
15#include "trg/trg/Debug.h"
16#include "trg/cdc/CircleFitter.h"
17#include "trg/cdc/TrackBase.h"
18#include "trg/cdc/Circle.h"
19#include "trg/cdc/Link.h"
20#include "trg/cdc/Lpav.h"
31 : TCFitter(name), _charge(0.), _radius(0.), _center(
Point3D(0., 0., 0.))
50 cout <<
TRGDebug::tab() <<
"Circle is fitted already" << endl;
56 if (t.links().size() < 3) {
65 const unsigned n = t.links().size();
66 for (
unsigned i = 0; i < n; i++) {
67 const TCLink* l = t.links()[i];
72 if (h->state() & CellHitPatternLeft)
73 point = h->position(CellHitLeft);
74 else if (h->state() & CellHitPatternRight)
75 point = h->position(CellHitRight);
77 point = h->xyPosition();
83 circle.add_point(point.x(), point.y());
87 cout << point << endl;
91 if (circle.fit() < 0.0 || circle.kappa() == 0.0) {
97 CLHEP::HepVector v(circle.center());
104 for (
unsigned i = 0; i < n; i++) {
105 const TCLink* l = t.links()[i];
106 if (l == 0)
continue;
109 if (h == 0)
continue;
111 float q = (
_center.cross(h->xyPosition())).z();
112 if (q > 0.) qSum += 1;
119 if (t.objectType() == TRGCDCCircleType)
124 for (
unsigned i = 0; i < n; i++) {
125 TCLink* l = t.links()[i];
126 if (l == 0)
continue;
A class to represent a wire hit in CDC.
HepGeom::Point3D< double > _center
center
A class to represent a circle.
A class to represent a track object in TRGCDC.
#define TRGCDCFitAlreadyFitted
parameter to identify fit result
static std::string tab(void)
returns tab spaces.
virtual int fit(TRGCDCTrackBase &) const override
Fitter.
virtual ~TRGCDCCircleFitter()
Destructor.
#define TRGCDCFitFailed
parameter to identify fit result
static void enterStage(const std::string &stageName)
Declare that you enter new stage.
#define TRGCDCFitErrorFewHits
parameter to identify fit result
static int level(void)
returns the debug level.
void fitDone(TRGCDCTrackBase &) const
sets the fitted flag. (Bad implementation)
static void leaveStage(const std::string &stageName)
Declare that you leave a stage.
TRGCDCCircleFitter(const std::string &name)
Constructor.
Abstract base class for different kinds of events.