Changeset 350


Ignore:
Timestamp:
01/31/00 21:01:01 (25 years ago)
Author:
harald
Message:
The member function get_deviations has changed!!!
That is all at the moment!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx

    r302 r350  
    187187  // get deviations of the CT from the original shower direction
    188188  inline Float_t get_deviations ( Float_t *t1, Float_t *t2 ) {
    189 
    190     float r;
    191 
    192     r = sqrt(deviationTheta*deviationTheta + deviationPhi*deviationPhi);
     189 
     190    float ct1,st1,cp1,sp1;
     191    float ct2,st2,cp2,sp2;
     192    float x1,y1,z1;
     193    float x2,y2,z2;
     194
     195    ct1 = cos(Theta);
     196    st1 = sin(Theta);
     197    cp1 = cos(Phi);
     198    sp1 = sin(Phi);
     199
     200    ct2 = cos(Theta+deviationTheta);
     201    st2 = sin(Theta+deviationTheta);
     202    cp2 = cos(Phi+deviationPhi);
     203    sp2 = sin(Phi+deviationPhi);
     204
     205    x1 = st1*cp1; y1 = st1*sp1; z1 = ct1;
     206    x2 = st2*cp2; y2 = st2*sp2; z2 = ct2;
     207
    193208    *t1 = deviationTheta;
    194209    *t2 = deviationPhi;
    195 
    196     // cerr << '\n' << deviationTheta << ' ' << deviationPhi << '\n' << flush;
    197 
    198     return ( r );
    199   }
    200 
     210   
     211    return (  acos(x1*x2 + y1*y2 + z1*z2) );
     212  }
     213 
    201214  inline void print ( void ) {
    202215    float *ptr = (float *)this;
Note: See TracChangeset for help on using the changeset viewer.