Method SetPoints of class TTRAP

From: GENTIT Francois-Xavier DAPNIA (GENTIT@DAPNIA.CEA.FR)
Date: Fri Oct 16 1998 - 09:44:23 MEST


  To the authors of ROOT,
  I think there is an error in the method SetPoints of the class TTRAP.
TTRAP requires, among other parameters, the parameter alpha2, which is
not used in the method SetPoints (which is impossible).
Here is the original code of the method SetPoints, with indication of
the problem.

 void TTRAP::SetPoints(Float_t *buff)
{
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Create TRAP
points*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                            ==================

    Float_t dx, dy, dx1, dx2, dz, theta, phi, alpha;
    const Float_t PI = Float_t (TMath::Pi());

    alpha = fAlpha1    * PI/180.0;  <=== WRONG ? should we not have a 
                                                <=== definition of
alpha1 and alpha2 ?
    theta = TBRIK::fDx * PI/180.0;
    phi   = TBRIK::fDy * PI/180.0;

    dx  = 2*fDz*TMath::Sin(theta)*TMath::Cos(phi);
    dy  = 2*fDz*TMath::Sin(theta)*TMath::Sin(phi);
    dz  = TBRIK::fDz;

    dx1 = 2*fH1*TMath::Tan(alpha);
    dx2 = 2*fH2*TMath::Tan(alpha);  <=== WRONG ? should it not be alpha2
?

    if (buff) {
        buff[ 0] = -fBl1;        buff[ 1] = -fH1;    buff[ 2] = -dz;
        buff[ 3] =  fBl1;        buff[ 4] = -fH1;    buff[ 5] = -dz;
        buff[ 6] =  fTl1+dx1;    buff[ 7] =  fH1;    buff[ 8] = -dz;
        buff[ 9] = -fTl1+dx1;    buff[10] =  fH1;    buff[11] = -dz;
        buff[12] = -fBl2+dx;     buff[13] = -fH2+dy; buff[14] = dz;
        buff[15] =  fBl2+dx;     buff[16] = -fH2+dy; buff[17] = dz;
        buff[18] =  fTl2+dx+dx2; buff[19] =  fH2+dy; buff[20] = dz;
        buff[21] = -fTl2+dx+dx2; buff[22] =  fH2+dy; buff[23] = dz;
    }
}

  Thanks for your help.

F.X. Gentit
DAPNIA/SPP CEN Saclay
tel : 01 69 08 30 38



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET