GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Tracking » WirepointHitPolicy detplane implementation
Re: WirepointHitPolicy detplane implementation [message #8096 is a reply to message #8080] Mon, 16 March 2009 23:25
 Anonymous Poster From: *pool.einsundeins.de
Hi again,

I have a very simple solution for your distance cut: Put a

protected:
double _maxDistance

in WirepointHitPolicy. Then make a WirepointHitPlicy which loks something like this

const DetPlane&
SpacepointHitPolicy::detPlane(AbsRecoHit* hit, AbsTrackRep* rep)
{
TMatrixT<double> rawcoord = hit->getRawHitCoord();
//I dont know which of the 8 params is for the wire points
TVector3 point1(rawcoord[0][0],rawcoord[1][0],rawcoord[2][0]);
TVector3 point2(rawcoord[3][0],rawcoord[4][0],rawcoord[5][0]);
int dimension = rep->getDim();
TMatrixT<double> statePred(dimension,1);
TMatrixT<double> covPred(dimension,dimension);
//note that _plane is defined in AbsTrackRep
TVector3 poca=rep->extrapolateToLine(point1,point2,statePred,covPred,_plane);

/*C. Hoeppner, March 09: I am not entirely sure that these two calls
are needed, but they dont hurt for sure. Something happens here
to the orientation of u and v, so keep it.*/
TVector3 m=_plane.getNormal();
_plane.setNormal(m);

//now calculate distance of poca to line between point1 and point2
double distance;
if(distance>_maxDistance) {
cout << "vpf greater than maxValue" << endl;
FitterException exc("distance vpf-wire larger than maxValue", __LINE__,__FILE__);
throw exc;
}

return _plane;
}

For the DCH where you dont want this distance cut, just set the _maxDistance (do this in the contructors of the recoHits) to a very large value. Or you can use a bool flag to deactivate this feature. This you would also be set in the ctors.

About the origin of the plane: can you come to a common solution? Is Lia's solution OK for you Ola?