Changeset 1352 for trunk/WuerzburgSoft/Thomas/mphys/MPairProduction.cc
- Timestamp:
- 06/10/02 08:49:28 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WuerzburgSoft/Thomas/mphys/MPairProduction.cc
r1349 r1352 32 32 #include <TF1.h> 33 33 #include <TMath.h> 34 #include <TRandom.h> 34 35 35 36 #include "TList.h" … … 70 71 71 72 // -------------------------------------------------------------------------- 72 Bool_t MPairProduction::Process(MParticle *gamma, MParticle *phot, TList *list)73 Bool_t MPairProduction::Process(MParticle *gamma, MParticle *phot, const Double_t theta, TList *list) 73 74 { 74 75 // … … 78 79 const Double_t E0 = 511e-6; // [GeV] 79 80 80 const Double_t theta = phot->GetAngle(); // [2pi]81 //const Double_t theta = phot->GetAngle(); // [2pi] 81 82 const Double_t Ep = phot->GetEnergy(); // [GeV] 82 83 const Double_t Eg = gamma->GetEnergy(); // [GeV] … … 120 121 const Double_t dE = E*Bcosd; 121 122 122 MElectron *p[2]; 123 p[0] = new MElectron(E+dE, gamma->GetZ()); 124 p[1] = new MElectron(E-dE, gamma->GetZ()); 123 MElectron &p0 = *new MElectron(E+dE, gamma->GetZ()); 124 MElectron &p1 = *new MElectron(E-dE, gamma->GetZ()); 125 p0 = *gamma; // Set Position and direction 126 p1 = *gamma; // Set Position and direction 125 127 126 128 const Double_t E1 = E0/(E+dE); … … 130 132 const Double_t beta2 = sqrt(1.-E2*E2); 131 133 132 p [0]->SetBeta(beta1);133 p [1]->SetBeta(beta2);134 p0.SetBeta(beta1); 135 p1.SetBeta(beta2); 134 136 135 137 const Double_t Bscp = Bsind*cphi; … … 140 142 const Double_t tan2 = (spg*(Bcosd-1) + Bscp)/((cpg*(Bcosd-1) - Bscp)); 141 143 142 p[0]->SetAngle(atan(tan1)); 143 p[1]->SetAngle(atan(tan2)); 144 static TRandom rand(0); 145 Double_t rnd = rand.Uniform(TMath::Pi() * 2); 146 p0.SetNewDirection(atan(tan1), rnd); 147 p1.SetNewDirection(atan(tan2), rnd+TMath::Pi()); 144 148 145 list->Add( p[0]);146 list->Add( p[1]);149 list->Add(&p0); 150 list->Add(&p1); 147 151 148 152 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.