Fixed Bugs

This commit is contained in:
paraiso 2006-03-15 02:37:11 +00:00
parent da93a5a456
commit 299699b906
25 changed files with 272 additions and 341 deletions

View File

@ -17,6 +17,9 @@ cp G4El_UsualEqRhs.cc $G4INSTALL/source/geometry/magneticfield/src/
cp G4El_UsualEqRhs.hh $G4INSTALL/source/geometry/magneticfield/include/ cp G4El_UsualEqRhs.hh $G4INSTALL/source/geometry/magneticfield/include/
# Enable the muon decay channel for "Mu" particle # Enable the muon decay channel for "Mu" particle
# Set parent polarization
cp G4VDecayChannel.cc $G4INSTALL/source/particles/management/src/
cp G4VDecayChannel.hh $G4INSTALL/source/particles/management/include/
cp G4MuonDecayChannel.cc $G4INSTALL/source/particles/management/src/ cp G4MuonDecayChannel.cc $G4INSTALL/source/particles/management/src/
cp G4MuonDecayChannel.hh $G4INSTALL/source/particles/management/include/ cp G4MuonDecayChannel.hh $G4INSTALL/source/particles/management/include/

View File

@ -100,6 +100,8 @@ int main(int argc,char** argv)//argc:: defines the user interface
runManager ->SetUserAction( new LEMuSRRunAction()); runManager ->SetUserAction( new LEMuSRRunAction());
runManager ->SetUserAction( new LEMuSREventAction());// scintillators, sensitive detectors runManager ->SetUserAction( new LEMuSREventAction());// scintillators, sensitive detectors
runManager ->SetUserAction( new LEMuSRTrackingAction()); runManager ->SetUserAction( new LEMuSRTrackingAction());
runManager ->SetUserAction( new LEMuSRStackingAction());
//! Optionnal stepping action: enable one at once only //! Optionnal stepping action: enable one at once only

View File

@ -0,0 +1,28 @@
LAST MODIFICATIONS
Stacking Manager:
The stacking manager is now responsible for the tracks selection. If the tracks in the staks are not desired partiles they are killed directly. This was done before by the stepping manager and costed more CPU time.
The gamma particles are killed. It seems that some processes for gamma particles have a bug in the 8.0.2.p01 version of geant4. The consequence is a global time that goes back. One should contact them to check it.
DetectorConstruction:
The ring anode was entirely built in the half or quarter detector view modes (cf command Detector/View ). This caused few problems with the geometry controler.
AtRestSpinPrecession:
The spin precession at rest is not calculated if the magnetic field is (0,0,0). This "mute" problem caused crashed in the simulation under rare special conditions. The typical error when a (0,0,0) vector is used or when a vector is divided by zero leads to a "ZMxpvInifiteVector thrown" message.
PhysicsList:
For simplicity the modular physics list was removed and everything is now in LEMuSRPhyiscsList.
SteppingAction:
Some data about the killed particles (killed for looping in fields) are now printed out.
LEMuSRMultipleScattering:
This class is now G4 independant and has its own ParticleChange.

View File

@ -146,8 +146,27 @@ typedef struct
Int_t muon,positron,gamma, runid; Int_t muon,positron,gamma, runid;
} cryoHit ; } 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. //! Root hit object.
cryoHit theHit; cryoHit theHit;
particleHit theParticle;
detectorData detector;
//! Filling the Root hit object. //! Filling the Root hit object.
/*! /*!

View File

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

View File

@ -64,7 +64,7 @@
#include "G4GPILSelection.hh" #include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh" #include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh" #include "G4VPhysicalVolume.hh"
#include "G4ParticleChangeForMSC.hh" #include "LEMuSRParticleChangeForMSC.hh"
#include "G4UnitsTable.hh" #include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh" #include "G4MaterialCutsCouple.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@ -212,7 +212,7 @@ class LEMuSRMSC : public G4VContinuousDiscreteProcess
G4double NuclCorrPar; G4double NuclCorrPar;
G4double FactPar; G4double FactPar;
G4ParticleChangeForMSC fParticleChange; LEMuSRParticleChangeForMSC fParticleChange;
G4double alfa1,alfa2,alfa3,b,xsi,c0,facxsi ; // angle distr. parameters G4double alfa1,alfa2,alfa3,b,xsi,c0,facxsi ; // angle distr. parameters
// facxsi : some tuning // facxsi : some tuning

View File

@ -20,11 +20,11 @@
// Magnetic Field // Magnetic Field
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$// //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
#include "G4UniformMagField.hh" #include "G4MagneticField.hh"
#include"G4ThreeVector.hh" #include"G4ThreeVector.hh"
#include"G4ios.hh" #include"G4ios.hh"
class LEMuSRMagneticField : public G4UniformMagField class LEMuSRMagneticField : public G4MagneticField
{ {
public: public:

View File

@ -64,7 +64,12 @@ private:
public: public:
/* inline void SetNRequestMuon(G4int val) { reqMuon = val; } 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 G4int GetNRequestMuon() const { return reqMuon; }
inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; } inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; }
inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; } inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; }

View File

@ -25,8 +25,30 @@
#define LEMuSRStackingActionMessenger_h 1 #define LEMuSRStackingActionMessenger_h 1
class LEMuSRStackingAction; class LEMuSRStackingAction;
class G4UIcmdWithAnInteger;
#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 G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3VectorAndUnit;
class G4UIcmdWith3Vector;
class G4UIcmdWithAnInteger;
class G4UIcmdWithAString;
class G4UIcmdWithoutParameter;
#include "G4UImessenger.hh" #include "G4UImessenger.hh"
#include "globals.hh" #include "globals.hh"
@ -49,10 +71,11 @@ class LEMuSRStackingActionMessenger: public G4UImessenger
LEMuSRStackingAction * myAction; LEMuSRStackingAction * myAction;
private: //commands private: //commands
/* G4UIcmdWithAnInteger * muonCmd; /*
G4UIcmdWithAnInteger * isomuonCmd; G4UIcmdWithAnInteger * muonCmd;
G4UIcmdWithAnInteger * isoCmd; G4UIcmdWithAnInteger * isomuonCmd;
G4UIcmdWithADoubleAndUnit * roiCmd; G4UIcmdWithAnInteger * isoCmd;
G4UIcmdWithADoubleAndUnit * roiCmd;
*/ */
}; };

View File

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

View File

@ -82,7 +82,7 @@ G4VParticleChange* LEMuSRAtRestSpinRotation::AtRestDoIt(const G4Track& theTrack,
{ {
theParticleChange.Initialize(theTrack); theParticleChange.Initialize(theTrack);
theParticleChange.ProposeTrackStatus(fAlive); theParticleChange.ProposeTrackStatus(fStopButAlive);
theParticleChange.ProposePosition(theTrack.GetPosition()); theParticleChange.ProposePosition(theTrack.GetPosition());
theParticleChange.ProposeMomentumDirection(theTrack.GetMomentumDirection()); theParticleChange.ProposeMomentumDirection(theTrack.GetMomentumDirection());
theParticleChange.ProposeEnergy(theTrack.GetKineticEnergy()); theParticleChange.ProposeEnergy(theTrack.GetKineticEnergy());
@ -136,16 +136,19 @@ G4VParticleChange* LEMuSRAtRestSpinRotation::AtRestDoIt(const G4Track& theTrack,
G4ThreeVector magField(B[0],B[1],B[2]); G4ThreeVector magField(B[0],B[1],B[2]);
RotateSpin(aStep,magField,deltatime); if(magField!=G4ThreeVector(0.0,0.0,0.0))
{
RotateSpin(aStep,magField,deltatime);
#ifdef G4SRVERBOSE #ifdef G4SRVERBOSE
G4cout<<"AT REST::: spin rotated"; G4cout<<"AT REST::: spin rotated";
#endif #endif
}
} }
theParticleChange.ProposePolarization(polar); theParticleChange.ProposePolarization(polar);

View File

@ -197,6 +197,13 @@ void LEMuSRCryoSD::getHit()
theHit.positron = e; theHit.positron = e;
theHit.gamma = g; theHit.gamma = g;
theHit.runid = G4RunManager::GetRunManager()->GetCurrentRun()->GetRunID(); theHit.runid = G4RunManager::GetRunManager()->GetCurrentRun()->GetRunID();
theParticle.muon = mu;
theParticle.positron = e;
theParticle.gamma = g;
theParticle.runid = G4RunManager::GetRunManager()->GetCurrentRun()->GetRunID();
} }
// ROOT METHODS // ROOT METHODS
@ -211,6 +218,8 @@ void LEMuSRCryoSD::BookRoot()
tree->Branch("cryoHit",&theHit.kenergy,"kenergy/F:tenergy/F:edeposit/F:localtime/F:globaltime:propertime/F:positionx/F:positiony:positionz:momdirx:momdiry:momdirz/F:foil/F:muon/I:muonium/I:gamma/I:runID/I"); tree->Branch("cryoHit",&theHit.kenergy,"kenergy/F:tenergy/F:edeposit/F:localtime/F:globaltime:propertime/F:positionx/F:positiony:positionz:momdirx:momdiry:momdirz/F:foil/F:muon/I:muonium/I:gamma/I:runID/I");
tree->Branch("particle",&theParticle.muon,"muon/I:muonium/I:gamma/I:runID/I");
} }
void LEMuSRCryoSD::FillRoot() void LEMuSRCryoSD::FillRoot()

View File

@ -42,6 +42,7 @@
#include "G4PropagatorInField.hh" #include "G4PropagatorInField.hh"
#include "G4ChordFinder.hh" #include "G4ChordFinder.hh"
#include "G4El_UsualEqRhs.hh" #include "G4El_UsualEqRhs.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4ClassicalRK4.hh" #include "G4ClassicalRK4.hh"
#include "G4SimpleHeum.hh" #include "G4SimpleHeum.hh"
#include "G4SimpleRunge.hh" #include "G4SimpleRunge.hh"
@ -169,13 +170,13 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !mind the V in
//! Definition of the top mothe volume: the laboratory. Refered to as Wolrd. //! Definition of the top mothe volume: the laboratory. Refered to as Wolrd.
// +++++++++++++++++++++++++++++++DEFINE THE MOTHER VOLUME: THE LABORATOY++++++++++++++++++++++ // +++++++++++++++++++++++++++++++DEFINE THE MOTHER VOLUME: THE LABORATOY++++++++++++++++++++++
// solid // solid
G4double LABO_x = 1*m; G4double LABO_x = 2*m;
G4double LABO_y = 1*m; G4double LABO_y = 2*m;
G4double LABO_z = 2*m; G4double LABO_z = 4*m;
LABO_box = new G4Box("World_box",LABO_x,LABO_y,LABO_z); LABO_box = new G4Box("World_box",LABO_x,LABO_y,LABO_z);
// logical volume // logical volume
LABO_material = G4Material::GetMaterial("Air"); LABO_material = G4Material::GetMaterial("vacuum");
lv_LABO = new G4LogicalVolume(LABO_box,LABO_material,"lv_World",0,0,0); lv_LABO = new G4LogicalVolume(LABO_box,LABO_material,"lv_World",0,0,0);
// physical volume // physical volume
@ -354,7 +355,7 @@ void LEMuSRDetectorConstruction::lemuMCP2()
// gate valve chamber // gate valve chamber
GATV_tube= new G4Tubs( "sGATV",7.65*cm, 10.325*cm, 9.25*cm, dSPhi, dEPhi); GATV_tube= new G4Tubs( "sGATV",7.655*cm, 10.32*cm, 9.25*cm, dSPhi, dEPhi);
GATS_tube= new G4Tubs( "sGATS", 10.325*cm, 12.65*cm, 9.25*cm, dSPhi, dEPhi); GATS_tube= new G4Tubs( "sGATS", 10.325*cm, 12.65*cm, 9.25*cm, dSPhi, dEPhi);
G4Transform3D tr_gatv; G4Transform3D tr_gatv;
@ -391,13 +392,12 @@ void LEMuSRDetectorConstruction::lemuMCP2()
if(AsymCheck!=1){ if(AsymCheck!=1){
pv_MCPS = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 0*cm),lv_MCPS ,"pv_MCPS",lv_LABO, false, 0 ); pv_MCPS = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 0*cm),lv_MCPS ,"pv_MCPS",lv_LABO, false, 0 );
pv_F160 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, -15.10*cm),lv_F160 ,"pv_F160",lv_LABO, false, 0 ); pv_F160 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, -15.10*cm),lv_F160 ,"pv_F160",lv_LABO, false, 0 );
pv_F100 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, +16.2*cm),lv_F100 ,"pv_F100",lv_LABO, false, 0 ); pv_F100 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, +16.2*cm),lv_F100 ,"pv_F100",lv_MCPV, false, 0 );
G4VPhysicalVolume* pv_F101;
pv_F101 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, -124.*cm),lv_F100 ,"pv_F101",lv_LABO, false, 0 );
GATVz= -25.45; GATVz= -25.45;
pv_F200 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 8.05*cm),lv_F200 ,"pv_F200",lv_GATV, false, 0 ); pv_F200 = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 8.05*cm),lv_F200 ,"pv_F200",lv_GATV, false, 0 );
@ -416,7 +416,7 @@ void LEMuSRDetectorConstruction::lemuMCP2()
// Apply attributes and user limit // Apply attributes and user limit
lv_MCPV->SetVisAttributes(G4VisAttributes::Invisible); lv_MCPV->SetVisAttributes(VTBB_style);//G4VisAttributes::Invisible);
lv_MCPS->SetVisAttributes(Blue_style); lv_MCPS->SetVisAttributes(Blue_style);
lv_F160->SetVisAttributes(fBlue_style); lv_F160->SetVisAttributes(fBlue_style);
lv_F100->SetVisAttributes(fBlue_style); lv_F100->SetVisAttributes(fBlue_style);
@ -428,7 +428,6 @@ void LEMuSRDetectorConstruction::lemuMCP2()
// user limits // user limits
G4UserLimits* RAV_lim = new G4UserLimits(); G4UserLimits* RAV_lim = new G4UserLimits();
RAV_lim -> SetMaxAllowedStep(FieldStepLim ); RAV_lim -> SetMaxAllowedStep(FieldStepLim );
//RAV_lim->SetUserMaxTrackLength(1.2*m);
RAV_lim-> SetUserMinEkine(1.*eV); RAV_lim-> SetUserMinEkine(1.*eV);
lv_MCPV->SetUserLimits(RAV_lim); lv_MCPV->SetUserLimits(RAV_lim);
// //
@ -453,13 +452,13 @@ void LEMuSRDetectorConstruction::lemuANODE()
RA_Ebox = new G4Box("RA_Ebox", 1.*cm,12.5*cm,2.25*cm ); RA_Ebox = new G4Box("RA_Ebox", 1.*cm,12.5*cm,2.25*cm );
RA_Mbox = new G4Box("RA_Mbox", 1.*cm,12.5*cm,2.25*cm ); RA_Mbox = new G4Box("RA_Mbox", 1.*cm,12.5*cm,2.25*cm );
RA_G_tube= new G4Tubs( "sRA_G", 5.8*cm,6.25*cm,5.55*cm, dSPhi, dEPhi); RA_G_tube = new G4Tubs( "sRA_G", 5.8*cm,6.25*cm,5.55*cm, dSPhi, dEPhi);
// logical volumes // logical volumes
lv_RA_E = new G4LogicalVolume( RA_E_cone , SSteel ,"lv_RA_E",0,0,0); lv_RA_E = new G4LogicalVolume( RA_E_cone ,G4Material::GetMaterial("stainless_steel") ,"lv_RA_E",0,0,0);
lv_RA_M = new G4LogicalVolume( RA_M_cone , SSteel ,"lv_RA_M",0,0,0); lv_RA_M = new G4LogicalVolume( RA_M_cone ,G4Material::GetMaterial("stainless_steel") ,"lv_RA_M",0,0,0);
lv_RA_G = new G4LogicalVolume( RA_G_tube , SSteel ,"lv_RA_G",0,0,0); lv_RA_G = new G4LogicalVolume( RA_G_tube , G4Material::GetMaterial("copper") ,"lv_RA_G",0,0,0);
// physical volumes // physical volumes
@ -469,8 +468,12 @@ void LEMuSRDetectorConstruction::lemuANODE()
// Mother Volume is lv_MCPV!!!! // Mother Volume is lv_MCPV!!!!
pv_RA_E = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Ez*cm-mcpv_z),lv_RA_E ,"pv_RA_E",lv_MCPV, false, 0 ); if(halfview==0)
pv_RA_M = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Mz*cm-mcpv_z),lv_RA_M ,"pv_RA_M",lv_MCPV, false, 0 ); {
pv_RA_E = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Ez*cm-mcpv_z),lv_RA_E ,"pv_RA_E",lv_MCPV, false, 0 );
pv_RA_M = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Mz*cm-mcpv_z),lv_RA_M ,"pv_RA_M",lv_MCPV, false, 0 );
}
pv_RA_G = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Gz*cm-mcpv_z),lv_RA_G ,"pv_RA_G",lv_MCPV, false, 0 ); pv_RA_G = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Gz*cm-mcpv_z),lv_RA_G ,"pv_RA_G",lv_MCPV, false, 0 );
rotation1=G4RotateZ3D(180*deg) ; rotation1=G4RotateZ3D(180*deg) ;
@ -494,7 +497,6 @@ void LEMuSRDetectorConstruction::lemuANODE()
lv_RA_M->SetVisAttributes(dBlue_style); lv_RA_M->SetVisAttributes(dBlue_style);
lv_RA_G->SetVisAttributes(lBlue_style); lv_RA_G->SetVisAttributes(lBlue_style);
} }
@ -1164,7 +1166,7 @@ void LEMuSRDetectorConstruction::buildAnodeField()
// 2 case of electro magnetic field // 2 case of electro magnetic field
G4UniformMagField* mcField; G4MagneticField* mcField;
if(magfield==1) if(magfield==1)
{ {
@ -1235,7 +1237,7 @@ void LEMuSRDetectorConstruction::buildAnodeField()
if(magfield==1) if(magfield==1)
{ {
G4UniformMagField* mcField; G4MagneticField* mcField;
#ifdef LEMU_TRANSVERSE_FIELD #ifdef LEMU_TRANSVERSE_FIELD

View File

@ -403,8 +403,8 @@ void LEMuSRDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newvalu
{ {
if(newvalue=="total") if(newvalue=="total")
{ {
theDetector->dSPhi=0*deg; theDetector->dSPhi=0.*deg;
theDetector->dEPhi=360*deg; theDetector->dEPhi=360.*deg;
theDetector->halfview=0; theDetector->halfview=0;
newDetector = theDetector->Construct(); newDetector = theDetector->Construct();
@ -413,8 +413,8 @@ void LEMuSRDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newvalu
} }
else if(newvalue=="half") else if(newvalue=="half")
{ {
theDetector->dSPhi=+90*deg; theDetector->dSPhi=90.*deg;
theDetector->dEPhi=180*deg; theDetector->dEPhi=180.*deg;
theDetector->halfview=1; theDetector->halfview=1;
newDetector = theDetector->Construct(); newDetector = theDetector->Construct();
@ -423,8 +423,8 @@ void LEMuSRDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newvalu
} }
else if(newvalue=="quarter") else if(newvalue=="quarter")
{ {
theDetector->dSPhi=0*deg; theDetector->dSPhi=0.*deg;
theDetector->dEPhi=270*deg; theDetector->dEPhi=270.*deg;
theDetector->halfview=1; theDetector->halfview=1;
newDetector = theDetector->Construct(); newDetector = theDetector->Construct();

View File

@ -1,103 +0,0 @@
// $Id$
// GEANT4 tag $Name: $
//
//
#include "LEMuSRIonPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
LEMuSRIonPhysics::LEMuSRIonPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
}
LEMuSRIonPhysics::~LEMuSRIonPhysics()
{
}
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
// Nuclei
#include "G4IonConstructor.hh"
void LEMuSRIonPhysics::ConstructParticle()
{
// Construct light ions
G4IonConstructor pConstructor;
pConstructor.ConstructParticle();
}
#include "G4ProcessManager.hh"
void LEMuSRIonPhysics::ConstructProcess()
{
G4ProcessManager * pManager = 0;
// Elastic Process
theElasticModel = new G4LElastic();
theElasticProcess.RegisterMe(theElasticModel);
// Generic Ion
pManager = G4GenericIon::GenericIon()->GetProcessManager();
// add process
pManager->AddDiscreteProcess(&theElasticProcess);
pManager->AddProcess(&fIonMultipleScattering, -1, 1, 1);
pManager->AddProcess(&fIonIonisation, -1, 2, 2);
// Deuteron
pManager = G4Deuteron::Deuteron()->GetProcessManager();
// add process
pManager->AddDiscreteProcess(&theElasticProcess);
fDeuteronModel = new G4LEDeuteronInelastic();
fDeuteronProcess.RegisterMe(fDeuteronModel);
pManager->AddDiscreteProcess(&fDeuteronProcess);
pManager->AddProcess(&fDeuteronMultipleScattering, -1, 1, 1);
pManager->AddProcess(&fDeuteronIonisation, -1, 2, 2);
// Triton
pManager = G4Triton::Triton()->GetProcessManager();
// add process
pManager->AddDiscreteProcess(&theElasticProcess);
fTritonModel = new G4LETritonInelastic();
fTritonProcess.RegisterMe(fTritonModel);
pManager->AddDiscreteProcess(&fTritonProcess);
pManager->AddProcess(&fTritonMultipleScattering, -1, 1, 1);
pManager->AddProcess(&fTritonIonisation, -1, 2, 2);
// Alpha
pManager = G4Alpha::Alpha()->GetProcessManager();
// add process
pManager->AddDiscreteProcess(&theElasticProcess);
fAlphaModel = new G4LEAlphaInelastic();
fAlphaProcess.RegisterMe(fAlphaModel);
pManager->AddDiscreteProcess(&fAlphaProcess);
pManager->AddProcess(&fAlphaMultipleScattering, -1, 1, 1);
pManager->AddProcess(&fAlphaIonisation, -1, 2, 2);
// He3
pManager = G4He3::He3()->GetProcessManager();
// add process
pManager->AddDiscreteProcess(&theElasticProcess);
pManager->AddProcess(&fHe3MultipleScattering, -1, 1, 1);
pManager->AddProcess(&fHe3Ionisation, -1, 2, 2);
}

View File

@ -67,7 +67,7 @@ G4VParticleChange* LEMuSRMUONIUM::PostStepDoIt(
{ {
fParticleChange.ProposeTrackStatus(trackData.GetTrackStatus()) ; fParticleChange.ProposeTrackStatus(trackData.GetTrackStatus()) ;
} }
// G4cout<<"MU Formation"<<G4endl;getchar();
return &fParticleChange; return &fParticleChange;
} }

View File

@ -63,13 +63,10 @@ LEMuSRMag_SpinEqRhs::SetChargeMomentumMass(G4double particleCharge, // in e+ uni
G4double gratio=GetGyromagneticRatio(); G4double gratio=GetGyromagneticRatio();
//G4cout <<"g ratio [MHz]/[T]"<<gratio<<G4endl; //G4cout <<"g ratio [MHz]/[T]"<<gratio<<G4endl;
omegac =gratio;// 0.105658387*GeV/mass * 2.837374841e-3*(rad/cm/kilogauss); omegac =gratio;
oldomegac = 0.105658387*GeV/mass * 2.837374841e-3*(rad/cm/kilogauss);
anomaly = 1.165923e-3;
#ifdef DEBUG #ifdef DEBUG
anomaly = 1.165923e-3;
oldomegac= 0.105658387*GeV/mass * 2.837374841e-3*(rad/cm/kilogauss); oldomegac= 0.105658387*GeV/mass * 2.837374841e-3*(rad/cm/kilogauss);
//G4cout<< "Old FrequencyG: " << G4BestUnit(oldomegac*gauss/(2*M_PI*rad)*cm,"Frequency") <<G4endl; //G4cout<< "Old FrequencyG: " << G4BestUnit(oldomegac*gauss/(2*M_PI*rad)*cm,"Frequency") <<G4endl;
#endif #endif
@ -92,6 +89,13 @@ LEMuSRMag_SpinEqRhs::EvaluateRhsGivenB( const G4double y[],
G4double dydx[] ) const G4double dydx[] ) const
{ {
G4double momentum_mag_square = sqr(y[3]) + sqr(y[4]) + sqr(y[5]); G4double momentum_mag_square = sqr(y[3]) + sqr(y[4]) + sqr(y[5]);
if (momentum_mag_square==0)
{
G4cout<<"LEMuSRMag_SpinEqRhs says: SEVERE ERROR:: MOMENTUM SQUARE ==0 !!!"<<G4endl;
return ;
}
G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square ); G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square );
G4double cof = FCof()*inv_momentum_magnitude; G4double cof = FCof()*inv_momentum_magnitude;
// G4cout << "\n------------ LEMuSRMAg_SpinEqRhs :: mommagnitude : "<< sqrt(momentum_mag_square) <<"\n"; // G4cout << "\n------------ LEMuSRMAg_SpinEqRhs :: mommagnitude : "<< sqrt(momentum_mag_square) <<"\n";

View File

@ -26,7 +26,6 @@
LEMuSRMagneticField::LEMuSRMagneticField(const G4ThreeVector FieldVector) LEMuSRMagneticField::LEMuSRMagneticField(const G4ThreeVector FieldVector)
:G4UniformMagField(FieldVector )
{ {
BField=FieldVector; BField=FieldVector;
// G4cout<<"MAGNETIC FIELD DEFINED AS "<<BField.x()/gauss<<"gauss"<<BField.y()/gauss<< "gauss"<<BField.z()/gauss<< "gauss"<<G4endl; // G4cout<<"MAGNETIC FIELD DEFINED AS "<<BField.x()/gauss<<"gauss"<<BField.y()/gauss<< "gauss"<<BField.z()/gauss<< "gauss"<<G4endl;
@ -42,27 +41,25 @@ void LEMuSRMagneticField::GetFieldValue (const G4double pos[4],
G4double *field ) const G4double *field ) const
{ {
field[0]= 0.0*gauss;
field[1]= 0.0*gauss;
field[2]= 0.0*gauss;
G4double X,Y,Z,factor;
field[0]= 0.0;
field[1]= 0.0;
field[2]= 0.0;
G4double X,Y,Z,factor;
X= pos[0]*mm;Y=pos[1]*mm;Z=pos[2]*mm; X= pos[0]*mm;Y=pos[1]*mm;Z=pos[2]*mm;
// G4cout<<"\n"<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<G4endl; // G4cout<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<G4endl;
if(Z<20*cm&&Z>-20*cm) /* if(Z<20*cm&&Z>-20*cm)
{ //G4cout<<"true!"; { //G4cout<<"true!";*/
factor=exp((-Z*Z)/(10*cm*10*cm)); factor=exp((-Z*Z)/(10*cm*10*cm));
field[0]= BField.x()*factor ;//TAO field[0]= BField.x()*factor*0 ;//TAO
field[1]= BField.y()*factor ; field[1]= BField.y()*factor*0 ;
field[2]= BField.z()*factor ; field[2]= BField.z()*factor*0 ;
//G4cout<<"true!"<<field[0]/gauss<<"gauss"<<field[1]/gauss<< "gauss"<<field[2]/gauss<< "gauss"<<G4endl;getchar(); // G4cout<<"true: "<<field[0]/gauss<<" gauss, "<<field[1]/gauss<< " gauss, "<<field[2]/gauss<< " gauss."<<G4endl;// getchar();
// getchar(); // getchar();
/*
} }
*/
} }

View File

@ -56,7 +56,7 @@ LEMuSRPgaMessenger::LEMuSRPgaMessenger(LEMuSRPrimaryGeneratorAction *thePGA)
posCmd->SetDefaultValue(Hep3Vector(0., 0., -114)); posCmd->SetDefaultValue(Hep3Vector(0., 0., -114));
momCmd = new G4UIcmdWith3Vector("/lemuGun/MomentumDirection",this); momCmd = new G4UIcmdWith3Vector("/lemuGun/MomentumDirection",this);
momCmd->SetGuidance("Set momentum direction >> norm must be one."); momCmd->SetGuidance("Set momentum direction >> sum must equal one.");
momCmd->SetParameterName("momX ","momY ","momZ ",true,true); momCmd->SetParameterName("momX ","momY ","momZ ",true,true);
momCmd->SetDefaultValue(Hep3Vector(0., 0., 1.)); momCmd->SetDefaultValue(Hep3Vector(0., 0., 1.));

View File

@ -51,8 +51,8 @@
LEMuSRPhysicsList::LEMuSRPhysicsList(): G4VUserPhysicsList() LEMuSRPhysicsList::LEMuSRPhysicsList(): G4VUserPhysicsList()
{ {
defaultCutValue = 1.0*mm; defaultCutValue = 5.0*mm;
SetVerboseLevel(1); SetVerboseLevel(2);
} }
LEMuSRPhysicsList::~LEMuSRPhysicsList() LEMuSRPhysicsList::~LEMuSRPhysicsList()
@ -78,11 +78,13 @@ void LEMuSRPhysicsList::ConstructParticle()
// for all particles which you want to use. // for all particles which you want to use.
// This ensures that objects of these particle types will be // This ensures that objects of these particle types will be
// created in the program. // created in the program.
SetCuts();
ConstructBosons(); ConstructBosons();
ConstructLeptons(); ConstructLeptons();
ConstructBaryons(); ConstructBaryons();
// ConstructMesons(); // ConstructMesons();
} }
@ -169,12 +171,14 @@ void LEMuSRPhysicsList::ConstructBaryons()
#include "G4PhotoElectricEffect.hh" #include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh" #include "G4MultipleScattering.hh"
#include "G4MultipleScattering52.hh"
#include "G4eIonisation.hh" #include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh" #include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh" #include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh" #include "G4MuIonisation.hh"
#include "G4MuIonisation52.hh"
#include "G4MuBremsstrahlung.hh" #include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh" #include "G4MuPairProduction.hh"
@ -210,7 +214,9 @@ void LEMuSRPhysicsList::ConstructProcess()
*/ */
ConstructEM(); ConstructEM();
/*! Construction of the Decay process when applicable. */ /*! Construction of the Decay process when applicable.
*
* Construction of User Cuts and Step Limitation. */
ConstructGeneral(); ConstructGeneral();
} }
@ -299,7 +305,7 @@ void LEMuSRPhysicsList::ConstructEM()
// PROCESSES FOR MUON PLUS // PROCESSES FOR MUON PLUS
//! Multiple Scattering including Meyer'Algorithm: LEMuSRMSC //! Multiple Scattering including Meyer'Algorithm: LEMuSRMSC
G4VProcess* aMultipleScattering = new LEMuSRMSC(); G4VProcess* aMultipleScattering = new LEMuSRMSC();//new G4MultipleScattering52();
//! Muonium formation: LEMuSRMUONIUM //! Muonium formation: LEMuSRMUONIUM
G4VProcess* aMuoniumFormation = new LEMuSRMUONIUM(); G4VProcess* aMuoniumFormation = new LEMuSRMUONIUM();
@ -332,20 +338,20 @@ void LEMuSRPhysicsList::ConstructEM()
// SET PROCESSES ORDERING (ALONG STEP. POST STEP. AT REST). // SET PROCESSES ORDERING (ALONG STEP. POST STEP. AT REST).
// set ordering for AlongStepDoIt // set ordering for AlongStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1); pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2); pmanager->SetProcessOrdering(anIonisation, idxAlongStep,3);
pmanager->SetProcessOrdering(aBremsstrahlung, idxAlongStep,3); pmanager->SetProcessOrdering(aBremsstrahlung, idxAlongStep,4);
pmanager->SetProcessOrdering(aPairProduction, idxAlongStep,4); pmanager->SetProcessOrdering(aPairProduction, idxAlongStep,5);
// set ordering for PostStepDoIt // set ordering for PostStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1); pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(aMuoniumFormation, idxPostStep,2); pmanager->SetProcessOrdering(aMuoniumFormation, idxPostStep,2);
pmanager->SetProcessOrdering(anIonisation, idxPostStep,3); pmanager->SetProcessOrdering(anIonisation, idxPostStep,3);
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,4); pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,4);
pmanager->SetProcessOrdering(aPairProduction, idxPostStep,5); pmanager->SetProcessOrdering(aPairProduction, idxPostStep,5);
// set ordering for AtRestDoIt // set ordering for AtRestDoIt
pmanager->SetProcessOrdering(aRestSpinRotation, idxAtRest,1); pmanager->SetProcessOrderingToFirst(aRestSpinRotation, idxAtRest);
} }
@ -361,41 +367,18 @@ void LEMuSRPhysicsList::ConstructEM()
G4VProcess* aRestSpinRotation = new LEMuSRAtRestSpinRotation(); G4VProcess* aRestSpinRotation = new LEMuSRAtRestSpinRotation();
G4VProcess* aMuScatt = new LEMuSRMUONIUMScatt(); G4VProcess* aMuScatt = new LEMuSRMUONIUMScatt();
/*
//! Unchanged \gf processes
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
G4VProcess* aPairProduction = new G4MuPairProduction();
G4VProcess* anIonisation = new G4MuIonisation();
*/
// ADD WANTED PROCESSES TO PROCESS MANAGER // ADD WANTED PROCESSES TO PROCESS MANAGER
// add lemu processes // add lemu processes
pmanager->AddProcess(aMuScatt); pmanager->AddProcess(aMuScatt);
pmanager->AddProcess(aRestSpinRotation); pmanager->AddProcess(aRestSpinRotation);
// add \gf processes
// pmanager->AddProcess(aBremsstrahlung);
// pmanager->AddProcess(anIonisation);
// pmanager->AddProcess(aPairProduction);
// SET PROCESSES ORDERING (ALONG STEP. POST STEP. AT REST).
// set ordering for AlongStepDoIt
// pmanager->SetProcessOrdering(anIonisation, idxAlongStep,1);
// pmanager->SetProcessOrdering(aBremsstrahlung, idxAlongStep,2);
// pmanager->SetProcessOrdering(aPairProduction, idxAlongStep,3);
// set ordering for PostStepDoIt // set ordering for PostStepDoIt
pmanager->SetProcessOrdering(aMuScatt, idxPostStep,1); pmanager->SetProcessOrdering(aMuScatt, idxPostStep,1);
// pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
// pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
// pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
// set ordering for AtRestDoIt // set ordering for AtRestDoIt
pmanager->SetProcessOrdering(aRestSpinRotation, idxAtRest,1); pmanager->SetProcessOrderingToFirst(aRestSpinRotation, idxAtRest);
} }
@ -405,7 +388,7 @@ void LEMuSRPhysicsList::ConstructEM()
//! Muon Minus Physics is implemented here. //! Muon Minus Physics is implemented here.
else if( particleName == "mu-" ) { else if( particleName == "mu-" ) {
//muon minus //muon minus
G4VProcess* aMultipleScattering = new G4MultipleScattering(); G4VProcess* aMultipleScattering = new G4MultipleScattering52();
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung(); G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
G4VProcess* aPairProduction = new G4MuPairProduction(); G4VProcess* aPairProduction = new G4MuPairProduction();
G4VProcess* anIonisation = new G4MuIonisation(); G4VProcess* anIonisation = new G4MuIonisation();
@ -468,7 +451,8 @@ void LEMuSRPhysicsList::ConstructEM()
#include "G4Decay.hh" #include "G4Decay.hh"
#include "G4UserSpecialCuts.hh" #include "G4UserSpecialCuts.hh"
#include "G4DecayTable.hh" #include "G4DecayTable.hh"
// Step Limiter Process
#include "G4StepLimiter.hh"
/*! \anchor constructdecayprocess*/ /*! \anchor constructdecayprocess*/
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
@ -481,9 +465,12 @@ void LEMuSRPhysicsList::ConstructEM()
void LEMuSRPhysicsList::ConstructGeneral() void LEMuSRPhysicsList::ConstructGeneral()
{ {
/*! Declare Decay Processes (from \lemu and \gf).*/ /*! Declare Decay Processes (from \lemu and \gf).*/
G4Decay* theDecayProcess = new G4Decay(); // G4Decay* theDecayProcess = new G4Decay();
LEMuSRDecay* theLEMuSRDecayProcess = new LEMuSRDecay(); LEMuSRDecay* theLEMuSRDecayProcess = new LEMuSRDecay();
/*! Declare User Cut.*/
G4StepLimiter* aStepLimiter = new G4StepLimiter();
G4UserSpecialCuts* aUserCut = new G4UserSpecialCuts();
/*! Initialization of the particle iterator.*/ /*! Initialization of the particle iterator.*/
theParticleIterator->reset(); theParticleIterator->reset();
@ -512,10 +499,14 @@ void LEMuSRPhysicsList::ConstructGeneral()
if (theLEMuSRDecayProcess->IsApplicable(*particle)) if (theLEMuSRDecayProcess->IsApplicable(*particle))
{ {
pmanager ->AddProcess(theLEMuSRDecayProcess); pmanager ->AddProcess(theLEMuSRDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt pmanager ->AddProcess(aStepLimiter);
pmanager ->SetProcessOrdering(theLEMuSRDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theLEMuSRDecayProcess, idxAtRest); // set ordering
pmanager ->SetProcessOrderingToLast(aStepLimiter, idxPostStep);
pmanager ->SetProcessOrderingToLast(theLEMuSRDecayProcess, idxPostStep);
pmanager ->SetProcessOrderingToLast(theLEMuSRDecayProcess, idxAtRest);
} }
pmanager->DumpInfo();
} }
else if (particle->GetParticleName()=="Mu") else if (particle->GetParticleName()=="Mu")
{ {
@ -534,11 +525,15 @@ void LEMuSRPhysicsList::ConstructGeneral()
if (theLEMuSRDecayProcess->IsApplicable(*particle)) if (theLEMuSRDecayProcess->IsApplicable(*particle))
{ {
pmanager ->AddProcess(theLEMuSRDecayProcess); pmanager ->AddProcess(theLEMuSRDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt pmanager ->AddProcess(aStepLimiter);
pmanager ->SetProcessOrdering(theLEMuSRDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theLEMuSRDecayProcess, idxAtRest); // set ordering
// pmanager ->SetProcessOrdering(aStepLimiter, idxPostStep, 1); // not needed for the muonium
pmanager ->SetProcessOrderingToLast(theLEMuSRDecayProcess, idxPostStep);
pmanager ->SetProcessOrderingToLast(theLEMuSRDecayProcess, idxAtRest);
} }
pmanager->DumpInfo();
} }
@ -553,6 +548,8 @@ void LEMuSRPhysicsList::ConstructGeneral()
else else
{ {
G4ProcessManager* pmanager = particle->GetProcessManager(); G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager ->AddProcess(aUserCut);
pmanager ->SetProcessOrdering(aUserCut, idxPostStep);
if (theLEMuSRDecayProcess->IsApplicable(*particle)) if (theLEMuSRDecayProcess->IsApplicable(*particle))
{ {
pmanager ->AddProcess(theLEMuSRDecayProcess); pmanager ->AddProcess(theLEMuSRDecayProcess);
@ -580,6 +577,9 @@ void LEMuSRPhysicsList::SetCuts()
// These values are used as the default production thresholds // These values are used as the default production thresholds
// for the world volume. // for the world volume.
SetCutsWithDefault(); SetCutsWithDefault();
SetCutValue(1.*mm, "e+");
SetCutValue(1.*mm, "e-");
// SetCutValue(1*mm, "proton");
} }

View File

@ -78,7 +78,7 @@ LEMuSRPrimaryGeneratorAction::LEMuSRPrimaryGeneratorAction()
lemuParticleGun->SetNumberOfParticles(1); lemuParticleGun->SetNumberOfParticles(1);
X=0; Y=0; X=0; Y=0;
Z=0.; Z=-114.;
momX=0.; momY=0.; momZ=1; momX=0.; momY=0.; momZ=1;
scan=0; scan=0;

View File

@ -38,6 +38,8 @@ LEMuSRStackingAction::LEMuSRStackingAction()
:ScintHits(0), stage(0) :ScintHits(0), stage(0)
{ {
theMessenger = new LEMuSRStackingActionMessenger(this); theMessenger = new LEMuSRStackingActionMessenger(this);
kill_e = true; kill_gamma = true; kill_nu_e = kill_nu_mu = true;
} }
LEMuSRStackingAction::~LEMuSRStackingAction() LEMuSRStackingAction::~LEMuSRStackingAction()
@ -48,10 +50,50 @@ LEMuSRStackingAction::~LEMuSRStackingAction()
G4ClassificationOfNewTrack G4ClassificationOfNewTrack
LEMuSRStackingAction::ClassifyNewTrack(const G4Track *) LEMuSRStackingAction::ClassifyNewTrack(const G4Track *track)
{ {
G4ClassificationOfNewTrack classification; G4ClassificationOfNewTrack classification;
classification = fUrgent; classification = fUrgent;
G4String p_name;
p_name = track->GetDefinition()->GetParticleName(); // particle name
if (p_name=="e-")
{
if (kill_e) classification=fKill;
}
else if (p_name=="gamma")
{
if (kill_gamma) classification=fKill;
}
else if (p_name=="nu_e")
{
if (kill_nu_e) classification=fKill;
}
else if (p_name=="anti_nu_e")
{
if (kill_nu_e) classification=fKill;
}
else if (p_name=="nu_mu")
{
if (kill_nu_mu) classification=fKill;
}
else if (p_name=="anti_nu_mu")
{
if (kill_nu_mu) classification=fKill;
}
return classification; return classification;
} }

View File

@ -66,6 +66,7 @@ void LEMuSRSteppingAction::UserSteppingAction(const G4Step* aStep)
{ {
LoopKiller(aStep); LoopKiller(aStep);
// G4cout<<"LEMuSR STEPPING ACTION INVOKED!"<<G4endl ;
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
G4String p_name; G4String p_name;
@ -87,6 +88,9 @@ void LEMuSRSteppingAction::UserSteppingAction(const G4Step* aStep)
pVVisManager -> Draw(polyline); pVVisManager -> Draw(polyline);
} }
// ParticleInfo(aStep);
} }
@ -105,23 +109,14 @@ void LEMuSRSteppingAction::UserSteppingAction(const G4Step* aStep)
void LEMuSRSteppingAction::LoopKiller(const G4Step *aStep) void LEMuSRSteppingAction::LoopKiller(const G4Step *aStep)
{ {
// loop killa // loop killa
if(aStep->GetTrack()->GetCurrentStepNumber()>2500) if(aStep->GetTrack()->GetCurrentStepNumber()>1500)
{ {
aStep->GetTrack()->SetTrackStatus(fStopAndKill); aStep->GetTrack()->SetTrackStatus(fStopAndKill);
G4cout<<"killed "<<G4endl; G4cout<<"killed:: step number > 1500 "<<G4endl;
ParticleInfo(aStep);
// getchar();
} }
/* if(aStep->GetTrack()->GetDefinition()->GetParticleName()=="e-"
||aStep->GetTrack()->GetDefinition()->GetParticleName()=="gamma"
||aStep->GetTrack()->GetDefinition()->GetParticleName()=="nu_e"
||aStep->GetTrack()->GetDefinition()->GetParticleName()=="anti_nu_e"
||aStep->GetTrack()->GetDefinition()->GetParticleName()=="nu_mu"
||aStep->GetTrack()->GetDefinition()->GetParticleName()=="anti_nu_mu")
{
aStep->GetTrack()->SetTrackStatus(fStopAndKill);
}
*/
} }
@ -246,8 +241,8 @@ void LEMuSRSteppingAction:: ParticleInfo(const G4Step *aStep)
G4double spin= aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetPDGSpin(); // spin in units of 1 G4double spin= aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetPDGSpin(); // spin in units of 1
//b //b
G4ThreeVector position = aStep->GetPostStepPoint()->GetPosition(); // position G4ThreeVector position = aStep->GetTrack()->GetPosition(); // position
G4ThreeVector momentum = aStep->GetPostStepPoint()->GetMomentum(); // momentum G4ThreeVector momentum = aStep->GetTrack()->GetMomentumDirection(); // momentum
//c //c
G4double tof = aStep->GetTrack()->GetLocalTime(); // time since track creation G4double tof = aStep->GetTrack()->GetLocalTime(); // time since track creation
G4double globaltime = aStep->GetTrack()->GetGlobalTime();// time since the event in which the track belongs is created. G4double globaltime = aStep->GetTrack()->GetGlobalTime();// time since the event in which the track belongs is created.
@ -263,8 +258,8 @@ void LEMuSRSteppingAction:: ParticleInfo(const G4Step *aStep)
// G4cout << "Parent particles are : " << aStep->GetTrack()->GetCreatorProcess()->GetProcessName() <<" ;\n "; // G4cout << "Parent particles are : " << aStep->GetTrack()->GetCreatorProcess()->GetProcessName() <<" ;\n ";
} }
G4cout.precision(6);
G4cout << "particle name : " << p_name <<" ;\n " G4cout << "particle name : " << p_name <<" ;\n "
<< "volume name : " << v_name <<" ;\n " << "volume name : " << v_name <<" ;\n "
<< "next volume name : " << nv_name <<" ;\n " << "next volume name : " << nv_name <<" ;\n "
<< "spin : " << spin <<" ;\n " << "spin : " << spin <<" ;\n "

View File

@ -1,9 +0,0 @@
#include "LEMuSRTrack.hh"
void LEMuSRTrack::SetDynamicParticle(G4DynamicParticle particle)
{
G4DynamicParticle *theParticle;
// theParticle = this->GetDynamicParticle();
*theParticle = particle;
}

View File

@ -96,10 +96,12 @@ void LEMuSRDetectorConstruction::lemuAsym()
G4Sphere *Asym_sphr = new G4Sphere("sphAsymR",25*cm,25.000001*cm,0.*deg,360*deg,0*deg,90*deg); G4Sphere *Asym_sphr = new G4Sphere("sphAsymR",25*cm,25.000001*cm,0.*deg,360*deg,0*deg,90*deg);
// logical volumes // logical volumes
lv_Asym = new G4LogicalVolume(Asym_tube,G4Material::GetMaterial("vacuum"),"lv_Asym",0,0,0); G4String mat = "vacuum";
lv_AsymL = new G4LogicalVolume(Asym_sphl,G4Material::GetMaterial("vacuum"),"lv_AsymL",0,0,0); lv_Asym = new G4LogicalVolume(Asym_tube,G4Material::GetMaterial(mat),"lv_Asym",0,0,0);
lv_AsymR = new G4LogicalVolume(Asym_sphr,G4Material::GetMaterial("vacuum"),"lv_AsymR",0,0,0);
lv_AsymL = new G4LogicalVolume(Asym_sphl,G4Material::GetMaterial(mat),"lv_AsymL",0,0,0);
lv_AsymR = new G4LogicalVolume(Asym_sphr,G4Material::GetMaterial(mat),"lv_AsymR",0,0,0);
// G4Translate3D trl =G4ThreeVector(+50.*cm,0.*cm,0.*cm); //uncomment // G4Translate3D trl =G4ThreeVector(+50.*cm,0.*cm,0.*cm); //uncomment
Asym_rotation = G4RotateY3D(90*deg); Asym_rotation = G4RotateY3D(90*deg);