//-------------------------------------------------------------------------- // // Environment: // This software is part of the EvtGen package developed jointly // for the BaBar and CLEO collaborations. If you use all or part // of it, please give an appropriate acknowledgement. // // Copyright Information: See EvtGen/COPYRIGHT // Copyright (C) 1998 Caltech, UCSB // // Module: EvtDiracSpinor.cc // // Description: Class to describe (EvtDiracParticle) spinors. // // Modification history: // // DJL/RYD September 25, 1996 Module created // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include #include #include "EvtGenBase/EvtDiracSpinor.hh" #include "EvtGenBase/EvtGammaMatrix.hh" #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtVector4C.hh" #include "EvtGenBase/EvtTensor4C.hh" using std::ostream; EvtDiracSpinor::~EvtDiracSpinor(){} EvtDiracSpinor::EvtDiracSpinor(const EvtComplex& sp0,const EvtComplex& sp1, const EvtComplex& sp2,const EvtComplex& sp3){ set(sp0,sp1,sp2,sp3); } void EvtDiracSpinor::set(const EvtComplex& sp0,const EvtComplex& sp1, const EvtComplex& sp2,const EvtComplex& sp3){ spinor[0]=sp0;spinor[1]=sp1;spinor[2]=sp2;spinor[3]=sp3; } void EvtDiracSpinor::set_spinor(int i,const EvtComplex& sp){ spinor[i]=sp; } ostream& operator<<(ostream& s, const EvtDiracSpinor& sp){ s <<"["<conj(); // first conjugate, then multiply with gamma0 EvtGammaMatrix g0 = EvtGammaMatrix::g0(); EvtDiracSpinor result; // automatically initialized to 0 for (int i=0; i<4; ++i) for (int j=0; j<4; ++j) result.spinor[i] += d.spinor[j] * g0._gamma[i][j]; return result; }