Ignore:
Timestamp:
06/10/02 08:49:28 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WuerzburgSoft/Thomas/mphys/MPairProduction.cc

    r1349 r1352  
    3232#include <TF1.h>
    3333#include <TMath.h>
     34#include <TRandom.h>
    3435
    3536#include "TList.h"
     
    7071
    7172// --------------------------------------------------------------------------
    72 Bool_t MPairProduction::Process(MParticle *gamma, MParticle *phot, TList *list)
     73Bool_t MPairProduction::Process(MParticle *gamma, MParticle *phot, const Double_t theta, TList *list)
    7374{
    7475    //
     
    7879    const Double_t E0     = 511e-6;              // [GeV]
    7980
    80     const Double_t theta  = phot->GetAngle();    // [2pi]
     81    //const Double_t theta  = phot->GetAngle();    // [2pi]
    8182    const Double_t Ep     = phot->GetEnergy();   // [GeV]
    8283    const Double_t Eg     = gamma->GetEnergy();  // [GeV]
     
    120121    const Double_t dE = E*Bcosd;
    121122
    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
    125127
    126128    const Double_t E1 = E0/(E+dE);
     
    130132    const Double_t beta2 = sqrt(1.-E2*E2);
    131133
    132     p[0]->SetBeta(beta1);
    133     p[1]->SetBeta(beta2);
     134    p0.SetBeta(beta1);
     135    p1.SetBeta(beta2);
    134136
    135137    const Double_t Bscp = Bsind*cphi;
     
    140142    const Double_t tan2 = (spg*(Bcosd-1) + Bscp)/((cpg*(Bcosd-1) - Bscp));
    141143
    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());
    144148
    145     list->Add(p[0]);
    146     list->Add(p[1]);
     149    list->Add(&p0);
     150    list->Add(&p1);
    147151
    148152    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.