Added to repository

This commit is contained in:
paraiso
2005-11-11 12:35:21 +00:00
parent bad53d7f6c
commit 277293fc40
201 changed files with 47334 additions and 0 deletions

View File

@ -0,0 +1,139 @@
#ifndef AsymCheck_h
#define AsymCheck_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include <fstream.h>
#include "LEMuSRVisManager.hh"
#include "LEMuSRDetectorConstruction.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
class AsymCheck : public G4UserSteppingAction
{
public:
static AsymCheck* GetInstance();
AsymCheck() ;
~AsymCheck() ;
void UserSteppingAction(const G4Step *theStep);
void SetParticleVolumeNames(const G4Step *theStep);
void SetPositionMomentum(const G4Step *theStep);
void SetTimeEnergy(const G4Step *theStep);
void SetAngles(const G4Step* aStep);
void PrintDatas(const G4Step *theStep);
void SetField(const G4Step *theStep);
void SetSpinDirection(const G4Step* aStep);
void SetPositronAngles(const G4Step *theStep);
G4bool CheckCondition(const G4Step* aStep);
G4String p_name, v_name, pv_name;
G4ThreeVector position,momentum,momentum_direction, polarization, m, parpol, p;
G4double kenergy, tenergy, localtime, globaltime, proptime;
G4double theta,sintheta, costheta, phi, sinphi, cosphi;
typedef struct {
Float_t kenergy, tenergy, localtime, globaltime, proptime;
Float_t theta,phi;
Float_t positionx, positiony,positionz,momdirx,momdiry,momdirz;
Int_t ID;
} LEMuSRparticle ;
typedef struct {
Float_t asym,L,R,S;
} Asym ;
typedef struct {
Float_t omegat,time;
} Spin ;
LEMuSRparticle positron;
Asym asym;
Spin spin;
void Update();
void BookRoot();
void FillRoot();
void WriteRoot();
void PrintAsym();
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b,*b2;
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
TTree *tree;
TFile* F;
TTree *dt;
Float_t time;
G4double L,R,A;
G4double BR1, BR2, dm1,dm2;// decay modes and branching ratios
private:
static AsymCheck* pointer;
};
#endif

View File

@ -0,0 +1,138 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : FieldCheck.hh , v 1.2
// AUTHOR: Taofiq PARAISO
// DATE : 2004-09-17 10:20
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// FIELDCHECK
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef FieldCheck_h
#define FieldCheck_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include <fstream.h>
#include "LEMuSRVisManager.hh"
#include "LEMuSRDetectorConstruction.hh"
#include "G4RunManager.hh"
#include "G4EventManager.hh"
#include "G4Run.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
class FieldCheck : public G4UserSteppingAction
{
public:
static FieldCheck* GetInstance();
FieldCheck() ;
~FieldCheck() ;
void UserSteppingAction(const G4Step *theStep);
void SetParticleVolumeNames(const G4Step *theStep);
void SetPositionMomentum(const G4Step *theStep);
void SetTimeEnergy(const G4Step *theStep);
void SetAngles(const G4Step* aStep);
void PrintDatas(const G4Step *theStep);
void SetField(const G4Step *theStep);
void SetSpinDirection(const G4Step* aStep);
void SetPositronAngles(const G4Step *theStep);
G4bool CheckCondition(const G4Step* aStep);
G4String p_name, v_name, pv_name;
G4ThreeVector position,momentum,momentum_direction, polarization, m, parpol, p;
G4double kenergy, tenergy, localtime, globaltime, proptime, fx, fy, fz, bx,by,bz;
G4double theta,sintheta, costheta, phi, sinphi, cosphi,charge;
G4int loop, evt;
typedef struct {
Float_t tenergy, localtime, globaltime, proptime;
Float_t positionx, positiony,positionz,momdirx,momdiry,momdirz;
Float_t Bx,By,Bz,Ex,Ey,Ez, charge;
Int_t index, event, id;
} LEMuSRparticle ;
LEMuSRparticle muon;
void Update();
void BookRoot();
void FillRoot();
void WriteRoot();
void PrintField(const G4Step *theStep);
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b,*b2;
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
TTree *tree;
TFile* F;
TTree *dt;
Float_t time;
G4double L,R,A;
private:
static FieldCheck* pointer;
};
#endif

View File

@ -0,0 +1,132 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : FocalLengthTest.hh , v 1.2
// AUTHOR: Taofiq PARAISO
// DATE : 2005-03-02 09:37
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// FocalLengthTest
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef FocalLengthTest_h
#define FocalLengthTest_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include <fstream.h>
#include "LEMuSRVisManager.hh"
#include "LEMuSRDetectorConstruction.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
class FocalLengthTest : public G4UserSteppingAction
{
public:
static FocalLengthTest* GetInstance();
FocalLengthTest() ;
~FocalLengthTest() ;
void UserSteppingAction(const G4Step *theStep);
void SetParticleVolumeNames(const G4Step *theStep);
void SetPositionMomentum(const G4Step *theStep);
void SetTimeEnergy(const G4Step *theStep);
void SetAngles(const G4Step* aStep);
void PrintDatas(const G4Step *theStep);
void SetField(const G4Step *theStep);
void SetSpinDirection(const G4Step* aStep);
void SetPositronAngles(const G4Step *theStep);
void LoopKiller(const G4Step*aStep);
G4int loop;
G4bool CheckCondition(const G4Step* aStep);
G4String p_name, v_name, pv_name;
G4ThreeVector position,momentum,momentum_direction, polarization, m, parpol, p;
G4double kenergy, tenergy, localtime, globaltime, proptime, fx, fy, fz, init_kenergy;
G4double theta,sintheta, costheta, phi, sinphi, cosphi;
typedef struct {
Float_t kenergy;
Float_t focal, ratio;
Float_t positionx, positiony,positionz,momdirx,momdiry,momdirz;
Int_t index, event;
} LEMuSRparticle ;
LEMuSRparticle muon;
void Update();
void BookRoot();
void FillRoot();
void WriteRoot();
void PrintField(const G4Step *theStep);
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b,*b2;
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
TTree *tree;
TFile* F;
TTree *dt;
Float_t time;
G4double L,R,A;
private:
static FocalLengthTest* pointer;
};
#endif

View File

@ -0,0 +1,57 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History:
// 17 August 2004 P. Gumplinger
// ------------------------------------------------------------
//
#ifndef G4AtRestSpinPrecession_hh
#define G4AtRestSpinPrecession_hh 1
#include "G4VRestProcess.hh"
#include "G4ParticleChangeForAtRestSP.hh"
class G4AtRestSpinPrecession : public G4VRestProcess
{
public:
G4AtRestSpinPrecession();
~G4AtRestSpinPrecession();
G4bool IsApplicable(const G4ParticleDefinition&);
G4VParticleChange* AtRestDoIt(const G4Track& aTrack,const G4Step& aStep);
virtual G4double GetMeanLifeTime(const G4Track&,
G4ForceCondition*);
private:
G4ParticleChangeForAtRestSP fParticleChange;
G4ThreeVector NewSpin(const G4Step& aStep,
G4ThreeVector B, G4double deltatime );
};
#endif

View File

@ -0,0 +1,69 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History:
// 17 August 2004 P. Gumplinger
// ------------------------------------------------------------
//
#ifndef G4DecayWithSpin_h
#define G4DecayWithSpin_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VRestDiscreteProcess.hh"
#include "G4ParticleChangeForDecay.hh"
#include "G4Decay.hh"
class G4VExtDecayer;
class G4DecayWithSpin : public G4Decay
{
public:
// Constructors
G4DecayWithSpin(const G4String& processName ="DecayWithSpin");
// Destructor
virtual ~G4DecayWithSpin();
protected: // With Description
virtual G4VParticleChange* DecayIt(
const G4Track& aTrack,
const G4Step& aStep
);
// The DecayIt() method returns by pointer a particle-change object,
// which has information of daughter particles.
// private:
public:
G4ThreeVector Spin_Precession(const G4Step& aStep,
G4ThreeVector B, G4double deltatime );
};
#endif

View File

@ -0,0 +1,45 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History:
// 17 August 2004 P. Gumplinger
// ------------------------------------------------------------
//
#ifndef G4ParticleChangeForAtRestSP_hh
#define G4ParticleChangeForAtRestSP_hh 1
#include "G4ParticleChange.hh"
class G4ParticleChangeForAtRestSP : public G4ParticleChange
{
public:
G4ParticleChangeForAtRestSP();
virtual ~G4ParticleChangeForAtRestSP();
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
};
#endif

View File

@ -0,0 +1,55 @@
#ifndef LEMUSRATRESTSPINROTATION_H
#define LEMUSRATRESTSPINROTATION_H 1
#include "G4VRestProcess.hh"
#include "G4DynamicParticle.hh"
#include "G4MagneticField.hh"
#include "G4ParticleTypes.hh"
#include "globals.hh"
#include "G4VParticleChange.hh"
#include "G4ios.hh"
#include "G4ForceCondition.hh"
#include "G4ParticleChangeForTransport.hh"
#include "LEMuSRParticleChangeForSR.hh"
class LEMuSRAtRestSpinRotation : public G4VRestProcess
{
public:
LEMuSRAtRestSpinRotation(const G4String& processName = "SpinRotationAtRest" );
LEMuSRAtRestSpinRotation(G4VRestProcess& );
virtual ~LEMuSRAtRestSpinRotation();
static LEMuSRAtRestSpinRotation* GetInstance();
private:
static LEMuSRAtRestSpinRotation* pointer;
public:
G4VParticleChange* AtRestDoIt(const G4Track& theTrack, const G4Step& theStep);
// G4Track
void RotateSpin(const G4Step&, G4ThreeVector, G4double);
G4double point[4];
G4double B[3], rotation_angle;
G4double itime, ftime, deltatime;
G4ThreeVector SpinDirection;
G4ParticleChange thePParticleChange;
G4VParticleChange theVParticleChange;
G4ParticleChangeForTransport theTParticleChange;
LEMuSRParticleChangeForSR theParticleChange;
const G4Field *mfield;
inline G4double GetMeanLifeTime(const G4Track&, G4ForceCondition* condition)
{
*condition = Forced;
return DBL_MAX;
}
G4ThreeVector polar;
};
#endif

View File

@ -0,0 +1,32 @@
#include "G4ElectricField.hh"
#include"G4ThreeVector.hh"
#include"G4ios.hh"
class LEMuSRCryoField : public G4ElectricField
{
public:
LEMuSRCryoField(G4ThreeVector FieldVector);
LEMuSRCryoField(G4ThreeVector FieldVector,G4double radius,G4double zmin, G4double zmax,G4double mcpv_z);
~LEMuSRCryoField();
G4bool DoesFieldChangeEnergy() const { return true; }
// Since an electric field can change track energy
void GetFieldValue(const G4double pos[4], G4double *field) const;
G4bool uniform;
G4double R;
private:
G4double flength, fpotential, fradius, fzmin, fzmax;
G4ThreeVector position;
G4ThreeVector EField;
};

View File

@ -0,0 +1,86 @@
#ifndef LEMuSRCryoHit_h
#define LEMuSRCryoHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class LEMuSRCryoHit : public G4VHit
{
public:
// contructor and destructor
LEMuSRCryoHit();
~LEMuSRCryoHit();
void Draw();
void Print();
void print(G4String name);
// operator for hit collector definition
LEMuSRCryoHit(const LEMuSRCryoHit &right);
const LEMuSRCryoHit& operator=(const LEMuSRCryoHit &right);
G4int operator==(const LEMuSRCryoHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
// private variables
private:
G4double energy_deposition, time_of_flight, spin;
G4ThreeVector position, momentum;
G4LogicalVolume* lv_Volume;
G4VPhysicalVolume* pv_Volume;
G4String particle_name;
// inline functions
public:
inline void SetEnergyDeposition(G4double ed){energy_deposition = ed;}
inline void AddEnergyDeposition(G4double ed){energy_deposition += ed;}
inline G4double GetEnergyDeposition(){return energy_deposition;}
inline void SetTimeOfFlight(G4double tf){ time_of_flight=tf;}
inline void AddTimeOfFlight(G4double tf){ time_of_flight+=tf;}
inline G4double GetTimeOfFlight(){return time_of_flight;}
inline void SetSpin(G4double sp){ spin=sp;}
inline G4double GetSpin(){return spin;}
inline void SetPosition(G4ThreeVector pos){position =pos;}
inline G4ThreeVector GetPosition(){return position;}
inline void SetMomentum(G4ThreeVector mom){momentum =mom;}
inline G4ThreeVector GetMomentum(){return momentum;}
inline void SetParticleName(G4String name){particle_name=name;}
inline G4String GetParticleName(){return particle_name;}
inline G4LogicalVolume* GetLogicalVolume(){return lv_Volume;}
inline G4VPhysicalVolume* GetPhysicalVolume(){return pv_Volume;}
};
// define the collection class according to template G4THitsCollection
typedef G4THitsCollection<LEMuSRCryoHit> LEMuSRCryoHitsCollection;
extern G4Allocator<LEMuSRCryoHit> LEMuSRCryoHitAllocator;
inline void* LEMuSRCryoHit :: operator new(size_t)
{
void *aHit;
aHit = (void*) LEMuSRCryoHitAllocator.MallocSingle();
return aHit;
}
inline void LEMuSRCryoHit :: operator delete(void *aHit)
{
LEMuSRCryoHitAllocator.FreeSingle((LEMuSRCryoHit*) aHit);
}
#endif

View File

@ -0,0 +1,88 @@
#ifndef LEMuSRCryoSD_h
#define LEMuSRCryoSD_h 1
#include "G4VSensitiveDetector.hh"
#include "LEMuSRCryoHit.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class LEMuSRCryoSD : public G4VSensitiveDetector
{
public:
LEMuSRCryoSD(G4String name);
~LEMuSRCryoSD();
void Initialize (G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*ROhist);
void EndOfEvent (G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
void BookRoot();
void FillRoot();
void WriteRoot();
TFile *myFile;
TTree *myTree;
TTree *tree;
// HIT datas
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
G4bool CheckCondition(const G4Step* aStep);
void GetDatas(const G4Step* aStep);
typedef struct
{
Float_t kenergy, tenergy, edeposit;
Float_t localtime, globaltime, proptime;
Float_t positionx, positiony,positionz;
Float_t momdirx,momdiry,momdirz, foil;
Int_t muon,positron,gamma, runid;
} cryoHit ;
cryoHit theHit;
void getHit();
private:
LEMuSRCryoHitsCollection *CryoCollection;
G4double positionResolution;
G4int mu,e,g;
};
#endif

View File

@ -0,0 +1,20 @@
#ifndef LEMuSRCylVector_h
#define LEMuSRCylVector_h 1
#include "G4ThreeVector.hh"
#include "G4UnitsTable.hh"
class LEMuSRCylVector : public G4ThreeVector
{
public:
LEMuSRCylVector();
LEMuSRCylVector(){;}
};
#endif

View File

@ -0,0 +1,34 @@
#ifndef LEMuSRDecay_h
#define LEMuSRDecay_h 1
#include "G4Decay.hh"
#include "G4ios.hh"
#include "globals.hh"
#include "G4VRestDiscreteProcess.hh"
#include "G4ParticleChangeForDecay.hh"
class G4VExtDecayer;
class G4Decay;
class LEMuSRDecay : public G4Decay
{
protected: // With Description
virtual G4VParticleChange* DecayIt(
const G4Track& aTrack,
const G4Step& aStep
);
// The DecayIt() method returns by pointer a particle-change object,
// which has information of daughter particles.
G4ParticleChangeForDecay pParticleChangeForDecay;
// const G4VExtDecayer *m_ExtDecayer;
G4double m_RemainderLifeTime;
public:
G4int testa, testb;
};
#endif

View File

@ -0,0 +1,88 @@
#ifndef LEMuSRDepolarize_h
#define LEMuSRDepolarize_h 1
#include "G4VDiscreteProcess.hh"
#include "G4EnergyLossTables.hh"
#include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VParticleChange.hh"
#include "G4ParticleChange.hh"
#include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4ForceCondition.hh"
#include "G4ParticleTable.hh"
#include "G4DynamicParticle.hh"
#include "LEMuSRPrimaryGeneratorAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class LEMuSRDepolarize : public G4VDiscreteProcess
{
public: // with description
LEMuSRDepolarize(const G4String& name="mudep" ,
G4ProcessType aType = fElectromagnetic );
~LEMuSRDepolarize();
G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
);
G4VParticleChange* PreStepDoIt(
const G4Track& ,
const G4Step&
);
G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
);
G4bool CheckCondition( const G4Step& aStep);
G4bool CheckCondition( const G4Step* aStep);
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime, itime, ftime,gtime, deltatime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
void GetDatas( const G4Step* aStep);
// model parameters
G4ParticleTable* particleTable;
G4ParticleDefinition* particle;
G4double rnd;
G4DynamicParticle *DP;
G4ParticleChange fParticleChange;
void PrepareSecondary(const G4Track&);
G4Track* aSecondary;
void InitializeSecondaries(const G4Track&);
};
#endif

View File

@ -0,0 +1,518 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : LEMuSRDetectorConstruction.hh , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-06-24 16:24
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// DETECTOR CONSTRUCTION.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMuSRDetectorConstruction_H
#define LEMuSRDetectorConstruction_H 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
// G4 CLASSES FOR MATERIAL DEFINITION
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4Isotope.hh"
#include "G4UnitsTable.hh"
#include "G4Transform3D.hh"
// G4 ATTRIBUTES CLASSES
#include "G4UserLimits.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
// G4 SENSITIVE DETECTOR
#include "G4SDManager.hh"
#include "LEMuSRScintSD.hh"
#include "LEMuSROScintSD.hh"
#include "LEMuSRMcpSD.hh"
#include "LEMuSRCryoSD.hh"
// G4 FIELD MANAGER
#include "G4UniformMagField.hh"
#include "G4UniformElectricField.hh"
#include "G4FieldManager.hh"
#include "LEMuSRRNDMAGField.hh"
class LEMuSRDetectorMessenger; // modif
class G4Box;
class G4Tubs;
class G4Cons;
class G4SubtractionSolid;
class G4UnionSolid;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class LEMuSRDetectorConstruction : public G4VUserDetectorConstruction
{
public:
// Constructeur et destructeur
static LEMuSRDetectorConstruction* theDetector; // un pointeur a l'instance
static LEMuSRDetectorConstruction* GetInstance();
LEMuSRDetectorConstruction();
~LEMuSRDetectorConstruction();
// construction
G4VPhysicalVolume* Construct();
G4VPhysicalVolume* lemuDetector();
// messenger
LEMuSRDetectorMessenger* Messenger;
//declaration of all the volumes
private:
//=======LABORATORY::WORLD=================
// solid
G4Box* LABO_box;
// logical
G4LogicalVolume* lv_LABO;
// physical
G4VPhysicalVolume* pv_LABO;
// materials
G4Material* LABO_material;
//======= MPC2 =================
void lemuMCP2();
//solids
G4Tubs* MCPV_tube;
G4Tubs* MCPS_tube;
G4Tubs* F160_tube;
G4Tubs* F100_tube;
G4Tubs* F200_tube;
G4Tubs* GATV_tube;
G4Tubs* GATS_tube;
G4UnionSolid* MCPV_vtube;
// logicals volumes
G4LogicalVolume* lv_MCPV;
G4LogicalVolume* lv_MCPS ;
G4LogicalVolume* lv_F160 ;
G4LogicalVolume* lv_F100 ;
G4LogicalVolume* lv_F200 ;
G4LogicalVolume* lv_GATV;
G4LogicalVolume* lv_GATS ;
// physical volumes
G4VPhysicalVolume* pv_MCPV;
G4VPhysicalVolume* pv_MCPS;
G4VPhysicalVolume* pv_F160 ;
G4VPhysicalVolume* pv_F100 ;
G4VPhysicalVolume* pv_F200 ;
G4VPhysicalVolume* pv_GATV;
G4VPhysicalVolume* pv_GATS ;
void buildAnodeField();
// parameter
public:
G4double mcpv_z;
G4int Grid, Guards;
//=================== ANODE =======================
private:
void lemuANODE();
// solids
G4Cons* RA_E_cone;
G4Cons* RA_M_cone;
G4Box *RA_Ebox, *RA_Mbox;
G4SubtractionSolid* RA_E, *RA_M;
G4Tubs* RA_G_tube, *RAV_tube;
// logical
G4LogicalVolume* lv_RA_E ;
G4LogicalVolume* lv_RA_M ;
G4LogicalVolume* lv_RA_G ;
G4LogicalVolume* lv_RAV ;
// physical
G4VPhysicalVolume* pv_RA_E ;
G4VPhysicalVolume* pv_RA_M ;
G4VPhysicalVolume* pv_RA_G ;
G4VPhysicalVolume* pv_RAV ;
//================ MCP DETECTOR =====================
private:
void lemuMCPdet();
// solids
G4Tubs* DMCP_tube;
G4Tubs* MCPM_tube;
G4Box* MCPA_box;
G4Tubs* ANVA_tube;
G4Box* MCSR_box;
G4Tubs* MCVR_tube;
G4Tubs* MCSS_tube;
// logical volumes
G4LogicalVolume* lv_DMCP ;
G4LogicalVolume* lv_MCPA ;
G4LogicalVolume* lv_MCPM ;
G4LogicalVolume* lv_ANVA ;
G4LogicalVolume* lv_MCSR ;
G4LogicalVolume* lv_MCVR ;
G4LogicalVolume* lv_MCSS ;
// physical volumes
G4VPhysicalVolume* pv_DMCP ;
G4VPhysicalVolume* pv_MCPA ;
G4VPhysicalVolume* pv_MCPM ;
G4VPhysicalVolume* pv_MCPM2;
G4VPhysicalVolume* pv_ANVA ;
G4VPhysicalVolume* pv_ANVA2;
G4VPhysicalVolume* pv_MCSR ;
G4VPhysicalVolume* pv_MCVR ;
G4VPhysicalVolume* pv_MCSS ;
// parameters
public:
G4double B; // magnetic field default unit gauss
//================ CRYOSTAT ======================
private:
void lemuCRYO();
// solids
G4Tubs* SAH1_tube;
G4Tubs* SAH2_tube;
G4Tubs* SAH3_tube;
G4Tubs* SAPH_tube;
G4Tubs* COFI_tube;
G4Tubs* CRY1_tube;
G4Tubs* CRY2_tube;
G4Tubs* CRY3_tube;
G4Tubs* CRY4_tube;
G4Tubs* CRSH_tube;
G4Tubs* cryoField_tube;
G4Tubs* CRSH2_tube;
G4Tubs* Guard_Rings;
// logical volumes
G4LogicalVolume* lv_SAH1 ;
G4LogicalVolume* lv_SAH2 ;
G4LogicalVolume* lv_SAH3;
G4LogicalVolume* lv_SAPH ;
G4LogicalVolume* lv_COFI ;
G4LogicalVolume* lv_CRY1 ;
G4LogicalVolume* lv_CRY2 ;
G4LogicalVolume* lv_CRY3 ;
G4LogicalVolume* lv_CRY4 ;
G4LogicalVolume* lv_CRSH ;
G4LogicalVolume* lv_CRSH2 ;
G4LogicalVolume* lv_Guards ;
G4LogicalVolume* lv_cryoField ;
// physical volumes
G4VPhysicalVolume* pv_SAH1 ;
G4VPhysicalVolume* pv_SAH2 ;
G4VPhysicalVolume* pv_SAH3 ;
G4VPhysicalVolume* pv_SAPH ;
G4VPhysicalVolume* pv_COFI ;
G4VPhysicalVolume* pv_CRY1 ;
G4VPhysicalVolume* pv_CRY2 ;
G4VPhysicalVolume* pv_CRY3 ;
G4VPhysicalVolume* pv_CRY4 ;
G4VPhysicalVolume* pv_CRSH ;
G4VPhysicalVolume* pv_CRSH2 ;
G4VPhysicalVolume* pv_Guard1 ;
G4VPhysicalVolume* pv_Guard2 ;
G4VPhysicalVolume* pv_cryoField;
// Cryo electric field manager
G4FieldManager* cryoFieldMgr;
G4ElectricField* cryoField;
G4FieldManager* sampleFieldMgr;
G4MagneticField* sampleField;
void buildCryoField();
void NEWMAPS();
public:
// Parameters
G4double cryoFieldLength,cryoVoltage;
G4String Material_SAH;
//================ LINSE three ======================
private:
void lemuLinse3();
// solids
G4Tubs* L3VA_tube;
G4Tubs* L3ST_tube;
G4Tubs* L3F_tube; // flange
G4SubtractionSolid* L3GP_tube;
G4Tubs* L3GP1, *L3GP2, *L3GP3; // L3GV_tube is a boolean
G4SubtractionSolid* L3HP_tube;
G4Tubs* L3HP1, *L3HP2 , *L3HP3, *L3HP4, *L3HP5;
// logical volumes
G4LogicalVolume* lv_L3VA ;
G4LogicalVolume* lv_L3ST ;
G4LogicalVolume* lv_L3F;//flange
// Ground potential
G4LogicalVolume* lv_L3GP1, *lv_L3GP2 , *lv_L3GP3;
// High potential
G4LogicalVolume* lv_L3HP, *lv_L3HP3, *lv_L3HP4, *lv_L3HP5 ;
// physical volumes
G4double L3z;
G4VPhysicalVolume* pv_L3VA ;
G4VPhysicalVolume* pv_L3ST ;
G4VPhysicalVolume* pv_L3F1, *pv_L3F2 ;// flanges
G4VPhysicalVolume* pv_L3GP1, *pv_L3GP2, *pv_L3GP3, *pv_L3GP4, *pv_L3GP5, *pv_L3GP6, *pv_L3GP7, *pv_L3GP8 ;
G4VPhysicalVolume* pv_L3HP, *pv_L3HP3, *pv_L3HP4, *pv_L3HP5 , *pv_L3HP6, *pv_L3HP7, *pv_L3HP8;
G4VPhysicalVolume* pv_L3GV2 ;
//================ TRIGGER DETECTOR ====================
private:
void lemuTrigger_Detector();
// solids
G4Tubs* Trigger_tube;
G4Tubs* TriggerV_tube;
G4Tubs* TriggerF_tube; // flange
G4Box* Trigger_box, *Trigger_box2, *Trigger_box3;
// magnetic field manager
G4FieldManager* T1FieldMgr;
G4UniformElectricField* T1Field;
// magnetic field manager
G4FieldManager* T2FieldMgr;
G4UniformElectricField* T2Field;
// magnetic field manager
G4FieldManager* T3FieldMgr;
G4UniformElectricField* T3Field;
// logical
G4LogicalVolume *lv_Trigger, *lv_TriggerF, *lv_TriggerV, *lv_TriggerB, *lv_TriggerB2, *lv_TriggerB3, *lv_CFOIL;
// physica.l
G4VPhysicalVolume *pv_Trigger, *pv_TriggerF1, *pv_TriggerF2,*pv_TriggerV, *pv_TriggerB, *pv_TriggerB2, *pv_TriggerB3, *pv_CFOIL;
//================ COMPENSATION GATE ====================
private:
void lemuCGate();
// solids
G4Tubs* CGate_tube;
G4Tubs* CGateV_tube;
G4Tubs* CGateF_tube; // flange
// logical
G4LogicalVolume *lv_CGate, *lv_CGateF, *lv_CGateV;
// physica.l
G4VPhysicalVolume *pv_CGate, *pv_CGateF1, *pv_CGateF2,*pv_CGateV;
//======= INNER/OUTER SCINTILLATOR =================
private:
void lemuSCINT();
//solids
G4Tubs* SCIS_tube;
G4Tubs* SCOS_tube;
// logicals volumes
G4LogicalVolume* lv_SCIS;
G4LogicalVolume* lv_SCOS ;
// physical volumes
G4VPhysicalVolume* pv_SCISl;
G4VPhysicalVolume* pv_SCOSl;
G4VPhysicalVolume* pv_SCISr;
G4VPhysicalVolume* pv_SCOSr;
G4VPhysicalVolume* pv_SCISb;
G4VPhysicalVolume* pv_SCOSb;
G4VPhysicalVolume* pv_SCISt;
G4VPhysicalVolume* pv_SCOSt;
G4Transform3D rotation1;
G4Transform3D rotation2;
G4Transform3D rotation3;
//================ ASYMETRY TEST VOLUMES ================
private:
void lemuAsym();
// solids
G4Tubs* Asym_tube;
// logical
G4LogicalVolume *lv_Asym, *lv_AsymL, *lv_AsymR;
// physica.l
G4VPhysicalVolume *pv_Asym, *pv_Asym2, *pv_AsymL, *pv_AsymR;
G4Transform3D Asym_rotation;
//========= ELECTRIC FIELD TEST VOLUMES ================
private:
void lemuFieldCheck();
// solids
G4Tubs* fchk_tube;
// logical
G4LogicalVolume* lv_fchk, *lv_fchk2,*lv_fchk3;
// physical
G4VPhysicalVolume* pv_fchk,*pv_fchk2,*pv_fchk3,*pv_fchk4,*pv_fchk5,*pv_fchk6,*pv_fchk7,*pv_fchk8,*pv_fchk9,*pv_fchk1,*pv_fchk10,*pv_fchk11,*pv_fchk12,*pv_fchk13,*pv_fchk14,*pv_fchk15,*pv_fchk16,*pv_fchk17,*pv_fchk18,*pv_fchk19,*pv_fchk20,*pv_fchk21,*pv_fchk22,*pv_fchk23,*pv_fchk24,*pv_fchk25,*pv_fchk26,*pv_fchk27,*pv_fchk28,*pv_fchk29,*pv_fchk30,*pv_fchk31,*pv_fchk32,*pv_fchk33,*pv_fchk34,*pv_fchk35,*pv_fchk36,*pv_fchk37,*pv_fchk38,*pv_fchk39,*pv_fchk40,*pv_fchk41,*pv_fchk42,*pv_fchk43,*pv_fchk44,*pv_fchk45,*pv_fchk46,*pv_fchk47,*pv_fchk48,*pv_fchk49,*pv_fchk50,*pv_fchk51,*pv_fchk52,*pv_fchk53,*pv_fchk54,*pv_fchk55,*pv_fchk56,*pv_fchk57,*pv_fchk58,*pv_fchk59,*pv_fchk60,*pv_fchk61,*pv_fchk62,*pv_fchk63,*pv_fchk64,*pv_fchk65,*pv_fchk66,*pv_fchk67,*pv_fchk68,*pv_fchk69,*pv_fchk70,*pv_fchk71,*pv_fchk72;
//====== SENSITIVE DETECTORS ==========================
public:
LEMuSRCryoSD *CryoSD;
LEMuSRMcpSD *McpSD;
LEMuSRScintSD *iScintSD;
LEMuSROScintSD *oScintSD;
G4int scint, mcp, cryo;
//====== MATERIAL DECLARATION =========================
private:
void MaterialsDefinition();
//materials
G4Material* SC_material;
G4Material* SAH_material;
G4Material* SAPH_material;
G4Material* Scint_material;
G4Material* DMCP_material;
G4Material* Vacuum ;
G4Material* SSteel ;
G4Material* Copper ;
G4Material* Macor ;
G4Material* Carbon ;
//====== ATTRIBUTES SETTING =========================
void LoadAttributes();
G4VisAttributes* Blue_style, *Red_style, *Purple_style, *Green_style, *Yellow_style, *dRed_style , *dYellow_style, *lBlue_style,*fBlue_style, *dBlue_style, *oxsteel;
G4VisAttributes* VTBB_style,*MCP_style, *MACOR_style, *SCINT_style, *dSCINT_style;
G4VisAttributes* White_style;
G4UserLimits* VTBB_lim;
//====== ARGUMENTS AND PARAMETERS======================
public:
G4double dSPhi; // starting angle for detector
G4double dEPhi; // ending angle for detector
G4double sSPhi; // starting angle for detector
G4double sEPhi; // ending angle for detector
G4int magfield, elfield, anode_elfield, trigger_field;
G4double L3FieldVal,AnodeFieldVal,RALval,RARval, FieldStepLim, cfthk;
G4FieldManager* L3FieldMgr, *GFieldMgr;
G4double offset, mcdetector, halfview;
G4double AsymCheck;
G4double RA_Ez, RA_Mz, RA_Gz, GATVz;
inline G4double GetParamMC(){return mcdetector;}
//======= TEMPLATE Volume To Be Built =================
void lemuVTBB();
//solids
G4Tubs* VTBB_tube;
// logicals volumes
G4LogicalVolume* lv_VTBB;
// physical volumes
G4VPhysicalVolume* pv_VTBB;
//materials
G4Material* VTBB_material;
// print STATUS
void PrintStatus();
};
#endif

View File

@ -0,0 +1,85 @@
#ifndef LEMuSRDetectorMessenger_h
#define LEMuSRDetectorMessenger_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4UImessenger.hh"
#include "LEMuSRDetectorConstruction.hh"
#include "LEMuSRElectricField.hh"
#include "G4RunManager.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
#include "G4UIcmdWith3Vector.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcommand.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
class G4UIcommand;
class G4UIdirectory;
class G4UIcmdWithADouble;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3VectorAndUnit;
class G4UIcmdWith3Vector;
class G4UIcmdWithAnInteger;
class G4UIcmdWithAString;
class G4UIcmdWithoutParameter;
class LEMuSRDetectorConstruction; //modif
class LEMuSRDetectorMessenger : public G4UImessenger {
public:
LEMuSRDetectorMessenger(LEMuSRDetectorConstruction*);
~LEMuSRDetectorMessenger();
public:
void SetNewValue(G4UIcommand* command, G4String newvalue);
//arguments
private:
LEMuSRDetectorConstruction* theDetector;
// commands
private:
G4UIdirectory* DetMode;
//commands with STRING
G4UIcmdWithAString* SetDetMode ;
G4UIcmdWithAString* SetElField ;
G4UIcmdWithAString* SetGrid ;
G4UIcmdWithAString* SetGuards ;
G4UIcmdWithAString* SetDetVisualization ;
G4UIcmdWithAString* SetSAHmaterial ;
G4UIcmdWithAString* SetAsymCheck ;
G4UIcmdWithAString* SetFieldCheck ;
//commands with DOUBLE
G4UIcmdWithADouble* SetThirdLensPotential, *SetCFthk ;
G4UIcmdWithADouble* SetFieldStepLim ;
G4UIcmdWithADouble* SetMagField ;
G4UIcmdWithADouble* SetCryoPotential;
//coomand with 3vector
G4UIcmdWith3Vector* SetRAPotential;
G4VPhysicalVolume* newDetector;
};
#endif

View File

@ -0,0 +1,61 @@
// -------------------------------------------
// History
// first version 12 Nov. 2000 by H.Kurashige
// ------------------------------------------------------------
#ifndef LEMuSREMPhysics_h
#define LEMuSREMPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
class LEMuSREMPhysics : public G4VPhysicsConstructor
{
public:
LEMuSREMPhysics(const G4String& name ="EM");
virtual ~LEMuSREMPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Gamma physics
G4PhotoElectricEffect thePhotoEffect;
G4ComptonScattering theComptonEffect;
G4GammaConversion thePairProduction;
// Electron physics
G4MultipleScattering theElectronMultipleScattering;
G4eIonisation theElectronIonisation;
G4eBremsstrahlung theElectronBremsStrahlung;
//Positron physics
G4MultipleScattering thePositronMultipleScattering;
G4eIonisation thePositronIonisation;
G4eBremsstrahlung thePositronBremsStrahlung;
G4eplusAnnihilation theAnnihilation;
};
#endif

View File

@ -0,0 +1,70 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID :LEMuSRElFieldMix.hh , v 1.3
// AUTHOR: Taofiq PARAISO
// DATE : 2005-02-14 15:15
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// Electric Field MIX
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMUSRELECTRICFIELDMIX_H
#define LEMUSRELECTRICFIELDMIX_H 1
#include"G4ElectricField.hh"
#include"G4ElectroMagneticField.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/Matrix.h"
#include "LEMuSRElectricField.hh"
class LEMuSRElFieldMix : public G4ElectricField
{
public:
LEMuSRElFieldMix( LEMuSRElectricField* E1, LEMuSRElectricField* E2, G4double field1_val, G4double field2_val);
LEMuSRElFieldMix( G4ElectricField* E1, G4ElectricField* E2, G4double field1_val, G4double field2_val);
~LEMuSRElFieldMix();
void GetFieldValue(const G4double point[4], G4double *Bfield) const;
void Test();
public:
G4double coef1, coef2;
// LEMuSRElectricField* field1, *field2;
G4ElectricField* field1, *field2;
};
#endif

View File

@ -0,0 +1,43 @@
#ifndef LEMUSRELECTRICMAGFIELD_H
#define LEMUSRELECTRICMAGFIELD_H 1
#include"G4ElectricField.hh"
#include"G4MagneticField.hh"
#include"G4ElectroMagneticField.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/Matrix.h"
#include "LEMuSRElectricField.hh"
class LEMuSRElMagField : public G4MagneticField
{
public:
LEMuSRElMagField( G4ElectricField* E, G4MagneticField* B, G4double field1_val, G4double field2_val);
~LEMuSRElMagField();
void GetFieldValue(const G4double point[4], G4double *Bfield) const;
void Test();
G4bool DoesFieldChangeEnergy() const { return true; }// important to state that field changes energy (electric part!!!)
public:
G4double coef1, coef2;
G4ElectricField* field1;
G4MagneticField* field2;
};
#endif

View File

@ -0,0 +1,41 @@
#ifndef LEMuSRELMAG_SPIN_EQRHS
#define LEMuSRELMAG_SPIN_EQRHS
#include "G4Types.hh"
#include "G4Mag_EqRhs.hh"
class G4MagneticField;
class LEMuSRElMag_SpinEqRhs : public G4Mag_EqRhs
{
public: // with description
LEMuSRElMag_SpinEqRhs( G4MagneticField* MagField );
~LEMuSRElMag_SpinEqRhs();
// Constructor and destructor. No actions.
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass);
void EvaluateRhsGivenB( const G4double y[],
const G4double B[3],
G4double dydx[] ) const;
// Given the value of the magnetic field B, this function
// calculates the value of the derivative dydx.
private:
G4double omegac;
G4double anomaly;
G4double ParticleCharge;
G4double E;
G4double gamma, m_mass;
G4double beta;
G4double cst;
};
#endif /* LEMuSRELMAG_SPIN_EQRHS */

View File

@ -0,0 +1,81 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID :LEMuSRElectricField.hh , v 1.3
// AUTHOR: Taofiq PARAISO
// DATE : 2004-09-17 10:20
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// Electric Field
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMUSRELECTRICFIELD_H
#define LEMUSRELECTRICFIELD_H 1
#include"G4ElectricField.hh"
#include"G4ElectroMagneticField.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/Matrix.h"
class LEMuSRElectricField : public G4ElectricField
{
public:
LEMuSRElectricField(G4double fieldval,const char* Xfile,
const char* Yfile,
const char* Zfile,G4String map_length_unit,
G4double Offset, G4double nx, G4double ny, G4double nz);//offset must be entered in millimeter
LEMuSRElectricField(G4double fieldval,const char* file,G4String map_length_unit,
G4double Offset, G4double nx, G4double ny, G4double nz);
~LEMuSRElectricField();
void GetFieldValue(const G4double Point[4], G4double *Bfield) const;
void Test();
public:
// std::vector< std::vector< std::vector< G4double > > > xField; // vector of
// vector of
// vector of G4doubles [[[a]i]j]k
// std::vector< std::vector< std::vector< G4double > > > yField;
// std::vector< std::vector< std::vector< G4double > > > zField;
G4double xField[90][90][201];
G4double yField[90][90][201];
G4double zField[90][90][201];
// The physical limits of the defined region
G4double minx, maxx, miny, maxy, minz, maxz;
G4double dx, dy, dz, zOffset, nx,ny,nz, FieldVal;
G4String map_unit;
};
#endif

View File

@ -0,0 +1,81 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID :LEMuSRElectricField.hh , v 1.3
// AUTHOR: Taofiq PARAISO
// DATE : 2004-09-17 10:20
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// Electric Field
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMUSRELECTRICFIELD_H
#define LEMUSRELECTRICFIELD_H 1
#include"G4ElectricField.hh"
#include"G4ElectroMagneticField.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/Matrix.h"
class LEMuSRElectricField : public G4ElectricField
{
public:
LEMuSRElectricField(G4double fieldval,const char* Xfile,
const char* Yfile,
const char* Zfile,G4String map_length_unit,
G4double Offset, G4double nx, G4double ny, G4double nz);//offset must be entered in millimeter
LEMuSRElectricField(G4double fieldval,const char* file,G4String map_length_unit,
G4double Offset, G4double nx, G4double ny, G4double nz);
~LEMuSRElectricField();
void GetFieldValue(const G4double Point[4], G4double *Bfield) const;
void Test();
public:
// std::vector< std::vector< std::vector< G4double > > > xField; // vector of
// vector of
// vector of G4doubles [[[a]i]j]k
// std::vector< std::vector< std::vector< G4double > > > yField;
// std::vector< std::vector< std::vector< G4double > > > zField;
G4double xField*;
G4double yField*;
G4double zField*;
// The physical limits of the defined region
G4double minx, maxx, miny, maxy, minz, maxz;
G4double dx, dy, dz, zOffset, nx,ny,nz, FieldVal;
G4String map_unit;
};
#endif

View File

@ -0,0 +1,82 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id$
// GEANT4 tag $Name$
//
//
// class LEMuSREqMagElectricField
//
// Class description:
//
// This is the right-hand side of equation of motion in a combined
// electric and magnetic field.
// History:
// - Created. V.Grichine, 10.11.98
// -------------------------------------------------------------------
#ifndef LEMuSREQMAGELECTRICFIELD_hh
#define LEMuSREQMAGELECTRICFIELD_hh
#include "G4EquationOfMotion.hh"
#include "G4ElectroMagneticField.hh"
class LEMuSREqMagElectricField : public G4EquationOfMotion
{
public: // with description
LEMuSREqMagElectricField(G4ElectroMagneticField *emField )
: G4EquationOfMotion( emField ) {;}
~LEMuSREqMagElectricField() {;}
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass);
void EvaluateRhsGivenB(const G4double y[],
const G4double Field[],
G4double dydx[] ) const;
// Given the value of the electromagnetic field, this function
// calculates the value of the derivative dydx.
private:
G4double fElectroMagCof ;
G4double fMassCof;
G4double omegac;
G4double anomaly;
G4double ParticleCharge;
G4double E;
G4double gamma;
G4double beta;
};
#endif

View File

@ -0,0 +1,97 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSREventAction.hh , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-07-07 11:15
//
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// EVENT ACTION.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§////
//
#ifndef LEMuSREventAction_h
#define LEMuSREventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
class G4EventManager;
class G4Event;
class LEMuSREventAction : public G4UserEventAction
{
public:
LEMuSREventAction();
~LEMuSREventAction();
public: // with description
void BeginOfEventAction(const G4Event* anEvent);
void EndOfEventAction(const G4Event* anEvent);
void SetDrawFlag (G4String val) {drawFlag = val;};
// Two virtual method the user can override.
void SDCollManagement(const G4Event* evt);
private:
G4String drawFlag;
G4int iScintCollID, oScintCollID, CryoCollID, McpCollID;
// root variables
public:
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b;
TH1D *hTest ,*hTest2,*hTest3, *hTest4;
LEMuSRCryoHit* aHit;
G4double en_dep;
typedef struct {
G4double lifetime, energy, angle;
} PRIMDATAS;
PRIMDATAS PMdatas;
};
#endif

View File

@ -0,0 +1,46 @@
// History
// first version 12 Nov. 2000 by H.Kurashige
// ------------------------------------------------------------
#ifndef LEMuSRGeneralPhysics_h
#define LEMuSRGeneralPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4StepLimiter.hh"
#include "LEMuSRDecay.hh"
class LEMuSRGeneralPhysics : public G4VPhysicsConstructor
{
public:
LEMuSRGeneralPhysics(const G4String& name = "general");
virtual ~LEMuSRGeneralPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
LEMuSRDecay fDecayProcess;
G4StepLimiter fStepLimiter;
};
#endif

View File

@ -0,0 +1,322 @@
// $Id$
// GEANT4 tag $Name$
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// This class is an derived class of G4VPhysicsConstructor
//
// ------------------------------------------------------------
#ifndef LEMuSRHadronPhysics_h
#define LEMuSRHadronPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include <vector>
#include "G4VPhysicsConstructor.hh"
#include "G4MultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4PionPlusInelasticProcess.hh"
#include "G4PionMinusInelasticProcess.hh"
#include "G4KaonPlusInelasticProcess.hh"
#include "G4KaonZeroSInelasticProcess.hh"
#include "G4KaonZeroLInelasticProcess.hh"
#include "G4KaonMinusInelasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4AntiProtonInelasticProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4AntiNeutronInelasticProcess.hh"
#include "G4LambdaInelasticProcess.hh"
#include "G4AntiLambdaInelasticProcess.hh"
#include "G4SigmaPlusInelasticProcess.hh"
#include "G4SigmaMinusInelasticProcess.hh"
#include "G4AntiSigmaPlusInelasticProcess.hh"
#include "G4AntiSigmaMinusInelasticProcess.hh"
#include "G4XiZeroInelasticProcess.hh"
#include "G4XiMinusInelasticProcess.hh"
#include "G4AntiXiZeroInelasticProcess.hh"
#include "G4AntiXiMinusInelasticProcess.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4AlphaInelasticProcess.hh"
#include "G4OmegaMinusInelasticProcess.hh"
#include "G4AntiOmegaMinusInelasticProcess.hh"
// Low-energy Models
#include "G4LElastic.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4LEPionPlusInelastic.hh"
#include "G4LEPionMinusInelastic.hh"
#include "G4LEKaonPlusInelastic.hh"
#include "G4LEKaonZeroSInelastic.hh"
#include "G4LEKaonZeroLInelastic.hh"
#include "G4LEKaonMinusInelastic.hh"
#include "G4LEProtonInelastic.hh"
#include "G4LEAntiProtonInelastic.hh"
#include "G4LENeutronInelastic.hh"
#include "G4LEAntiNeutronInelastic.hh"
#include "G4LELambdaInelastic.hh"
#include "G4LEAntiLambdaInelastic.hh"
#include "G4LESigmaPlusInelastic.hh"
#include "G4LESigmaMinusInelastic.hh"
#include "G4LEAntiSigmaPlusInelastic.hh"
#include "G4LEAntiSigmaMinusInelastic.hh"
#include "G4LEXiZeroInelastic.hh"
#include "G4LEXiMinusInelastic.hh"
#include "G4LEAntiXiZeroInelastic.hh"
#include "G4LEAntiXiMinusInelastic.hh"
#include "G4LEDeuteronInelastic.hh"
#include "G4LETritonInelastic.hh"
#include "G4LEAlphaInelastic.hh"
#include "G4LEOmegaMinusInelastic.hh"
#include "G4LEAntiOmegaMinusInelastic.hh"
// High-energy Models
#include "G4HEPionPlusInelastic.hh"
#include "G4HEPionMinusInelastic.hh"
#include "G4HEKaonPlusInelastic.hh"
#include "G4HEKaonZeroInelastic.hh"
#include "G4HEKaonZeroInelastic.hh"
#include "G4HEKaonMinusInelastic.hh"
#include "G4HEProtonInelastic.hh"
#include "G4HEAntiProtonInelastic.hh"
#include "G4HENeutronInelastic.hh"
#include "G4HEAntiNeutronInelastic.hh"
#include "G4HELambdaInelastic.hh"
#include "G4HEAntiLambdaInelastic.hh"
#include "G4HESigmaPlusInelastic.hh"
#include "G4HESigmaMinusInelastic.hh"
#include "G4HEAntiSigmaPlusInelastic.hh"
#include "G4HEAntiSigmaMinusInelastic.hh"
#include "G4HEXiZeroInelastic.hh"
#include "G4HEXiMinusInelastic.hh"
#include "G4HEAntiXiZeroInelastic.hh"
#include "G4HEAntiXiMinusInelastic.hh"
#include "G4HEOmegaMinusInelastic.hh"
#include "G4HEAntiOmegaMinusInelastic.hh"
// Stopping processes
#include "G4AntiProtonAnnihilationAtRest.hh"
#include "G4AntiNeutronAnnihilationAtRest.hh"
#ifdef TRIUMF_STOP_PIMINUS
#include "G4PionMinusAbsorptionAtRest.hh"
#else
#include "G4PiMinusAbsorptionAtRest.hh"
#endif
#ifdef TRIUMF_STOP_KMINUS
#include "G4KaonMinusAbsorption.hh"
#else
#include "G4KaonMinusAbsorptionAtRest.hh"
#endif
// quark gluon string model with chips afterburner.
#include "G4TheoFSGenerator.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
class LEMuSRHadronPhysics : public G4VPhysicsConstructor
{
public:
LEMuSRHadronPhysics(const G4String& name ="hadron");
virtual ~LEMuSRHadronPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Elastic Process
G4HadronElasticProcess theElasticProcess;
G4LElastic* theElasticModel;
// Pi +
G4PionPlusInelasticProcess thePionPlusInelastic;
G4LEPionPlusInelastic* theLEPionPlusModel;
G4MultipleScattering thePionPlusMult;
G4hIonisation thePionPlusIonisation;
// Pi -
G4PionMinusInelasticProcess thePionMinusInelastic;
G4LEPionMinusInelastic* theLEPionMinusModel;
G4MultipleScattering thePionMinusMult;
G4hIonisation thePionMinusIonisation;
#ifdef TRIUMF_STOP_PIMINUS
G4PionMinusAbsorptionAtRest thePionMinusAbsorption;
#else
G4PiMinusAbsorptionAtRest thePionMinusAbsorption;
#endif
// pi+ and pi-
G4TheoFSGenerator theTheoModel;
G4ExcitationHandler theHandler;
G4PreCompoundModel * thePreEquilib;
G4GeneratorPrecompoundInterface theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
// K +
G4KaonPlusInelasticProcess theKaonPlusInelastic;
G4LEKaonPlusInelastic* theLEKaonPlusModel;
G4HEKaonPlusInelastic* theHEKaonPlusModel;
G4MultipleScattering theKaonPlusMult;
G4hIonisation theKaonPlusIonisation;
// K -
G4KaonMinusInelasticProcess theKaonMinusInelastic;
G4LEKaonMinusInelastic* theLEKaonMinusModel;
G4HEKaonMinusInelastic* theHEKaonMinusModel;
G4MultipleScattering theKaonMinusMult;
G4hIonisation theKaonMinusIonisation;
#ifdef TRIUMF_STOP_KMINUS
G4KaonMinusAbsorption theKaonMinusAbsorption;
#else
G4PiMinusAbsorptionAtRest theKaonMinusAbsorption;
#endif
// K0L
G4KaonZeroLInelasticProcess theKaonZeroLInelastic;
G4LEKaonZeroLInelastic* theLEKaonZeroLModel;
G4HEKaonZeroInelastic* theHEKaonZeroLModel;
// K0S
G4KaonZeroSInelasticProcess theKaonZeroSInelastic;
G4LEKaonZeroSInelastic* theLEKaonZeroSModel;
G4HEKaonZeroInelastic* theHEKaonZeroSModel;
// Proton
G4ProtonInelasticProcess theProtonInelastic;
G4LEProtonInelastic* theLEProtonModel;
G4HEProtonInelastic* theHEProtonModel;
G4MultipleScattering theProtonMult;
G4hIonisation theProtonIonisation;
// anti-proton
G4AntiProtonInelasticProcess theAntiProtonInelastic;
G4LEAntiProtonInelastic* theLEAntiProtonModel;
G4HEAntiProtonInelastic* theHEAntiProtonModel;
G4MultipleScattering theAntiProtonMult;
G4hIonisation theAntiProtonIonisation;
G4AntiProtonAnnihilationAtRest theAntiProtonAnnihilation;
// neutron
G4NeutronInelasticProcess theNeutronInelastic;
G4LENeutronInelastic* theLENeutronModel;
G4HENeutronInelastic* theHENeutronModel;
G4HadronFissionProcess theNeutronFission;
G4LFission* theNeutronFissionModel;
G4HadronCaptureProcess theNeutronCapture;
G4LCapture* theNeutronCaptureModel;
// anti-neutron
G4AntiNeutronInelasticProcess theAntiNeutronInelastic;
G4LEAntiNeutronInelastic* theLEAntiNeutronModel;
G4HEAntiNeutronInelastic* theHEAntiNeutronModel;
G4AntiNeutronAnnihilationAtRest theAntiNeutronAnnihilation;
// Lambda
G4LambdaInelasticProcess theLambdaInelastic;
G4LELambdaInelastic* theLELambdaModel;
G4HELambdaInelastic* theHELambdaModel;
// AntiLambda
G4AntiLambdaInelasticProcess theAntiLambdaInelastic;
G4LEAntiLambdaInelastic* theLEAntiLambdaModel;
G4HEAntiLambdaInelastic* theHEAntiLambdaModel;
// SigmaMinus
G4SigmaMinusInelasticProcess theSigmaMinusInelastic;
G4LESigmaMinusInelastic* theLESigmaMinusModel;
G4HESigmaMinusInelastic* theHESigmaMinusModel;
G4MultipleScattering theSigmaMinusMult;
G4hIonisation theSigmaMinusIonisation;
// AntiSigmaMinus
G4AntiSigmaMinusInelasticProcess theAntiSigmaMinusInelastic;
G4LEAntiSigmaMinusInelastic* theLEAntiSigmaMinusModel;
G4HEAntiSigmaMinusInelastic* theHEAntiSigmaMinusModel;
G4MultipleScattering theAntiSigmaMinusMult;
G4hIonisation theAntiSigmaMinusIonisation;
// SigmaPlus
G4SigmaPlusInelasticProcess theSigmaPlusInelastic;
G4LESigmaPlusInelastic* theLESigmaPlusModel;
G4HESigmaPlusInelastic* theHESigmaPlusModel;
G4MultipleScattering theSigmaPlusMult;
G4hIonisation theSigmaPlusIonisation;
// AntiSigmaPlus
G4AntiSigmaPlusInelasticProcess theAntiSigmaPlusInelastic;
G4LEAntiSigmaPlusInelastic* theLEAntiSigmaPlusModel;
G4HEAntiSigmaPlusInelastic* theHEAntiSigmaPlusModel;
G4MultipleScattering theAntiSigmaPlusMult;
G4hIonisation theAntiSigmaPlusIonisation;
// XiZero
G4XiZeroInelasticProcess theXiZeroInelastic;
G4LEXiZeroInelastic* theLEXiZeroModel;
G4HEXiZeroInelastic* theHEXiZeroModel;
// AntiXiZero
G4AntiXiZeroInelasticProcess theAntiXiZeroInelastic;
G4LEAntiXiZeroInelastic* theLEAntiXiZeroModel;
G4HEAntiXiZeroInelastic* theHEAntiXiZeroModel;
// XiMinus
G4XiMinusInelasticProcess theXiMinusInelastic;
G4LEXiMinusInelastic* theLEXiMinusModel;
G4HEXiMinusInelastic* theHEXiMinusModel;
G4MultipleScattering theXiMinusMult;
G4hIonisation theXiMinusIonisation;
// AntiXiMinus
G4AntiXiMinusInelasticProcess theAntiXiMinusInelastic;
G4LEAntiXiMinusInelastic* theLEAntiXiMinusModel;
G4HEAntiXiMinusInelastic* theHEAntiXiMinusModel;
G4MultipleScattering theAntiXiMinusMult;
G4hIonisation theAntiXiMinusIonisation;
// OmegaMinus
G4OmegaMinusInelasticProcess theOmegaMinusInelastic;
G4LEOmegaMinusInelastic* theLEOmegaMinusModel;
G4HEOmegaMinusInelastic* theHEOmegaMinusModel;
G4MultipleScattering theOmegaMinusMult;
G4hIonisation theOmegaMinusIonisation;
// AntiOmegaMinus
G4AntiOmegaMinusInelasticProcess theAntiOmegaMinusInelastic;
G4LEAntiOmegaMinusInelastic* theLEAntiOmegaMinusModel;
G4HEAntiOmegaMinusInelastic* theHEAntiOmegaMinusModel;
G4MultipleScattering theAntiOmegaMinusMult;
G4hIonisation theAntiOmegaMinusIonisation;
};
#endif

View File

@ -0,0 +1,80 @@
// -------------------------------------------
// History
// first version 12 Nov. 2000 by H.Kurashige
// ------------------------------------------------------------
#ifndef LEMuSRIonPhysics_h
#define LEMuSRIonPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronElasticProcess.hh"
#include "G4LElastic.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4LEDeuteronInelastic.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4LETritonInelastic.hh"
#include "G4AlphaInelasticProcess.hh"
#include "G4LEAlphaInelastic.hh"
#include "G4hIonisation.hh"
#include "G4ionIonisation.hh"
#include "G4MultipleScattering.hh"
class LEMuSRIonPhysics : public G4VPhysicsConstructor
{
public:
LEMuSRIonPhysics(const G4String& name="ion");
virtual ~LEMuSRIonPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Elastic Process
G4HadronElasticProcess theElasticProcess;
G4LElastic* theElasticModel;
// Generic Ion physics
G4MultipleScattering fIonMultipleScattering;
G4ionIonisation fIonIonisation;
// Deuteron physics
G4MultipleScattering fDeuteronMultipleScattering;
G4hIonisation fDeuteronIonisation;
G4DeuteronInelasticProcess fDeuteronProcess;
G4LEDeuteronInelastic* fDeuteronModel;
// Triton physics
G4MultipleScattering fTritonMultipleScattering;
G4hIonisation fTritonIonisation;
G4TritonInelasticProcess fTritonProcess;
G4LETritonInelastic* fTritonModel;
// Alpha physics
G4MultipleScattering fAlphaMultipleScattering;
G4hIonisation fAlphaIonisation;
G4AlphaInelasticProcess fAlphaProcess;
G4LEAlphaInelastic* fAlphaModel;
// He3 physics
G4MultipleScattering fHe3MultipleScattering;
G4hIonisation fHe3Ionisation;
};
#endif

View File

@ -0,0 +1,227 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id$
// GEANT4 tag $Name$
//
//------------- G4MultipleScattering52 physics process --------------------------
// by Laszlo Urban, March 2001
//
// 07-08-01 new methods Store/Retrieve PhysicsTable
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 11-09-01 G4MultipleScatteringx put as default: G4MultipleScattering
// Store,Retrieve methods reactived (mma)
// 13-09-01 Unused TrueToGeomTransformation method deleted,
// class description (L.Urban)
// 19-09-01 come back to previous process name msc
// 17-04-02 NEW angle distribution + boundary algorithm modified, L.Urban
// 22-04-02 boundary algorithm modified -> important improvement in timing !!!!
// (L.Urban)
// 24-04-02 some minor changes in boundary algorithm, L.Urban
// 24-05-02 changes in data members, L.Urban
// 30-10-02 changes in data members, L.Urban
// 05-02-03 changes in data members, L.Urban
// 18-04-03 Change signature of GetTransportMeanFreePath (V.Ivanchenko)
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
// 08-11-04 Remove Store/Retrieve tables (V.Ivantchenko)
//------------------------------------------------------------------------------
// class description
//
// The class simulates the multiple scattering for any kind
// of charged particle.
//
// class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef LEMuSRMSC_h
#define LEMuSRMSC_h 1
#include "G4VContinuousDiscreteProcess.hh"
#include "G4EnergyLossTables.hh"
#include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ParticleChangeForMSC.hh"
#include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class LEMuSRMSC : public G4VContinuousDiscreteProcess
{
public: // with description
LEMuSRMSC(const G4String& processName="lemumsc");
~LEMuSRMSC();
G4bool IsApplicable ( const G4ParticleDefinition& );
// returns true for charged particles, false otherwise
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
// This function overloads the corresponding virtual function
// of the base class G4VContinuousDiscreteProcess.
// It is invoked by the G4ParticleWithCuts()::SetCut() method.
// It prepares the table of the transport mean free paths
// for every material.
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection);
// The function overloads the corresponding function of the base
// class.It limits the step near to boundaries only
// and invokes the method GetContinuousStepLimit at every step.
G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety);
// It performs the true step length --> geometrical step length
// transformation. It is invoked by the
// AlongStepGetPhysicalInteractionLength method.
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition);
// It sets the force condition to true only
// in order to have the PostStepDoIt called at every step.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4double GetTransportMeanFreePath(
G4double KineticEnergy,const G4MaterialCutsCouple* couple);
// Just a utility method to get the values of the transport
// mean free path . (It is not used inside the class.)
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,const G4Step& aStep);
// The geometrical step length --> true path length transformation
// is performed here (the inverse of the transformation done
// by GetContinuousStepLimit).
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,const G4Step& aStep);
// It computes the final state of the particle: samples the
// scattering angle and computes the lateral displacement.
// The final state is returned as a ParticleChange object.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
void Setsamplez(G4bool value) {samplez = value;};
// geom. step length distribution should be sampled or not
void Setdtrl(G4double value) {dtrl = value;};
// to reduce the energy/step dependence
void SetBoundary(G4bool value) {boundary = value;};
void Setfacxsi(G4double value) {facxsi = value;
G4cout << " facxsi=" << facxsi << G4endl;};
void SetFacrange(G4double val) {facrange=val;
nsmallstep = G4int(std::log((cf+facrange-1.)/
facrange)/std::log(cf))+1 ;
G4cout << " fr=" << facrange
<< " nsmall=" << nsmallstep << G4endl ;};
// Steplimit after boundary crossing = facrange*range
// estimated nb of steps at boundary nsmallstep = 1/facrange
void SetLateralDisplacementFlag(G4bool flag) {fLatDisplFlag = flag;};
// lateral displacement to be/not to be computed
void SetNuclCorrPar(G4double val) {NuclCorrPar = val;};
void SetFactPar(G4double val) {FactPar = val;};
protected: // with description
virtual G4double ComputeTransportCrossSection(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber,
G4double AtomicWeight);
// It computes the transport cross section.
// The transport mean free path is 1/(transport cross section).
private:
// hide assignment operator as private
LEMuSRMSC & operator = (const LEMuSRMSC &right);
LEMuSRMSC ( const LEMuSRMSC &);
private: // data members
G4PhysicsTable* theTransportMeanFreePathTable;
G4double taubig,tausmall,taulim;
G4double LowestKineticEnergy;
G4double HighestKineticEnergy;
G4int TotBin;
G4int materialIndex;
G4double tLast;
G4double zLast;
// model parameters
G4bool boundary; // spec. handling near boundaries
G4double facrange,tlimit,tlimitmin,cf;
G4int stepno,stepnolastmsc,nsmallstep ;
G4double laststep ;
G4GPILSelection valueGPILSelectionMSC;
G4double zmean; // z(geom.step length)
G4bool samplez ; // distribution
G4double range,T0,T1,lambda0,lambda1, // used to reduce the energy
Tlow,alam,blam,dtrl,lambdam, // (or step length) dependence
clam,zm,cthm;
// with/without lateral displacement
G4bool fLatDisplFlag;
// nuclear size effect correction
G4double NuclCorrPar;
G4double FactPar;
G4ParticleChangeForMSC fParticleChange;
G4double alfa1,alfa2,alfa3,b,xsi,c0,facxsi ; // angle distr. parameters
// facxsi : some tuning
// possibility in the tail
};
#include "LEMuSRMSC.icc"
#endif

View File

@ -0,0 +1,97 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id$
// GEANT4 tag $Name$
//
//------------ LEMuSRMSC physics process ---------------------------
// by Laszlo Urban, March 2001
//
// Modified:
//
// 18-05-01 V.Ivanchenko Clean up against Linux ANSI compilation
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 27-08-01 bugfix in AlongStepDoIt, L.Urban
// 28-08-01 GetContinuousStepLimit and AlongStepDoIt moved to .cc file (mma)
// 11-09-01 G4MultipleScatteringx put as default: G4MultipleScattering (mma)
// 15-01-03 Migrade to cut per region (V.Ivanchenko)
// 18-04-03 Change signature of GetTransportMeanFreePath (V.Ivanchenko)
// 16-06-03: ShortLived are not applicable any more (V.Ivanchenko)
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
//
//------------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4bool LEMuSRMSC::IsApplicable(const G4ParticleDefinition& particle)
{
return(particle.GetPDGCharge() != 0. && !particle.IsShortLived());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double LEMuSRMSC::AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection)
{
// get Step limit proposed by the process
G4double steplength = GetContinuousStepLimit(track,previousStepSize,
currentMinimumStep,currentSafety);
// set return value for G4GPILSelection
*selection = valueGPILSelectionMSC;
return steplength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double LEMuSRMSC::GetMeanFreePath(
const G4Track&,
G4double,
G4ForceCondition* condition)
// it does not limit the Step size , but it sets condition to
// Forced , because the PostStepDoIt always has to be called
{
*condition = Forced;
return DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double LEMuSRMSC::GetTransportMeanFreePath(G4double KineticEnergy,
const G4MaterialCutsCouple* couple)
{
G4bool isOut;
return (*theTransportMeanFreePathTable)
(couple->GetIndex())->GetValue(KineticEnergy,isOut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

View File

@ -0,0 +1,81 @@
#ifndef LEMuSRMUONIUM_h
#define LEMuSRMUONIUM_h 1
#include "G4VDiscreteProcess.hh"
#include "G4EnergyLossTables.hh"
#include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VParticleChange.hh"
#include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4ForceCondition.hh"
#include "G4ParticleTable.hh"
#include "G4DynamicParticle.hh"
#include "LEMuSRPrimaryGeneratorAction.hh"
#include "yields.h"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class LEMuSRMUONIUM : public G4VDiscreteProcess
{
public: // with description
LEMuSRMUONIUM(const G4String& name="Muformation" ,
G4ProcessType aType = fElectromagnetic );
~LEMuSRMUONIUM();
G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
);
G4bool CheckCondition( const G4Step& aStep);
G4bool CheckCondition( const G4Step* aStep);
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
void GetDatas( const G4Step* aStep);
// model parameters
G4ParticleTable* particleTable;
G4ParticleDefinition* particle;
Yields Gonin;
G4double yvector[3];
G4double rnd;
G4DynamicParticle *DP;
G4VParticleChange fParticleChange;
void PrepareSecondary(const G4Track&);
G4Track* aSecondary;
void InitializeSecondaries(const G4Track&);
};
#endif

View File

@ -0,0 +1,80 @@
#ifndef LEMuSRMUONIUMScatt_h
#define LEMuSRMUONIUMScatt_h 1
#include "G4VDiscreteProcess.hh"
#include "G4EnergyLossTables.hh"
#include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VParticleChange.hh"
#include "G4ParticleChange.hh"
#include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4ForceCondition.hh"
#include "G4ParticleTable.hh"
#include "G4DynamicParticle.hh"
#include "LEMuSRPrimaryGeneratorAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class LEMuSRMUONIUMScatt : public G4VDiscreteProcess
{
public: // with description
LEMuSRMUONIUMScatt(const G4String& name="Muscatt" ,
G4ProcessType aType = fGeneral );
~LEMuSRMUONIUMScatt();
G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition
);
G4bool CheckCondition( const G4Step& aStep);
G4bool CheckCondition( const G4Step* aStep);
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
void GetDatas( const G4Step* aStep);
// model parameters
G4ParticleTable* particleTable;
G4ParticleDefinition* particle;
G4double yvector[3];
G4double rnd;
G4DynamicParticle *DP;
G4ParticleChange fParticleChange;
void PrepareSecondary(const G4Track&);
G4Track* aSecondary;
void InitializeSecondaries(const G4Track&);
};
#endif

View File

@ -0,0 +1,77 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id$
// GEANT4 tag $Name$
//
//
// class G4Mag_SpinEqRhs
//
// Class description:
//
// This is the equation of motion for a particle with spin in a pure
// magnetic field. The three components of the particle's spin are
// treated utilising BMT equation.
// History:
// - Created: J.Apostolakis, P.Gumplinger - February 8th, 1999.
// --------------------------------------------------------------------
#ifndef LEMuSRMAG_SPIN_EQRHS
#define LEMuSRMAG_SPIN_EQRHS
#include "G4Types.hh"
#include "G4Mag_EqRhs.hh"
class G4MagneticField;
class LEMuSRMag_SpinEqRhs : public G4Mag_EqRhs
{
public: // with description
LEMuSRMag_SpinEqRhs( G4MagneticField* MagField );
~LEMuSRMag_SpinEqRhs();
// Constructor and destructor. No actions.
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass);
void EvaluateRhsGivenB( const G4double y[],
const G4double B[3],
G4double dydx[] ) const;
// Given the value of the magnetic field B, this function
// calculates the value of the derivative dydx.
private:
G4double omegac;
G4double anomaly;
G4double ParticleCharge;
G4double E;
G4double gamma;
G4double beta;
};
#endif /* LEMuSRMAG_SPIN_EQRHS */

View File

@ -0,0 +1,28 @@
#include "G4UniformMagField.hh"
#include"G4ThreeVector.hh"
#include"G4ios.hh"
class LEMuSRMagneticField : public G4UniformMagField
{
public:
LEMuSRMagneticField(const G4ThreeVector FieldVector);
~LEMuSRMagneticField();
void GetFieldValue(const G4double pos[4], G4double *field) const;
G4bool uniform;
G4double R;
private:
G4double flength, fpotential, fradius, fzmin, fzmax;
G4ThreeVector position;
G4ThreeVector BField;
};

View File

@ -0,0 +1,86 @@
#ifndef LEMuSRMcpHit_h
#define LEMuSRMcpHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class LEMuSRMcpHit : public G4VHit
{
public:
// contructor and destructor
LEMuSRMcpHit();
~LEMuSRMcpHit();
void Draw();
void Print();
void print(G4String name);
// operator for hit collector definition
LEMuSRMcpHit(const LEMuSRMcpHit &right);
const LEMuSRMcpHit& operator=(const LEMuSRMcpHit &right);
G4int operator==(const LEMuSRMcpHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
// private variables
private:
G4double energy_deposition, time_of_flight,spin;
G4ThreeVector position, momentum;
G4LogicalVolume* lv_Volume;
G4VPhysicalVolume* pv_Volume;
G4String particle_name;
// inline functions
public:
inline void SetEnergyDeposition(G4double ed){energy_deposition = ed;}
inline void AddEnergyDeposition(G4double ed){energy_deposition += ed;}
inline G4double GetEnergyDeposition(){return energy_deposition;}
inline void SetTimeOfFlight(G4double tf){ time_of_flight=tf;}
inline void AddTimeOfFlight(G4double tf){ time_of_flight+=tf;}
inline G4double GetTimeOfFlight(){return time_of_flight;}
inline void SetSpin(G4double sp){ spin=sp;}
inline G4double GetSpin(){return spin;}
inline void SetPosition(G4ThreeVector pos){position =pos;}
inline G4ThreeVector GetPosition(){return position;}
inline void SetMomentum(G4ThreeVector mom){momentum =mom;}
inline G4ThreeVector GetMomentum(){return momentum;}
inline void SetParticleName(G4String name){particle_name=name;}
inline G4String GetParticleName(){return particle_name;}
inline G4LogicalVolume* GetLogicalVolume(){return lv_Volume;}
inline G4VPhysicalVolume* GetPhysicalVolume(){return pv_Volume;}
};
// define the collection class according to template G4THitsCollection
typedef G4THitsCollection<LEMuSRMcpHit> LEMuSRMcpHitsCollection;
extern G4Allocator<LEMuSRMcpHit> LEMuSRMcpHitAllocator;
inline void* LEMuSRMcpHit :: operator new(size_t)
{
void *aHit;
aHit = (void*) LEMuSRMcpHitAllocator.MallocSingle();
return aHit;
}
inline void LEMuSRMcpHit :: operator delete(void *aHit)
{
LEMuSRMcpHitAllocator.FreeSingle((LEMuSRMcpHit*) aHit);
}
#endif

View File

@ -0,0 +1,90 @@
#ifndef LEMuSRMcpSD_h
#define LEMuSRMcpSD_h 1
#include "G4VSensitiveDetector.hh"
#include "LEMuSRMcpHit.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class LEMuSRMcpSD : public G4VSensitiveDetector
{
public:
LEMuSRMcpSD(G4String name);
~LEMuSRMcpSD();
void Initialize (G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*ROhist);
void EndOfEvent (G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
void BookRoot();
void FillRoot();
void WriteRoot();
TFile *myFile;
TTree *myTree;
TTree *tree;
// HIT datas
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
G4bool CheckCondition(const G4Step* aStep);
void GetDatas(const G4Step* aStep);
typedef struct
{
Float_t kenergy, tenergy, edeposit;
Float_t localtime, globaltime, proptime;
Float_t positionx, positiony,positionz;
Float_t momdirx,momdiry,momdirz, foil;
Int_t muon,positron,gamma, runid;
} mcpHit ;
mcpHit theHit;
void getHit();
private:
LEMuSRMcpHitsCollection *McpCollection;
G4double positionResolution;
G4int mu,e,g;
};
#endif

View File

@ -0,0 +1,82 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSRMuonDecayChannel.hh , v 1.0
// AUTHOR: Taofiq PARAISO based on G4MuonDecayChannel $Id$
// DATE : 2004-07-13 11:15
//
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// MUON DECAY CHANNEL.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§////
#ifndef LEMuSRMuonDecayChannel_h
#define LEMuSRMuonDecayChannel_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VDecayChannel.hh"
#include "G4DynamicParticle.hh"
#include "Randomize.hh"
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
class LEMuSRMuonDecayChannel : public G4VDecayChannel
{
// Class Decription
//
// To do list::
// Find muon polarization
// Compute the positron angle distribution
// Compute the positron energy as a function of angle distribution
// Remove G4MuonDecayChannel in decay table and add this new one
public:
//Constructors
LEMuSRMuonDecayChannel(const G4String& theParentName,
G4double theBR);
// Destructor
~LEMuSRMuonDecayChannel();
static LEMuSRMuonDecayChannel* pointer;
static LEMuSRMuonDecayChannel* GetInstance();
void finalize();
public: // With Description
virtual G4DecayProducts *DecayIt(G4double);
HepRandomEngine* theEngine;
G4ThreeVector emomdir;
G4double alpha,sinalpha, cosalpha, delta, sindelta, cosdelta;
G4double costheta, sintheta, phi, sinphi, cosphi, theta;
inline G4double GetTheta(){return theta;};
inline G4double GetPhi(){return phi;};
G4DecayProducts *DecayItPolarized(G4double,G4ThreeVector polar);
private:
};
#endif

View File

@ -0,0 +1,96 @@
// History
// first version 12 Nov. 2000 by H.Kurashige
// ------------------------------------------------------------
#ifndef LEMuSRMuonPhysics_h
#define LEMuSRMuonPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4MultipleScattering.hh"
#include "G4MultipleScattering52.hh"
#include "LEMuSRMSC.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4MuIonisation.hh"
#include "G4hIonisation.hh"
#include "G4MuonMinusCaptureAtRest.hh"
#include "G4DecayWithSpin.hh"
#include "G4MuonDecayChannel.hh"
#include "G4MuonDecayChannelWithSpin.hh"
#include "LEMuSRAtRestSpinRotation.hh"
#include "LEMuSRDecay.hh"
#include "LEMuSRMUONIUM.hh"
#include "LEMuSRDepolarize.hh"
#include "LEMuSRMUONIUMScatt.hh"
#include"G4VMuEnergyLoss.hh"
class LEMuSRMuonPhysics : public G4VPhysicsConstructor
{
public:
LEMuSRMuonPhysics(const G4String& name="muon");
virtual ~LEMuSRMuonPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Muon physics
G4MuIonisation fMuPlusIonisation;
G4MultipleScattering fMuoniumMultipleScattering;
LEMuSRMSC fMuPlusMultipleScattering;
G4MuBremsstrahlung fMuPlusBremsstrahlung ;
G4MuPairProduction fMuPlusPairProduction;
LEMuSRMUONIUMScatt fMuoniumScatt;
LEMuSRMUONIUM fMuFormation;
LEMuSRDepolarize fDepolarization;
G4MuIonisation fMuMinusIonisation;
G4MultipleScattering fMuMinusMultipleScattering;
G4MuBremsstrahlung fMuMinusBremsstrahlung ;
G4MuPairProduction fMuMinusPairProduction;
G4MuonMinusCaptureAtRest fMuMinusCaptureAtRest;
#ifdef ASYM_USE_LEMU
LEMuSRDecay fDecayProcess;
#else
G4Decay fDecayProcess;
G4DecayWithSpin fSDecayProcess;
#endif
LEMuSRAtRestSpinRotation fMuAtRestSpinRotation;
// Tau physics
G4MultipleScattering fTauPlusMultipleScattering;
G4hIonisation fTauPlusIonisation;
G4MultipleScattering fTauMinusMultipleScattering;
G4hIonisation fTauMinusIonisation;
};
#endif

View File

@ -0,0 +1,85 @@
#ifndef LEMuSROScintHit_h
#define LEMuSROScintHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class LEMuSROScintHit : public G4VHit
{
public:
// contructor and destructor
LEMuSROScintHit();
~LEMuSROScintHit();
void Draw();
void Print();
void print(G4String name);
// operator for hit collector definition
LEMuSROScintHit(const LEMuSROScintHit &right);
const LEMuSROScintHit& operator=(const LEMuSROScintHit &right);
G4int operator==(const LEMuSROScintHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
// private variables
private:
G4double energy_deposition, time_of_flight,spin;
G4ThreeVector position, momentum;
G4LogicalVolume* lv_Volume;
G4VPhysicalVolume* pv_Volume;
G4String particle_name;
// inline functions
public:
inline void SetEnergyDeposition(G4double ed){energy_deposition = ed;}
inline void AddEnergyDeposition(G4double ed){energy_deposition += ed;}
inline G4double GetEnergyDeposition(){return energy_deposition;}
inline void SetTimeOfFlight(G4double tf){ time_of_flight=tf;}
inline void AddTimeOfFlight(G4double tf){ time_of_flight+=tf;}
inline G4double GetTimeOfFlight(){return time_of_flight;}
inline void SetSpin(G4double sp){ spin=sp;}
inline G4double GetSpin(){return spin;}
inline void SetPosition(G4ThreeVector pos){position =pos;}
inline G4ThreeVector GetPosition(){return position;}
inline void SetMomentum(G4ThreeVector mom){momentum =mom;}
inline G4ThreeVector GetMomentum(){return momentum;}
inline void SetParticleName(G4String name){particle_name=name;}
inline G4String GetParticleName(){return particle_name;}
inline G4LogicalVolume* GetLogicalVolume(){return lv_Volume;}
inline G4VPhysicalVolume* GetPhysicalVolume(){return pv_Volume;}
};
// define the collection class according to template G4THitsCollection
typedef G4THitsCollection<LEMuSROScintHit> LEMuSROScintHitsCollection;
extern G4Allocator<LEMuSROScintHit> LEMuSROScintHitAllocator;
inline void* LEMuSROScintHit :: operator new(size_t)
{
void *aHit;
aHit = (void*) LEMuSROScintHitAllocator.MallocSingle();
return aHit;
}
inline void LEMuSROScintHit :: operator delete(void *aHit)
{
LEMuSROScintHitAllocator.FreeSingle((LEMuSROScintHit*) aHit);
}
#endif

View File

@ -0,0 +1,86 @@
#ifndef LEMuSROScintSD_h
#define LEMuSROScintSD_h 1
#include "G4VSensitiveDetector.hh"
#include "LEMuSROScintHit.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class LEMuSROScintSD : public G4VSensitiveDetector
{
public:
LEMuSROScintSD(G4String name);
~LEMuSROScintSD();
void Initialize (G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*ROhist);
void EndOfEvent (G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
void BookRoot();
void FillRoot();
void WriteRoot();
TFile *myFile;
TTree *myTree;
TTree *tree;
// HIT datas
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom;
G4int ID;
G4bool condition;
G4bool CheckCondition(const G4Step* aStep);
void GetDatas(const G4Step* aStep);
typedef struct
{
Float_t kenergy, tenergy, edeposit;
Float_t localtime, globaltime, proptime;
Float_t positionx, positiony,positionz;
Float_t momdirx,momdiry,momdirz;
Float_t scLeft, scRight, scBottom, scTop ;
Int_t runID;
} scintHit ;
scintHit theHit;
void getHit();
private:
LEMuSROScintHitsCollection *ScintCollection;
G4double positionResolution;
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef LEMuSRParticleChangeForSR_h
#define LEMuSRParticleChangeForSR_h 1
#include "G4ParticleChangeForTransport.hh"
class LEMuSRParticleChangeForSR : public G4ParticleChangeForTransport
{
G4Step* UpdateStepForAtRest(G4Step* Step);
public:
G4double theDecayTime;
inline void SetDecayTime(G4double fDecayTime) { theDecayTime = fDecayTime; }
inline G4double GetDecayTime() { return theDecayTime; }
};
#endif

View File

@ -0,0 +1,34 @@
#ifndef LEMuSRParticleGun_h
#define LEMuSRParticleGun_h 1
#include "G4ParticleGun.hh"
#include "G4Event.hh"
#include "G4PrimaryParticle.hh"
class LEMuSRParticleGunMessenger;
#include"G4ParticleGunMessenger.hh"
class LEMuSRParticleGun: public G4ParticleGun
{
public:
LEMuSRParticleGun();
~LEMuSRParticleGun();
void GeneratePrimaryVertex(G4Event* evt);
inline void SetDecayTime(G4double d) {decaytime = d;}
G4double decaytime;
protected:
void SetInitialValues();
private:
LEMuSRParticleGunMessenger* theMessenger;
G4ParticleGunMessenger* Messenger;
};
#endif

View File

@ -0,0 +1,59 @@
#ifndef LEMUSRPARTICLEGUNMESSENGER
#define LEMUSRPARTICLEGUNMESSENGER
class LEMuSRParticleGun;
class G4ParticleTable;
class G4UIcommand;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3Vector;
class G4UIcmdWith3VectorAndUnit;
class G4UIcmdWithAnInteger;
#include "G4UImessenger.hh"
#include "globals.hh"
class LEMuSRParticleGunMessenger : public G4UImessenger
{
public:
LEMuSRParticleGunMessenger(LEMuSRParticleGun* gun);
~LEMuSRParticleGunMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
void IonCommand(G4String newValues);
private:
LEMuSRParticleGun* fParticleGun;
G4ParticleTable * particleTable;
private: //commands
G4UIdirectory * gunDirectory;
G4UIcmdWithoutParameter * listCmd;
G4UIcmdWithAString * particleCmd;
G4UIcmdWith3Vector * directionCmd;
G4UIcmdWithADoubleAndUnit * energyCmd;
G4UIcmdWith3VectorAndUnit * positionCmd;
G4UIcmdWithADoubleAndUnit * timeCmd;
G4UIcmdWith3Vector * polCmd;
G4UIcmdWithAnInteger * numberCmd;
G4UIcommand * ionCmd;
private: // for ion shooting
G4bool fShootIon;
G4int fAtomicNumber;
G4int fAtomicMass;
G4int fIonCharge;
G4double fIonExciteEnergy;
};
#endif

View File

@ -0,0 +1,67 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : LEMuSRPgaMessenger.cc , v 1.2
// AUTHOR: Taofiq PARAISO
// DATE : 2004-09-16 09:12
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// PRIMARY GENERATOR ACTION MESSENGER
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMUSRPGAMESSENGER_H
#define LEMUSRPGAMESSENGER_H 1
class LEMuSRPrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithADouble;
class G4UIcmdWith3Vector;
class G4UIcmdWith3VectorAndUnit;
class G4UIcmdWithAnInteger;
#include "G4UImessenger.hh"
#include "globals.hh"
class LEMuSRPgaMessenger: public G4UImessenger
{
public:
LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction* thPGA);
~LEMuSRPgaMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
private:
LEMuSRPrimaryGeneratorAction * lemuPGA;
private: //commands
G4UIdirectory * pgaDirectory;
G4UIcmdWithAString *setRndEnergy;
G4UIcmdWithAString *setMuonium;
G4UIcmdWithoutParameter *reset;
G4UIcmdWith3Vector *posCmd, *momCmd, *scaCmd, *scbCmd, *scgCmd, *setEGauss;
G4UIcmdWithADouble *setEnergy;
G4UIcmdWithADouble *setKEoffset;
G4UIcmdWithADouble *setCharge;
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef LEMuSRPhysicsList_h
#define LEMuSRPhysicsList_h 1
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
class LEMuSRPhysicsList: public G4VModularPhysicsList
{
public:
LEMuSRPhysicsList();
virtual ~LEMuSRPhysicsList();
public:
// SetCuts()
virtual void SetCuts();
};
#endif

View File

@ -0,0 +1,99 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : LEMuSRPrimaryGeneratorAction.hh , v 1.3
// AUTHOR: Taofiq PARAISO
// DATE : 2004-09-16 09:12
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// PRIMARY GENERATOR ACTION
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMuSRPrimaryGeneratorAction_h
#define LEMuSRPrimaryGeneratorAction_h 1
// G4 LIBRARIES
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "LEMuSRParticleGun.hh"
#include "G4Event.hh"
#include "Randomize.hh"
#include "G4ParticleGun.hh"
#include "LEMuSRPgaMessenger.hh"
#include <iomanip>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <ios>
// G4 CLASSES
//class G4RandGauss;
class G4ParticleGun;
class LEMuSRParticleGun;
class G4Event;
// LEMuSRPrimaryGeneratorAction CLASS DEFINITION
class LEMuSRPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
// Constructor & Destructor
public:
LEMuSRPrimaryGeneratorAction();
~LEMuSRPrimaryGeneratorAction();
static LEMuSRPrimaryGeneratorAction* thePGA;
static LEMuSRPrimaryGeneratorAction* GetPGA();
// Event generation method
void GeneratePrimaries(G4Event* anEvent);
void GetScanningMode(G4int scan_mode);
private:
LEMuSRParticleGun* lemuParticleGun;
public:
double rndenergy;
G4double decaytime, energy;
HepRandomEngine * theEngine;
G4double X, Y, Z,momX, momY, momZ, m_xrange, m_yrange;
G4int m_counterx, m_nbxsteps, m_countery, m_nbysteps, scan, gauss;
G4double radius, angle, mean, stddev, sc_mean, sc_stddev;
G4double circ;
G4bool rnd;
LEMuSRPgaMessenger* messenger;
G4double charge, ke_offset;
G4String pname;
//===============================
std::ofstream Yprint;
double table[1000];
int i,j;
};
#endif

View File

@ -0,0 +1,30 @@
#include "G4UniformMagField.hh"
#include"G4ThreeVector.hh"
#include"G4ios.hh"
class LEMuSRRNDMAGField : public G4UniformMagField
{
public:
LEMuSRRNDMAGField(const G4ThreeVector FieldVector, G4double randomness);
~LEMuSRRNDMAGField();
void GetFieldValue(const G4double pos[4], G4double *field) const;
G4bool uniform;
G4double R;
G4double randomness;
private:
G4double flength, fpotential, fradius, fzmin, fzmax;
G4ThreeVector position;
G4ThreeVector BField;
};

View File

@ -0,0 +1,61 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSRRunAction.hh , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-07-07 11:15
//
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// RUN ACTION.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMuSRRunAction_h
#define LEMuSRRunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
#include "G4ParticleGun.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Run;
class LEMuSRRunAction : public G4UserRunAction
{
public:
LEMuSRRunAction();
~LEMuSRRunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
};
#endif

View File

@ -0,0 +1,85 @@
#ifndef LEMuSRScintHit_h
#define LEMuSRScintHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
class LEMuSRScintHit : public G4VHit
{
public:
// contructor and destructor
LEMuSRScintHit();
~LEMuSRScintHit();
void Draw();
void Print();
void print(G4String name);
// operator for hit collector definition
LEMuSRScintHit(const LEMuSRScintHit &right);
const LEMuSRScintHit& operator=(const LEMuSRScintHit &right);
G4int operator==(const LEMuSRScintHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
// private variables
private:
G4double energy_deposition, time_of_flight, spin, kenergy, tenergy;
G4ThreeVector position, momentum;
G4LogicalVolume* lv_Volume;
G4VPhysicalVolume* pv_Volume;
G4String particle_name;
// inline functions
public:
inline void SetEnergyDeposition(G4double ed){energy_deposition = ed;}
inline void AddEnergyDeposition(G4double ed){energy_deposition += ed;}
inline G4double GetEnergyDeposition(){return energy_deposition;}
inline void SetTimeOfFlight(G4double tf){ time_of_flight=tf;}
inline void AddTimeOfFlight(G4double tf){ time_of_flight+=tf;}
inline G4double GetTimeOfFlight(){return time_of_flight;}
inline void SetSpin(G4double sp){ spin=sp;}
inline G4double GetSpin(){return spin;}
inline void SetPosition(G4ThreeVector pos){position=pos;}
inline G4ThreeVector GetPosition(){return position;}
inline void SetMomentum(G4ThreeVector mom){momentum=mom;}
inline G4ThreeVector GetMomentum(){return momentum;}
inline void SetParticleName(G4String name){particle_name=name;}
inline G4String GetParticleName(){return particle_name;}
inline G4LogicalVolume* GetLogicalVolume(){return lv_Volume;}
inline G4VPhysicalVolume* GetPhysicalVolume(){return pv_Volume;}
};
// define the collection class according to template G4THitsCollection
typedef G4THitsCollection<LEMuSRScintHit> LEMuSRScintHitsCollection;
extern G4Allocator<LEMuSRScintHit> LEMuSRScintHitAllocator;
inline void* LEMuSRScintHit :: operator new(size_t)
{
void *aHit;
aHit = (void*) LEMuSRScintHitAllocator.MallocSingle();
return aHit;
}
inline void LEMuSRScintHit :: operator delete(void *aHit)
{
LEMuSRScintHitAllocator.FreeSingle((LEMuSRScintHit*) aHit);
}
#endif

View File

@ -0,0 +1,89 @@
#ifndef LEMuSRScintSD_h
#define LEMuSRScintSD_h 1
#include "G4VSensitiveDetector.hh"
#include "LEMuSRScintHit.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
#include "G4PrimaryParticle.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class LEMuSRScintSD : public G4VSensitiveDetector
{
public:
LEMuSRScintSD(G4String name);
~LEMuSRScintSD();
void Initialize (G4HCofThisEvent* HCE);
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*ROhist);
void EndOfEvent (G4HCofThisEvent* HCE);
void clear();
void DrawAll();
void PrintAll();
void BookRoot();
void FillRoot();
void WriteRoot();
TFile *myFile;
TTree *myTree;
TTree *tree;
// HIT datas
G4String p_name, vname;
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
G4ThreeVector hitpos, hitmom,hitvertex;
G4int scintID, runID;
G4double parentCharge;
G4bool condition;
G4bool CheckCondition(const G4Step* aStep);
void GetDatas(const G4Step* aStep);
typedef struct
{
Float_t kenergy, tenergy, edeposit;
Float_t localtime, globaltime, proptime;
Float_t positionx, positiony,positionz;
Float_t momdirx,momdiry,momdirz;
Float_t ipositionx, ipositiony,ipositionz;
Float_t scLeft, scRight, scBottom, scTop ;
Int_t runID;
Float_t motherCharge;
} scintHit ;
scintHit theHit;
void getHit();
private:
LEMuSRScintHitsCollection *ScintCollection;
G4double positionResolution;
};
#endif

View File

@ -0,0 +1,75 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSRStackingAction.hh , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-07-07 11:15
//
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// STACKING ACTION.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMuSRStackingAction_H
#define LEMuSRStackingAction_H 1
#include "globals.hh"
#include "G4UserStackingAction.hh"
#include "G4ThreeVector.hh"
class G4Track;
#include "LEMuSRScintHit.hh"
class LEMuSRStackingActionMessenger;
class LEMuSRStackingAction : public G4UserStackingAction
{
public:
LEMuSRStackingAction();
virtual ~LEMuSRStackingAction();
public:
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
private:
// G4bool InsideRoI(const G4Track * aTrack,G4double ang);
G4VHitsCollection* GetCollection(G4String colName);
LEMuSRScintHitsCollection* ScintHits;
LEMuSRStackingActionMessenger* theMessenger;
G4int stage;
/* G4int reqMuon;
G4int reqIsoMuon;
G4int reqIso;
G4double angRoI;
*/
public:
/* inline void SetNRequestMuon(G4int val) { reqMuon = val; }
inline G4int GetNRequestMuon() const { return reqMuon; }
inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; }
inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; }
inline void SetNIsolation(G4int val) { reqIso = val; }
inline G4int GetNIsolation() const { return reqIso; }
inline void SetRoIAngle(G4double val) { angRoI = val; }
inline G4double GetRoIAngle() const { return angRoI; }
*/
};
#endif

View File

@ -0,0 +1,35 @@
#ifndef LEMuSRStackingActionMessenger_h
#define LEMuSRStackingActionMessenger_h 1
class LEMuSRStackingAction;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
#include "G4UImessenger.hh"
#include "globals.hh"
class LEMuSRStackingActionMessenger: public G4UImessenger
{
public:
LEMuSRStackingActionMessenger(LEMuSRStackingAction* msa);
~LEMuSRStackingActionMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
LEMuSRStackingAction * myAction;
private: //commands
/* G4UIcmdWithAnInteger * muonCmd;
G4UIcmdWithAnInteger * isomuonCmd;
G4UIcmdWithAnInteger * isoCmd;
G4UIcmdWithADoubleAndUnit * roiCmd;
*/
};
#endif

View File

@ -0,0 +1,59 @@
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSRSteppingAction.hh , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-07-07 11:15
//
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// STEPPING ACTION.HH
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef LEMuSRSteppingAction_h
#define LEMuSRSteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include <fstream.h>
#include "LEMuSRVisManager.hh"
#include "LEMuSRDetectorConstruction.hh"
class LEMuSRSteppingAction : public G4UserSteppingAction
{
public:
static LEMuSRSteppingAction* GetInstance();
LEMuSRSteppingAction() ;
~LEMuSRSteppingAction() ;
void UserSteppingAction(const G4Step *theStep);
void FieldInfo(const G4Step *theStep);
void ParticleInfo(const G4Step *theStep);
void LoopKiller(const G4Step *theStep);
private:
static LEMuSRSteppingAction* pointer;
G4int loop;
};
#endif

View File

@ -0,0 +1,11 @@
#include "G4Track.hh"
#include "G4DynamicParticle.hh"
class LEMuSRTrack : public G4Track
{
public:
void SetDynamicParticle(G4DynamicParticle );
};

View File

@ -0,0 +1,48 @@
#ifndef LEMuSRTrackingAction_h
#define LEMuSRTrackingAction_h 1
#include "G4DynamicParticle.hh"
#include "G4UserTrackingAction.hh"
#include "G4Track.hh"
#include "globals.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
#include "LEMuSRCryoHit.hh"
class LEMuSRTrackingAction : public G4UserTrackingAction {
public:
LEMuSRTrackingAction();
~ LEMuSRTrackingAction();
void PreUserTrackingAction(const G4Track*);
void PostUserTrackingAction(const G4Track*);
void Collect_datas(const G4Track*);
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b;
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
private:
};
#endif

View File

@ -0,0 +1,27 @@
#ifndef LEMuSRVisManager_h
#define LEMuSRVisManager_h 1
#ifdef G4VIS_USE
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class LEMuSRVisManager: public G4VisManager {
public:
LEMuSRVisManager ();
~LEMuSRVisManager ();
private:
void RegisterGraphicsSystems ();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif

View File

@ -0,0 +1,49 @@
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "globals.hh"
#include "G4VUserPhysicsList.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4MultipleScattering.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4MuIonisation.hh"
#include "G4DecayWithSpin.hh"
class PhysicsList: public G4VUserPhysicsList
{
public:
PhysicsList();
~PhysicsList();
protected:
// Construct particle and physics process
void ConstructParticle();
void ConstructProcess();
void SetCuts();
private:
G4DecayWithSpin* theDecayProcess;
G4MuIonisation* theMuPlusIonisation;
G4MultipleScattering* theMuPlusMultipleScattering;
G4MuBremsstrahlung* theMuPlusBremsstrahlung ;
G4MuPairProduction* theMuPlusPairProduction;
G4MuIonisation* theMuMinusIonisation;
G4MultipleScattering* theMuMinusMultipleScattering;
G4MuBremsstrahlung* theMuMinusBremsstrahlung ;
G4MuPairProduction* theMuMinusPairProduction;
};
#endif

View File

@ -0,0 +1,128 @@
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
//
// ID : TDCheck.hh , v 1.2
// AUTHOR: Taofiq PARAISO
// DATE : 2005-03-01 10:11
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// TDCHECK
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//
#ifndef TDCheck_h
#define TDCheck_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
#include <fstream.h>
#include "LEMuSRVisManager.hh"
#include "LEMuSRDetectorConstruction.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
// root histogram classes
#include <stdlib.h>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TRandom.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"
#include "TStopwatch.h"
class TDCheck : public G4UserSteppingAction
{
public:
static TDCheck* GetInstance();
TDCheck() ;
~TDCheck() ;
void UserSteppingAction(const G4Step *theStep);
void SetParticleVolumeNames(const G4Step *theStep);
void SetPositionMomentum(const G4Step *theStep);
void SetTimeEnergy(const G4Step *theStep);
G4bool CheckCondition(const G4Step* aStep);
G4String p_name, v_name, pv_name, previousv_name, nextv_name;
G4ThreeVector position,momentum,momentum_direction, polarization, m, parpol, p;
G4double kenergy, tenergy, localtime, globaltime, proptime, fx, fy, fz, oldz, thk_old;
G4int id, old_id, index;
G4double theta,sintheta, costheta, phi, sinphi, cosphi;
void LoopKiller(const G4Step*aStep);
G4int loop;
typedef struct {
Float_t ienergy,tenergy, localtime, globaltime, proptime;
Float_t positionx, positiony,positionz,momdirx,momdiry,momdirz;
Float_t angle;
Int_t index;
Float_t thickness;
Int_t id, charge;
} LEMuSRparticle ;
LEMuSRparticle muon;
void Update();
void BookRoot();
void FillRoot();
void WriteRoot();
// TROOT eventTree;
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
TFile *myFile;
TTree *myTree;
TBranch *b,*b2;
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
TTree *tree;
TFile* F;
TTree *dt;
Float_t time;
G4double L,R,A;
private:
static TDCheck* pointer;
};
#endif

View File

@ -0,0 +1,27 @@
#ifndef meyer_h
#define meyer_h 1
#include <iomanip>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <ios>
#include "globals.hh"
class meyer
{
public:
meyer();
~meyer();
void GFunctions(double*, double*, double);
void Get_F_Function_Meyer(double tau, double Ekin, double Z1, double Z2, double m1, double m2);
void F_Functions_Meyer( double tau,double thetaSchlange,double *f1,double *f2);
void Get_F_Function(double tau,double theta, double Ekin, double Z1, double Z2, double m1, double m2, double* F);
};
#endif

View File

@ -0,0 +1,28 @@
#ifndef Yields_h
#define Yield_h 1
#include "globals.hh"
class Yields
{
public:
//constructor
Yields();
//destructor
~Yields();
void GetYields(double E, double masse, double yvector[]);
private:
// VARIABLES
double Q_zero,Q_minus,D;
double Yield_minus,Yield_zero,Yield_plus;
double help1,help2,help3;
};
#endif