[824] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // ------------------------------------------------------------ |
---|
| 27 | // GEANT 4 class header file |
---|
| 28 | // |
---|
| 29 | // History: |
---|
| 30 | // 01 August 2007 P.Gumplinger |
---|
| 31 | // Reference: TRIUMF PIENU Technote: |
---|
| 32 | // M. Blecher - "Inclusion of pi->enug in MC " |
---|
| 33 | // Rate is for gammas > 100keV |
---|
| 34 | // |
---|
| 35 | // ------------------------------------------------------------ |
---|
| 36 | // |
---|
| 37 | // |
---|
| 38 | // |
---|
| 39 | |
---|
| 40 | #include "G4PionRadiativeDecayChannel.hh" |
---|
| 41 | |
---|
| 42 | #include "Randomize.hh" |
---|
| 43 | #include "G4DecayProducts.hh" |
---|
| 44 | #include "G4LorentzVector.hh" |
---|
| 45 | |
---|
| 46 | G4PionRadiativeDecayChannel:: |
---|
| 47 | G4PionRadiativeDecayChannel(const G4String& theParentName, |
---|
| 48 | G4double theBR) |
---|
| 49 | : G4VDecayChannel("Radiative Pion Decay",1) |
---|
| 50 | { |
---|
| 51 | // set names for daughter particles |
---|
| 52 | if (theParentName == "pi+") { |
---|
| 53 | SetBR(theBR); |
---|
| 54 | SetParent("pi+"); |
---|
| 55 | SetNumberOfDaughters(3); |
---|
| 56 | SetDaughter(0, "e+"); |
---|
| 57 | SetDaughter(1, "gamma"); |
---|
| 58 | SetDaughter(2, "nu_e"); |
---|
| 59 | } else if (theParentName == "pi-") { |
---|
| 60 | SetBR(theBR); |
---|
| 61 | SetParent("pi-"); |
---|
| 62 | SetNumberOfDaughters(3); |
---|
| 63 | SetDaughter(0, "e-"); |
---|
| 64 | SetDaughter(1, "gamma"); |
---|
| 65 | SetDaughter(2, "anti_nu_e"); |
---|
| 66 | } else { |
---|
| 67 | #ifdef G4VERBOSE |
---|
| 68 | if (GetVerboseLevel()>0) { |
---|
| 69 | G4cout << "G4RadiativePionDecayChannel:: constructor :"; |
---|
| 70 | G4cout << " parent particle is not muon but "; |
---|
| 71 | G4cout << theParentName << G4endl; |
---|
| 72 | } |
---|
| 73 | #endif |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | beta = 3.6612e-03; |
---|
| 77 | |
---|
| 78 | cib = 1.16141e-03; |
---|
| 79 | csdp = 3.45055e-02; |
---|
| 80 | csdm = 5.14122e-03; |
---|
| 81 | cif = 4.63543e-05; |
---|
| 82 | cig = 1.78928e-05; |
---|
| 83 | |
---|
| 84 | xl = 2.*0.1*MeV/139.57*MeV; |
---|
| 85 | yl = ((1.-xl) + std::sqrt((1-xl)*(1-xl)+4*beta*beta))/2.; |
---|
| 86 | |
---|
| 87 | xu = 1. - (yl - std::sqrt(yl*yl-4.*beta*beta))/2.; |
---|
| 88 | yu = 1. + beta*beta; |
---|
| 89 | |
---|
| 90 | d2wmax = D2W(xl,yl); |
---|
| 91 | |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | G4PionRadiativeDecayChannel::~G4PionRadiativeDecayChannel() |
---|
| 95 | { |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | G4DecayProducts *G4PionRadiativeDecayChannel::DecayIt(G4double) |
---|
| 99 | { |
---|
| 100 | |
---|
| 101 | #ifdef G4VERBOSE |
---|
| 102 | if (GetVerboseLevel()>1) |
---|
| 103 | G4cout << "G4PionRadiativeDecayChannel::DecayIt "; |
---|
| 104 | #endif |
---|
| 105 | |
---|
| 106 | if (parent == 0) FillParent(); |
---|
| 107 | if (daughters == 0) FillDaughters(); |
---|
| 108 | |
---|
| 109 | // parent mass |
---|
| 110 | G4double parentmass = parent->GetPDGMass(); |
---|
| 111 | |
---|
| 112 | G4double EMPI = parentmass; |
---|
| 113 | |
---|
| 114 | //daughters'mass |
---|
| 115 | G4double daughtermass[3]; |
---|
| 116 | G4double sumofdaughtermass = 0.0; |
---|
| 117 | for (G4int index=0; index<3; index++){ |
---|
| 118 | daughtermass[index] = daughters[index]->GetPDGMass(); |
---|
| 119 | sumofdaughtermass += daughtermass[index]; |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | G4double EMASS = daughtermass[0]; |
---|
| 123 | |
---|
| 124 | //create parent G4DynamicParticle at rest |
---|
| 125 | G4ThreeVector dummy; |
---|
| 126 | G4DynamicParticle * parentparticle = |
---|
| 127 | new G4DynamicParticle( parent, dummy, 0.0); |
---|
| 128 | //create G4Decayproducts |
---|
| 129 | G4DecayProducts *products = new G4DecayProducts(*parentparticle); |
---|
| 130 | delete parentparticle; |
---|
| 131 | |
---|
| 132 | G4double x, y, d2w; |
---|
| 133 | |
---|
| 134 | do { |
---|
| 135 | |
---|
| 136 | do { |
---|
| 137 | |
---|
| 138 | x = xl + G4UniformRand()*(xu-xl); |
---|
| 139 | y = yl + G4UniformRand()*(yu-yl); |
---|
| 140 | |
---|
| 141 | } while (x+y <= 1.); |
---|
| 142 | |
---|
| 143 | d2w = D2W(x,y); |
---|
| 144 | |
---|
| 145 | } while (d2w <= G4UniformRand()*d2wmax); |
---|
| 146 | |
---|
| 147 | //----------------------------------------------------------------------- |
---|
| 148 | // |
---|
| 149 | // Calculate the angle between positron and photon (cosine) |
---|
| 150 | // |
---|
| 151 | G4double cthetaGE = (y*(x-2.)+2.*(1.-x+beta*beta)) / |
---|
| 152 | (x*std::sqrt(y*y-4.*beta*beta)); |
---|
| 153 | |
---|
| 154 | // |
---|
| 155 | //----------------------------------------------------------------------- |
---|
| 156 | // |
---|
| 157 | G4double G = x * EMPI/2.; |
---|
| 158 | G4double E = y * EMPI/2.; |
---|
| 159 | // |
---|
| 160 | //----------------------------------------------------------------------- |
---|
| 161 | // |
---|
| 162 | |
---|
| 163 | if (E < EMASS) E = EMASS; |
---|
| 164 | |
---|
| 165 | // calculate daughter momentum |
---|
| 166 | G4double daughtermomentum[2]; |
---|
| 167 | |
---|
| 168 | daughtermomentum[0] = std::sqrt(E*E - EMASS*EMASS); |
---|
| 169 | |
---|
| 170 | G4double cthetaE = 2.*G4UniformRand()-1.; |
---|
| 171 | G4double sthetaE = std::sqrt(1.-cthetaE*cthetaE); |
---|
| 172 | |
---|
| 173 | G4double phiE = twopi*G4UniformRand()*rad; |
---|
| 174 | G4double cphiE = std::cos(phiE); |
---|
| 175 | G4double sphiE = std::sin(phiE); |
---|
| 176 | |
---|
| 177 | //Coordinates of the decay positron |
---|
| 178 | |
---|
| 179 | G4double px = sthetaE*cphiE; |
---|
| 180 | G4double py = sthetaE*sphiE; |
---|
| 181 | G4double pz = cthetaE; |
---|
| 182 | |
---|
| 183 | G4ThreeVector direction0(px,py,pz); |
---|
| 184 | |
---|
| 185 | G4DynamicParticle * daughterparticle0 |
---|
| 186 | = new G4DynamicParticle( daughters[0], daughtermomentum[0]*direction0); |
---|
| 187 | |
---|
| 188 | products->PushProducts(daughterparticle0); |
---|
| 189 | |
---|
| 190 | daughtermomentum[1] = G; |
---|
| 191 | |
---|
| 192 | G4double sthetaGE = std::sqrt(1.-cthetaGE*cthetaGE); |
---|
| 193 | |
---|
| 194 | G4double phiGE = twopi*G4UniformRand()*rad; |
---|
| 195 | G4double cphiGE = std::cos(phiGE); |
---|
| 196 | G4double sphiGE = std::sin(phiGE); |
---|
| 197 | |
---|
| 198 | //Coordinates of the decay gamma with respect to the decay positron |
---|
| 199 | |
---|
| 200 | px = sthetaGE*cphiGE; |
---|
| 201 | py = sthetaGE*sphiGE; |
---|
| 202 | pz = cthetaGE; |
---|
| 203 | |
---|
| 204 | G4ThreeVector direction1(px,py,pz); |
---|
| 205 | |
---|
| 206 | direction1.rotateUz(direction0); |
---|
| 207 | |
---|
| 208 | G4DynamicParticle * daughterparticle1 |
---|
| 209 | = new G4DynamicParticle( daughters[1], daughtermomentum[1]*direction1); |
---|
| 210 | |
---|
| 211 | products->PushProducts(daughterparticle1); |
---|
| 212 | |
---|
| 213 | // output message |
---|
| 214 | #ifdef G4VERBOSE |
---|
| 215 | if (GetVerboseLevel()>1) { |
---|
| 216 | G4cout << "G4PionRadiativeDecayChannel::DecayIt "; |
---|
| 217 | G4cout << " create decay products in rest frame " <<G4endl; |
---|
| 218 | products->DumpInfo(); |
---|
| 219 | } |
---|
| 220 | #endif |
---|
| 221 | |
---|
| 222 | return products; |
---|
| 223 | |
---|
| 224 | } |
---|