diff --git a/geant4/LEMuSR/src/AsymCheck.cc b/geant4/LEMuSR/src/AsymCheck.cc index 4ddffe1..8bfd81e 100644 --- a/geant4/LEMuSR/src/AsymCheck.cc +++ b/geant4/LEMuSR/src/AsymCheck.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // -// ID : AsymCheck.cc , v 1.2 +// ID : AsymCheck.cc , v 1.3 // AUTHOR: Taofiq PARAISO -// DATE : 2004-08-20 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +// DATE : 2006-01-19 15:17 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,9 +18,9 @@ // & // & // ASYMCHECK -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// -#include "AsymCheck.hh" +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +#include "AsymCheck.hh" #include "G4SteppingManager.hh" #include "G4Transform3D.hh" #include "G4DynamicParticle.hh" @@ -28,6 +28,7 @@ #include "LEMuSRMuonDecayChannel.hh" #include "G4MuonDecayChannelWithSpin.hh" + AsymCheck::AsymCheck() { @@ -42,7 +43,7 @@ AsymCheck::AsymCheck() AsymCheck::~AsymCheck() { PrintAsym(); -G4cout <<"\n Left/Right Asymmetry: L vs R = " << L <<" vs " << R <<" => A = " << A <<" for "<< L+R <<" particles.\n"< A = " << A <<" for "<< L+R <<" particles.\n"<GetTrack()->GetCreatorProcess()) - { - if( aStep->GetTrack()->GetCreatorProcess()->GetProcessName()=="Decay"|| aStep->GetTrack()->GetCreatorProcess()->GetProcessName()=="DecayWithSpin") + { + if(p_name == "e+") + { + if( aStep->GetTrack()->GetCreatorProcess()) + { + if( aStep->GetTrack()->GetCreatorProcess()->GetProcessName()=="Decay"|| aStep->GetTrack()->GetCreatorProcess()->GetProcessName()=="DecayWithSpin") - { - condition=true; - } - } - } - } + { + condition=true; + } + } + } + } return condition; @@ -106,11 +104,6 @@ G4bool AsymCheck::CheckCondition(const G4Step* aStep) void AsymCheck::SetAngles(const G4Step* aStep) { - //lemu - // theta = LEMuSRMuonDecayChannel::GetInstance()->theta; - // phi = LEMuSRMuonDecayChannel::GetInstance()->phi; - - // triumf m=aStep->GetPreStepPoint()->GetMomentumDirection(); p= aStep->GetTrack()->GetDynamicParticle()->GetPolarization(); @@ -127,7 +120,6 @@ void AsymCheck::SetAngles(const G4Step* aStep) void AsymCheck::SetParticleVolumeNames(const G4Step* aStep) { - // NAMES p_name = aStep->GetTrack()->GetDefinition()->GetParticleName(); // particle name v_name = aStep->GetTrack()->GetVolume()->GetLogicalVolume()->GetName(); //lv_name pv_name = aStep->GetTrack()->GetVolume()->GetName(); //lv_name @@ -206,7 +198,6 @@ void AsymCheck::Update() void AsymCheck::PrintAsym() { A = (L-R)/(L+R); - // G4cout <<"\n Left/Right Asymmetry: L vs R = " << L <<" vs " << R <<" => A = " << A <<" for "<< L+R <<" particles.\n"<GetTrack()->GetCreatorProcess()) { - G4cout << "NOT PRIMARY PARTICLE : created by : " << aStep->GetTrack()->GetCreatorProcess()->GetProcessName() <<" ;\n "; + G4cout << "NOT PRIMARY PARTICLE : created by : " << aStep->GetTrack()->GetCreatorProcess()->GetProcessName() <<" ;\n "; } G4cout << "particle name : " << p_name <<" ;\n " diff --git a/geant4/LEMuSR/src/FieldCheck.cc b/geant4/LEMuSR/src/FieldCheck.cc index 8b8e2c8..42633ac 100644 --- a/geant4/LEMuSR/src/FieldCheck.cc +++ b/geant4/LEMuSR/src/FieldCheck.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID :FieldCheck.cc , v 1.2 // AUTHOR: Taofiq PARAISO -// DATE : 2004-09-17 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +// DATE : 2006-01-19 15:17 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // FIELDCHECK -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "FieldCheck.hh" #include "G4SteppingManager.hh" @@ -70,11 +70,7 @@ void FieldCheck::UserSteppingAction(const G4Step* aStep) SetPositionMomentum(aStep); SetTimeEnergy(aStep); - // SetSpinDirection(aStep); - - // Print datas to screen - // PrintDatas(aStep); - PrintField(aStep); + PrintField(aStep); Update(); FillRoot(); @@ -85,18 +81,10 @@ void FieldCheck::UserSteppingAction(const G4Step* aStep) } - // kill useless particles - // kill useless particles - /* if(aStep->GetTrack()->GetDefinition()->GetParticleName()=="e-" - ||aStep->GetTrack()->GetDefinition()->GetParticleName()=="gamma") - { - aStep->GetTrack()->SetTrackStatus(fStopAndKill); - }*/ - if(p_name!="mu+" &&p_name!="Mu" &&p_name!="e+" &&p_name!="geantino") - { - aStep->GetTrack()->SetTrackStatus(fStopAndKill); - } + { + aStep->GetTrack()->SetTrackStatus(fStopAndKill); + } // loop killa @@ -242,8 +230,7 @@ void FieldCheck::Update() void FieldCheck::PrintField(const G4Step* aStep) { - // G4cout<< position.z()<GetTrack()->GetVolume()->GetLogicalVolume()->GetFieldManager()) + if(aStep->GetTrack()->GetVolume()->GetLogicalVolume()->GetFieldManager()) { G4double point[4]; G4double Bfield[6]; @@ -253,11 +240,9 @@ void FieldCheck::PrintField(const G4Step* aStep) point[2]=position.z(); aStep->GetTrack()->GetVolume()->GetLogicalVolume()->GetFieldManager()->GetDetectorField()->GetFieldValue(point, Bfield); - // G4cout<< position.z()<energy/keV; diff --git a/geant4/LEMuSR/src/LEMuSRAtRestSpinRotation.cc b/geant4/LEMuSR/src/LEMuSRAtRestSpinRotation.cc index f9242af..6d56eb8 100644 --- a/geant4/LEMuSR/src/LEMuSRAtRestSpinRotation.cc +++ b/geant4/LEMuSR/src/LEMuSRAtRestSpinRotation.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // -// ID : LEMuSRAtRestSpinRotation.cc , v 1.2 +// ID : LEMuSRAtRestSpinRotation.cc , v 1.3 // AUTHOR: Taofiq PARAISO -// DATE : 2004-08-20 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +// DATE : 2006-01-19 16:15 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,8 @@ // & // & // AT REST SPIN ROTATION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + #include "LEMuSRAtRestSpinRotation.hh" @@ -61,17 +62,32 @@ LEMuSRAtRestSpinRotation* LEMuSRAtRestSpinRotation::GetInstance() + +//$$$$$$$$$$$$$$$$$$$$$$$$$$ AT REST DO IT $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + + /*! + * This method contains the list of modifications to do when the particle come to rest state. It is the implementation of a virtual method of G4VProcess. Therefore, it's name should not be changed. + * + * The procedure is the following: + * -# Initialize the particle change object according to the particle's properties taken from the track object. + * -# Propose a status for the track, a position, momentum, energy, and time change. + * -# Check is the volume where the particle is at rest contains a magnetic field + * -# If there is a magnetic field, get the B vector and call the RotateSpin method to rotate the spin. + * -# Propose a spin change + * -# Return the particle change object. + * . + * Then the AtRestUpdateStep method is called cf LEMuSRParticleChangeForSR. + */ G4VParticleChange* LEMuSRAtRestSpinRotation::AtRestDoIt(const G4Track& theTrack, const G4Step& aStep) { theParticleChange.Initialize(theTrack); theParticleChange.ProposeTrackStatus(fAlive); - // G4cout<<"AT REST::: globaltime "<< theTrack.GetGlobalTime()/ns <GetPreAssignedDecayProperTime(); @@ -97,10 +113,10 @@ G4VParticleChange* LEMuSRAtRestSpinRotation::AtRestDoIt(const G4Track& theTrack, { #ifdef G4SRVERBOSE - G4cout<<"AT REST::: MAGNETIC FIELD HERE" <GetDefinition()->GetGammaFactor()*rad; + gamma = aStep.GetTrack()->GetDefinition()->GetGyromagneticRatio()*rad; // G4cout<< fqz*(s*tesla)<GetTrack()->GetDefinition()->GetParticleName(); // particle name if(p_name=="mu+")mu=1; if(p_name=="Mu")e=1; @@ -64,11 +86,11 @@ G4bool LEMuSRCryoSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) FillRoot(); } - + /* Obsolete: to be removed // Define Hit aHit = new LEMuSRCryoHit(); - //++++++++++++++ set hit values _______________ + //++++++++++++++ set hit values _______________ aHit->SetParticleName(p_name); aHit->SetSpin(spin); @@ -77,16 +99,15 @@ G4bool LEMuSRCryoSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) aHit->SetTimeOfFlight( tof); aHit->SetEnergyDeposition( edep ); - + CryoCollection->insert( aHit ); // aHit->Print(); // aHit->print("Statistics/SCIS.Hits"); aHit->Draw(); - PrintAll(); - + */ return true; } @@ -105,7 +126,7 @@ G4bool LEMuSRCryoSD::CheckCondition(const G4Step* aStep) G4bool condition=false; if(p_name == "mu+"||p_name == "Mu") { - if(aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_SAH2"||aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_SAH3"||aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_SAH1"||aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_CRSH2"||aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_CRSH"||aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_SAPH") + if(aStep->GetTrack()->GetNextVolume()->GetLogicalVolume()->GetName()=="lv_SAH2") { condition=true; } diff --git a/geant4/LEMuSR/src/LEMuSRDecay.cc b/geant4/LEMuSR/src/LEMuSRDecay.cc index 558e240..da739a8 100644 --- a/geant4/LEMuSR/src/LEMuSRDecay.cc +++ b/geant4/LEMuSR/src/LEMuSRDecay.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSRDecay.cc , v 1.2 +// AUTHOR: Taofiq PARAISO +// DATE : 2006-01-19 15:17 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// LEMUSRDECAY +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include"LEMuSRDecay.hh" #include "G4DynamicParticle.hh" diff --git a/geant4/LEMuSR/src/LEMuSRDepolarize.cc b/geant4/LEMuSR/src/LEMuSRDepolarize.cc index a42e191..8a73022 100644 --- a/geant4/LEMuSR/src/LEMuSRDepolarize.cc +++ b/geant4/LEMuSR/src/LEMuSRDepolarize.cc @@ -1,3 +1,24 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSRDepolarize.cc , v 1.2 +// AUTHOR: Taofiq PARAISO +// DATE : 2006-01-19 15:17 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// LEMUSRDEPOLARIZE +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRDepolarize.hh" #include "G4StepStatus.hh" diff --git a/geant4/LEMuSR/src/LEMuSRDetectorConstruction.cc b/geant4/LEMuSR/src/LEMuSRDetectorConstruction.cc index e95d096..f7fa162 100644 --- a/geant4/LEMuSR/src/LEMuSRDetectorConstruction.cc +++ b/geant4/LEMuSR/src/LEMuSRDetectorConstruction.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRDetectorConstruction.cc , v 1.0 // AUTHOR: Taofiq PARAISO // DATE : 2004-06-24 16:33 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // DETECTOR CONSTRUCTION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // G4 GEOMETRIC FORMS CLASSES @@ -82,7 +82,7 @@ #include "LEMuSRElMag_SpinEqRhs.hh" #include "LEMuSRMagneticField.hh" #include "G4Mag_SpinEqRhs.hh" -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// @@ -153,9 +153,9 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::Construct() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE DETECTOR -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V dans G4VP... { @@ -163,8 +163,8 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V // +++++++++++++++++++++++++++++++DEFINE THE MOTHER VOLUME: THE LABORATOY++++++++++++++++++++++ // solid - G4double LABO_x = 2*m; - G4double LABO_y = 2*m; + G4double LABO_x = 1*m; + G4double LABO_y = 1*m; G4double LABO_z = 2*m; LABO_box = new G4Box("World_box",LABO_x,LABO_y,LABO_z); @@ -321,9 +321,9 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE MCP2 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuMCP2() @@ -404,12 +404,12 @@ void LEMuSRDetectorConstruction::lemuMCP2() // Apply attributes and user limit - // lv_MCPV->SetVisAttributes(Blue_style);//G4VisAttributes::Invisible); + lv_MCPV->SetVisAttributes(G4VisAttributes::Invisible); lv_MCPS->SetVisAttributes(Blue_style); lv_F160->SetVisAttributes(fBlue_style); lv_F100->SetVisAttributes(fBlue_style); lv_F200->SetVisAttributes(fBlue_style); - // lv_GATV->SetVisAttributes(Blue_style);//G4VisAttributes::Invisible); + lv_GATV->SetVisAttributes(G4VisAttributes::Invisible); lv_GATS->SetVisAttributes(Blue_style); @@ -424,9 +424,9 @@ void LEMuSRDetectorConstruction::lemuMCP2() } -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE ANODE -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuANODE() { @@ -494,9 +494,9 @@ void LEMuSRDetectorConstruction::lemuANODE() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE CRYOSTAT -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction:: lemuCRYO() { @@ -599,9 +599,9 @@ void LEMuSRDetectorConstruction:: lemuCRYO() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE MULTIPLE CHANNEL-DETECTOR -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction:: lemuMCPdet() { @@ -656,9 +656,9 @@ void LEMuSRDetectorConstruction:: lemuMCPdet() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE SCINTILLATOR -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuSCINT() { @@ -710,9 +710,9 @@ void LEMuSRDetectorConstruction::lemuSCINT() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE THIRD LENS -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuLinse3() @@ -747,7 +747,7 @@ void LEMuSRDetectorConstruction::lemuLinse3() { G4ElectricField* L3Field = new LEMuSRElectricField(L3FieldVal, - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/ThirdLense/L3b.map" + "/home/l_paraiso/LEMuSR/FieldMaps/ThirdLense/L3b.map" ,"dm",-567,60,60,100); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -761,7 +761,7 @@ void LEMuSRDetectorConstruction::lemuLinse3() // equation considers spin or not G4ChordFinder* pChordFinder = new G4ChordFinder( L3Field, - 1.e-3 * mm, // Minimum step size + 1.e-10 * mm, // Minimum step size: must be very small for a precise calculation of transport energy pStepper); L3FieldMgr->SetDetectorField(L3Field); @@ -847,9 +847,9 @@ void LEMuSRDetectorConstruction::lemuLinse3() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE TRIGGER DETECTOR -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuTrigger_Detector() { @@ -972,9 +972,9 @@ void LEMuSRDetectorConstruction::lemuTrigger_Detector() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE COMPENSATION GATE -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction::lemuCGate() { @@ -1013,9 +1013,9 @@ void LEMuSRDetectorConstruction::lemuCGate() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE THE FIELDS -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// @@ -1031,16 +1031,16 @@ void LEMuSRDetectorConstruction::buildAnodeField() { case 0: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break; case 1: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break; case 2: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break; case 3: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break; default: break; @@ -1163,7 +1163,16 @@ void LEMuSRDetectorConstruction::buildAnodeField() if(magfield==1) { - mcField = new G4UniformMagField(G4ThreeVector(0.,0.,B*gauss)); +#ifdef LEMU_TRANSVERSE_FIELD + mcField = new LEMuSRMagneticField(G4ThreeVector(0.,B*gauss,0.)); + G4cout<<"Transverse Field Applied: (0 G, " <SetDetectorField(EMField,true); EMFieldMgr->SetChordFinder(EMChordFinder); - + EMFieldMgr->SetFieldMagComponent(true); + lv_MCPV = new G4LogicalVolume( MCPV_tube , Vacuum ,"lv_MCPV",EMFieldMgr,0,0); @@ -1219,13 +1228,24 @@ void LEMuSRDetectorConstruction::buildAnodeField() // 3 pure magnetic field if(magfield==1) { + G4UniformMagField* mcField; - - mcField = new LEMuSRMagneticField(G4ThreeVector(0.,0.,B*gauss)); - - G4Mag_SpinEqRhs *Mag_SpinEqRhs; + + +#ifdef LEMU_TRANSVERSE_FIELD + mcField = new LEMuSRMagneticField(G4ThreeVector(0.,B*gauss,0.)); + G4cout<<"Transverse Field Applied: (0 G, " <GetFieldManager(); // 2 mcFieldMgr->SetDetectorField(mcField,true); mcFieldMgr->SetChordFinder(pChordFinder); + mcFieldMgr->SetFieldMagComponent(true); lv_MCPV = new G4LogicalVolume( MCPV_tube , Vacuum ,"lv_MCPV",mcFieldMgr,0,0); } if(magfield==0) @@ -1264,7 +1285,7 @@ void LEMuSRDetectorConstruction::buildCryoField() G4ThreeVector C_field(0.,0.,-V/d); - // char dir[]="/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/"; + // char dir[]="/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/"; char dir[256]; int k=2*Grid+Guards; @@ -1272,16 +1293,16 @@ void LEMuSRDetectorConstruction::buildCryoField() { case 0: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break; case 1: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break; case 2: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break; case 3: - stpcpy(dir,"/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break; + stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break; default: break; } @@ -1327,17 +1348,17 @@ void LEMuSRDetectorConstruction::NEWMAPS() // left LEMuSRElectricField* LEFTMAP = new LEMuSRElectricField(1, - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ex.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ey.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ez.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ex.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ey.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ez.txt", "mm",0.0,80,80,200);//offset in milimeters // right LEMuSRElectricField* RIGHTMAP = new LEMuSRElectricField(1, - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ex.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ey.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ez.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ex.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ey.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ez.txt", "mm",0.0,80,80,200);//offset in milimeters @@ -1346,9 +1367,9 @@ void LEMuSRDetectorConstruction::NEWMAPS() LEMuSRElectricField* SAMPLEMAP = new LEMuSRElectricField(1, - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ex.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ey.txt", - "/home/l_paraiso/geant4.7.0/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ez.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ex.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ey.txt", + "/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ez.txt", "mm",0.0,80,80,200);//offset in milimeters) diff --git a/geant4/LEMuSR/src/LEMuSRDetectorMessenger.cc b/geant4/LEMuSR/src/LEMuSRDetectorMessenger.cc index 0e1ed2f..8ab5415 100644 --- a/geant4/LEMuSR/src/LEMuSRDetectorMessenger.cc +++ b/geant4/LEMuSR/src/LEMuSRDetectorMessenger.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRDetectorMessenger.cc , v 1.2 // AUTHOR: Taofiq PARAISO // DATE : 2004-08-20 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // DETECTOR MESSENGER -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRDetectorMessenger.hh" #include "LEMuSRDetectorConstruction.hh" @@ -84,7 +84,7 @@ LEMuSRDetectorMessenger::LEMuSRDetectorMessenger(LEMuSRDetectorConstruction *lem // SAH MATERIAL - SetSAHmaterial = new G4UIcmdWithAString("/Detector/Sample/Material",this); + SetSAHmaterial = new G4UIcmdWithAString("/Detector/Sample/HolderMaterial",this); SetSAHmaterial->SetGuidance("\n Sample material"); SetSAHmaterial->SetParameterName("material",false); SetSAHmaterial->SetDefaultValue("copper"); diff --git a/geant4/LEMuSR/src/LEMuSREMPhysics.cc b/geant4/LEMuSR/src/LEMuSREMPhysics.cc index d62d763..6112e1d 100644 --- a/geant4/LEMuSR/src/LEMuSREMPhysics.cc +++ b/geant4/LEMuSR/src/LEMuSREMPhysics.cc @@ -1,4 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // +// ID :LEMuSREMPhysics.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// ElectroMagnetic Physics List +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSREMPhysics.hh" diff --git a/geant4/LEMuSR/src/LEMuSRElFieldMix.cc b/geant4/LEMuSR/src/LEMuSRElFieldMix.cc index 3721046..5ff99a7 100644 --- a/geant4/LEMuSR/src/LEMuSRElFieldMix.cc +++ b/geant4/LEMuSR/src/LEMuSRElFieldMix.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID :LEMuSRElFieldMix.cc , v 1.3 // AUTHOR: Taofiq PARAISO // DATE : 2004-09-17 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // Electric Field -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include"LEMuSRElFieldMix.hh" #include"G4UnitsTable.hh" diff --git a/geant4/LEMuSR/src/LEMuSRElMagField.cc b/geant4/LEMuSR/src/LEMuSRElMagField.cc index f679eaa..b7d4095 100644 --- a/geant4/LEMuSR/src/LEMuSRElMagField.cc +++ b/geant4/LEMuSR/src/LEMuSRElMagField.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID :LEMuSRElMagField.cc , v 1.3 // AUTHOR: Taofiq PARAISO // DATE : 2004-09-17 10:20 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -17,8 +17,8 @@ // & // & // & -// Electric Field -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +// ElectroMagnetic Field +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include"LEMuSRElMagField.hh" #include"G4UnitsTable.hh" #include "G4ios.hh" diff --git a/geant4/LEMuSR/src/LEMuSRElMag_SpinEqRhs.cc b/geant4/LEMuSR/src/LEMuSRElMag_SpinEqRhs.cc index 694222a..aeb1c4b 100644 --- a/geant4/LEMuSR/src/LEMuSRElMag_SpinEqRhs.cc +++ b/geant4/LEMuSR/src/LEMuSRElMag_SpinEqRhs.cc @@ -1,23 +1,68 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSRElMag_SpinEqRhs.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// ElectroMagnetic Spin Equation +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRElMag_SpinEqRhs.hh" #include "G4MagneticField.hh" #include "G4ThreeVector.hh" +#include "G4ios.hh" +#include "G4UnitsTable.hh" +#include "globals.hh" LEMuSRElMag_SpinEqRhs::LEMuSRElMag_SpinEqRhs( G4MagneticField* MagField ) - : G4Mag_EqRhs( MagField ) {} + : G4Mag_EqRhs( MagField ) { +} LEMuSRElMag_SpinEqRhs::~LEMuSRElMag_SpinEqRhs() {} -void -LEMuSRElMag_SpinEqRhs::SetChargeMomentumMass(G4double particleCharge, // in e+ units + +void LEMuSRElMag_SpinEqRhs::SetChargeMomentumMass(G4double particleCharge, // in e+ units G4double MomentumXc, G4double mass) { // To set fCof_val G4Mag_EqRhs::SetChargeMomentumMass(particleCharge, MomentumXc, mass); - omegac = 0.105658387*GeV/mass * 2.837374841e-3*(rad/cm/kilogauss); - anomaly = 1.165923e-3*0; + /* theTrackingAction= LEMuSRTrackingAction::GetInstance(); + G4double gratio=theTrackingAction->GyroMagRatio; + G4cout <<"g ratio [MHz]/[T]"<GetTrackingManager()->GetTrack(); + G4double gratio= theTrack->GetDefinition()->GetGyromagneticRatio(); + // G4cout <<"g ratio [MHz]/[T]"<GetPreAssignedDecayProperTime(); @@ -37,7 +66,7 @@ G4VParticleChange* LEMuSRMUONIUMScatt::PostStepDoIt( deltatime = ftime - itime; fParticleChange.ProposeGlobalTime(deltatime + itime -gtime); - // set position momentum energy + /*! - Set position, momentum, energy and time of the particle change. */ fParticleChange.ProposePosition(trackData.GetPosition()); fParticleChange.ProposeMomentumDirection(trackData.GetMomentumDirection()); fParticleChange.ProposeEnergy(trackData.GetKineticEnergy()); @@ -45,24 +74,23 @@ G4VParticleChange* LEMuSRMUONIUMScatt::PostStepDoIt( fParticleChange.ProposeProperTime(itime); fParticleChange.ProposeTrackStatus(trackData.GetTrackStatus()) ; + /*! * - Verify the condition of applying the process.*/ if( CheckCondition(aStep)) { - // fParticleChange.ProposeEnergy(0); - fParticleChange.ProposePosition(trackData.GetStep()->GetPreStepPoint()->GetPosition()); - - // fParticleChange.ProposePolarization(trackData.GetPolarization()); - // G4cout<<" at rest "<< trackData.GetStep()->GetPreStepPoint()->GetPosition() <GetPreStepPoint()->GetPosition()); + fParticleChange.ProposeTrackStatus(fStopButAlive) ; } else - { - // fParticleChange.ProposePolarization(trackData.GetPolarization()); - } + {;} + /*! *- Rotate the spin if there is a magnetic field.*/ polar = RotateSpinIfMag(trackData, aStep); fParticleChange.ProposePolarization(polar); + + // fParticleChange.DumpInfo(); + /*! * - Return the particle change object. */ return &fParticleChange; @@ -72,7 +100,9 @@ G4VParticleChange* LEMuSRMUONIUMScatt::PostStepDoIt( - +/*! + * The muonium will be stopped as soon as it enters a material different as the carbon foil and vacuum. +*/ G4bool LEMuSRMUONIUMScatt::CheckCondition( const G4Step& aStep) { G4bool condition=false; @@ -99,27 +129,11 @@ G4double LEMuSRMUONIUMScatt:: GetMeanFreePath(const G4Track& , } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - +/*! + * Not used. +*/ void LEMuSRMUONIUMScatt::GetDatas( const G4Step* aStep) -{ - - // Particle generation according to yields - particleTable=G4ParticleTable::GetParticleTable(); - particle = particleTable->FindParticle("Mu"); - - // Set the new dynamic particle - DP = new G4DynamicParticle(particle, - aStep->GetTrack()->GetDynamicParticle() - ->GetMomentumDirection(),0.0/*the kinectic energy set to zero*/ - ); - - - DP->SetProperTime(aStep->GetTrack()->GetDynamicParticle()->GetPreAssignedDecayProperTime()); - DP->SetPolarization(aStep->GetTrack()->GetDynamicParticle()->GetPolarization().x(),aStep->GetTrack()->GetDynamicParticle()->GetPolarization().y(),aStep->GetTrack()->GetDynamicParticle()->GetPolarization().z()); - DP->SetPreAssignedDecayProperTime(aStep->GetTrack()->GetDynamicParticle()->GetPreAssignedDecayProperTime()); - - -} +{;} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -132,7 +146,9 @@ void LEMuSRMUONIUMScatt::PrepareSecondary(const G4Track& track) ;} - +/*! + * If a magnetic field is present in the volume the muonium is going through the spin precession is performed. +*/ G4ThreeVector LEMuSRMUONIUMScatt::RotateSpinIfMag( const G4Track& theTrack, const G4Step& aStep) { G4ThreeVector theSpin = theTrack.GetPolarization() ; @@ -145,7 +161,7 @@ G4ThreeVector LEMuSRMUONIUMScatt::RotateSpinIfMag( const G4Track& theTrack, cons // if(!fMgr->DoesFieldChangeEnergy())//then we have a magnetic field - if(fMgr->FieldHasMagComponent())//then we have a magnetic field + if(fMgr->FieldHasMagComponent()==true)//then we have a magnetic field { #ifdef G4SRVERBOSE @@ -153,15 +169,22 @@ G4ThreeVector LEMuSRMUONIUMScatt::RotateSpinIfMag( const G4Track& theTrack, cons #endif // tao :: Get Field - point[0]=theTrack.GetPosition().x(); - point[1]=theTrack.GetPosition().y(); - point[2]=theTrack.GetPosition().z(); + point[0]=theTrack.GetPosition().x()/mm; + point[1]=theTrack.GetPosition().y()/mm; + point[2]=theTrack.GetPosition().z()/mm; const G4Field* mfield; mfield = fMgr->GetDetectorField(); mfield->GetFieldValue(point,B); + +#ifdef G4SRVERBOSE + G4cout <<"IN FLIGHT::: POSITION ="<< point[0]/mm <<" mm, " << point[1]/mm <<" mm, " << point[2]/mm<<" mm" <GyroMagRatio; + //G4cout <<"g ratio [MHz]/[T]"< @@ -7,7 +29,8 @@ LEMuSRMagneticField::LEMuSRMagneticField(const G4ThreeVector FieldVector) :G4UniformMagField(FieldVector ) { BField=FieldVector; - + // G4cout<<"MAGNETIC FIELD DEFINED AS "<-20*cm) { //G4cout<<"true!"; diff --git a/geant4/LEMuSR/src/LEMuSRMaterials.cc b/geant4/LEMuSR/src/LEMuSRMaterials.cc index 4a40b05..8ca8879 100644 --- a/geant4/LEMuSR/src/LEMuSRMaterials.cc +++ b/geant4/LEMuSR/src/LEMuSRMaterials.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRDetectorConstruction.cc , v 1.0 // AUTHOR: Taofiq PARAISO // DATE : 2004-06-24 16:33 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -17,8 +17,8 @@ // & // & // & -// DETECTOR CONSTRUCTION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +// DETECTOR CONSTRUCTION: MATERIALS +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // G4 GEOMETRIC FORMS CLASSES @@ -77,23 +77,23 @@ #include "G4ElectroMagneticField.hh" #include "G4EqMagElectricField.hh" -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // DEFINE COLOR AND USER LIMIT ATTRIBUTES -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction :: LoadAttributes() { // visual attributes - - Blue_style = new G4VisAttributes(G4Colour(0.80,0.83,1.)); + G4VisAttributes InBlack = new G4VisAttributes(G4Colour(0.,0.,0.));// for special projection plot. + Blue_style = new G4VisAttributes(G4Colour(0.80,0.83,1.));// InBlack Blue_style->SetForceSolid(true); //Blue_style->SetForceWireframe(false); - fBlue_style = new G4VisAttributes(G4Colour(0.85,.88,0.92)); + fBlue_style = new G4VisAttributes(G4Colour(0.85,.88,0.92));//InBlack fBlue_style->SetForceSolid(true); @@ -156,9 +156,9 @@ void LEMuSRDetectorConstruction :: LoadAttributes() -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // MATERIALS DEFINITION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// void LEMuSRDetectorConstruction :: MaterialsDefinition () { diff --git a/geant4/LEMuSR/src/LEMuSRMcpHit.cc b/geant4/LEMuSR/src/LEMuSRMcpHit.cc index 14bae77..7d17a27 100644 --- a/geant4/LEMuSR/src/LEMuSRMcpHit.cc +++ b/geant4/LEMuSR/src/LEMuSRMcpHit.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSRMcpHit.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// MCP HITS +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRMcpHit.hh" #include "G4VVisManager.hh" #include "G4Circle.hh" diff --git a/geant4/LEMuSR/src/LEMuSRMcpSD.cc b/geant4/LEMuSR/src/LEMuSRMcpSD.cc index 406766c..df4b3de 100644 --- a/geant4/LEMuSR/src/LEMuSRMcpSD.cc +++ b/geant4/LEMuSR/src/LEMuSRMcpSD.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSRMcpSD.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// MCP SD +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRMcpSD.hh" #include "LEMuSRDetectorConstruction.hh" #include "G4HCofThisEvent.hh" diff --git a/geant4/LEMuSR/src/LEMuSRMuonDecayChannel.cc b/geant4/LEMuSR/src/LEMuSRMuonDecayChannel.cc index d3b71b0..2750050 100644 --- a/geant4/LEMuSR/src/LEMuSRMuonDecayChannel.cc +++ b/geant4/LEMuSR/src/LEMuSRMuonDecayChannel.cc @@ -1,4 +1,4 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION // ID : LEMuSRMuonDecayChannel.cc , v 1.2 // AUTHOR: Taofiq PARAISO based on G4MuonDecayChannel $Id$ @@ -6,7 +6,7 @@ // // add muonium decay, PARAISO 07/04/2005 // -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -20,7 +20,7 @@ // & // & // MUON DECAY CHANNEL.CC -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// diff --git a/geant4/LEMuSR/src/LEMuSRMuonPhysics.cc b/geant4/LEMuSR/src/LEMuSRMuonPhysics.cc index 7baa98c..d1dfc76 100644 --- a/geant4/LEMuSR/src/LEMuSRMuonPhysics.cc +++ b/geant4/LEMuSR/src/LEMuSRMuonPhysics.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID : LEMuSRMuonPhysics.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2006-01-19 16:15 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// MuonPhysics +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ + #include "LEMuSRMuonPhysics.hh" #include "globals.hh" @@ -36,25 +58,33 @@ LEMuSRMuonPhysics::~LEMuSRMuonPhysics() void LEMuSRMuonPhysics::ConstructParticle() { - // Mu + //! Muon G4MuonPlus::MuonPlusDefinition(); G4Muonium::MuoniumDefinition(); G4MuonMinus::MuonMinusDefinition(); G4NeutrinoMu::NeutrinoMuDefinition(); G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); - // Tau + //! Tau G4TauMinus::TauMinusDefinition(); G4TauPlus::TauPlusDefinition(); G4NeutrinoTau::NeutrinoTauDefinition(); G4AntiNeutrinoTau::AntiNeutrinoTauDefinition(); + //! The decay process + /*! + * Although the asymmetric decay process is a feature of new Geant4 versions, + * it is recommended to use the original \lemu implementation. +*/ #ifdef ASYM_USE_LEMU G4DecayTable* MuonPlusDecayTable = new G4DecayTable(); MuonPlusDecayTable -> Insert(new LEMuSRMuonDecayChannel("mu+",1.00)); G4MuonPlus::MuonPlusDefinition() -> SetDecayTable(MuonPlusDecayTable); + /*! + Half of the muonium have a completely isotropic decay. + */ G4DecayTable* MuoniumDecayTable = new G4DecayTable(); MuoniumDecayTable -> Insert(new LEMuSRMuonDecayChannel("Mu",0.5)); MuoniumDecayTable -> Insert(new G4MuonDecayChannel("Mu",0.5)); @@ -92,7 +122,8 @@ void LEMuSRMuonPhysics::ConstructProcess() // Muon Plus Physics pManager = G4MuonPlus::MuonPlus()->GetProcessManager(); - pManager->AddProcess(&fMuAtRestSpinRotation, 1, -1, -1); //(&fprocess, atrest, prestep, poststep) +//! Syntax: pManager->AddProcess(&fprocess, atrest, prestep, poststep). -1 means that the process is not executed under correspondant condition. + pManager->AddProcess(&fMuAtRestSpinRotation, 1, -1, -1); pManager->AddProcess(&fMuFormation,-1, -1, 1); pManager->AddProcess(&fMuPlusMultipleScattering,-1, 1, -1);// may crash when enabled as post step process pManager->AddProcess(&fMuPlusIonisation, -1, 2, 2); @@ -103,13 +134,13 @@ void LEMuSRMuonPhysics::ConstructProcess() // pManager ->SetProcessOrderingToLast(&fDepolarization, idxAtRest); // pManager ->SetProcessOrdering(&fDepolarization, idxPostStep); - // the last process: decay + //! the last process: decay pManager->AddProcess(&fDecayProcess); pManager ->SetProcessOrderingToLast(&fDecayProcess, idxAtRest); pManager ->SetProcessOrdering(&fDecayProcess, idxPostStep); - // Muonium Physics is the same as muon plus physics + //! Muonium Physics is the same as muon plus physics pManager = G4Muonium::Muonium()->GetProcessManager(); pManager->AddProcess(&fMuAtRestSpinRotation, 1, -1, -1); @@ -125,7 +156,7 @@ void LEMuSRMuonPhysics::ConstructProcess() pManager->SetProcessOrderingToLast(&fDecayProcess, idxAtRest); pManager->SetProcessOrdering(&fDecayProcess, idxPostStep); - // Muon Minus Physics + //! Muon Minus Physics pManager = G4MuonMinus::MuonMinus()->GetProcessManager(); pManager->AddProcess(&fMuMinusMultipleScattering,-1, 1, 1); @@ -138,13 +169,13 @@ void LEMuSRMuonPhysics::ConstructProcess() pManager->SetProcessOrderingToLast(&fDecayProcess, idxAtRest); pManager->SetProcessOrdering(&fDecayProcess, idxPostStep); - // Tau Plus Physics + //! Tau Plus Physics pManager = G4TauPlus::TauPlus()->GetProcessManager(); pManager->AddProcess(&fTauPlusMultipleScattering, -1, 1, 1); pManager->AddProcess(&fTauPlusIonisation, -1, 2, 2); - // Tau Minus Physics + //! Tau Minus Physics pManager = G4TauMinus::TauMinus()->GetProcessManager(); pManager->AddProcess(&fTauMinusMultipleScattering, -1, 1, 1); diff --git a/geant4/LEMuSR/src/LEMuSROScintHit.cc b/geant4/LEMuSR/src/LEMuSROScintHit.cc index 9b66ab7..aa6f741 100644 --- a/geant4/LEMuSR/src/LEMuSROScintHit.cc +++ b/geant4/LEMuSR/src/LEMuSROScintHit.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSROScintHit.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// Outer SCINT HITS +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSROScintHit.hh" #include "G4VVisManager.hh" #include "G4Circle.hh" diff --git a/geant4/LEMuSR/src/LEMuSROScintSD.cc b/geant4/LEMuSR/src/LEMuSROScintSD.cc index 7b7e170..c7128c8 100644 --- a/geant4/LEMuSR/src/LEMuSROScintSD.cc +++ b/geant4/LEMuSR/src/LEMuSROScintSD.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID :LEMuSROScintSD.cc , v 1.3 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-09-17 10:20 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// Outer SCINT SD +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSROScintSD.hh" #include "G4HCofThisEvent.hh" #include "G4TouchableHistory.hh" diff --git a/geant4/LEMuSR/src/LEMuSRParticleChangeForSR.cc b/geant4/LEMuSR/src/LEMuSRParticleChangeForSR.cc index 33d5338..8815d75 100644 --- a/geant4/LEMuSR/src/LEMuSRParticleChangeForSR.cc +++ b/geant4/LEMuSR/src/LEMuSRParticleChangeForSR.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRParticleChangeForSR.cc , v 1.2b // AUTHOR: Taofiq PARAISO // DATE : 2004-08-20 10:36 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // PARTICLE CHANGE FOR SPIN ROTATION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRParticleChangeForSR.hh" diff --git a/geant4/LEMuSR/src/LEMuSRParticleGun.cc b/geant4/LEMuSR/src/LEMuSRParticleGun.cc index ac6e139..7fbb2b8 100644 --- a/geant4/LEMuSR/src/LEMuSRParticleGun.cc +++ b/geant4/LEMuSR/src/LEMuSRParticleGun.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRParticleGun.cc , v 1.2 // AUTHOR: Taofiq PARAISO // DATE : 2004-08-20 10:48 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // PARTICLE GUN -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRParticleGun.hh" #include "Randomize.hh" @@ -30,6 +30,8 @@ #include "G4ProcessVector.hh" + + LEMuSRParticleGun::LEMuSRParticleGun() { SetInitialValues(); @@ -60,12 +62,20 @@ void LEMuSRParticleGun::GeneratePrimaryVertex(G4Event* evt) { if(particle_definition==0) return; - // create a new vertex + //! \b 1. Creates a new vertex. + /*! + * The initial vertex of the particle is defined with a position-time + * and receives the information of the particle to simulate. + */ G4PrimaryVertex* vertex = new G4PrimaryVertex(particle_position,particle_time); - // create new primaries and set them to the vertex + //! \b 2. Creates new primary particle. + /*! + * The primary particle is used in the initial vertex to + * produce the dynamic particles which will actually be tracked. + */ G4double mass = particle_definition->GetPDGMass(); G4double energy = particle_energy + mass; G4double pmom = sqrt(energy*energy-mass*mass); @@ -78,18 +88,19 @@ void LEMuSRParticleGun::GeneratePrimaryVertex(G4Event* evt) G4PrimaryParticle* particle = new G4PrimaryParticle(particle_definition,px,py,pz); particle->SetMass( mass ); - // particle->SetCharge( particle_charge ); - // G4cout<<"Charge (from gun) = " << particle->GetCharge() <<" \n" <SetPolarization(particle_polarization.x(), particle_polarization.y(), particle_polarization.z()); particle->SetProperTime(decaytime); // G4cout<<"Muon decay time = " << decaytime/ns <<"ns. \n" <SetPrimary( particle ); } + //! \b 4. Sets the vertex to the event. evt->AddPrimaryVertex( vertex ); } diff --git a/geant4/LEMuSR/src/LEMuSRParticleGunMessenger.cc b/geant4/LEMuSR/src/LEMuSRParticleGunMessenger.cc index 762af1d..b2776a3 100644 --- a/geant4/LEMuSR/src/LEMuSRParticleGunMessenger.cc +++ b/geant4/LEMuSR/src/LEMuSRParticleGunMessenger.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID : LEMuSRParticleGunMessenger.cc , v 1.2 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-08-20 10:48 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// PARTICLE GUN MESSENGER +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRParticleGunMessenger.hh" #include "LEMuSRParticleGun.hh" #include "G4Geantino.hh" diff --git a/geant4/LEMuSR/src/LEMuSRPgaMessenger.cc b/geant4/LEMuSR/src/LEMuSRPgaMessenger.cc index d5575b5..20c3bb4 100644 --- a/geant4/LEMuSR/src/LEMuSRPgaMessenger.cc +++ b/geant4/LEMuSR/src/LEMuSRPgaMessenger.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRPgaMessenger.cc , v 1.1 // AUTHOR: Taofiq PARAISO // DATE : 2004-06-30 09:12 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // PRIMARY GENERATOR ACTION MEESENGER -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRPgaMessenger.hh" @@ -36,6 +36,12 @@ #include "G4ios.hh" #include "G4UnitsTable.hh" #include "G4ParticleTable.hh" + +/*! + * The commands are instanciated and a new pointer is created for each of them. + * A directory and name for the commands is also defined, as well as some guidance to the user about how to use the command. + * Finally if possible some default values are defined. +*/ LEMuSRPgaMessenger::LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction *thePGA) :lemuPGA(thePGA) { @@ -97,7 +103,7 @@ LEMuSRPgaMessenger::LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction *thePGA) setMuonium = new G4UIcmdWithAString("/lemuGun/particle",this); setMuonium->SetGuidance("Particles to be shot"); - setMuonium->SetParameterName("Particle types: mu+/Mu",true); + setMuonium->SetParameterName("Particle types: mu+/Mu or other.",true); setMuonium->SetDefaultValue("mu+"); @@ -108,7 +114,9 @@ LEMuSRPgaMessenger::LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction *thePGA) } - +/*! +* Kills the implemented pointers. +*/ LEMuSRPgaMessenger::~LEMuSRPgaMessenger() { delete posCmd; @@ -126,6 +134,13 @@ LEMuSRPgaMessenger::~LEMuSRPgaMessenger() } +/*! + * This method registers all the operation to take when a command is + * entered in the terminal. Typically, the command is read and according to its name, is identified to a command defined in the constructor. + * Then the user value is read by the GetNewValue type methods. It can be a string, a double, a vector etc. + * + * What to do with this new value(s) is then implemented. +*/ void LEMuSRPgaMessenger::SetNewValue(G4UIcommand * command,G4String newValues) { diff --git a/geant4/LEMuSR/src/LEMuSRPhysicsList.cc b/geant4/LEMuSR/src/LEMuSRPhysicsList.cc index fe48d95..361b712 100644 --- a/geant4/LEMuSR/src/LEMuSRPhysicsList.cc +++ b/geant4/LEMuSR/src/LEMuSRPhysicsList.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRPhysicsList.cc , v 1.1 // AUTHOR: Taofiq PARAISO // DATE : 2004-08-24 16:33 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // PHYSICS LIST -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRPhysicsList.hh" @@ -43,31 +43,21 @@ LEMuSRPhysicsList::LEMuSRPhysicsList(): G4VModularPhysicsList() { - // default cut value (1.0mm) - defaultCutValue = 10.0*cm; - // SetVerboseLevel(1); - // SetCuts(); - SetCutsWithDefault(); - - SetCutValue(1*mm, "e+"); - SetCutValue(1*mm, "proton"); + SetCuts(); - // SetCutValue(0.001*mm, "mu+"); - // SetCutValue(0.001*mm, "Mu"); - - // General Physics + //! Register General Processes RegisterPhysics( new LEMuSRGeneralPhysics("general") ); - // EM Physics + //! Register Electro-Magnetic Prcesses RegisterPhysics( new LEMuSREMPhysics("standard EM")); - // Muon Physics + //! Register Muon Processes RegisterPhysics( new LEMuSRMuonPhysics("muon")); - // Hadron Physics + //! Register Hadron Processes RegisterPhysics( new LEMuSRHadronPhysics("hadron")); - // Ion Physics + //! Register Ion Processes RegisterPhysics( new LEMuSRIonPhysics("ion")); @@ -77,15 +67,25 @@ LEMuSRPhysicsList::~LEMuSRPhysicsList() { } + /*! + * " G4VUserPhysicsList::SetCutsWithDefault" method sets + * the default cut value for all particle types . + * The cut value is given in distance, and is then converted + * in energy according the particle's stopping range in different + * materials. + */ void LEMuSRPhysicsList::SetCuts() { - // " G4VUserPhysicsList::SetCutsWithDefault" method sets - // the default cut value for all particle types - SetCutsWithDefault(); + defaultCutValue = 1.0*cm; + SetCutsWithDefault(); SetCutValue(1.*mm, "e+"); SetCutValue(1.*mm, "e-"); - + SetCutValue(1*mm, "proton"); + + // SetCutValue(0.001*mm, "mu+"); + // SetCutValue(0.001*mm, "Mu"); + } diff --git a/geant4/LEMuSR/src/LEMuSRPrimaryGeneratorAction.cc b/geant4/LEMuSR/src/LEMuSRPrimaryGeneratorAction.cc index 489b9ef..66a6c7c 100644 --- a/geant4/LEMuSR/src/LEMuSRPrimaryGeneratorAction.cc +++ b/geant4/LEMuSR/src/LEMuSRPrimaryGeneratorAction.cc @@ -1,10 +1,10 @@ -///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION // // ID : LEMuSRPrimaryGeneratorAction.cc , v 1.3 // AUTHOR: Taofiq PARAISO // DATE : 2004-09-16 09:12 -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // PRIMARY GENERATOR ACTION -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// @@ -48,7 +48,12 @@ #include "G4Muonium.hh" - +/*! + * In the constructor the PGA messenger is initialized + * the particle gun is created and the default + * values are given to the variables for the particle definition + * or the scanning parameters + */ LEMuSRPrimaryGeneratorAction::LEMuSRPrimaryGeneratorAction() { @@ -104,6 +109,10 @@ LEMuSRPrimaryGeneratorAction::LEMuSRPrimaryGeneratorAction() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OO +/*! + * The particle gun and the messenger pointers are deleted inthe destructor. + */ + LEMuSRPrimaryGeneratorAction::~LEMuSRPrimaryGeneratorAction() { delete lemuParticleGun; @@ -125,6 +134,15 @@ LEMuSRPrimaryGeneratorAction::~LEMuSRPrimaryGeneratorAction() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OO +/*! + * This method defines all the parameters for the particle gun and + * calls the GeneratePrimaryVertex from the LEMuSRParticleGun class. + * An important submethod is the GetScanningMode. which is called to + * get different distribution of the initial gun position. + * + * The decay time is preliminary assigned for muons and muonium particles. +*/ + void LEMuSRPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { @@ -163,13 +181,6 @@ void LEMuSRPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) // std::cout<<"Particle "<< particle->GetParticleName(); - - lemuParticleGun->SetParticleDefinition(particle); - - lemuParticleGun->SetParticleEnergy(energy+ke_offset); - - - if(particle->GetParticleSubType()=="mu") { // the random time of the decay for muons @@ -182,8 +193,14 @@ void LEMuSRPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) } - GetScanningMode(scan); - // G4cout<<"Zposition "<SetParticleDefinition(particle); + + lemuParticleGun->SetParticleEnergy(energy+ke_offset); + + + GetScanningMode(scan); + + // G4cout<<"Zposition "<>>>>>>>>>>>>>>>>>> lemuParticleGun->SetParticleMomentumDirection(G4ThreeVector(momX,momY,momZ)); @@ -205,7 +222,20 @@ void LEMuSRPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) - +/*! + * The different scanning modes are distributions of the initial position of the gun. + * Few of them were implemented and one can modify them as he likes. + * The user can switch the scanning mode before each run via the user interface + * terminal thanks to the commands implemented in LEMuSRPGAMessenger. + * + * So far, one can choose between the following distributions: + * - Single position of the gun + * - Square sweeping: the gun position will be uniformely distributed in a square. The dimensions and steps along x and y directions are defined by the user. + * - Circular scan: the radius is scaned linearly and for all radius a circle is described according to the specified steps number. This distribution is not homogeneous. + * - Gaussian scan: x and y are randomly determined according to a gaussian distribution. The mean value and the standard deviation are user parameters. + *. + * The following picture shows different beam profiles generated by modifying the parameters of the gaussian circular scan. The maximal radius is limited to 2.5cm around the mean value. + */ void LEMuSRPrimaryGeneratorAction::GetScanningMode(G4int scan) { @@ -285,7 +315,7 @@ void LEMuSRPrimaryGeneratorAction::GetScanningMode(G4int scan) } - //----------------------CIRCULAR SCAN Gauss >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + //---------------------- GAUSSIAN SCAN >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if(scan==3) @@ -299,7 +329,7 @@ void LEMuSRPrimaryGeneratorAction::GetScanningMode(G4int scan) X = iRndGauss->shoot(sc_mean, sc_stddev)*cm; Y = iRndGauss->shoot(sc_mean, sc_stddev)*cm; - radius= sqrt(X*X+Y*Y); + radius= sqrt((X-sc_mean)*(X-sc_mean)+(Y-sc_mean)*(Y-sc_mean)); }while(radius>2.5*cm); // SET POSITION lemuParticleGun->SetParticlePosition(G4ThreeVector(X,Y,-114*cm)); @@ -324,31 +354,3 @@ LEMuSRPrimaryGeneratorAction* LEMuSRPrimaryGeneratorAction::GetPGA() - - - -//---------------------------------------------------------------- -//---------------------------------------------------------------- -//---------------------------------------------------------------- -//---------------------------------------------------------------- - - - /* - G4double k=G4UniformRand(); - if(k>0.5) - { - G4double gamma; - gamma = 0.5*((1.*eplus)/(0.1056584*GeV/(c_light*c_light))+(1.*eplus)/(0.51099906*MeV/(c_light*c_light))); - G4cout<< "PGA "<< k<< " " <SetGammaFactor(gamma); - } - else if(k<0.5) - { - G4double gamma; - gamma = 0.5*((1.*eplus)/(0.1056584*GeV/(c_light*c_light))-(1.*eplus)/(0.51099906*MeV/(c_light*c_light))); - G4cout<< "PGA "<< k<< " " <SetGammaFactor(gamma); - } - */ diff --git a/geant4/LEMuSR/src/LEMuSRRNDMAGField.cc b/geant4/LEMuSR/src/LEMuSRRNDMAGField.cc index d251a02..9169135 100644 --- a/geant4/LEMuSR/src/LEMuSRRNDMAGField.cc +++ b/geant4/LEMuSR/src/LEMuSRRNDMAGField.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION +// +// ID : LEMuSRRNDMAGField.cc , v 1.2 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-08-20 10:48 +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// RND MAG FIELD +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRRNDMAGField.hh" #include "G4ios.hh" #include diff --git a/geant4/LEMuSR/src/LEMuSRRunAction.cc b/geant4/LEMuSR/src/LEMuSRRunAction.cc index 97ab3e6..5c6a7c5 100644 --- a/geant4/LEMuSR/src/LEMuSRRunAction.cc +++ b/geant4/LEMuSR/src/LEMuSRRunAction.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION // ID : LEMuSRRunAction.cc , v 1.0 // AUTHOR: Taofiq PARAISO // DATE : 2004-07-12 16:15 // -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // RUN ACTION.CC -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// #include "LEMuSRRunAction.hh" @@ -52,7 +52,7 @@ LEMuSRRunAction::~LEMuSRRunAction() {} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - +/*! Initializes the user interface manager.*/ void LEMuSRRunAction::BeginOfRunAction(const G4Run* aRun) { G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; @@ -68,7 +68,7 @@ void LEMuSRRunAction::BeginOfRunAction(const G4Run* aRun) } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - +/*! Updates the user interface manager.*/ void LEMuSRRunAction::EndOfRunAction(const G4Run*) { if (G4VVisManager::GetConcreteInstance()) diff --git a/geant4/LEMuSR/src/LEMuSRScintHit.cc b/geant4/LEMuSR/src/LEMuSRScintHit.cc index c37f3dd..2361228 100644 --- a/geant4/LEMuSR/src/LEMuSRScintHit.cc +++ b/geant4/LEMuSR/src/LEMuSRScintHit.cc @@ -1,3 +1,25 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : LEMuSRScintHit.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-07-12 16:15 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// INNER SCINT HIT +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "LEMuSRScintHit.hh" #include "G4VVisManager.hh" #include "G4Circle.hh" diff --git a/geant4/LEMuSR/src/LEMuSRScintSD.cc b/geant4/LEMuSR/src/LEMuSRScintSD.cc index 7fd0d89..f42994e 100644 --- a/geant4/LEMuSR/src/LEMuSRScintSD.cc +++ b/geant4/LEMuSR/src/LEMuSRScintSD.cc @@ -1,3 +1,26 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : LEMuSRScintSD.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-07-12 16:15 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// INNER SCINT SD +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + + #include "LEMuSRScintSD.hh" #include "G4HCofThisEvent.hh" #include "G4TouchableHistory.hh" diff --git a/geant4/LEMuSR/src/LEMuSRStackingAction.cc b/geant4/LEMuSR/src/LEMuSRStackingAction.cc index 6ccf69a..f56e314 100644 --- a/geant4/LEMuSR/src/LEMuSRStackingAction.cc +++ b/geant4/LEMuSR/src/LEMuSRStackingAction.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION // ID : LEMuSRStackingAction.cc , v 1.0 // AUTHOR: Taofiq PARAISO // DATE : 2004-07-07 11:15 // -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,13 +18,7 @@ // & // & // STACKING ACTION.CC -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// - - - - - - +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// diff --git a/geant4/LEMuSR/src/LEMuSRStackingActionMessenger.cc b/geant4/LEMuSR/src/LEMuSRStackingActionMessenger.cc index 87fc68e..eb7916e 100644 --- a/geant4/LEMuSR/src/LEMuSRStackingActionMessenger.cc +++ b/geant4/LEMuSR/src/LEMuSRStackingActionMessenger.cc @@ -1,3 +1,27 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : LEMuSRStackingActionMessenger.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-07-07 11:15 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// STACKING ACTION MESSENGER +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + + + #include "LEMuSRStackingActionMessenger.hh" #include "LEMuSRStackingAction.hh" #include "G4UIcmdWithAnInteger.hh" diff --git a/geant4/LEMuSR/src/LEMuSRSteppingAction.cc b/geant4/LEMuSR/src/LEMuSRSteppingAction.cc index 5bb0873..e7054d1 100644 --- a/geant4/LEMuSR/src/LEMuSRSteppingAction.cc +++ b/geant4/LEMuSR/src/LEMuSRSteppingAction.cc @@ -1,10 +1,10 @@ -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//* +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* // LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION // ID : LEMuSRSteppingAction.cc , v 1.0 // AUTHOR: Taofiq PARAISO // DATE : 2004-07-07 11:15 // -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// // // & &&&&&&&&&& &&&&&&& &&&&&&&& // & & && && & && @@ -18,7 +18,7 @@ // & // & // STEPPING ACTION.CC -//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// @@ -35,14 +35,15 @@ #include "G4VisAttributes.hh" #include "G4Colour.hh" - + +//! \ct LEMuSRSteppingAction::LEMuSRSteppingAction() { pointer=this ; loop=0; } - +//! \dt LEMuSRSteppingAction::~LEMuSRSteppingAction() { ; @@ -55,7 +56,12 @@ LEMuSRSteppingAction* LEMuSRSteppingAction::GetInstance() } - +//! \mm +/*! + * The main role of the stepping action in \lemu simulation is to kill particles that are looping in electromagnetic fields. + * + * Is also illustrated here the possiblity of personalizing the color of the trajectories for visualisation. + */ void LEMuSRSteppingAction::UserSteppingAction(const G4Step* aStep) { @@ -84,6 +90,17 @@ void LEMuSRSteppingAction::UserSteppingAction(const G4Step* aStep) } +//! Method to kill the looping partiles +/*! + * A looping particle can increase the CPU time, and in the worst case even paralize the simulation. To kill the loops, we just limit the steps number of one track to 2500. The loop killer method check the step number and kills the particle when it gets too big. Note that a usual track does not contain more that few hundred steps and experience showed that above 1000 steps, the particles were actually trapped in a loop and rarely recovered a normal trajectory. + * + * In order to verify that this method is not abusive, the word "killed" is printed to the screen each time a particle is killed. Usually, this is the case of few particles over hundred thousands. + * + * The neutrinos, gammas and electrons tracks are killed directly because they have no influence on the simulation but increasing the calculation time. + * In particular, electrons are important sources of looping tracks in electromagntic field. + * + * Of course, one can select the particles to kill or not. + */ void LEMuSRSteppingAction::LoopKiller(const G4Step *aStep) { diff --git a/geant4/LEMuSR/src/LEMuSRTrackingAction.cc b/geant4/LEMuSR/src/LEMuSRTrackingAction.cc index 4972c1d..2540af7 100644 --- a/geant4/LEMuSR/src/LEMuSRTrackingAction.cc +++ b/geant4/LEMuSR/src/LEMuSRTrackingAction.cc @@ -1,29 +1,68 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : LEMuSRTrackingAction.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2004-07-07 11:15 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// TRACKING ACTION.CC +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include"LEMuSRTrackingAction.hh" #include"G4VProcess.hh" #include"G4PrimaryParticle.hh" #include"G4UnitsTable.hh" #include"LEMuSRMuonDecayChannel.hh" - +//! \ct LEMuSRTrackingAction ::LEMuSRTrackingAction() { + pointer=this ; + tMgr=new G4TrackingManager(); +} - -;} +LEMuSRTrackingAction* LEMuSRTrackingAction::pointer=0; + +//! Returns pointer to the tracking action. +LEMuSRTrackingAction* LEMuSRTrackingAction::GetInstance() +{ + return pointer; +} + + +//! \dt LEMuSRTrackingAction:: ~LEMuSRTrackingAction() { - + delete tMgr; } - +//! Actions to take at the beginning of a track. void LEMuSRTrackingAction::PreUserTrackingAction(const G4Track* theTrack) { - - -} + // G4cout << theTrack->GetDefinition()->GetParticleName()<GetDefinition()->GetPDGMass()!=0) + { + GyroMagRatio=theTrack->GetDefinition()->GetGyromagneticRatio(); + GyroMagFactor=theTrack->GetDefinition()->GetGyromagneticFactor(); + } + // G4cout <<"g ratio [Hz]/[G]"<angle/rad;//momentum_direction.x(); - muon.momdiry= LEMuSRPrimaryGeneratorAction::GetPGA()->radius/cm; //momentum_direction.y(); + muon.momdiry= LEMuSRPrimaryGeneratorAction::GetPGA()->radius/cm; //momentum_direction.y(); muon.momdirz= momentum_direction.z(); muon.tenergy = kenergy/keV; diff --git a/geant4/LEMuSR/src/meyer.cc b/geant4/LEMuSR/src/meyer.cc index bf29433..1d3a0d8 100644 --- a/geant4/LEMuSR/src/meyer.cc +++ b/geant4/LEMuSR/src/meyer.cc @@ -1,3 +1,23 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : MEYER.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2005-04 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// MEYER /* fIRST IMPLEMENTATION BY ANLSEM,H. IN FORTRAN C++ CONVERSION T.K.PARAISO 04-2005 @@ -14,6 +34,8 @@ http://gershwin.ens.fr/vdaniel/Doc-Locale/Langages-Program-Scientific/Fortran/Tutorial/arrays.htm */ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + #include "meyer.h" #include diff --git a/geant4/LEMuSR/src/yields.cc b/geant4/LEMuSR/src/yields.cc index cfca5a3..6aca634 100644 --- a/geant4/LEMuSR/src/yields.cc +++ b/geant4/LEMuSR/src/yields.cc @@ -1,3 +1,30 @@ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//* +// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION +// ID : YIELDS.cc , v 1.0 +// AUTHOR: Taofiq PARAISO +// DATE : 2005-04 +// +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// +// +// & &&&&&&&&&& &&&&&&& &&&&&&&& +// & & && && & && +// & & & & & & && +// & &&&&&&& & & &&&&&& &&&&&&&& +// & & & && & & && +// & & && & & && && & & +// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & && +// & +// & +// & +// & +// YIELDS +/* + fIRST IMPLEMENTATION BY ANLSEM,H. IN FORTRAN + C++ CONVERSION T.K.PARAISO 04-2005 +*/ +//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// + + #include "yields.h" #include #include