LCOV - code coverage report
Current view: top level - TEvtGen/EvtGen/EvtGenBase - EvtVectorParticle.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 51 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 8 0.0 %

          Line data    Source code
       1             : //--------------------------------------------------------------------------
       2             : //
       3             : // Environment:
       4             : //      This software is part of the EvtGen package developed jointly
       5             : //      for the BaBar and CLEO collaborations.  If you use all or part
       6             : //      of it, please give an appropriate acknowledgement.
       7             : //
       8             : // Copyright Information: See EvtGen/COPYRIGHT
       9             : //      Copyright (C) 1998      Caltech, UCSB
      10             : //
      11             : // Module: EvtVectorParticle.cc
      12             : //
      13             : // Description: Class to describe spin 1 particles
      14             : //
      15             : // Modification history:
      16             : //
      17             : //    DJL/RYD   September 25, 1996           Module created
      18             : //
      19             : //------------------------------------------------------------------------
      20             : // 
      21             : #include "EvtGenBase/EvtPatches.hh"
      22             : #include <stdlib.h>
      23             : #include <iostream>
      24             : #include <math.h>
      25             : #include "EvtGenBase/EvtComplex.hh"
      26             : #include "EvtGenBase/EvtVectorParticle.hh"
      27             : #include "EvtGenBase/EvtVector4C.hh"
      28             : #include "EvtGenBase/EvtPDL.hh"
      29             : #include "EvtGenBase/EvtReport.hh"
      30             : 
      31           0 : EvtVectorParticle::~EvtVectorParticle(){}
      32             : 
      33             : 
      34             : void EvtVectorParticle::init(EvtId part_n,double e,double px,double py,double pz){
      35             : 
      36           0 :   _validP4=true;
      37           0 :   setp(e,px,py,pz);
      38           0 :   setpart_num(part_n);
      39             :   
      40           0 :   _eps[0].set(0.0,1.0,0.0,0.0);
      41           0 :   _eps[1].set(0.0,0.0,1.0,0.0);
      42           0 :   _eps[2].set(0.0,0.0,0.0,1.0);
      43             : 
      44           0 :   setLifetime();
      45           0 : }
      46             : 
      47             : void EvtVectorParticle::init(EvtId part_n,const EvtVector4R& p4){
      48             : 
      49           0 :   _validP4=true;
      50           0 :   setp(p4);
      51           0 :   setpart_num(part_n);
      52             :   
      53           0 :   _eps[0].set(0.0,1.0,0.0,0.0);
      54           0 :   _eps[1].set(0.0,0.0,1.0,0.0);
      55           0 :   _eps[2].set(0.0,0.0,0.0,1.0);
      56           0 :   setLifetime();
      57           0 : }
      58             : 
      59             : void EvtVectorParticle::init(EvtId part_n,const EvtVector4R& p4,
      60             :                              const EvtVector4C & epsin1,
      61             :                              const EvtVector4C & epsin2,
      62             :                              const EvtVector4C & epsin3){
      63             : 
      64           0 :   _validP4=true;
      65           0 :   setp(p4);
      66           0 :   setpart_num(part_n);
      67             :   
      68           0 :   _eps[0]=epsin1;
      69           0 :   _eps[1]=epsin2;
      70           0 :   _eps[2]=epsin3;
      71             : 
      72           0 :   setLifetime();
      73           0 : }
      74             : 
      75             : 
      76             : 
      77             : EvtSpinDensity EvtVectorParticle::rotateToHelicityBasis() const{
      78             : 
      79           0 :   static EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
      80           0 :   static EvtVector4C ezero(0.0,0.0,0.0,1.0);
      81           0 :   static EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
      82             :   
      83           0 :   static EvtVector4C eplusC(eplus.conj());
      84           0 :   static EvtVector4C ezeroC(ezero.conj());
      85           0 :   static EvtVector4C eminusC(eminus.conj());
      86             : 
      87           0 :   EvtSpinDensity R;
      88           0 :   R.setDim(3);
      89             : 
      90           0 :   for ( int i=0; i<3; i++ ) {
      91           0 :     R.set(0,i,(eplusC)*_eps[i]);
      92           0 :     R.set(1,i,(ezeroC)*_eps[i]);
      93           0 :     R.set(2,i,(eminusC)*_eps[i]);
      94             :   }
      95             : 
      96             :   return R;
      97             : 
      98           0 : }
      99             : 
     100             : 
     101             : EvtSpinDensity EvtVectorParticle::rotateToHelicityBasis(double alpha,
     102             :                                                         double beta,
     103             :                                                         double gamma) const{
     104             : 
     105           0 :   EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
     106           0 :   EvtVector4C ezero(0.0,0.0,0.0,1.0);
     107           0 :   EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
     108             :   
     109           0 :   eplus.applyRotateEuler(alpha,beta,gamma);
     110           0 :   ezero.applyRotateEuler(alpha,beta,gamma);
     111           0 :   eminus.applyRotateEuler(alpha,beta,gamma);
     112             : 
     113           0 :   EvtSpinDensity R;
     114           0 :   R.setDim(3);
     115             : 
     116             : 
     117           0 :   for ( int i=0; i<3; i++ ) {
     118           0 :     R.set(0,i,(eplus.conj())*_eps[i]);
     119           0 :     R.set(1,i,(ezero.conj())*_eps[i]);
     120           0 :     R.set(2,i,(eminus.conj())*_eps[i]);
     121             :   }
     122             : 
     123             :   return R;
     124             : 
     125           0 : }
     126             : 
     127             : 

Generated by: LCOV version 1.11