Moved Tao's code to TaoLEMuSR.
This commit is contained in:
@ -1,156 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : AsymCheck.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// ASYMCHECK
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#ifndef AsymCheck_h
|
||||
#define AsymCheck_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "globals.hh"
|
||||
#include <fstream>
|
||||
#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
|
@ -1,138 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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>
|
||||
#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
|
@ -1,132 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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>
|
||||
#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
|
@ -1,57 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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
|
@ -1,69 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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
|
@ -1,45 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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
|
@ -1,161 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRAtRestSpinRotation.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 16:15
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// AT REST SPIN ROTATION
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*The LEMuSRAtRestSpinRotation class contains the implementation of the muon spin
|
||||
*precession in a magnetic field when the muon is at rest.
|
||||
*
|
||||
*To implement a process one should create a particle change object.
|
||||
*
|
||||
*Indeed, in Geant4, a process is simply the change of an old particle to a new
|
||||
*one. Hence, this spin rotation process will just replace the muon by another
|
||||
*one with spin rotated, but same parameters of time, position, etc.
|
||||
*
|
||||
*The particle change object registers all the parameters of the new particle,
|
||||
*like the change in time, the momentum direction, the position, the polarization but also
|
||||
*the type of the particle, which can be changed also as in the muonium formation
|
||||
*process (cf.LEMuSRMUONIUM ).
|
||||
*
|
||||
*At each step of a track Geant4 we check the list possible processes to excecute
|
||||
*(cf. LEMuSRPhysicsList) and will select them according to the priority which was
|
||||
*given by the user and to the state of the particle. Indeed, the user should
|
||||
*indicate if the process should be ran at rest, before and/or after the step.
|
||||
*
|
||||
*
|
||||
*Some processes can be implemented such that the behaviour in different in those
|
||||
*three different cases.
|
||||
*
|
||||
*Hence the class G4VProcess contains three important virtual methods:
|
||||
* -# PreStepDoIt()
|
||||
* -# PostStepDoIt()
|
||||
* -# AtRestDoIt()
|
||||
* .
|
||||
*In the present implementation, we only use the AtRestDoIt() method.
|
||||
*/
|
||||
|
||||
|
||||
#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"
|
||||
#include "G4EventManager.hh"
|
||||
|
||||
/*!
|
||||
* This class is a public class of the G4VRestProcess class,
|
||||
* which contains virtual methods to execute a process when a particle
|
||||
* is at rest.
|
||||
*/
|
||||
class LEMuSRAtRestSpinRotation : public G4VRestProcess
|
||||
{
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//! The constructor specifies the process name.
|
||||
LEMuSRAtRestSpinRotation(const G4String& processName = "SpinRotationAtRest" );
|
||||
LEMuSRAtRestSpinRotation(G4VRestProcess& );
|
||||
|
||||
virtual ~LEMuSRAtRestSpinRotation();
|
||||
|
||||
//! Method to return a pointer to the spin rotation process instance.
|
||||
static LEMuSRAtRestSpinRotation* GetInstance();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! The pointer to the process
|
||||
/**
|
||||
One can use it to communicate with the process and get information about different parameters
|
||||
*/
|
||||
static LEMuSRAtRestSpinRotation* pointer;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//!The main method to execute the spin precession process.
|
||||
G4VParticleChange* AtRestDoIt(const G4Track& theTrack, const G4Step& theStep);
|
||||
|
||||
|
||||
G4double
|
||||
//! The muon position-time is given to the method GetFieldValue in order to get the magnetic field vector.
|
||||
point[4];
|
||||
G4double
|
||||
//! The magnetic field vector at the point[4] position.
|
||||
B[3],
|
||||
//! The rotation frequency
|
||||
fqz,
|
||||
//! The spin rotation angle computed in the RotateSpin method
|
||||
rotation_angle;
|
||||
|
||||
G4double
|
||||
//! The initial time.
|
||||
itime,
|
||||
//! The final time.
|
||||
ftime,
|
||||
//! The time variation.
|
||||
deltatime;
|
||||
|
||||
|
||||
G4ThreeVector SpinDirection;
|
||||
|
||||
//! The particle change object which stores all the proposed modification of the particle's state.
|
||||
LEMuSRParticleChangeForSR theParticleChange;
|
||||
|
||||
|
||||
const G4Field *mfield;
|
||||
|
||||
|
||||
|
||||
void RotateSpin(const G4Step&, G4ThreeVector, G4double);
|
||||
//! Returns the precession frequency according to the particle:
|
||||
/*!
|
||||
*- For muons and all other particles \f$ \gamma= 8.5062e+7*rad/(s*kGauss)\f$
|
||||
*- For muonium \f$ \gamma=*rad/(s*kGauss) \f$
|
||||
*/
|
||||
G4double GetGyromagneticRatio();
|
||||
|
||||
inline G4double GetMeanLifeTime(const G4Track&, G4ForceCondition* condition)
|
||||
{
|
||||
*condition = Forced;
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
/*! The particle's polarization vector.*/
|
||||
G4ThreeVector polar;
|
||||
|
||||
|
||||
|
||||
};
|
||||
#endif
|
@ -1,63 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRCryoField.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// CRYOFIELD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#include "G4ElectricField.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4ios.hh"
|
||||
/*!
|
||||
* This class is defines homogenous electric field in the cryostat region.
|
||||
* It is obsolete since a field map has been introduces for this region.
|
||||
* Should be removed in the future.
|
||||
*/
|
||||
|
||||
class LEMuSRCryoField : public G4ElectricField
|
||||
{
|
||||
public:
|
||||
|
||||
/*! This constructor initializes the field for all the sample chamber
|
||||
*/
|
||||
LEMuSRCryoField(G4ThreeVector FieldVector);
|
||||
/*! The constructor initializes the field within the boundary cylinder centered in mcpv_z, radius and length= zmax-zmin
|
||||
*/
|
||||
|
||||
LEMuSRCryoField(G4ThreeVector FieldVector,G4double radius,G4double zmin, G4double zmax);
|
||||
~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;
|
||||
|
||||
};
|
@ -1,122 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRCryoHit.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// CRYOHIT
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
|
||||
|
||||
#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"
|
||||
|
||||
|
||||
/**
|
||||
*The LEMuSRCryoHit class defines the Hit object for the Sample Plate. A hit is an elementary
|
||||
*component for the sensitive detection. As soon as particle enters in the specified
|
||||
*volume, a hit object is created and will store any parameter the user wants to
|
||||
*consider.
|
||||
*The hit can then be plotted, printed or registered in a hit collection for further histogramming.
|
||||
*
|
||||
*However, it is not necessary to use hits objects since histograms can be filled
|
||||
*directly from the sensitive detector classes (cf. LEMuSRCryoSD.cc).
|
||||
*
|
||||
*/
|
||||
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
|
@ -1,186 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRCryoSD.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// CRYOSD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef LEMuSRCryoSD_h
|
||||
#define LEMuSRCryoSD_h 1
|
||||
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "LEMuSRCryoHit.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Run.hh"
|
||||
|
||||
//! Root histogramming 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;
|
||||
|
||||
|
||||
/**
|
||||
*The sensitive detector classes are the most important to simulate the data acquisition.
|
||||
*The sensitive detector object is attached to the detector in LEMuSRDetectorConstruction.
|
||||
*
|
||||
*During the particle transportation, geant4 will check if the volume where the particle
|
||||
*travels is a sensitive detector (cf. G4Transportation). If this is the case, the method
|
||||
*ProcessHits will be executed.
|
||||
*
|
||||
*In the geant4 standard, the ProcessHit method would create a hit object, fill it with
|
||||
*desired parameters and send it to the corresponding hits collection for histogramming.
|
||||
*
|
||||
*This implementationof the \lemu simulation uses Root for histogramming, and therefore the hit object are not used.
|
||||
*Instead of filling a collection, we directly fill a Root tree with all the data we want.
|
||||
*A new hit structutre has been implemented according to Root format.
|
||||
*/
|
||||
|
||||
class LEMuSRCryoSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
//! The constructor specifies the name.
|
||||
LEMuSRCryoSD(G4String name);
|
||||
~LEMuSRCryoSD();
|
||||
|
||||
//!Initialization of the sensitive detector
|
||||
void Initialize (G4HCofThisEvent* HCE);
|
||||
|
||||
//! The main method for sensitive detection.
|
||||
/*!
|
||||
* This method contains all the operations to perform when a particle is detected in the volume. Note that it is called at each step, which is very important because a single particle can make many hits. For some detectors it is important to detect a particle only once (to avoid multiple counts in histograms).
|
||||
* The CheckCondition method (see later) can be used to segregate unwanted hits. For any good event, the following methods are executed:
|
||||
* -# GetDatas() : to store the parameters.
|
||||
* -# getHit() : to fill the Root hit object with the previous parameters.
|
||||
* -# FillRoot() : to fill the Root tree with the Root hit object.
|
||||
*/
|
||||
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*ROhist);
|
||||
void EndOfEvent (G4HCofThisEvent* HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
//! Root method to book a tree.
|
||||
void BookRoot();
|
||||
|
||||
//! Root method to fill a tree.
|
||||
void FillRoot();
|
||||
|
||||
//! Root method to write a tree in a file.
|
||||
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;
|
||||
|
||||
//! Boolean variable set by the CheckCondition method. If condition=true, the hit will be stored in the Root tree.
|
||||
G4bool condition;
|
||||
|
||||
//! Events segregation.
|
||||
/*!
|
||||
* The CheckCondition method is the first called by the ProcessHit method. It will check if the step information should be stored or not. Here, the step is registered when the following conditions are fulfilled:
|
||||
* - The particle is a muon or a muonium
|
||||
* - The particle is in the Sample Holder2 (lv_SAH2, cf. LEMuSRDetectorConstruction.cc)
|
||||
*/
|
||||
G4bool CheckCondition(const G4Step* aStep);
|
||||
|
||||
|
||||
//! Obtaining data on the particle.
|
||||
/*!
|
||||
* The GetDatas() method take useful data from the step:
|
||||
* - Volume, name, spin
|
||||
* - Position, momentum
|
||||
* - Time
|
||||
* - Energy
|
||||
* .
|
||||
* Those data are taken in G4 format i.e. with units.
|
||||
*/
|
||||
void GetDatas(const G4Step* aStep);
|
||||
|
||||
//! The Root Hit Structure.
|
||||
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 ;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
Int_t muon,positron,gamma, runid;
|
||||
|
||||
} particleHit ;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Int_t grid, guards, mcp, cryo;
|
||||
Float_t RAL, RAR, L3, TDet1, TDet2, TDet3;
|
||||
Float_t Bmag;
|
||||
} detectorData ;
|
||||
|
||||
//! Root hit object.
|
||||
cryoHit theHit;
|
||||
particleHit theParticle;
|
||||
detectorData detector;
|
||||
|
||||
|
||||
//! Filling the Root hit object.
|
||||
/*!
|
||||
* The getHit() method fills the Root hit object theHit with the data taken in the GetDatas method. As root do not handle units, the user must specify them explicitely. Otherwise, the default \gf units are used.
|
||||
*/
|
||||
void getHit();
|
||||
|
||||
private:
|
||||
LEMuSRCryoHitsCollection *CryoCollection;
|
||||
|
||||
G4double positionResolution;
|
||||
G4int mu,e,g;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,20 +0,0 @@
|
||||
#ifndef LEMuSRCylVector_h
|
||||
#define LEMuSRCylVector_h 1
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
class LEMuSRCylVector : public G4ThreeVector
|
||||
{
|
||||
public:
|
||||
LEMuSRCylVector();
|
||||
LEMuSRCylVector(){;}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,63 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRDecay.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// LEMUSRDECAY
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
||||
|
||||
//! The main method for the decay process.
|
||||
/*!
|
||||
* The DecayIt() method returns by pointer a particle-change object,
|
||||
* which has information of daughter particles.
|
||||
*/
|
||||
|
||||
virtual G4VParticleChange* DecayIt(
|
||||
const G4Track& aTrack,
|
||||
const G4Step& aStep
|
||||
);
|
||||
|
||||
//! The particle change object.
|
||||
G4ParticleChangeForDecay pParticleChangeForDecay;
|
||||
// const G4VExtDecayer *m_ExtDecayer;
|
||||
G4double m_RemainderLifeTime;
|
||||
|
||||
public:
|
||||
G4int testa, testb;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,114 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRDepolarize.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 15:17
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// LEMUSRDEPOLARIZE
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
/*!
|
||||
This class was built to depolarize the muon in some materials. It is not used in the simulation and shall probably be removed.
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
|
||||
|
@ -1,599 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
// 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;
|
||||
|
||||
|
||||
/*! In this class the detector geometry is defined according to the following hierarchy:
|
||||
* - Solid Volume
|
||||
* -# The solid shape of the detector element. For example tube, sphere, box etc.
|
||||
* -# It can be defined as a boolean combination of solids.
|
||||
* - Logical Volume
|
||||
* -# The solid volume plus a material, a color, and all other specific parameters.
|
||||
* -# One can define different kind of attributes: visualization attributes, step size limitation, minimal kinetic enery to pursue the tracking of a particle etc. They are called UserAttributes or UserLimits. For more precision please refer to the G4UserLimits class.
|
||||
* -# The sensitive detection is also set in the logical volume: the user should first define a sensitive detector, and then assign it to the logical volume (cf. source code of LEMuSRDetectorConstruction.cc)
|
||||
* - Physical Volume
|
||||
* -# The logical volume and its position inside a mother logical volume.
|
||||
* -# One can also define space transformations (rotation, translation etc.) to position the physical volume in the mother volume.
|
||||
* -# Only the World volume does not need to be given a mother volume.
|
||||
* .
|
||||
* The main method is the virtual method Construct.
|
||||
* For clarity and compilation reasons the implementation code has been shared in the following files:
|
||||
* -# LEMuSRDetectorConstruction.cc
|
||||
* -# LEMuSRMaterials.cc where the materials table is built as well as the different attribute
|
||||
* -# LEMuSRdummydets.cc, which build the dummy detectors. This file should be removed in the future since we notice that the introduction of dummy detectors could influence the results.
|
||||
*/
|
||||
class LEMuSRDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
|
||||
public:
|
||||
// Constructeur et destructeur
|
||||
|
||||
/*! The pointer to the detector instance.*/
|
||||
static LEMuSRDetectorConstruction* theDetector; // un pointeur a l'instance
|
||||
//! Return the detector pointer.
|
||||
/*! This method returns a pointer to the detector instance.*/
|
||||
static LEMuSRDetectorConstruction* GetInstance();
|
||||
|
||||
/*! In the constructor, the detector messenger is instanciated and the pointer to the detector instance is given to the detector messenger.
|
||||
*
|
||||
* The materials table is also defined in the constructor by calling the MaterialsDefinition method.
|
||||
*
|
||||
* Finally, the constructor contains the default initialization of the modifiable variables like the carbon foil thickness, the voltages, the layout of the detector (mcp, cryo, guards on/off etc.). Those parameters can be changed interactively during the simulation via the detector messenger (cf. LEMuSDetectorMessenger).
|
||||
*
|
||||
*/
|
||||
//! Constructor.
|
||||
LEMuSRDetectorConstruction();
|
||||
//! Destructor.
|
||||
~LEMuSRDetectorConstruction();
|
||||
|
||||
|
||||
|
||||
// construction
|
||||
//! Main method.
|
||||
/*! The Construct method contains the implementation of the detector construction. It calls different methods which are in charge of building the different parts of the detector. For example
|
||||
* - lemuMCP2
|
||||
* - lemuCRYO
|
||||
* - lemuAnode
|
||||
* - lemuMCPdet
|
||||
* - lemuSCINT
|
||||
* - lemuLinse3
|
||||
* - lemuTrigger_Detector
|
||||
*.
|
||||
* Some other methods are called to create the different fields
|
||||
* ( anode, electric/magnetic field at the sample etc.).
|
||||
*
|
||||
* As it is a virtual method, its name <I>must not</I> be changed.
|
||||
*
|
||||
* In the source code LEMuSRDetectorContruction.cc, one would notice that the Construct() method returns the result of the lemuDetector() method, where all the implementation is actually done.
|
||||
*/
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
//! Implementation of the detector construction procedure (cf. Construct).
|
||||
/*! In this method the Wold volume or Labo is defined as a 2x2x4 cubic meters room, which center defines the origin point (0 0 0) of the geometry. Then the different contruction methods are called and the sensitive detection for the scintillators, the MCP2 and the sample plate are defined.
|
||||
*/
|
||||
G4VPhysicalVolume* lemuDetector();
|
||||
|
||||
|
||||
// messenger
|
||||
/*! The pointer to the detector messenger.*/
|
||||
LEMuSRDetectorMessenger* Messenger;
|
||||
|
||||
|
||||
|
||||
//declaration of all the volumes
|
||||
|
||||
|
||||
private:
|
||||
//!#anchor LEMUDETCOMPONENTS
|
||||
//=======LABORATORY::WORLD=================
|
||||
|
||||
// solid
|
||||
G4Box* LABO_box;
|
||||
|
||||
// logical
|
||||
G4LogicalVolume* lv_LABO;
|
||||
|
||||
// physical
|
||||
G4VPhysicalVolume* pv_LABO;
|
||||
|
||||
// materials
|
||||
G4Material* LABO_material;
|
||||
|
||||
|
||||
|
||||
//======= MPC2 =================
|
||||
//! MCP2 chamber.
|
||||
/*! This method contructs the MCP2 chamber.*/
|
||||
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 ;
|
||||
|
||||
/*! This method contructs the field of the ring anode.*/
|
||||
void buildAnodeField();
|
||||
|
||||
|
||||
// parameter
|
||||
public:
|
||||
G4double mcpv_z;
|
||||
G4int Grid, Guards;
|
||||
|
||||
|
||||
|
||||
//=================== ANODE =======================
|
||||
private:
|
||||
//! Ring Anode
|
||||
/*! This method contructs the ring anode. The electric field is defined by a field map.*/
|
||||
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:
|
||||
//! MCP detector.
|
||||
/*! This method contructs the MCP detector. It is attached to a sensitive detector in the lemuDetector method.*/
|
||||
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:
|
||||
//! Cryostat.
|
||||
/*! This method contructs the sample cryostat. It is attached to a sensitive detector in the lemuDetector method.*/
|
||||
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;
|
||||
|
||||
|
||||
//! Electromagnetic fields in the gate valve chamber and the MCP2 chamber.
|
||||
/*! This method defines the field in the sample region.*/
|
||||
void buildCryoField();
|
||||
|
||||
//! Get new field maps.
|
||||
/*! This method can be enabled via an environment variable in case new field maps are built*/
|
||||
void NEWMAPS();
|
||||
|
||||
public:
|
||||
// Parameters
|
||||
G4double cryoFieldLength,cryoVoltage;
|
||||
G4String Material_SAH;
|
||||
|
||||
|
||||
//================ LINSE three ======================
|
||||
private:
|
||||
//! Third Lense.
|
||||
/*! This method contructs the third einzel lense. The electric field is defined by a field map.*/
|
||||
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:
|
||||
//! Trigger detector.
|
||||
/*! This method contructs the trigger detector:
|
||||
* - The carbon foil
|
||||
* - The electric fields
|
||||
*/
|
||||
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_TriggerE, *lv_TriggerE2, *lv_TriggerE3, *lv_CFOIL;
|
||||
// physica.l
|
||||
G4VPhysicalVolume *pv_Trigger, *pv_TriggerF1, *pv_TriggerF2,*pv_TriggerV, *pv_TriggerE, *pv_TriggerE2, *pv_TriggerE3, *pv_CFOIL;
|
||||
|
||||
|
||||
//================ COMPENSATION GATE ====================
|
||||
private:
|
||||
//! Compensation gate.
|
||||
/*! This method contructs the compensation gate.*/
|
||||
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:
|
||||
//! Scintillators.
|
||||
/*! This method contructs the inner and outer scintillators as four quarter of cynlinders around the MCP2 chamber. The sensitive detection is set in the lemuDetector() method.*/
|
||||
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;
|
||||
|
||||
|
||||
|
||||
|
||||
//================ ASYMMETRY TEST VOLUMES ================
|
||||
private:
|
||||
//! Test of asymmetry
|
||||
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:
|
||||
//! Test of electric fields
|
||||
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:
|
||||
//!\anchor mat_def
|
||||
//! Declaration of materials
|
||||
/*! This method contains the definition of all elements and materials and builds the materials table. It is important to call this method in the contructor because the materials table should be built only once. If this method was called in the Construct method, each modification of the detector would lead to an additional materials table. The consequence is a severe conflict causing a segmentation fault.*/
|
||||
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;
|
||||
|
||||
|
||||
G4String FieldMapsDir;
|
||||
|
||||
|
||||
// print STATUS
|
||||
void PrintStatus();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,148 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRDetectorMessenger.hh, v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-08-20 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// DETECTOR MESSENGER
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
/**
|
||||
* The LEMuSRDetectorMessenger class defines the terminal's commands to operate changes in the detector geometry. The following settings can be personalized:
|
||||
* -# MCP/Sample cryostat geometry
|
||||
* -# Electric Fields on/off
|
||||
* -# Magnetic Fields on/off
|
||||
* -# Sample cryostat grid
|
||||
* -# Sample cryostat guards
|
||||
* -# Electric potentials
|
||||
* -# Carbon foil thickness
|
||||
* -# Maximal step size in field regions
|
||||
* -# Sample holder material
|
||||
* -# Views of the detector
|
||||
* .
|
||||
* Many more can be implemented at will by the user.
|
||||
*/
|
||||
class LEMuSRDetectorMessenger : public G4UImessenger {
|
||||
public:
|
||||
//! Constructor.
|
||||
/*!
|
||||
* It stores the pointer to the detector provided by LEMuSRDetectorConstruction.
|
||||
* For the command names, refer to the LEMuSRDetectorMessenger.cc file.
|
||||
*/
|
||||
LEMuSRDetectorMessenger(LEMuSRDetectorConstruction*);
|
||||
|
||||
//! Destructor.
|
||||
~LEMuSRDetectorMessenger();
|
||||
|
||||
|
||||
public:
|
||||
//! Applying the modifications.
|
||||
void SetNewValue(G4UIcommand* command, G4String newvalue);
|
||||
|
||||
|
||||
//arguments
|
||||
private:
|
||||
//! Pointer to the detector.
|
||||
LEMuSRDetectorConstruction* theDetector;
|
||||
|
||||
// commands
|
||||
private:
|
||||
//! Directory name for the commands: /Detector/
|
||||
|
||||
G4UIdirectory* DetMode;
|
||||
|
||||
//commands with STRING
|
||||
//! Detector with MCP/CRYO
|
||||
G4UIcmdWithAString* SetDetMode ;
|
||||
//! Enable/Disable electric fields
|
||||
G4UIcmdWithAString* SetElField ;
|
||||
//! Enable/Disable grids at sample cryostat
|
||||
G4UIcmdWithAString* SetGrid ;
|
||||
//! Enable/Disable guards at sample cryostat
|
||||
G4UIcmdWithAString* SetGuards ;
|
||||
//! Set the view of the detector (quarter, half, total).
|
||||
/*!
|
||||
* Only for visualization purpose. The total geometry must be loaded to run a simulation.
|
||||
*/
|
||||
G4UIcmdWithAString* SetDetVisualization ;
|
||||
//! The material for the sample holder
|
||||
G4UIcmdWithAString* SetSAHmaterial ;
|
||||
|
||||
//! Would replace the environment variable in order to run any test without recompilation.
|
||||
G4UIcmdWithAString* SetAsymCheck ;
|
||||
G4UIcmdWithAString* SetFieldCheck ;
|
||||
|
||||
//commands with DOUBLE
|
||||
//! Third lens voltage settings
|
||||
G4UIcmdWithADouble* SetThirdLensPotential, *SetCFthk ;
|
||||
//! Maximal step in field regions
|
||||
G4UIcmdWithADouble* SetFieldStepLim ;
|
||||
//! Magnetic field value (will be changed to current)
|
||||
G4UIcmdWithADouble* SetMagField ;
|
||||
//! Sample cryostat voltage
|
||||
G4UIcmdWithADouble* SetCryoPotential;
|
||||
|
||||
|
||||
//coomand with 3vector
|
||||
//! Ring anode potential
|
||||
G4UIcmdWith3Vector* SetRAPotential;
|
||||
|
||||
|
||||
//! The new detector to build
|
||||
G4VPhysicalVolume* newDetector;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,100 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
// 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>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "CLHEP/Matrix/Vector.h"
|
||||
#include "CLHEP/Matrix/Matrix.h"
|
||||
|
||||
|
||||
#include "LEMuSRElectricField.hh"
|
||||
|
||||
|
||||
/**
|
||||
* In order to build complex electric fields, the following class has been built.
|
||||
* It allows the superposition of many electric fields recurrently.
|
||||
*
|
||||
* The main reason for this is that the field manager attached to a given volume do not handle such a
|
||||
* superposition. In the case of the sample chamber, this is a big problem because we have to handle
|
||||
* the fields of the ring anode and of the sample cryostat.
|
||||
*
|
||||
* The electric field in the sample region (gate valve chamber + mcp2 chamber) is then the
|
||||
* superposition of the following electric fields:
|
||||
* -# left side of the ring anode
|
||||
* -# right side of the ring anode
|
||||
* -# sample cryostat
|
||||
* .
|
||||
* On the same principle was built the class LEMuSRElMagField.
|
||||
*/
|
||||
class LEMuSRElFieldMix : public G4ElectricField
|
||||
{
|
||||
public:
|
||||
|
||||
//! Contructor for two field map superposition.
|
||||
LEMuSRElFieldMix( LEMuSRElectricField* E1, LEMuSRElectricField* E2, G4double field1_val, G4double field2_val);
|
||||
|
||||
//! Constructor for two general fields superposition.
|
||||
LEMuSRElFieldMix( G4ElectricField* E1, G4ElectricField* E2, G4double field1_val, G4double field2_val);
|
||||
|
||||
|
||||
//! Destructor.
|
||||
~LEMuSRElFieldMix();
|
||||
|
||||
//! Method to return the field at position-time point[4].
|
||||
/*!
|
||||
* As an electric field superposition is linear, the GetFieldValue method simply ask each input field
|
||||
* for its value at the given position-time and returns as a field value the weighted sum of the
|
||||
* two answers.
|
||||
*/
|
||||
void GetFieldValue(const G4double point[4], G4double*) const;
|
||||
|
||||
void Test();
|
||||
|
||||
public:
|
||||
|
||||
//! Input field 1.
|
||||
G4ElectricField* field1;
|
||||
//! Input field 2.
|
||||
G4ElectricField* field2;
|
||||
|
||||
//! Weight for input field 1.
|
||||
G4double coef1;
|
||||
//! Weight for input field 2.
|
||||
G4double coef2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,85 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRElMagField.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// ElectroMagnetic Field
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#ifndef LEMUSRELECTRICMAGFIELD_H
|
||||
#define LEMUSRELECTRICMAGFIELD_H 1
|
||||
|
||||
#include"G4ElectricField.hh"
|
||||
#include"G4MagneticField.hh"
|
||||
#include"G4ElectroMagneticField.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "CLHEP/Matrix/Vector.h"
|
||||
#include "CLHEP/Matrix/Matrix.h"
|
||||
|
||||
|
||||
#include "LEMuSRElectricField.hh"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* In order to build complex electromagnetic fields, the following class has been built.
|
||||
* It allows the superposition of an electric field and a magnetic field.
|
||||
*
|
||||
* The main reason for this is that the field manager attached to a given volume do not handle such a
|
||||
* superposition. In the case of the sample chamber, this is a big problem because we have to handle
|
||||
* the electric fields of the ring anode and of the sample cryostat as well as the magnetic field over the sample.
|
||||
*
|
||||
* The electromagnetic field in the sample region (gate valve chamber + mcp2 chamber) is then the
|
||||
* superposition of the following fields:
|
||||
* -# electric field for left side of the ring anode
|
||||
* -# electric field for right side of the ring anode
|
||||
* -# electric field for sample cryostat
|
||||
* -# magnetic field for sample region
|
||||
* .
|
||||
* On the same principle was built the class LEMuSRElFieldMix
|
||||
*/
|
||||
|
||||
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
|
@ -1,92 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRElMag_SpinEqRhs.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// ElectroMagnetic Spin Equation
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#ifndef LEMuSRELMAG_SPIN_EQRHS
|
||||
#define LEMuSRELMAG_SPIN_EQRHS 1
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4Mag_EqRhs.hh"
|
||||
#include "G4SteppingManager.hh" // Include from 'tracking'
|
||||
#include "G4TrackingManager.hh" // Include from 'tracking'
|
||||
#include "LEMuSRTrackingAction.hh"
|
||||
#include "LEMuSRSteppingAction.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrackingManager.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4ParticleDefinition.hh" // Include from 'tracking'
|
||||
|
||||
|
||||
|
||||
class G4MagneticField;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the motion equation to use to calculate the evolution of a
|
||||
* particle in an electromagnetic field. The derivatives vector is calculated for
|
||||
* the electric field, and for the magnetic field, taking into account the spin precession
|
||||
* and the time evolution.
|
||||
*/
|
||||
class LEMuSRElMag_SpinEqRhs : public G4Mag_EqRhs
|
||||
{
|
||||
public: // with description
|
||||
//! Constructor.
|
||||
LEMuSRElMag_SpinEqRhs( G4MagneticField* MagField );
|
||||
//! Destructor.
|
||||
~LEMuSRElMag_SpinEqRhs();
|
||||
// Constructor and destructor. No actions.
|
||||
|
||||
//! Set constant particle parameters
|
||||
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc,
|
||||
G4double mass);
|
||||
//! Calculate derivatives.
|
||||
void EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double B[3],
|
||||
G4double dydx[] ) const;
|
||||
// Given the value of the electromagnetic field B, this function
|
||||
// calculates the value of the derivative dydx.
|
||||
|
||||
|
||||
//! Return the gyromagnetic ratio
|
||||
/*!
|
||||
* This method call the event manager to get the tracking manager and then the current track in order to get the particle name. According to the name of the particle it returns the gyromagnetic ratio.
|
||||
*/
|
||||
|
||||
G4double GetGyromagneticRatio();
|
||||
|
||||
private:
|
||||
|
||||
G4double omegac;
|
||||
G4double anomaly;
|
||||
G4double ParticleCharge;
|
||||
|
||||
G4double E;
|
||||
G4double gamma, m_mass;
|
||||
G4double beta;
|
||||
G4double cst;
|
||||
|
||||
G4double oldomegac; //for debugging :: to remove
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,132 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "CLHEP/Matrix/Vector.h"
|
||||
#include "CLHEP/Matrix/Matrix.h"
|
||||
|
||||
|
||||
/**
|
||||
* The goal of the LEMuSRElectricField class is to read field maps generated by
|
||||
* COMSOL Multiphysics.
|
||||
* \image html field.gif Example of a field map generated using COMSOL.
|
||||
* Those field maps are shared into three ascii files, one per field component,
|
||||
* in the format (x y z B_i). The first line in the file contains
|
||||
* the labels. The second line is (x_min y_min z_min B_i) and the last line
|
||||
* is (x_max y_max z_max B_i).
|
||||
* LEMuSRElectricField reads those files and store them in an array.
|
||||
* Some important parameters must be specified to read a field map:
|
||||
* -# <b> The number of points</b> along each axis which was defined in COMSOL
|
||||
* before exporting the maps.
|
||||
* - It is very important to check that the number of points do not
|
||||
* exceed the size of the array defined in LEMuSRElectricField.hh
|
||||
* -# <b> The unit of the map</b>, which is an important parameter because the
|
||||
* default distance unit in COMSOL is the meter.
|
||||
* - A different unit has an influence
|
||||
* on the coordinates reading, but also on the actual field value which has to
|
||||
* be scaled consequently.
|
||||
* -# The voltage to use. Indeed,the field maps are generated for 1kV potential.
|
||||
* The user should indicate the actual voltage to multiply the fields values.
|
||||
* -# The offset along z axis, in case the map is not centered on the actual
|
||||
* postition of the field. This is the case for the third lense field for example:
|
||||
* the map is centered on (0, 0, 0) and the center or the lens is at (0, 0, -567mm).
|
||||
* .
|
||||
* The field maps can be very heavy files and reading them can cost a lot of time.
|
||||
* For this reason, it is possible to write the field map array in a single file
|
||||
* after the first reading. Such maps files have been produced for the third
|
||||
* lens, the anode and the sample.
|
||||
*/
|
||||
|
||||
class LEMuSRElectricField : public G4ElectricField
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor from three field maps
|
||||
LEMuSRElectricField(G4double fieldval,G4String Xfile,
|
||||
G4String Yfile,
|
||||
G4String Zfile,G4String map_length_unit,
|
||||
G4double Offset, G4double nx, G4double ny, G4double nz);//offset must be entered in millimeter
|
||||
|
||||
//! Contructor from a single field map
|
||||
LEMuSRElectricField(G4double fieldval,G4String file,G4String map_length_unit,
|
||||
G4double Offset, G4double nx, G4double ny, G4double nz);
|
||||
|
||||
|
||||
~LEMuSRElectricField();
|
||||
|
||||
//! Returns the field value at Point[4] space-time coordinate.
|
||||
/*!
|
||||
* This method is in charge of returning the field value for a given position.
|
||||
* It scales the field array according to the unit and interpolates the field
|
||||
* value from the cube surrounding Point[4].
|
||||
*/
|
||||
void GetFieldValue(const G4double Point[4], G4double *Bfield) const;
|
||||
|
||||
//! Debugging test.
|
||||
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;
|
||||
|
||||
//! Bx, By, Bz, for all x positions
|
||||
G4double xField[90][90][201];
|
||||
//! Bx, By, Bz, for all y positions
|
||||
G4double yField[90][90][201];
|
||||
//! Bx, By, Bz, for all z positions
|
||||
G4double zField[90][90][201];
|
||||
|
||||
//! The physical limits of the defined region
|
||||
G4double minx, maxx, miny, maxy, minz, maxz;
|
||||
|
||||
G4double
|
||||
//! Number of divisions along axis.
|
||||
nx,ny,nz,
|
||||
//! Offset along propagation axis
|
||||
zOffset,
|
||||
//! Actual voltage value.
|
||||
FieldVal;
|
||||
|
||||
//! Unit of the field map.
|
||||
G4String map_unit;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,81 +0,0 @@
|
||||
///§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
|
||||
// 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
|
||||
|
||||
|
@ -1,82 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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
|
@ -1,103 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
// 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;
|
||||
|
||||
/*!
|
||||
* The role of the event action is to take special actions at the beginning or at the end of each event. It can be used for histogramming, plotting trajectories, or any other useful actions.
|
||||
*
|
||||
* It can be used to initialized the hits collections for the sensitive detection. In \lemu simulation, we finally did not really use the event action.
|
||||
*/
|
||||
class LEMuSREventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
//! Constructor.
|
||||
LEMuSREventAction();
|
||||
//! Destructor.
|
||||
~LEMuSREventAction();
|
||||
public: // with description
|
||||
//! Actions to take at the beginnig of the event
|
||||
void BeginOfEventAction(const G4Event* anEvent);
|
||||
//! Actions to take at the end of the event
|
||||
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
|
@ -1,227 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: geant4-07-00-cand-03 $
|
||||
//
|
||||
//------------- 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 "LEMuSRParticleChangeForMSC.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;
|
||||
|
||||
LEMuSRParticleChangeForMSC fParticleChange;
|
||||
|
||||
G4double alfa1,alfa2,alfa3,b,xsi,c0,facxsi ; // angle distr. parameters
|
||||
// facxsi : some tuning
|
||||
// possibility in the tail
|
||||
};
|
||||
|
||||
#include "LEMuSRMSC.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,97 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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......
|
@ -1,127 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRMUONIUM.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 16:15
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// AT REST SPIN ROTATION
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
|
||||
#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......
|
||||
|
||||
/*!
|
||||
* LEMuSRMUONIUM class defines the muonium formation process in the carbon foil according
|
||||
* to yields from Gonin's paper Sci. Rev. Instrum. 65 (3), 648-652 (1994).
|
||||
*
|
||||
* \image html yields3.gif The muonium formation yields.
|
||||
*
|
||||
* The main parameters are the thickness of the foil and the energy of the muon. For a given
|
||||
* energy, a corresponding proportion of the muons will be converted into muonium.
|
||||
* Concretely, the muon will be killed and replace by a muonium with same properties of time,
|
||||
* energy, momentum, position etc.
|
||||
*
|
||||
* This process is executed at the end of a step, i.e. the muon is converted into muonium after
|
||||
* flying through the carbon foil.
|
||||
*cf. yields.h, gonin.cc.
|
||||
*/
|
||||
class LEMuSRMUONIUM : public G4VDiscreteProcess
|
||||
|
||||
{
|
||||
public: // with description
|
||||
//! \ct
|
||||
LEMuSRMUONIUM(const G4String& name="Muformation" ,
|
||||
G4ProcessType aType = fElectromagnetic );
|
||||
|
||||
//! \dt
|
||||
~LEMuSRMUONIUM();
|
||||
|
||||
//! Main method.
|
||||
/*!
|
||||
*The muonium formation process is executed at the end of a step.
|
||||
*/
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
|
||||
|
||||
//! Condition for process application (step object).
|
||||
G4bool CheckCondition( const G4Step& aStep);
|
||||
//! Condition for process application (step pointer).
|
||||
G4bool CheckCondition( const G4Step* aStep);
|
||||
|
||||
|
||||
G4String p_name, vname;
|
||||
G4double spin, edep, toten, kinen, tof, globaltime, proptime;
|
||||
G4ThreeVector hitpos, hitmom;
|
||||
G4int ID;
|
||||
|
||||
//! \cbv
|
||||
G4bool condition;
|
||||
|
||||
|
||||
void GetDatas( const G4Step* aStep);
|
||||
// model parameters
|
||||
G4ParticleTable* particleTable;
|
||||
G4ParticleDefinition* particle;
|
||||
Yields Gonin;
|
||||
G4double yvector[3];
|
||||
G4double rnd;
|
||||
G4DynamicParticle *DP;
|
||||
|
||||
//! The particle change object.
|
||||
G4VParticleChange fParticleChange;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void PrepareSecondary(const G4Track&);
|
||||
G4Track* aSecondary;
|
||||
|
||||
void InitializeSecondaries(const G4Track&);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,129 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRMUONIUMScatt.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2006-01-19 16:15
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// MUONIUMScatt
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
|
||||
|
||||
#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"
|
||||
|
||||
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
#include "G4EventManager.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
/*!
|
||||
* LEMuSRMUONIUMScatt class defines the muonium scattering process. It is a very basic model
|
||||
* since we assume the muonium loose its electron as soon as it enters a material
|
||||
* (other than vauum).
|
||||
*
|
||||
* Moreover, the spin precession of the muonium in flight is also implemented in this clss.
|
||||
*/
|
||||
class LEMuSRMUONIUMScatt : public G4VDiscreteProcess
|
||||
|
||||
{
|
||||
public: // with description
|
||||
//! \ct
|
||||
LEMuSRMUONIUMScatt(const G4String& name="Muscatt" ,
|
||||
G4ProcessType aType = fGeneral );
|
||||
|
||||
//! \dt
|
||||
~LEMuSRMUONIUMScatt();
|
||||
|
||||
//! \mm The actions are taken at the end of the step.
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
|
||||
//! The condition to apply the process.
|
||||
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;
|
||||
|
||||
|
||||
G4ThreeVector RotateSpinIfMag( const G4Track& , const G4Step&);
|
||||
G4double point[3], B[6];
|
||||
G4double itime, gtime, ftime,deltatime;
|
||||
G4ThreeVector polar;
|
||||
G4ThreeVector RotateSpin(const G4Step&, G4ThreeVector, G4double);
|
||||
|
||||
void PrepareSecondary(const G4Track&);
|
||||
G4Track* aSecondary;
|
||||
|
||||
void InitializeSecondaries(const G4Track&);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,96 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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"
|
||||
#include "G4SteppingManager.hh" // Include from 'tracking'
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrackingManager.hh" // Include from 'tracking'
|
||||
|
||||
class G4MagneticField;
|
||||
|
||||
/**
|
||||
* This class defines the motion equation to use to calculate the evolution of a
|
||||
* particle in a magnetic field. The derivatives vector is calculated for
|
||||
* the magnetic field, taking into account the spin precession
|
||||
* and the time evolution.
|
||||
*/
|
||||
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);
|
||||
|
||||
//! Calculation of the derivatives
|
||||
/*! Given the value of the magnetic field B, this function
|
||||
* calculates the value of the derivative dydx.
|
||||
*/
|
||||
void EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double B[3],
|
||||
G4double dydx[] ) const;
|
||||
|
||||
//! Return the gyromagnetic ratio
|
||||
/*!
|
||||
* This method call the event manager to get the tracking manager and then the current track in order to get the particle name. According to the name of the particle it returns the gyromagnetic ratio.
|
||||
*/
|
||||
G4double GetGyromagneticRatio();
|
||||
private:
|
||||
|
||||
G4double omegac;
|
||||
G4double anomaly;
|
||||
G4double ParticleCharge;
|
||||
|
||||
G4double E;
|
||||
G4double gamma;
|
||||
G4double beta;
|
||||
G4double m_mass;
|
||||
|
||||
G4double oldomegac; //to remove
|
||||
};
|
||||
|
||||
#endif /* LEMuSRMAG_SPIN_EQRHS */
|
@ -1,50 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRMagneticField.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// Magnetic Field
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#include "G4MagneticField.hh"
|
||||
#include"G4ThreeVector.hh"
|
||||
#include"G4ios.hh"
|
||||
|
||||
class LEMuSRMagneticField : public G4MagneticField
|
||||
{
|
||||
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;
|
||||
|
||||
};
|
@ -1,108 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRMcpHit.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// MCP HITS
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,112 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSRMcpSD.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// MCP SD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,122 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
/**
|
||||
* The LEMuSRMuonDecayChannel class contains the implementation of the asymmetric muon decay. The process is applicable to muon (positive or negative) and muonium.
|
||||
*
|
||||
* It was inspired from the G4MuonDecayChannel method, which did not take into account the spin polarization of the muon.
|
||||
*
|
||||
* One should notice that recent versions of Geant4 feature a G4MuonDecayChannelWithSpin class, whose role is identical to the class we are describing.
|
||||
*
|
||||
* The two caracteristics of this process are
|
||||
* - The Michel spectrum for e+ energy distribution
|
||||
* \image html michel.gif Michel's Spectrum.
|
||||
* - The cardioidal angular distribution as a function of the positron energy
|
||||
* \image html kardio.gif Cardioid.
|
||||
* .
|
||||
* The angular direction of the positron emission is in relation with the energy of
|
||||
* the positron.
|
||||
* The more energy the positron has, the smaller the angle of emission with respect
|
||||
* to the muon spin is. The V-A theory predicts the positron rate to be
|
||||
* \f[ \mbox{d}\Gamma^2(w,\theta)= \frac{1}{\tau n(w)\left[1+ D(w)cos\theta \right]}\mbox{d}w \mbox{d}(\cos \theta),\f]
|
||||
* \f$w\f$ being the ratio between the energy of the emitted positron and the
|
||||
* maximal energy, and \f$\theta\f$ the angle between the muon spin and the
|
||||
* positron momentum.
|
||||
*
|
||||
* The distribution \f$n(w)\f$ along energy is given by the Michel's spectrum
|
||||
* \f[ n(w)= w^2(3-2w)\f] and the asymmetric factor is given by
|
||||
* \f[D(w) = \frac{2w-1}{3-2w}.\f] We assume, here, that the muons are fully
|
||||
* polarized.
|
||||
*
|
||||
* The distribution along energies becomes, for \f$\Theta=0\f$,
|
||||
* \f[n(w)+n(w)D(w)= 2w^2\f]
|
||||
* and for \f$\Theta = \pi\f$,
|
||||
* \f[n(w)-n(w)D(w)= 4(w^2-w^3)\f]
|
||||
*
|
||||
* The asymmetry can be derived integrating the rate \f$d\Gamma^2\f$,
|
||||
* and one should get
|
||||
* \f[A(w_{min}, \Theta_0) = \frac{1+\cos\Theta_0}{6}\frac{1+2w_{min}^3-3w_{min}^4}{1-2w_{min}^3+w_{min}^4}\f]
|
||||
* where \f$\Theta_0\f$ is the opening angle of the solid angle.
|
||||
* This means that if one select all positron energies, \f$w_{min}\simeq 0\f$
|
||||
* - \f$A \simeq\frac{1}{3}\f$ for small solid angles
|
||||
* - \f$A \simeq\frac{1}{6}\f$ for large solid angles
|
||||
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
public:
|
||||
//!Constructor.
|
||||
LEMuSRMuonDecayChannel(const G4String& theParentName,
|
||||
G4double theBR);
|
||||
//! Destructor.
|
||||
~LEMuSRMuonDecayChannel();
|
||||
|
||||
static LEMuSRMuonDecayChannel* pointer;
|
||||
static LEMuSRMuonDecayChannel* GetInstance();
|
||||
|
||||
|
||||
void finalize();
|
||||
|
||||
public: // With Description
|
||||
//! \mm
|
||||
virtual G4DecayProducts *DecayIt(G4double);
|
||||
HepRandomEngine* theEngine;
|
||||
G4ThreeVector emomdir;
|
||||
|
||||
//! Angles.
|
||||
G4double alpha,sinalpha, cosalpha, delta, sindelta, cosdelta;
|
||||
//! Sines and cosines.
|
||||
G4double costheta, sintheta, phi, sinphi, cosphi, theta;
|
||||
|
||||
inline G4double GetTheta(){return theta;};
|
||||
inline G4double GetPhi(){return phi;};
|
||||
|
||||
|
||||
//! Polarized decay
|
||||
/*!
|
||||
* Gets the muon polarization and launch the Decay it method.
|
||||
*/
|
||||
G4DecayProducts *DecayItPolarized(G4double,G4ThreeVector polar);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,69 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: LEMuSRMuoniumParticle.hh,v 1.9 2005/01/14 03:49:17 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00-patch-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 4-th April 1996, G.Cosmo
|
||||
// ****************************************************************
|
||||
// New implementation as a utility class M.Asai, 26 July 2004
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
#ifndef LEMuSRMuoniumParticle_h
|
||||
#define LEMuSRMuoniumParticle_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
// ######################################################################
|
||||
// ### MUONIUM ###
|
||||
// ######################################################################
|
||||
|
||||
class LEMuSRMuoniumParticle : public G4ParticleDefinition
|
||||
{
|
||||
private:
|
||||
static LEMuSRMuoniumParticle* theInstance;
|
||||
LEMuSRMuoniumParticle(){}
|
||||
~LEMuSRMuoniumParticle(){}
|
||||
|
||||
public:
|
||||
static LEMuSRMuoniumParticle* Definition();
|
||||
static LEMuSRMuoniumParticle* MuoniumDefinition();
|
||||
static LEMuSRMuoniumParticle* Muonium();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,107 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSROScintHit.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// Outer SCINT HITS
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,108 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID :LEMuSROScintSD.hh , v 1.3
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-09-17 10:20
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// Outer SCINT SD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,119 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: LEMuSRParticleChangeForMSC.hh,v 1.8 2004/10/19 00:51:29 kurasige Exp $
|
||||
// GEANT4 tag $ $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
//
|
||||
// Class Description
|
||||
// This class is special "Particle Change" for Multiple Scattering process
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
|
||||
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
|
||||
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
#ifndef LEMuSRParticleChangeForMSC_h
|
||||
#define LEMuSRParticleChangeForMSC_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
class G4DynamicParticle;
|
||||
#include "G4VParticleChange.hh"
|
||||
|
||||
class LEMuSRParticleChangeForMSC: public G4VParticleChange
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
LEMuSRParticleChangeForMSC();
|
||||
|
||||
// destructor
|
||||
virtual ~LEMuSRParticleChangeForMSC();
|
||||
|
||||
protected:
|
||||
// hide copy constructor and assignment operaor as protected
|
||||
LEMuSRParticleChangeForMSC(const LEMuSRParticleChangeForMSC &right);
|
||||
LEMuSRParticleChangeForMSC & operator=(const LEMuSRParticleChangeForMSC &right);
|
||||
|
||||
|
||||
public: // with description
|
||||
// ----------------------------------------------------
|
||||
// --- the following methods are for updating G4Step -----
|
||||
// Return the pointer to the G4Step after updating the Step information
|
||||
// by using final state information of the track given by a physics
|
||||
// process
|
||||
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
|
||||
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
|
||||
// A physics process gives the final state of the particle
|
||||
// based on information of G4Track (or equivalently the PreStepPoint)
|
||||
|
||||
virtual void Initialize(const G4Track&);
|
||||
// Initialize all propoerties by using G4Track information
|
||||
|
||||
// ----------------------------------------------------
|
||||
//--- methods to keep information of the final state--
|
||||
// IMPORTANT NOTE: Although the name of the class and methods are
|
||||
// "Change", what it stores (and returns in get) are the "FINAL"
|
||||
// values of the Position, Momentum, etc.
|
||||
|
||||
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
|
||||
const G4ThreeVector* GetMomentumDirection() const;
|
||||
const G4ThreeVector* GetProposedMomentumDirection() const;
|
||||
void SetProposedMomentumDirection(const G4ThreeVector& Pfinal);
|
||||
// Get/Set theMomentumDirectionChange vector: it is the final momentum direction.
|
||||
|
||||
const G4ThreeVector* GetPosition() const;
|
||||
void ProposePosition(const G4ThreeVector& finalPosition);
|
||||
const G4ThreeVector* GetProposedPosition() const;
|
||||
void SetProposedPosition(const G4ThreeVector& finalPosition);
|
||||
// Get/Set the final position of the current particle.
|
||||
|
||||
public:
|
||||
virtual void DumpInfo() const;
|
||||
// for Debug
|
||||
virtual G4bool CheckIt(const G4Track&);
|
||||
G4bool Post_Update;
|
||||
|
||||
private:
|
||||
G4ThreeVector theMomentumDirection;
|
||||
// It is the vector containing the final momentum direction
|
||||
// after the invoked process. The application of the change
|
||||
// of the momentum direction of the particle is not Done here.
|
||||
// The responsibility to apply the change is up the entity
|
||||
// which invoked the process.
|
||||
|
||||
G4ThreeVector thePosition;
|
||||
// The changed (final) position of a given particle.
|
||||
};
|
||||
|
||||
#include "LEMuSRParticleChangeForMSC.icc"
|
||||
#endif
|
||||
|
@ -1,93 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: LEMuSRParticleChangeForMSC.icc,v 1.6 2004/10/19 00:51:29 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
inline
|
||||
void LEMuSRParticleChangeForMSC::ProposeMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void LEMuSRParticleChangeForMSC::SetProposedMomentumDirection(const G4ThreeVector& P)
|
||||
{
|
||||
theMomentumDirection = P;
|
||||
}
|
||||
|
||||
inline
|
||||
void LEMuSRParticleChangeForMSC::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
|
||||
{
|
||||
theMomentumDirection.setX(Px);
|
||||
theMomentumDirection.setY(Py);
|
||||
theMomentumDirection.setZ(Pz);
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* LEMuSRParticleChangeForMSC::GetMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* LEMuSRParticleChangeForMSC::GetProposedMomentumDirection() const
|
||||
{
|
||||
return &theMomentumDirection;
|
||||
}
|
||||
|
||||
inline
|
||||
void LEMuSRParticleChangeForMSC::SetProposedPosition(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* LEMuSRParticleChangeForMSC::GetPosition() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4ThreeVector* LEMuSRParticleChangeForMSC::GetProposedPosition() const
|
||||
{
|
||||
return &thePosition;
|
||||
}
|
||||
|
||||
inline
|
||||
void LEMuSRParticleChangeForMSC::ProposePosition(const G4ThreeVector& P)
|
||||
{
|
||||
thePosition = P;
|
||||
}
|
||||
|
||||
|
||||
inline void LEMuSRParticleChangeForMSC::Initialize(const G4Track& track)
|
||||
{
|
||||
theStatusChange = track.GetTrackStatus();
|
||||
theMomentumDirection = track.GetMomentumDirection();
|
||||
thePosition = track.GetPosition();
|
||||
}
|
||||
|
@ -1,50 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRParticleChangeForSR.hh , v 1.2b
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-08-20 10:36
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// PARTICLE CHANGE FOR SPIN ROTATION
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#ifndef LEMuSRParticleChangeForSR_h
|
||||
#define LEMuSRParticleChangeForSR_h 1
|
||||
|
||||
#include "G4ParticleChangeForTransport.hh"
|
||||
|
||||
/*!
|
||||
* This class defines the particle change object for the spin rotation process.
|
||||
* cf. LEMuSRAtRestSpinRotation
|
||||
*/
|
||||
class LEMuSRParticleChangeForSR : public G4ParticleChangeForTransport
|
||||
{
|
||||
|
||||
G4Step* UpdateStepForAtRest(G4Step* Step);
|
||||
|
||||
public:
|
||||
G4double theDecayTime;
|
||||
|
||||
|
||||
|
||||
|
||||
inline void SetDecayTime(G4double fDecayTime) { theDecayTime = fDecayTime; }
|
||||
|
||||
inline G4double GetDecayTime() { return theDecayTime; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -1,71 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRParticleGun.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-08-20 10:48
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// PARTICLE GUN
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#ifndef LEMuSRParticleGun_h
|
||||
#define LEMuSRParticleGun_h 1
|
||||
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4PrimaryParticle.hh"
|
||||
|
||||
class LEMuSRParticleGunMessenger;
|
||||
#include"G4ParticleGunMessenger.hh"
|
||||
|
||||
/*!
|
||||
* The LEMuSRParticleGun is the class which stores the initial settings of the particles.
|
||||
* Its interplay with the LEMuSRPrimaryGeneratorAction (PGA) is very strong.
|
||||
* Indeed, the particle gun object is instanciated and initialized in the PGA.
|
||||
*
|
||||
* After this initialization, the PGA calls the particle gun's GeneratePrimaryVertex method
|
||||
* to create an event with the defined initial conditions.
|
||||
*
|
||||
* As an image one can think that the PGA loads the gun with some defined particles,
|
||||
* set the shooting energy, aims and fires. Hence the name.
|
||||
*/
|
||||
class LEMuSRParticleGun: public G4ParticleGun
|
||||
{
|
||||
public:
|
||||
//!\ct
|
||||
LEMuSRParticleGun();
|
||||
//!\dt
|
||||
~LEMuSRParticleGun();
|
||||
|
||||
//! Creates the first event.
|
||||
void GeneratePrimaryVertex(G4Event* evt);
|
||||
|
||||
//! Assign a decay time
|
||||
inline void SetDecayTime(G4double d) {decaytime = d;}
|
||||
|
||||
G4double decaytime;
|
||||
|
||||
|
||||
protected:
|
||||
//! Default initialization of the gun.
|
||||
void SetInitialValues();
|
||||
|
||||
private:
|
||||
//! Messenger
|
||||
LEMuSRParticleGunMessenger* theMessenger;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,96 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRParticleGunMessenger.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-08-20 10:48
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// PARTICLE GUN MESSENGER
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
|
||||
#ifndef LEMUSRPARTICLEGUNMESSENGER
|
||||
#define LEMUSRPARTICLEGUNMESSENGER 1
|
||||
|
||||
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"
|
||||
|
||||
/**
|
||||
* The LEMuSRParticleGunMessenger class defines the terminal's commands to operate changes in the initial conditions of the muon beam. The following settings can be personalized:
|
||||
* -# particle to shoot
|
||||
* -# initial direction of the momentum
|
||||
* -# initial energy
|
||||
* -# initial position
|
||||
* -# initial polarization
|
||||
* .
|
||||
* The directory lemuGun/ is completed in the LEMuSRPgaMessenger class. There one can find commands
|
||||
* for shooting particles randomly, with specified energy distribution etc.
|
||||
*/
|
||||
class LEMuSRParticleGunMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
//!ct
|
||||
LEMuSRParticleGunMessenger(LEMuSRParticleGun* gun);
|
||||
//! dt
|
||||
~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
|
@ -1,97 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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"
|
||||
/**
|
||||
* The LEMuSRPgaMessenger class is the completion of the LEMuSRParticleGunMessenger
|
||||
* class which defines the terminal's commands to operate changes in the initial
|
||||
* conditions of the muon beam.
|
||||
*
|
||||
* The commands directory lemuGun/ is completed with commands
|
||||
* to shoot particles randomely and to specify the energy distribution etc.
|
||||
*/
|
||||
class LEMuSRPgaMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
//!\ct
|
||||
LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction* thPGA);
|
||||
//!\dt
|
||||
~LEMuSRPgaMessenger();
|
||||
|
||||
public:
|
||||
//! \mm
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
|
||||
private:
|
||||
//! Pointer to the LEMuSRPrimaryGeneratorAction object.
|
||||
LEMuSRPrimaryGeneratorAction * lemuPGA;
|
||||
|
||||
private: //commands
|
||||
//! Directory of the commands.
|
||||
G4UIdirectory * pgaDirectory;
|
||||
//! Set particle energy.
|
||||
G4UIcmdWithAString *setRndEnergy;
|
||||
//! Set the particle type.
|
||||
G4UIcmdWithAString *setMuonium;
|
||||
//! Unusedx
|
||||
G4UIcmdWithoutParameter *reset;
|
||||
G4UIcmdWith3Vector
|
||||
//! Set Gun Position (fixed).
|
||||
*posCmd,
|
||||
//! Set Momentum Direction.
|
||||
*momCmd,
|
||||
//! Set Square Scan.
|
||||
*scaCmd,
|
||||
//! Set Circular Scan.
|
||||
*scbCmd,
|
||||
//! Set Gaussian Scan.
|
||||
*scgCmd,
|
||||
//! Set Gaussian Energy Distribution.
|
||||
*setEGauss;
|
||||
//! Set Energy Value.
|
||||
G4UIcmdWithADouble *setEnergy;
|
||||
// Set Energy Offset.
|
||||
G4UIcmdWithADouble *setKEoffset;
|
||||
// Set Particle's Charge (not implemented).
|
||||
G4UIcmdWithADouble *setCharge;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,64 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: geant4-08-00-patch-01 $
|
||||
//
|
||||
|
||||
#ifndef LEMuSRPhysicsList_h
|
||||
#define LEMuSRPhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class LEMuSRPhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
LEMuSRPhysicsList();
|
||||
~LEMuSRPhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBaryons();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,137 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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
|
||||
/*!
|
||||
* The initial parameters of the particle(s) to simulate are given in the
|
||||
* LEMuSRPrimaryGeneratorAction class. This mandatory class work in interplay
|
||||
* with the LEMuSRParticleGun to create each new event of the simulation.
|
||||
*
|
||||
* An event is the track of one particle and all the particles created during its
|
||||
* evolution in the detector, by decay, scattering or any other kind of process.
|
||||
* cf. \ref pga.
|
||||
*/
|
||||
|
||||
class LEMuSRPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
// Constructor & Destructor
|
||||
public:
|
||||
//!\ct
|
||||
LEMuSRPrimaryGeneratorAction();
|
||||
//!\dt
|
||||
~LEMuSRPrimaryGeneratorAction();
|
||||
|
||||
|
||||
//! Pointer to the instance.
|
||||
static LEMuSRPrimaryGeneratorAction* thePGA;
|
||||
//! Returns the pointer to the instance.
|
||||
static LEMuSRPrimaryGeneratorAction* GetPGA();
|
||||
|
||||
|
||||
// Event generation method
|
||||
//!\mm
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
//! Selection of the beam profile.
|
||||
void GetScanningMode(G4int scan_mode);
|
||||
|
||||
private:
|
||||
//! Particle gun pointer.
|
||||
LEMuSRParticleGun* lemuParticleGun;
|
||||
public:
|
||||
double rndenergy;
|
||||
G4double
|
||||
//! Particle's decay time.
|
||||
decaytime,
|
||||
//! Energy of the particle.
|
||||
energy;
|
||||
HepRandomEngine * theEngine;
|
||||
|
||||
G4double
|
||||
//! Position of the gun.
|
||||
X, Y, Z,
|
||||
//! Momentum of the initial particle.
|
||||
momX, momY, momZ,
|
||||
//! Scanning parameters.
|
||||
m_xrange, m_yrange;
|
||||
|
||||
//! Scaning parameters.
|
||||
G4int m_counterx, m_nbxsteps, m_countery, m_nbysteps, scan, gauss;
|
||||
//! Scanning parameters.
|
||||
G4double radius, angle, mean, stddev, sc_mean, sc_stddev;
|
||||
//! Scanning parameters
|
||||
G4double circ;
|
||||
//! Scanning parameters.
|
||||
G4bool rnd;
|
||||
//! Pointer to the messenger.
|
||||
LEMuSRPgaMessenger* messenger;
|
||||
|
||||
G4double
|
||||
//! Particle's charge.
|
||||
charge,
|
||||
//! Energy offset (3.73 keV by default) to take into account the acceleration at the carbon foil.
|
||||
ke_offset;
|
||||
|
||||
//! Particle's name.
|
||||
G4String pname;
|
||||
|
||||
//===============================
|
||||
std::ofstream Yprint;
|
||||
double table[1000];
|
||||
int i,j;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION
|
||||
//
|
||||
// ID : LEMuSRRNDMAGField.hh , v 1.2
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-08-20 10:48
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// RND MAG FIELD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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;
|
||||
|
||||
};
|
@ -1,69 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
// LEMuSR
|
||||
#include "LEMuSRDetectorConstruction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4Run;
|
||||
/*!
|
||||
* This class registers the actions to take at the beginning of a run.
|
||||
* It has been imlpemented to enable the user interface.
|
||||
* cf \ref runaction.
|
||||
*/
|
||||
class LEMuSRRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
LEMuSRRunAction();
|
||||
~LEMuSRRunAction();
|
||||
|
||||
public:
|
||||
//! \ct
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
//! \dt
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -1,107 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : LEMuSRScintHit.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-07-12 16:15
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// INNER SCINT HIT
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,111 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : LEMuSRScintSD.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-07-12 16:15
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// INNER SCINT SD
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
@ -1,84 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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;
|
||||
|
||||
/*!
|
||||
* The role of the stacking action is to select the tracks to register or not.
|
||||
* Because of its architecture the \lemu simulation does not need to use a stacking action( cf. \ref Useraction).
|
||||
*/
|
||||
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:
|
||||
G4bool kill_e, kill_gamma, kill_nu_e, kill_nu_mu;
|
||||
|
||||
void KillUnwanted();
|
||||
|
||||
|
||||
/* 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
|
||||
|
@ -1,84 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : LEMuSRStackingActionMessenger.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-07-07 11:15
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// STACKING ACTION MESSENGER
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#ifndef LEMuSRStackingActionMessenger_h
|
||||
#define LEMuSRStackingActionMessenger_h 1
|
||||
|
||||
class LEMuSRStackingAction;
|
||||
|
||||
#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;
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
|
||||
/*!
|
||||
* Messenger clas for the stacking action (unused).
|
||||
*/
|
||||
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
|
||||
|
@ -1,68 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// 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>
|
||||
#include "LEMuSRVisManager.hh"
|
||||
#include "LEMuSRDetectorConstruction.hh"
|
||||
|
||||
/*!
|
||||
* The role of the stepping action is to take special actions
|
||||
* before or after a step.
|
||||
* Two importants methods can be implemented at will by the user,
|
||||
* the PreUserTrackingAction and the PostUserTrackingAction. Those two methods are
|
||||
* virtual methods and their names must not be changed.
|
||||
* One can use the tracking action for histogramming, but also to act on the tracked
|
||||
* particles, to get/print information, or even to delete useless tracks etc.( cf. \ref Useraction).
|
||||
*/
|
||||
|
||||
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
|
@ -1,88 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : LEMuSRTrackingAction.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-07-07 11:15
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// TRACKING ACTION.CC
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#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"
|
||||
#include "G4SteppingManager.hh" // Include from 'tracking'
|
||||
#include "G4TrackingManager.hh" // Include from 'tracking'
|
||||
|
||||
|
||||
/*!
|
||||
* The role of the tracking action is to take special actions
|
||||
* before or after a track.
|
||||
* Two importants methods can be implemented at will by the user,
|
||||
* the PreUserTrackingAction and the PostUserTrackingAction. Those two methods are
|
||||
* virtual methods and their names must not be changed.
|
||||
* One can use the tracking action for histogramming, but also to act on the tracked
|
||||
* particles, to get/print information, or even to delete useless tracks etc.( cf. \ref Useraction).
|
||||
*/
|
||||
|
||||
class LEMuSRTrackingAction : public G4UserTrackingAction {
|
||||
|
||||
public:
|
||||
LEMuSRTrackingAction();
|
||||
~ LEMuSRTrackingAction();
|
||||
void PreUserTrackingAction(const G4Track*);
|
||||
void PostUserTrackingAction(const G4Track*);
|
||||
|
||||
void Collect_datas(const G4Track*);
|
||||
static LEMuSRTrackingAction* GetInstance();
|
||||
static LEMuSRTrackingAction* pointer;
|
||||
|
||||
// TROOT eventTree;
|
||||
Int_t nevent , comp , split , write , hfill , read ,arg4, arg5 ;
|
||||
TFile *myFile;
|
||||
TTree *myTree;
|
||||
TBranch *b;
|
||||
TH1D *hEnergy, *hTime, *hAngle, *hAngle2;
|
||||
|
||||
G4TrackingManager* tMgr;
|
||||
|
||||
G4double GyroMagRatio;
|
||||
G4double GyroMagFactor;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : LEMuSRVisManager.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2004-07-07 11:15
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// VIS MANAGER
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#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
|
@ -1,49 +0,0 @@
|
||||
|
||||
#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
|
@ -1,128 +0,0 @@
|
||||
//§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§//*
|
||||
// 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>
|
||||
#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
|
@ -1,66 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : MEYER.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2005-04
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// MEYER
|
||||
/*
|
||||
fIRST IMPLEMENTATION BY ANLSEM,H. IN FORTRAN
|
||||
C++ CONVERSION T.K.PARAISO 04-2005
|
||||
|
||||
!!! IMPORTANT !!!
|
||||
|
||||
Notice:
|
||||
Tables definition changes between FORTRAN and C++:
|
||||
1/ Fortran indices start at 1 and C++ indices start at 0
|
||||
2/ Tables are defined as table[column][row] in Fortran
|
||||
table[row][column] in c++
|
||||
|
||||
usefull reference
|
||||
http://gershwin.ens.fr/vdaniel/Doc-Locale/Langages-Program-Scientific/Fortran/Tutorial/arrays.htm
|
||||
|
||||
*/
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
|
||||
#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
|
@ -1,54 +0,0 @@
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
|
||||
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
|
||||
// ID : YIELDS.hh , v 1.0
|
||||
// AUTHOR: Taofiq PARAISO
|
||||
// DATE : 2005-04
|
||||
//
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
//
|
||||
// & &&&&&&&&&& &&&&&&& &&&&&&&&
|
||||
// & & && && & &&
|
||||
// & & & & & & &&
|
||||
// & &&&&&&& & & &&&&&& &&&&&&&&
|
||||
// & & & && & & &&
|
||||
// & & && & & && && & &
|
||||
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// &
|
||||
// YIELDS
|
||||
/*
|
||||
fIRST IMPLEMENTATION BY ANLSEM,H. IN FORTRAN
|
||||
C++ CONVERSION T.K.PARAISO 04-2005
|
||||
*/
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
#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
|
Reference in New Issue
Block a user