Example #1
0
void DiracAntiSpinor::SetP4(const Vector4<double> &__p4,
			    const double &__mass){

  Matrix <complex<double> > sigP(2,2);
  Matrix <complex<double> > chi(2,1);
  PauliSigma sigma;

  _p4 = __p4;
  _mass = __mass;

  complex<double> norm = sqrt(__p4.E() + __mass);
  complex<double> epm = __p4.E() + __mass;
  sigP = sigma[1]*__p4.X() + sigma[2]*__p4.Y() + sigma[3]*__p4.Z();

  // spin up
  chi(0,0) = 0.;  
  chi(1,0) = 1.;  
  _spinors[1](2,0) = chi(0,0)*norm;
  _spinors[1](3,0) = chi(1,0)*norm;
  _spinors[1](0,0) = ((sigP*chi)(0,0))*norm/epm;
  _spinors[1](1,0) = ((sigP*chi)(1,0))*norm/epm;

  // spin down
  chi(0,0) = 1.;
  chi(1,0) = 0.;
  _spinors[0](2,0) = chi(0,0)*norm;
  _spinors[0](3,0) = chi(1,0)*norm;
  _spinors[0](0,0) = ((sigP*chi)(0,0))*norm/epm;
  _spinors[0](1,0) = ((sigP*chi)(1,0))*norm/epm;
  
  this->_SetProjector();
}
Example #2
0
void throwDecay(float sig=3.) {// spread W momentum in GeV
  float Pmag=40; // energy avaliable to electron in GeV
  float phi=2*3.1416*rnd->Uniform();
  float cosTh=2*rnd->Uniform()-1.;
  float theta=acos(cosTh);
  TVector3 P(1,2,3); P.SetMag(Pmag); P.SetTheta(theta); P.SetPhi(phi); // mean
  TVector3 sigP(rnd->Gaus(0,sig),rnd->Gaus(0,sig),rnd->Gaus(0,sig));// spread
  P=P+sigP;
  h2D->Fill(P.z(), P.Pt());
  if( fabs(P.Pt())<15) continue; // minPt cut used in analysis
  hmcPt->Fill(P.Pt());  
  hmcP->Fill(P.Mag());
}