3 #include "ERGammaGenerator.h" 7 #include "G4IonTable.hh" 8 #include "G4ParticleTable.hh" 19 fRnd =
new TRandom3();
27 Double_t phiCM = fRnd->Uniform()*(fPhiMaxCM - fPhiMinCM) + fPhiMinCM;
28 phiCM *= TMath::DegToRad();
29 G4IonTable* fIonTable = G4IonTable::GetIonTable();
30 G4ParticleTable* fParticleTable = G4ParticleTable::GetParticleTable();
31 fGammaPDG = fParticleTable->FindParticle(
"gamma")->GetPDGEncoding();
32 fIonMass = fIonTable->GetIonMass(fZ,fA)/1000.;
33 Double_t fullEBeam = fEBeam + fIonMass;
35 Double_t cos_thetaCM = fRnd->Uniform(TMath::Cos(fThetaMaxCM), TMath::Cos(fThetaMinCM));
36 Double_t sin_thetaCM = TMath::Sqrt(1-cos_thetaCM*cos_thetaCM);
37 Double_t pGammaCM = fEGammaCM;
38 Double_t pxCM = pGammaCM*TMath::Cos(phiCM)*sin_thetaCM;
39 Double_t pyCM = pGammaCM*TMath::Sin(phiCM)*sin_thetaCM;
40 Double_t pzCM = pGammaCM*cos_thetaCM;
42 Double_t pBeam = TMath::Sqrt(fullEBeam*fullEBeam - fIonMass*fIonMass);
43 Double_t betaCM = pBeam/fullEBeam;
44 Double_t gammaCM = TMath::Sqrt( 1. / ( 1. - betaCM*betaCM) );
46 Double_t pxLAB = pxCM;
47 Double_t pyLAB = pyCM;
48 Double_t pzLAB = gammaCM * ( pzCM + betaCM * fEGammaCM);
50 Double_t pLAB = TMath::Sqrt(pxLAB*pxLAB + pyLAB*pyLAB + pzLAB*pzLAB);
51 primGen->AddTrack(fGammaPDG, pxLAB, pyLAB, pzLAB,0, 0, 0);
56 void ERGammaGenerator::SetGammaCMThetaRange(Double_t thetaMin, Double_t thetaMax)
58 fThetaMinCM = thetaMin;
59 fThetaMaxCM= thetaMax;
60 cerr << fThetaMinCM <<
" " << fThetaMaxCM << endl;
61 fThetaMinCM *= TMath::DegToRad();
62 fThetaMaxCM *= TMath::DegToRad();
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
virtual ~ERGammaGenerator()