//-------------------------------------------------------------------------- // // 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: EvtGammaMatrix.cc // // Description: Make gamma matrices availible for the calc. of amplitudes, etc. // // Modification history: // // DJL/RYD September 25, 1996 Module created // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include #include #include #include "EvtGenBase/EvtComplex.hh" #include "EvtGenBase/EvtGammaMatrix.hh" #include "EvtGenBase/EvtDiracSpinor.hh" #include "EvtGenBase/EvtReport.hh" #include "EvtGenBase/EvtTensor4C.hh" #include "EvtGenBase/EvtVector4C.hh" #include using std::endl; using std::ostream; EvtGammaMatrix::EvtGammaMatrix(){ int i,j; static EvtComplex zero(0.0,0.0); for(i=0;i<4;i++){ for(j=0;j<4;j++){ _gamma[i][j]=zero; } } } EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c) { return c*g; } EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g){ int i,j; EvtGammaMatrix temp; for(i=0;i<4;i++){ for(j=0;j<4;j++){ temp._gamma[i][j]=g._gamma[i][j]*c; } } return temp; } ostream& operator<<(ostream& s, const EvtGammaMatrix& g){ s<<"["< 3 || nu > 3) { report(ERROR, "EvtSigmaTensor") << "Expected index between 0 and 3, but found " << nu << "!" << endl; assert(0); } return sigma[mu][nu]; } const EvtGammaMatrix& EvtGammaMatrix::sigmaLower(unsigned int mu, unsigned int nu) { const EvtComplex I(0, 1); EvtGammaMatrix a, b; static EvtGammaMatrix sigma[4][4]; static bool hasBeenCalled = false; static const EvtTensor4C eta = EvtTensor4C::g(); if (!hasBeenCalled) // has to be initialized only at the first call { // lower index for (int i=0; i<4; ++i) { a = eta.get(i, 0)*g0() + eta.get(i, 1)*g1() + eta.get(i, 2)*g2() + eta.get(i, 3)*g3(); for (int j=0; j<4; ++j) { b = eta.get(j, 0)*g0() + eta.get(j, 1)*g1() + eta.get(j, 2)*g2() + eta.get(j, 3)*g3(); sigma[i][j] = I/2 * (a*b - b*a); } } } return sigma[mu][nu]; } EvtGammaMatrix slash(const EvtVector4C& p) { return EvtGammaMatrix::g0()*p.get(0) + EvtGammaMatrix::g1()*p.get(1) + EvtGammaMatrix::g2()*p.get(2) + EvtGammaMatrix::g3()*p.get(3); }