//*-- Author : V.Pechenov (18/04/2010) //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////////// // HMdcKickPlane // // Descriptor of the magnetic kick plane of HADES. // Contains a parametrization of the kick plane. // Parametrization and parameters of the kick plane is the copy // of HSurfPlaneTriV parameters from HKickPlane2 (detPartName: MDC3) //////////////////////////////////////////////////////////////////////////// #include "hmdckickplane.h" ClassImp(HMdcKickPlane) void HMdcKickPlane::setDefaultParam(void) { // Plane equation: y=fDx*x + fDz[i]*z + fC[i] // This parameters is the copy of HSurfPlaneTriV parameters // from HKickPlane2 (detPartName: MDC3) fDzLimit[1] = 400.; // =fDzLimit[1] in HSurfPlaneTriV fDzLimit[0] = 1100.; // =fDzLimit[1] in HSurfPlaneTriV fDx = 0.124811; fDz[2] = -0.6546; // =fDz[0] in HSurfPlaneTriV fDz[1] = -0.82008; // =fDz[1] in HSurfPlaneTriV fDz[0] = -1.1989; // =fDz[2] in HSurfPlaneTriV fC[2] = 1295.53; // =fDc[0] in HSurfPlaneTriV fC[1] = fC[2] + (fDz[2]-fDz[1])*fDzLimit[1]; // =fDc[1] in HSurfPlaneTriV fC[0] = fC[1] + (fDz[1]-fDz[0])*fDzLimit[0]; // =fDc[2] in HSurfPlaneTriV } void HMdcKickPlane::calcIntersection(Double_t x1,Double_t y1,Double_t z1, Double_t x2, Double_t y2, Double_t z2, Double_t& x, Double_t& y, Double_t& z) const { // Calcul. a cross of the line with plane y=fDx*x+fDz*z+fC Double_t dX = x2-x1; Double_t dY = y2-y1; Double_t dZ = z2-z1; for(Int_t i=0;i<3;i++) { Double_t c2 = fDz[i]*dZ; Double_t c3 = y1-fC[i]; Double_t cDx = fDx; Double_t c1 = cDx*dX-dY; Double_t div = 1/(c1+c2); Double_t cx = dX*(c3-fDz[i]*z1)+ x1*(c2-dY); x = cx*div; if(x<0) { cDx = -fDx; c1 = cDx*dX-dY; div = 1/(c1+c2); x = cx*div; } z = (dZ*(c3-cDx*x1) + z1*c1)*div; if(i<2 && z