1 #include <CLHEP/Matrix/Matrix.h>
2 #include <CLHEP/Matrix/Vector.h>
12 const double c = 29.9792548;
19 n_fdc(pseudopoints->
size()), ppPtr(pseudopoints),
20 trajPtr(trajectory), debug_level(level), lorentz_def(lorentz_def_in), errorFDC(0.046) {}
23 double docaThis, errorThis, residThis;
24 HepVector pointThis(3);
25 HepLorentzVector pocaThis;
31 for (
unsigned int i = 0; i <
n_fdc; i++) {
32 ppointPtr = (*ppPtr)[i];
34 point.push_back(pointThis);
37 residThis = docaThis/errorThis;
38 doca.push_back(docaThis);
39 poca.push_back(pocaThis);
40 resid.push_back(residThis);
41 error.push_back(errorThis);
42 if (
debug_level > 2) cout <<
"residFDC: i = " << i <<
" doca = " << docaThis <<
" poca xyzt = " << pocaThis.getX() <<
' ' << pocaThis.getY() <<
' ' << pocaThis.getZ() <<
' ' << pocaThis.getT()/
c <<
" resid = " << residThis << endl;
53 double delta_x = 0.0, delta_y = 0.0;
58 point(1) = ppoint.
xy.X() + delta_x;
59 point(2) = ppoint.
xy.Y() + delta_y;
61 point(1) = ppoint.
xy.X() - delta_x;
62 point(2) = ppoint.
xy.Y() - delta_y;
66 cout <<
"residFDC::pseudo2HepVector, x = " << x <<
" y = " << y <<
" z = " << z <<
" ct = " << ct <<
" delta_x = " << delta_x <<
" delta_y = " << delta_y <<
" ispos = " << ispos <<
" point = " << point << endl;
74 double wireCrossTraj = xWire*(y - ppoint.
xy.Y()) - yWire*(x - ppoint.
xy.X());
75 double wireCrossDelta = xWire*delta_y - yWire*delta_x;
76 bool isposTraj = wireCrossTraj > 0?
true:
false;
77 bool isposDelta = wireCrossDelta > 0?
true:
false;
78 bool ispos = !(isposTraj ^ isposDelta);
80 <<
"residFDC::getCorrectionSign,"
83 <<
" ppx = " << ppoint.
xy.X()
84 <<
" ppy = " << ppoint.
xy.Y()
85 <<
" dx = " << x - ppoint.
xy.X()
86 <<
" dy = " << y - ppoint.
xy.Y()
87 <<
" delta_x = " << delta_x
88 <<
" delta_y = " << delta_y
89 <<
" xWire = " << xWire
90 <<
" yWire = " << yWire
91 <<
" wireCrossTraj = " << wireCrossTraj
92 <<
" wireCrossDelta = " << wireCrossDelta
93 <<
" isposTraj = " << isposTraj
94 <<
" isposDelta = " << isposDelta
95 <<
" ispos = " << ispos
103 double cosangle = ppoint.
wire->
udir(1);
104 double sinangle= ppoint.
wire->
udir(0);
106 if (
debug_level > 3) cout <<
"x, y, z, ct = " << x <<
' ' << y <<
' ' << z <<
' ' << ct <<
" time, ct/c = " << ppoint.
time <<
" " << ct/
c <<
" driftdist = " << driftDist << endl;
108 double ds = -lorentzShift;
109 double dw = driftDist;
110 if (
debug_level > 3) cout <<
"ds, dw" << ds <<
" " << dw << endl;
111 delta_x = dw*cosangle + ds*sinangle;
112 delta_y = -dw*sinangle + ds*cosangle;
122 vector<HepLorentzVector> &pocasRef) {
int getXYT(double z, double &x, double &y, double &ct) const
DVector2 xy
rough x,y coordinates in lab coordinate system
vector< HepVector > point
bool getCorrectionSign(const DFDCPseudo &pseudopoint, double x, double y, double deltaX, double deltaY)
vector< HepLorentzVector > poca
HepVector pseudo2HepVector(const DFDCPseudo &pseudopoint)
const DFDCWire * wire
DFDCWire for this wire.
void getDetails(vector< HepVector > &points, vector< double > &docasRef, vector< double > &errorsRef, vector< HepLorentzVector > &pocasRef)
double doca(C &spaceObject, HepLorentzVector &poca) const
class DFDCPseudo: definition for a reconstructed point in the FDC
void getResids(vector< double > &residsRef)
const MyTrajectory * trajPtr
residFDC(vector< const DFDCPseudo * > *pseudopoints, const MyTrajectory *trajectory, const DLorentzDeflections *lorentz_def, int level=1)
double time
time corresponding to this pseudopoint.
double GetLorentzCorrection(double x, double y, double z, double alpha, double dx) const
const DLorentzDeflections * lorentz_def
void getCorrectionValue(const DFDCPseudo &pseudopoint, double x, double y, double z, double t, double &delta_x, double &delta_y)