Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4MuonDecayChannelWithSpin class implementa << 26 // ------------------------------------------------------------ >> 27 // GEANT 4 class header file >> 28 // >> 29 // History: >> 30 // 17 August 2004 P.Gumplinger and T.MacPhail >> 31 // samples Michel spectrum including 1st order >> 32 // radiative corrections >> 33 // Reference: Florian Scheck "Muon Physics", in Physics Reports >> 34 // (Review Section of Physics Letters) 44, No. 4 (1978) >> 35 // 187-248. North-Holland Publishing Company, Amsterdam >> 36 // at page 210 cc. >> 37 // >> 38 // W.E. Fisher and F. Scheck, Nucl. Phys. B83 (1974) 25. >> 39 // >> 40 // ------------------------------------------------------------ 27 // 41 // 28 // References: << 29 // - Florian Scheck "Muon Physics", in Physics << 30 // (Review Section of Physics Letters) 44, N << 31 // 187-248. North-Holland Publishing Company << 32 // - W.E. Fisher and F. Scheck, Nucl. Phys. B8 << 33 << 34 // Authors: P.Gumplinger and T.MacPhail, 17 Au << 35 // ------------------------------------------- << 36 << 37 #include "G4MuonDecayChannelWithSpin.hh" 42 #include "G4MuonDecayChannelWithSpin.hh" 38 43 >> 44 #include "Randomize.hh" >> 45 39 #include "G4DecayProducts.hh" 46 #include "G4DecayProducts.hh" 40 #include "G4LorentzVector.hh" 47 #include "G4LorentzVector.hh" 41 #include "G4PhysicalConstants.hh" << 42 #include "G4SystemOfUnits.hh" << 43 #include "Randomize.hh" << 44 48 45 G4MuonDecayChannelWithSpin::G4MuonDecayChannel << 49 G4MuonDecayChannelWithSpin::G4MuonDecayChannelWithSpin(const G4String& theParentName, 46 << 50 G4double theBR) 47 : G4MuonDecayChannel(theParentName, theBR) << 51 : G4MuonDecayChannel(theParentName,theBR) 48 {} << 52 { >> 53 EMMU = 0.*MeV; >> 54 EMASS = 0.*MeV; >> 55 } 49 56 50 G4MuonDecayChannelWithSpin& << 57 G4MuonDecayChannelWithSpin::~G4MuonDecayChannelWithSpin() 51 G4MuonDecayChannelWithSpin::operator=(const G4 << 52 { 58 { 53 if (this != &right) { << 54 kinematics_name = right.kinematics_name; << 55 verboseLevel = right.verboseLevel; << 56 rbranch = right.rbranch; << 57 << 58 // copy parent name << 59 delete parent_name; << 60 parent_name = new G4String(*right.parent_n << 61 << 62 // clear daughters_name array << 63 ClearDaughtersName(); << 64 << 65 // recreate array << 66 numberOfDaughters = right.numberOfDaughter << 67 if (numberOfDaughters > 0) { << 68 daughters_name = new G4String*[numberOfD << 69 // copy daughters name << 70 for (G4int index = 0; index < numberOfDa << 71 daughters_name[index] = new G4String(* << 72 } << 73 } << 74 } << 75 return *this; << 76 } 59 } 77 60 78 G4DecayProducts* G4MuonDecayChannelWithSpin::D << 61 G4DecayProducts *G4MuonDecayChannelWithSpin::DecayIt(G4double) 79 { 62 { 80 // This version assumes V-A coupling with 1s 63 // This version assumes V-A coupling with 1st order radiative correctons, 81 // the standard model Michel pa 64 // the standard model Michel parameter values, but 82 // gives incorrect energy spect 65 // gives incorrect energy spectrum for neutrinos 83 66 84 #ifdef G4VERBOSE 67 #ifdef G4VERBOSE 85 if (GetVerboseLevel() > 1) G4cout << "G4Muon << 68 if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannelWithSpin::DecayIt "; 86 #endif 69 #endif 87 70 88 CheckAndFillParent(); << 71 if (parent == 0) FillParent(); 89 CheckAndFillDaughters(); << 72 if (daughters == 0) FillDaughters(); 90 73 91 // parent mass 74 // parent mass 92 G4double parentmass = G4MT_parent->GetPDGMas << 75 G4double parentmass = parent->GetPDGMass(); 93 76 94 G4double EMMU = parentmass; << 77 EMMU = parentmass; 95 78 96 // daughters'mass << 79 //daughters'mass 97 G4double daughtermass[3]; << 80 G4double daughtermass[3]; 98 // G4double sumofdaughtermass = 0.0; << 81 G4double sumofdaughtermass = 0.0; 99 for (G4int index = 0; index < 3; ++index) { << 82 for (G4int index=0; index<3; index++){ 100 daughtermass[index] = G4MT_daughters[index << 83 daughtermass[index] = daughters[index]->GetPDGMass(); 101 // sumofdaughtermass += daughtermass[index << 84 sumofdaughtermass += daughtermass[index]; 102 } 85 } 103 86 104 G4double EMASS = daughtermass[0]; << 87 EMASS = daughtermass[0]; 105 88 106 // create parent G4DynamicParticle at rest << 89 //create parent G4DynamicParticle at rest 107 G4ThreeVector dummy; 90 G4ThreeVector dummy; 108 auto parentparticle = new G4DynamicParticle( << 91 G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0); 109 // create G4Decayproducts << 92 //create G4Decayproducts 110 auto products = new G4DecayProducts(*parentp << 93 G4DecayProducts *products = new G4DecayProducts(*parentparticle); 111 delete parentparticle; 94 delete parentparticle; 112 95 113 // calculate electron energy << 96 // calcurate electron energy 114 97 115 G4double michel_rho = 0.75; // Standard Mod << 98 G4double michel_rho = 0.75; //Standard Model Michel rho 116 G4double michel_delta = 0.75; // Standard M << 99 G4double michel_delta = 0.75; //Standard Model Michel delta 117 G4double michel_xsi = 1.00; // Standard Mod << 100 G4double michel_xsi = 1.00; //Standard Model Michel xsi 118 G4double michel_eta = 0.00; // Standard Mod << 101 G4double michel_eta = 0.00; //Standard Model eta 119 102 120 G4double rndm, x, ctheta; 103 G4double rndm, x, ctheta; 121 104 122 G4double FG; << 105 G4double FG; 123 G4double FG_max = 2.00; 106 G4double FG_max = 2.00; 124 107 125 G4double W_mue = (EMMU * EMMU + EMASS * EMAS << 108 G4double W_mue = (EMMU*EMMU+EMASS*EMASS)/(2.*EMMU); 126 G4double x0 = EMASS / W_mue; << 109 G4double x0 = EMASS/W_mue; 127 110 128 G4double x0_squared = x0 * x0; << 111 G4double x0_squared = x0*x0; 129 112 130 // ***************************************** 113 // *************************************************** 131 // x0 <= x <= 1. and -1 <= y <= 1 114 // x0 <= x <= 1. and -1 <= y <= 1 132 // 115 // 133 // F(x,y) = f(x)*g(x,y); g(x,y) = 1.+g 116 // F(x,y) = f(x)*g(x,y); g(x,y) = 1.+g(x)*y 134 // ***************************************** 117 // *************************************************** 135 118 136 // ***** sampling F(x,y) directly (brute for 119 // ***** sampling F(x,y) directly (brute force) ***** 137 120 138 const std::size_t MAX_LOOP = 10000; << 121 do{ 139 for (std::size_t loop_count = 0; loop_count << 122 140 // Sample the positron energy by sampling 123 // Sample the positron energy by sampling from F 141 124 142 rndm = G4UniformRand(); 125 rndm = G4UniformRand(); 143 126 144 x = x0 + rndm * (1. - x0); << 127 x = x0 + rndm*(1.-x0); 145 128 146 G4double x_squared = x * x; << 129 G4double x_squared = x*x; 147 130 148 G4double F_IS, F_AS, G_IS, G_AS; 131 G4double F_IS, F_AS, G_IS, G_AS; 149 132 150 F_IS = 1. / 6. * (-2. * x_squared + 3. * x << 133 F_IS = 1./6.*(-2.*x_squared+3.*x-x0_squared); 151 F_AS = 1. / 6. * std::sqrt(x_squared - x0_ << 134 F_AS = 1./6.*std::sqrt(x_squared-x0_squared)*(2.*x-2.+std::sqrt(1.-x0_squared)); 152 135 153 G_IS = 2. / 9. * (michel_rho - 0.75) * (4. << 136 G_IS = 2./9.*(michel_rho-0.75)*(4.*x_squared-3.*x-x0_squared); 154 G_IS = G_IS + michel_eta * (1. - x) * x0; << 137 G_IS = G_IS + michel_eta*(1.-x)*x0; 155 138 156 G_AS = 3. * (michel_xsi - 1.) * (1. - x); << 139 G_AS = 3.*(michel_xsi-1.)*(1.-x); 157 G_AS = << 140 G_AS = G_AS+2.*(michel_xsi*michel_delta-0.75)*(4.*x-4.+std::sqrt(1.-x0_squared)); 158 G_AS + 2. * (michel_xsi * michel_delta - << 141 G_AS = 1./9.*std::sqrt(x_squared-x0_squared)*G_AS; 159 G_AS = 1. / 9. * std::sqrt(x_squared - x0_ << 160 142 161 F_IS = F_IS + G_IS; 143 F_IS = F_IS + G_IS; 162 F_AS = F_AS + G_AS; 144 F_AS = F_AS + G_AS; 163 145 164 // *** Radiative Corrections *** 146 // *** Radiative Corrections *** 165 147 166 const G4double omega = std::log(EMMU / EMA << 148 G4double R_IS = F_c(x,x0); 167 G4double R_IS = F_c(x, x0, omega); << 168 149 169 G4double F = 6. * F_IS + R_IS / std::sqrt( << 150 G4double F = 6.*F_IS + R_IS/std::sqrt(x_squared-x0_squared); 170 151 171 // *** Radiative Corrections *** 152 // *** Radiative Corrections *** 172 153 173 G4double R_AS = F_theta(x, x0, omega); << 154 G4double R_AS = F_theta(x,x0); 174 155 175 rndm = G4UniformRand(); 156 rndm = G4UniformRand(); 176 157 177 ctheta = 2. * rndm - 1.; << 158 ctheta = 2.*rndm-1.; 178 159 179 G4double G = 6. * F_AS - R_AS / std::sqrt( << 160 G4double G = 6.*F_AS - R_AS/std::sqrt(x_squared-x0_squared); 180 161 181 FG = std::sqrt(x_squared - x0_squared) * F << 162 FG = std::sqrt(x_squared-x0_squared)*F*(1.+(G/F)*ctheta); 182 163 183 if (FG > FG_max) { << 164 if(FG>FG_max){ 184 G4Exception("G4MuonDecayChannelWithSpin: << 165 G4cout<<"***Problem in Muon Decay *** : FG > FG_max"<<G4endl; 185 "Problem in Muon Decay: FG > << 186 FG_max = FG; 166 FG_max = FG; 187 } 167 } 188 168 189 rndm = G4UniformRand(); 169 rndm = G4UniformRand(); 190 170 191 if (FG >= rndm * FG_max) break; << 171 }while(FG<rndm*FG_max); 192 } << 193 172 194 G4double energy = x * W_mue; 173 G4double energy = x * W_mue; 195 174 196 rndm = G4UniformRand(); 175 rndm = G4UniformRand(); 197 176 198 G4double phi = twopi * rndm; 177 G4double phi = twopi * rndm; 199 178 200 if (energy < EMASS) energy = EMASS; << 179 if(energy < EMASS) energy = EMASS; 201 180 202 // Calculate daughter momentum << 181 // calculate daughter momentum 203 G4double daughtermomentum[3]; 182 G4double daughtermomentum[3]; 204 183 205 daughtermomentum[0] = std::sqrt(energy * ene << 184 daughtermomentum[0] = std::sqrt(energy*energy - EMASS*EMASS); 206 185 207 G4double stheta = std::sqrt(1. - ctheta * ct << 186 G4double stheta = std::sqrt(1.-ctheta*ctheta); 208 G4double cphi = std::cos(phi); 187 G4double cphi = std::cos(phi); 209 G4double sphi = std::sin(phi); 188 G4double sphi = std::sin(phi); 210 189 211 // Coordinates of the decay positron with re << 190 //Coordinates of the decay positron with respect to the muon spin 212 G4double px = stheta * cphi; << 191 213 G4double py = stheta * sphi; << 192 G4double px = stheta*cphi; >> 193 G4double py = stheta*sphi; 214 G4double pz = ctheta; 194 G4double pz = ctheta; 215 195 216 G4ThreeVector direction0(px, py, pz); << 196 G4ThreeVector direction0(px,py,pz); 217 197 218 direction0.rotateUz(parent_polarization); 198 direction0.rotateUz(parent_polarization); 219 199 220 auto daughterparticle0 = << 200 G4DynamicParticle * daughterparticle0 221 new G4DynamicParticle(G4MT_daughters[0], d << 201 = new G4DynamicParticle( daughters[0], daughtermomentum[0]*direction0); 222 202 223 products->PushProducts(daughterparticle0); 203 products->PushProducts(daughterparticle0); 224 204 >> 205 225 // daughter 1 ,2 (neutrinos) 206 // daughter 1 ,2 (neutrinos) 226 // create neutrinos in the C.M frame of two 207 // create neutrinos in the C.M frame of two neutrinos 227 G4double energy2 = parentmass - energy; << 208 G4double energy2 = parentmass*(1.0 - x/2.0); 228 G4double vmass = std::sqrt((energy2 - daught << 209 G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0])); 229 G4double beta = -1.0 * daughtermomentum[0] / << 210 G4double beta = -1.0*daughtermomentum[0]/energy2; 230 G4double costhetan = 2. * G4UniformRand() - << 211 G4double costhetan = 2.*G4UniformRand()-1.0; 231 G4double sinthetan = std::sqrt((1.0 - costhe << 212 G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan)); 232 G4double phin = twopi * G4UniformRand() * ra << 213 G4double phin = twopi*G4UniformRand()*rad; 233 G4double sinphin = std::sin(phin); 214 G4double sinphin = std::sin(phin); 234 G4double cosphin = std::cos(phin); 215 G4double cosphin = std::cos(phin); 235 216 236 G4ThreeVector direction1(sinthetan * cosphin << 217 G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan); 237 auto daughterparticle1 = new G4DynamicPartic << 218 G4DynamicParticle * daughterparticle1 238 auto daughterparticle2 = << 219 = new G4DynamicParticle( daughters[1], direction1*(vmass/2.)); 239 new G4DynamicParticle(G4MT_daughters[2], d << 220 G4DynamicParticle * daughterparticle2 >> 221 = new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.)); 240 222 241 // boost to the muon rest frame 223 // boost to the muon rest frame 242 G4LorentzVector p4; 224 G4LorentzVector p4; 243 p4 = daughterparticle1->Get4Momentum(); 225 p4 = daughterparticle1->Get4Momentum(); 244 p4.boost(direction0.x() * beta, direction0.y << 226 p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta); 245 daughterparticle1->Set4Momentum(p4); 227 daughterparticle1->Set4Momentum(p4); 246 p4 = daughterparticle2->Get4Momentum(); 228 p4 = daughterparticle2->Get4Momentum(); 247 p4.boost(direction0.x() * beta, direction0.y << 229 p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta); 248 daughterparticle2->Set4Momentum(p4); 230 daughterparticle2->Set4Momentum(p4); 249 products->PushProducts(daughterparticle1); 231 products->PushProducts(daughterparticle1); 250 products->PushProducts(daughterparticle2); 232 products->PushProducts(daughterparticle2); 251 daughtermomentum[1] = daughterparticle1->Get 233 daughtermomentum[1] = daughterparticle1->GetTotalMomentum(); 252 daughtermomentum[2] = daughterparticle2->Get 234 daughtermomentum[2] = daughterparticle2->GetTotalMomentum(); 253 235 254 // output message 236 // output message 255 #ifdef G4VERBOSE 237 #ifdef G4VERBOSE 256 if (GetVerboseLevel() > 1) { << 238 if (GetVerboseLevel()>1) { 257 G4cout << "G4MuonDecayChannelWithSpin::Dec 239 G4cout << "G4MuonDecayChannelWithSpin::DecayIt "; 258 G4cout << " create decay products in rest << 240 G4cout << " create decay products in rest frame " <<G4endl; 259 G4double TT = daughterparticle0->GetTotalE << 241 products->DumpInfo(); 260 + daughterparticle2->GetTota << 261 G4cout << "e " << daughterparticle0->GetT << 262 G4cout << "nu1" << daughterparticle1->GetT << 263 G4cout << "nu2" << daughterparticle2->GetT << 264 G4cout << "total" << (TT - parentmass) / k << 265 if (GetVerboseLevel() > 2) { << 266 products->DumpInfo(); << 267 } << 268 } 242 } 269 #endif 243 #endif 270 << 271 return products; 244 return products; 272 } 245 } 273 246 274 G4double G4MuonDecayChannelWithSpin::R_c(G4dou << 247 G4double G4MuonDecayChannelWithSpin::R_c(G4double x){ 275 { << 276 auto n_max = (G4int)(100. * x); << 277 248 278 if (n_max < 10) n_max = 10; << 249 G4int n_max = (int)(100.*x); >> 250 >> 251 if(n_max<10)n_max=10; 279 252 280 G4double L2 = 0.0; 253 G4double L2 = 0.0; 281 254 282 for (G4int n = 1; n <= n_max; ++n) { << 255 for(G4int n=1; n<=n_max; n++){ 283 L2 += std::pow(x, n) / (n * n); << 256 L2 += std::pow(x,n)/(n*n); 284 } 257 } 285 258 >> 259 G4double omega = std::log(EMMU/EMASS); >> 260 286 G4double r_c; 261 G4double r_c; 287 262 288 r_c = 2. * L2 - (pi * pi / 3.) - 2.; << 263 r_c = 2.*L2-(pi*pi/3.)-2.; 289 r_c = r_c + omega * (1.5 + 2. * std::log((1. << 264 r_c = r_c + omega * (1.5+2.*std::log((1.-x)/x)); 290 r_c = r_c - std::log(x) * (2. * std::log(x) << 265 r_c = r_c - std::log(x)*(2.*std::log(x)-1.); 291 r_c = r_c + (3. * std::log(x) - 1. - 1. / x) << 266 r_c = r_c + (3.*std::log(x)-1.-1./x)*std::log(1.-x); 292 267 293 return r_c; 268 return r_c; 294 } 269 } 295 270