ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MuonRadiativeDecayChannelWithSpin.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4MuonRadiativeDecayChannelWithSpin.hh
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 // 25 July 2007 P.Gumplinger - Triumf
31 // 10 August 2011 D. Mingming - Center for HEP, Tsinghua Univ.
32 //
33 // Samples Radiative Muon Decay
34 // References:
35 // TRIUMF/TWIST Technote TN-55:
36 // "Radiative muon decay" by P. Depommier and A. Vacheret
37 // ------------------------------------------------------
38 // Yoshitaka Kuno and Yasuhiro Okada
39 // "Muon Decays and Physics Beyond the Standard Model"
40 // Rev. Mod. Phys. 73, 151 (2001)
41 //
42 // ------------------------------------------------------------
43 //
44 //
45 //
46 //
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
51 #ifndef G4MuonRadiativeDecayChannelWithSpin_h
52 #define G4MuonRadiativeDecayChannelWithSpin_h 1
53 
55 
56 #include "globals.hh"
57 #include "Randomize.hh"
58 #include "G4ThreeVector.hh"
59 #include "G4VDecayChannel.hh"
60 
62 {
63  // Class Decription
64  // This class describes radiative muon decay kinemtics, but
65  // gives incorrect energy spectrum for neutrinos
66 
67  public: // With Description
68 
69  //Constructors
70  G4MuonRadiativeDecayChannelWithSpin(const G4String& theParentName,
71  G4double theBR);
72  // Destructor
74 
75  protected:
76  // Copy constructor and assignment operator
79 
80  private:
82 
83  public: // With Description
84 
86 
87  private:
88 
90  G4double cthetaE, G4double cthetaG, G4double cthetaEG);
91 
92  // rn3dim generates random vectors, uniformly distributed over the surface
93  // of a sphere of given radius.
94  // See http://wwwinfo.cern.ch/asdoc/shortwrupsdir/v131/top.html
95 
96  void rn3dim(G4double& x, G4double& y, G4double& z, G4double xlong);
97 
99 
100 };
101 
103  G4double& y,
104  G4double& z,
105  G4double xlong)
106 {
107  G4double a = 0.; G4double b = 0.; G4double c = 0.; G4double r = 0.;
108 
109  do {
110  a = G4UniformRand() - 0.5;
111  b = G4UniformRand() - 0.5;
112  c = G4UniformRand() - 0.5;
113  r = a*a + b*b + c*c;
114  } while (r > 0.25);// Loop checking, 09.08.2015, K.Kurashige
115 
116  G4double rinv = xlong/(std::sqrt(r));
117  x = a * rinv;
118  y = b * rinv;
119  z = c * rinv;
120 
121  return;
122 }
123 
125  G4double y)
126 {
127  G4double phi = 0.;
128 
129  if (x==0. && y>0.){
130  phi = 0.5*CLHEP::pi;
131  } else if (x==0. && y<0.){
132  phi = 1.5*CLHEP::pi;
133  } else if (y==0. && x>0.){
134  phi = 0.;
135  } else if (y==0. && x<0.){
136  phi = CLHEP::pi;
137  } else if (x>0. ){
138  phi = std::atan(y/x);
139  } else if (x<0. ){
140  phi = std::atan(y/x) + CLHEP::pi;
141  }
142 
143  return phi;
144 }
145 
146 #endif