SSO Logout

Subversion Repositories hepmc

Rev

Rev 28 | Rev 65 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 43
Line 8... Line 8...
8
// High Energy Physics", Computer Physics Communications (to be published).
8
// High Energy Physics", Computer Physics Communications (to be published).
9
//
9
//
10
// Polarization object for a particle. All angles are in radians.
10
// Polarization object for a particle. All angles are in radians.
11
//////////////////////////////////////////////////////////////////////////
11
//////////////////////////////////////////////////////////////////////////
12
12
13
#include "CLHEP/Geometry/Normal3D.h"
-
 
-
 
13
#include "HepMC/SimpleVector.h"
14
#include <iostream>
14
#include <iostream>
15
#include <cmath>
15
#include <cmath>
16
-
 
17
typedef HepGeom::Normal3D<double> HepNormal3D;
-
 
18
16
19
namespace HepMC {
17
namespace HepMC {
20
18
21
    static const double HepMC_pi = 3.14159265358979323846;  // copy of pi from CLHEP
19
    static const double HepMC_pi = 3.14159265358979323846;  // copy of pi from CLHEP
22
   
20
   
Line 25... Line 23...
25
        friend std::ostream& operator<<( std::ostream&, const Polarization& );
23
        friend std::ostream& operator<<( std::ostream&, const Polarization& );
26
24
27
    public:
25
    public:
28
        Polarization( double theta = 0, double phi = 0 );
26
        Polarization( double theta = 0, double phi = 0 );
29
        Polarization( const Polarization& inpolar );
27
        Polarization( const Polarization& inpolar );
30
        Polarization( const HepNormal3D& vec3in );
-
 
-
 
28
        Polarization( const ThreeVector& vec3in );
31
        virtual       ~Polarization() {}
29
        virtual       ~Polarization() {}
32
30
33
        Polarization& operator=( const Polarization& inpolar );
31
        Polarization& operator=( const Polarization& inpolar );
34
        bool          operator==( const Polarization& ) const;
32
        bool          operator==( const Polarization& ) const;
35
        bool          operator!=( const Polarization& ) const;
33
        bool          operator!=( const Polarization& ) const;
Line 39... Line 37...
39
        ////////////////////
37
        ////////////////////
40
        // access methods //
38
        // access methods //
41
        ////////////////////
39
        ////////////////////
42
        double        theta() const;    // returns polar angle in radians
40
        double        theta() const;    // returns polar angle in radians
43
        double        phi() const;      // returns azimuthal angle in radians
41
        double        phi() const;      // returns azimuthal angle in radians
44
        HepNormal3D   normal3d() const; // unit 3 vector for easy manipulation
-
 
-
 
42
        ThreeVector   normal3d() const; // unit 3 vector for easy manipulation
45
43
46
        double        set_theta( double theta );
44
        double        set_theta( double theta );
47
        double        set_phi( double phi );
45
        double        set_phi( double phi );
48
        void          set_theta_phi( double theta, double phi );
46
        void          set_theta_phi( double theta, double phi );
49
        // sets polarization according to direction of 3 vec
47
        // sets polarization according to direction of 3 vec
50
        HepNormal3D   set_normal3d( const HepNormal3D& vec3in );
-
 
-
 
48
        ThreeVector   set_normal3d( const ThreeVector& vec3in );
51
49
52
    private:
50
    private:
53
        double m_theta; //polar angle of polarization in radians 0< theta <pi
51
        double m_theta; //polar angle of polarization in radians 0< theta <pi
54
        double m_phi;   //azimuthal angle of polarization in rad. 0< phi <2pi
52
        double m_phi;   //azimuthal angle of polarization in rad. 0< phi <2pi
55
    };
53
    };