Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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: RE01BosonPhysics.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
#include "RE01BosonPhysics.hh"
#include "G4ProcessManager.hh"
#include "G4GammaConversion.hh"
#include "G4ComptonScattering.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
RE01BosonPhysics::RE01BosonPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{;}
RE01BosonPhysics::~RE01BosonPhysics()
{;}
void RE01BosonPhysics::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
}
void RE01BosonPhysics::ConstructProcess()
{
// Add e+e- pair creation, Compton scattering and photo-electric effect
// to gamma
G4ProcessManager* pManager = G4Gamma::Gamma()->GetProcessManager();
pManager->AddDiscreteProcess(new G4GammaConversion());
pManager->AddDiscreteProcess(new G4ComptonScattering());
pManager->AddDiscreteProcess(new G4PhotoElectricEffect());
}
@@ -0,0 +1,101 @@
//
// ********************************************************************
// * 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: RE01CalorimeterHit.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01CalorimeterHit.hh"
#include "G4ios.hh"
#include "G4VVisManager.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4LogicalVolume.hh"
G4Allocator<RE01CalorimeterHit> RE01CalorimeterHitAllocator;
RE01CalorimeterHit::RE01CalorimeterHit()
{pLogV=0;}
RE01CalorimeterHit::RE01CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi)
: ZCellID(z), PhiCellID(phi), pLogV(logVol)
{;}
RE01CalorimeterHit::~RE01CalorimeterHit()
{;}
RE01CalorimeterHit::RE01CalorimeterHit(const RE01CalorimeterHit &right)
: G4VHit()
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
edepByATrack = right.edepByATrack;
trackInfo = right.trackInfo;
}
const RE01CalorimeterHit& RE01CalorimeterHit::operator=(const RE01CalorimeterHit &right)
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
edepByATrack = right.edepByATrack;
trackInfo = right.trackInfo;
return *this;
}
G4int RE01CalorimeterHit::operator==(const RE01CalorimeterHit &right) const
{
return ((ZCellID==right.ZCellID)&&(PhiCellID==right.PhiCellID));
}
void RE01CalorimeterHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Transform3D trans(rot,pos);
G4VisAttributes attribs;
const G4VisAttributes* pVA = pLogV->GetVisAttributes();
if(pVA) attribs = *pVA;
G4Colour colour(1.,0.,0.);
attribs.SetColour(colour);
attribs.SetForceWireframe(false);
attribs.SetForceSolid(true);
pVVisManager->Draw(*pLogV,attribs,trans);
}
}
void RE01CalorimeterHit::Print()
{
G4cout << "Cell[" << ZCellID << "," << PhiCellID << "] " << edep/GeV << " [GeV]" << G4endl;
}
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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: RE01CalorimeterParametrisation.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01CalorimeterParametrisation.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4Tubs.hh"
RE01CalorimeterParametrisation::RE01CalorimeterParametrisation()
{
#include "RE01DetectorParameterDef.icc"
}
RE01CalorimeterParametrisation::~RE01CalorimeterParametrisation()
{;}
void RE01CalorimeterParametrisation::ComputeTransformation
(const G4int,G4VPhysicalVolume *physVol) const
{
G4ThreeVector origin;
physVol->SetTranslation(origin);
}
void RE01CalorimeterParametrisation::ComputeDimensions
(G4Tubs & calorimeterLayer, const G4int copyNo, const G4VPhysicalVolume*) const
{
G4double innerRad = caloTubs_rmin
+ copyNo*(absorber_thick+scinti_thick);
calorimeterLayer.SetInnerRadius(innerRad);
calorimeterLayer.SetOuterRadius(innerRad+absorber_thick);
calorimeterLayer.SetZHalfLength(caloTubs_dz);
calorimeterLayer.SetStartPhiAngle(caloTubs_sphi);
calorimeterLayer.SetDeltaPhiAngle(caloTubs_dphi);
}
@@ -0,0 +1,113 @@
//
// ********************************************************************
// * 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: RE01CalorimeterROGeometry.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01CalorimeterROGeometry.hh"
#include "RE01DummySD.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4SDManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4ThreeVector.hh"
#include "G4Material.hh"
RE01CalorimeterROGeometry::RE01CalorimeterROGeometry()
: G4VReadOutGeometry()
{
#include "RE01DetectorParameterDef.icc"
}
RE01CalorimeterROGeometry::RE01CalorimeterROGeometry(G4String aString)
: G4VReadOutGeometry(aString)
{
#include "RE01DetectorParameterDef.icc"
}
RE01CalorimeterROGeometry::~RE01CalorimeterROGeometry()
{
}
G4VPhysicalVolume* RE01CalorimeterROGeometry::Build()
{
// A dummy material is used to fill the volumes of the readout geometry.
// ( It will be allowed to set a NULL pointer in volumes of such virtual
// division in future, since this material is irrelevant for tracking.)
G4Material* dummyMat = new G4Material(name="dummyMat", 1., 1.*g/mole, 1.*g/cm3);
//Builds the ReadOut World:
G4Box *ROWorldBox = new G4Box("ROWorldBox", expHall_x, expHall_y, expHall_z);
G4LogicalVolume *ROWorldLog = new G4LogicalVolume(ROWorldBox, dummyMat,
"ROWorldLogical", 0, 0, 0);
G4PVPlacement *ROWorldPhys = new G4PVPlacement(0,G4ThreeVector(),
"ROWorldPhysical",
ROWorldLog,
0,false,0);
// Calorimeter volume:
G4VSolid * caloROtub
= new G4Tubs("caloROtub",caloTubs_rmin,caloTubs_rmax,
caloTubs_dz,caloTubs_sphi,caloTubs_dphi);
G4LogicalVolume * caloROlog
= new G4LogicalVolume(caloROtub,dummyMat,"caloROlogical",0,0,0);
G4VPhysicalVolume * caloROphys
= new G4PVPlacement(0,G4ThreeVector(),"calROphysical",caloROlog,
ROWorldPhys,false,0);
// -------------------------------
// Calorimeter readout division:
// -------------------------------
// Phi division first: 48 sectors
G4VSolid * caloROphiDivisionTub
= new G4Tubs("caloROphiDivision", caloCell_rmin, caloCell_rmax,
caloCell_dz, caloCell_sphi, caloCell_dphi);
G4LogicalVolume * caloROphiDivisionLog
= new G4LogicalVolume(caloROphiDivisionTub, dummyMat, "caloROphiDivisionLogical",0,0,0);
G4VPhysicalVolume * caloROphiDivisionPhys
= new G4PVReplica("caloROphiDivisionPhysical", caloROphiDivisionLog, caloROphys,
kPhi, segmentsinPhi, caloCell_dphi);
// then z division: 20 slices:
G4VSolid * caloROcellTub
= new G4Tubs("caloROcellTub", caloRing_rmin, caloRing_rmax,
caloRing_dz, caloRing_sphi, caloRing_dphi);
G4LogicalVolume * caloROcellLog
= new G4LogicalVolume(caloROcellTub, dummyMat, "caloROcellLogical",0,0,0);
// G4VPhysicalVolume * caloROcellPhys =
new G4PVReplica("caloROcellPhysical", caloROcellLog, caloROphiDivisionPhys,
kZAxis, segmentsinZ,2.*caloRing_dz);
//Flags the cells as sensitive .The pointer here serves
// as a flag only to check for sensitivity.
// (Could we make it by a simple cast of a non-NULL value ?)
RE01DummySD * dummySensi = new RE01DummySD;
caloROcellLog->SetSensitiveDetector(dummySensi);
return ROWorldPhys;
}
@@ -0,0 +1,122 @@
//
// ********************************************************************
// * 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: RE01CalorimeterSD.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01CalorimeterSD.hh"
#include "RE01CalorimeterHit.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4ParticleDefinition.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4ios.hh"
RE01CalorimeterSD::RE01CalorimeterSD(G4String name)
:G4VSensitiveDetector(name),
numberOfCellsInZ(20),numberOfCellsInPhi(48)
{
G4String HCname;
collectionName.insert(HCname="calCollection");
}
RE01CalorimeterSD::~RE01CalorimeterSD()
{;}
void RE01CalorimeterSD::Initialize(G4HCofThisEvent* HCE)
{
CalCollection = new RE01CalorimeterHitsCollection
(SensitiveDetectorName,collectionName[0]);
for(G4int j=0;j<numberOfCellsInZ;j++)
for(G4int k=0;k<numberOfCellsInPhi;k++)
{
CellID[j][k] = -1;
}
static G4int HCID = -1;
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection( HCID, CalCollection );
}
G4bool RE01CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
{
if(!ROhist) return false;
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep==0.) return false;
G4VPhysicalVolume* physVol = ROhist->GetVolume();
//ROhist->MoveUpHistory();
//G4VPhysicalVolume* mothVol = ROhist->GetVolume(1);
G4int copyIDinZ = ROhist->GetReplicaNumber();
G4int copyIDinPhi = ROhist->GetReplicaNumber(1);
if(CellID[copyIDinZ][copyIDinPhi]==-1)
{
RE01CalorimeterHit* calHit
= new RE01CalorimeterHit
(physVol->GetLogicalVolume(),copyIDinZ,copyIDinPhi);
G4RotationMatrix rotM;
if(physVol->GetObjectRotation()) rotM = *(physVol->GetObjectRotation());
calHit->SetEdep( edep );
calHit->SetPos( physVol->GetTranslation() );
calHit->SetRot( rotM );
calHit->SetTrackInformation(aStep->GetTrack());
G4int icell = CalCollection->insert( calHit );
CellID[copyIDinZ][copyIDinPhi] = icell - 1;
if(verboseLevel>0)
{ G4cout << " New Calorimeter Hit on CellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
else
{
(*CalCollection)[CellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
(*CalCollection)[CellID[copyIDinZ][copyIDinPhi]]->SetTrackInformation(aStep->GetTrack());
if(verboseLevel>0)
{ G4cout << " Energy added to CellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
return true;
}
void RE01CalorimeterSD::EndOfEvent(G4HCofThisEvent*)
{
}
void RE01CalorimeterSD::clear()
{
}
void RE01CalorimeterSD::DrawAll()
{
}
void RE01CalorimeterSD::PrintAll()
{
}
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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: RE01DecayPhysics.cc,v 1.1 2004/11/26 07:37:41 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01DecayPhysics.hh"
// #include "globals.hh"
// #include "G4ios.hh"
// #include <iomanip>
RE01DecayPhysics::RE01DecayPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{
}
RE01DecayPhysics::~RE01DecayPhysics()
{
}
// #include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4UnknownParticle.hh"
void RE01DecayPhysics::ConstructParticle()
{
G4UnknownParticle::UnknownParticleDefinition();
}
void RE01DecayPhysics::ConstructProcess()
{
// Add Decay Process
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess.IsApplicable(*particle)) {
pmanager ->AddProcess(&fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(&fDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(&fDecayProcess, idxAtRest);
}
if(particle->GetParticleName()=="unknown") {
pmanager ->AddProcess(&fUnknownDecay);
pmanager ->SetProcessOrdering(&fUnknownDecay, idxPostStep);
}
}
}
@@ -0,0 +1,249 @@
//
// ********************************************************************
// * 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: RE01DetectorConstruction.cc,v 1.2 2004/11/26 17:20:27 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01DetectorConstruction.hh"
#include "RE01TrackerSD.hh"
#include "RE01CalorimeterSD.hh"
#include "RE01CalorimeterROGeometry.hh"
#include "RE01TrackerParametrisation.hh"
#include "RE01CalorimeterParametrisation.hh"
#include "RE01Field.hh"
#include "RE01RegionInformation.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4PVParameterised.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4SDManager.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4Region.hh"
#include "G4RegionStore.hh"
RE01DetectorConstruction::RE01DetectorConstruction()
{
#include "RE01DetectorParameterDef.icc"
}
RE01DetectorConstruction::~RE01DetectorConstruction()
{;}
G4VPhysicalVolume* RE01DetectorConstruction::Construct()
{
//-------------------------------------------------------------------------
// Magnetic field
//-------------------------------------------------------------------------
/******************************************************************
static G4bool fieldIsInitialized = false;
if(!fieldIsInitialized)
{
RE01Field* myField = new RE01Field;
G4FieldManager* fieldMgr
= G4TransportationManager::GetTransportationManager()
->GetFieldManager();
fieldMgr->SetDetectorField(myField);
fieldMgr->CreateChordFinder(myField);
fieldIsInitialized = true;
}
*******************************************************************/
//-------------------------------------------------------------------------
// Materials
//-------------------------------------------------------------------------
G4double a, iz, z, density;
G4String name, symbol;
G4int nel;
a = 1.01*g/mole;
G4Element* elH = new G4Element(name="Hydrogen", symbol="H", iz=1., a);
a = 12.01*g/mole;
G4Element* elC = new G4Element(name="Carbon", symbol="C", iz=6., a);
a = 14.01*g/mole;
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
a = 16.00*g/mole;
G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
density = 1.29e-03*g/cm3;
G4Material* Air = new G4Material(name="Air", density, nel=2);
Air->AddElement(elN, .7);
Air->AddElement(elO, .3);
a = 207.19*g/mole;
density = 11.35*g/cm3;
G4Material* Lead = new G4Material(name="Lead", z=82., a, density);
a = 39.95*g/mole;
density = 1.782e-03*g/cm3;
G4Material* Ar = new G4Material(name="ArgonGas", z=18., a, density);
a = 28.09*g/mole;
density = 2.33*g/cm3;
G4Material * Silicon = new G4Material(name="Silicon", z=14., a, density);
density = 1.032*g/cm3;
G4Material* Scinti = new G4Material(name="Scintillator", density, nel=2);
Scinti->AddElement(elC, 9);
Scinti->AddElement(elH, 10);
//-------------------------------------------------------------------------
// Detector geometry
//-------------------------------------------------------------------------
//------------------------------ experimental hall
G4Box * experimentalHall_box
= new G4Box("expHall_b",expHall_x,expHall_y,expHall_z);
G4LogicalVolume * experimentalHall_log
= new G4LogicalVolume(experimentalHall_box,Air,"expHall_L",0,0,0);
G4VPhysicalVolume * experimentalHall_phys
= new G4PVPlacement(0,G4ThreeVector(),experimentalHall_log,"expHall_P",
0,false,0);
G4VisAttributes* experimentalHallVisAtt
= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
experimentalHallVisAtt->SetForceWireframe(true);
experimentalHall_log->SetVisAttributes(experimentalHallVisAtt);
G4Region* defaultRegion = (*(G4RegionStore::GetInstance()))[0];
RE01RegionInformation* defaultRInfo = new RE01RegionInformation();
defaultRInfo->SetWorld();
defaultRegion->SetUserInformation(defaultRInfo);
//------------------------------ tracker
G4VSolid * tracker_tubs
= new G4Tubs("trkTubs_tubs",trkTubs_rmin,trkTubs_rmax,trkTubs_dz,
trkTubs_sphi,trkTubs_dphi);
G4LogicalVolume * tracker_log
= new G4LogicalVolume(tracker_tubs,Ar,"trackerT_L",0,0,0);
// G4VPhysicalVolume * tracker_phys =
new G4PVPlacement(0,G4ThreeVector(),tracker_log,"tracker_phys",
experimentalHall_log,false,0);
G4VisAttributes* tracker_logVisAtt
= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
tracker_logVisAtt->SetForceWireframe(true);
tracker_log->SetVisAttributes(tracker_logVisAtt);
G4Region* trackerRegion = new G4Region("TrackerRegion");
RE01RegionInformation* trackerInfo = new RE01RegionInformation();
trackerInfo->SetTracker();
trackerRegion->SetUserInformation(trackerInfo);
tracker_log->SetRegion(trackerRegion);
trackerRegion->AddRootLogicalVolume(tracker_log);
//------------------------------ tracker layers
// As an example for Parameterised volume
// dummy values for G4Tubs -- modified by parameterised volume
G4VSolid * trackerLayer_tubs
= new G4Tubs("trackerLayer_tubs",trkTubs_rmin,trkTubs_rmax,trkTubs_dz,
trkTubs_sphi,trkTubs_dphi);
G4LogicalVolume * trackerLayer_log
= new G4LogicalVolume(trackerLayer_tubs,Silicon,"trackerB_L",0,0,0);
G4VPVParameterisation * trackerParam
= new RE01TrackerParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume *trackerLayer_phys =
new G4PVParameterised("trackerLayer_phys",trackerLayer_log,tracker_log,
kXAxis, notrkLayers, trackerParam);
G4VisAttributes* trackerLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.5,0.0,1.0));
trackerLayer_logVisAtt->SetForceWireframe(true);
trackerLayer_log->SetVisAttributes(trackerLayer_logVisAtt);
//------------------------------ calorimeter
G4VSolid * calorimeter_tubs
= new G4Tubs("calorimeter_tubs",caloTubs_rmin,caloTubs_rmax,
caloTubs_dz,caloTubs_sphi,caloTubs_dphi);
G4LogicalVolume * calorimeter_log
= new G4LogicalVolume(calorimeter_tubs,Scinti,"caloT_L",0,0,0);
// G4VPhysicalVolume * calorimeter_phys =
new G4PVPlacement(0,G4ThreeVector(),calorimeter_log,"caloM_P",
experimentalHall_log,false,0);
G4VisAttributes* calorimeter_logVisATT
= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
calorimeter_logVisATT->SetForceWireframe(true);
calorimeter_log->SetVisAttributes(calorimeter_logVisATT);
G4Region* calorimeterRegion = new G4Region("CalorimeterRegion");
RE01RegionInformation* calorimeterInfo = new RE01RegionInformation();
calorimeterInfo->SetCalorimeter();
calorimeterRegion->SetUserInformation(calorimeterInfo);
calorimeter_log->SetRegion(calorimeterRegion);
calorimeterRegion->AddRootLogicalVolume(calorimeter_log);
//------------------------------- Lead layers
// As an example for Parameterised volume
// dummy values for G4Tubs -- modified by parameterised volume
G4VSolid * caloLayer_tubs
= new G4Tubs("caloLayer_tubs",caloRing_rmin,caloRing_rmax,
caloRing_dz,caloRing_sphi,caloRing_dphi);
G4LogicalVolume * caloLayer_log
= new G4LogicalVolume(caloLayer_tubs,Lead,"caloR_L",0,0,0);
G4VPVParameterisation * calorimeterParam
= new RE01CalorimeterParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume * caloLayer_phys =
new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
kXAxis, nocaloLayers, calorimeterParam);
G4VisAttributes* caloLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.7,1.0,0.0));
caloLayer_logVisAtt->SetForceWireframe(true);
caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
//------------------------------------------------------------------
// Sensitive Detector
//------------------------------------------------------------------
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String trackerSDname = "/mydet/tracker";
RE01TrackerSD * trackerSD = new RE01TrackerSD(trackerSDname);
SDman->AddNewDetector(trackerSD);
trackerLayer_log->SetSensitiveDetector(trackerSD);
G4String calorimeterSDname = "/mydet/calorimeter";
RE01CalorimeterSD * calorimeterSD = new RE01CalorimeterSD(calorimeterSDname);
G4String ROgeometryName = "CalorimeterROGeom";
G4VReadOutGeometry* calRO = new RE01CalorimeterROGeometry(ROgeometryName);
calRO->BuildROGeometry();
calorimeterSD->SetROgeometry(calRO);
SDman->AddNewDetector(calorimeterSD);
calorimeter_log->SetSensitiveDetector(calorimeterSD);
return experimentalHall_phys;
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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: RE01DetectorParameterDef.icc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
expHall_x = 600.*cm;
expHall_y = 600.*cm;
expHall_z = 600.*cm;
trkTubs_rmax = 50.*cm;
trkTubs_rmin = 20.*cm;
trkTubs_dz = 100.*cm;
trkTubs_sphi = 0.*deg;
trkTubs_dphi = 360.*deg;
notrkLayers = 5;
tracker_radius[0] = 25.*cm;
tracker_radius[1] = 30.*cm;
tracker_radius[2] = 35.*cm;
tracker_radius[3] = 40.*cm;
tracker_radius[4] = 45.*cm;
tracker_thick = 0.5*cm;
for(int il=0;il<5;il++)
{
tracker_length[il] = tracker_radius[il];
}
caloTubs_rmax = 300.*cm;
caloTubs_rmin = 50.*cm;
caloTubs_dz = 200.*cm;
caloTubs_sphi = 0.*deg;
caloTubs_dphi = 360.*deg;
absorber_thick = 3.*cm;
scinti_thick = 2.*cm;
nocaloLayers = int((caloTubs_rmax-caloTubs_rmin)/(absorber_thick+scinti_thick));
segmentsinPhi = 48;
caloCell_rmax = caloTubs_rmax;
caloCell_rmin = caloTubs_rmin;
caloCell_dz = caloTubs_dz;
caloCell_sphi = caloTubs_sphi;
caloCell_dphi = caloTubs_dphi/segmentsinPhi;
segmentsinZ = 20;
caloRing_rmax = caloCell_rmax;
caloRing_rmin = caloCell_rmin;
caloRing_dz = caloCell_dz/segmentsinZ ;
caloRing_sphi = caloCell_sphi;
caloRing_dphi = caloCell_dphi;
@@ -0,0 +1,39 @@
//
// ********************************************************************
// * 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: RE01DummySD.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// Dummy sensitive used only to flag sensitivity
// in cells of RO geometry.
//
#include "RE01DummySD.hh"
RE01DummySD::RE01DummySD()
: G4VSensitiveDetector("dummySD")
{;}
RE01DummySD::~RE01DummySD()
{;}
@@ -0,0 +1,160 @@
//
// ********************************************************************
// * 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: RE01EventAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01EventAction.hh"
#include "RE01TrackerHit.hh"
#include "RE01CalorimeterHit.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4TrajectoryContainer.hh"
#include "G4VVisManager.hh"
#include "G4SDManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "RE01Trajectory.hh"
#include "G4PrimaryVertex.hh"
#include "G4PrimaryParticle.hh"
RE01EventAction::RE01EventAction()
{
trackerCollID = -1;
calorimeterCollID = -1;
muonCollID = -1;
}
RE01EventAction::~RE01EventAction()
{;}
void RE01EventAction::BeginOfEventAction(const G4Event*)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
if(trackerCollID<0||calorimeterCollID<0||muonCollID<0)
{
G4String colNam;
trackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
calorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
}
}
void RE01EventAction::EndOfEventAction(const G4Event* evt)
{
G4cout << ">>> Summary of Event " << evt->GetEventID() << G4endl;
if(trackerCollID<0||calorimeterCollID<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RE01TrackerHitsCollection* THC = 0;
RE01CalorimeterHitsCollection* CHC = 0;
if(HCE)
{
THC = (RE01TrackerHitsCollection*)(HCE->GetHC(trackerCollID));
CHC = (RE01CalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
}
if(THC)
{
int n_hit = THC->entries();
G4cout << G4endl;
G4cout << "Tracker hits --------------------------------------------------------------" << G4endl;
G4cout << n_hit << " hits are stored in RE01TrackerHitsCollection." << G4endl;
G4cout << "List of hits in tracker" << G4endl;
for(int i=0;i<n_hit;i++)
{ (*THC)[i]->Print(); }
}
if(CHC)
{
int n_hit = CHC->entries();
G4cout << G4endl;
G4cout << "Calorimeter hits --------------------------------------------------------------" << G4endl;
G4cout << n_hit << " hits are stored in RE01CalorimeterHitsCollection." << G4endl;
G4double totE = 0;
for(int i=0;i<n_hit;i++)
{ totE += (*CHC)[i]->GetEdep(); }
G4cout << " Total energy deposition in calorimeter : "
<< totE / GeV << " (GeV)" << G4endl;
}
// get number of stored trajectories
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
// extract the trajectories and print them out
G4cout << G4endl;
G4cout << "Trajectories in tracker --------------------------------------------------------------" << G4endl;
for(G4int i=0; i<n_trajectories; i++)
{
RE01Trajectory* trj = (RE01Trajectory*)((*(evt->GetTrajectoryContainer()))[i]);
trj->ShowTrajectory();
}
G4cout << G4endl;
G4cout << "Primary particles --------------------------------------------------------------" << G4endl;
G4int n_vertex = evt->GetNumberOfPrimaryVertex();
for(G4int iv=0;iv<n_vertex;iv++)
{
G4PrimaryVertex* pv = evt->GetPrimaryVertex(iv);
G4cout << G4endl;
G4cout << "Primary vertex "
<< G4ThreeVector(pv->GetX0(),pv->GetY0(),pv->GetZ0())
<< " at t = " << (pv->GetT0())/ns << " [ns]" << G4endl;
G4PrimaryParticle* pp = pv->GetPrimary();
while(pp)
{
PrintPrimary(pp,0);
pp = pp->GetNext();
}
}
}
void RE01EventAction::PrintPrimary(G4PrimaryParticle* pp,G4int ind)
{
for(G4int ii=0;ii<=ind;ii++)
{ G4cout << " "; }
G4cout << "==PDGcode " << pp->GetPDGcode() << " ";
if(pp->GetG4code()!=0)
{ G4cout << "(" << pp->GetG4code()->GetParticleName() << ")"; }
else
{ G4cout << "is not defined in G4"; }
G4cout << " " << pp->GetMomentum()/GeV << " [GeV] ";
if(pp->GetTrackID()<0)
{ G4cout << G4endl; }
else
{ G4cout << ">>> G4Track ID " << pp->GetTrackID() << G4endl; }
G4PrimaryParticle* daughter = pp->GetDaughter();
while(daughter)
{
PrintPrimary(daughter,ind+1);
daughter = daughter->GetNext();
}
}
@@ -0,0 +1,49 @@
//
// ********************************************************************
// * 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: RE01Field.cc,v 1.2 2004/12/02 07:34:56 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
#include "RE01Field.hh"
RE01Field::RE01Field()
{
Bz = 3.0*tesla;
rmax_sq = sqr(50.*cm);
zmax = 100.*cm;
}
RE01Field::~RE01Field()
{;}
void RE01Field::GetFieldValue(const double Point[3],double *Bfield) const
{
Bfield[0] = 0.;
Bfield[1] = 0.;
if(std::abs(Point[2])<zmax && (sqr(Point[0])+sqr(Point[1]))<rmax_sq)
{ Bfield[2] = Bz; }
else
{ Bfield[2] = 0.; }
}
@@ -0,0 +1,741 @@
//
// ********************************************************************
// * 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: RE01HadronPhysics.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01HadronPhysics.hh"
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
// processes
#include "G4ParticleTable.hh"
#include "G4ProcessManager.hh"
#include "G4MultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4HadronElasticProcess.hh"
#include "G4PionPlusInelasticProcess.hh"
#include "G4PionMinusInelasticProcess.hh"
#include "G4KaonPlusInelasticProcess.hh"
#include "G4KaonMinusInelasticProcess.hh"
#include "G4KaonZeroLInelasticProcess.hh"
#include "G4KaonZeroSInelasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4AntiProtonInelasticProcess.hh"
#include "G4AntiNeutronInelasticProcess.hh"
#include "G4LambdaInelasticProcess.hh"
#include "G4AntiLambdaInelasticProcess.hh"
#include "G4SigmaPlusInelasticProcess.hh"
#include "G4SigmaMinusInelasticProcess.hh"
#include "G4AntiSigmaPlusInelasticProcess.hh"
#include "G4AntiSigmaMinusInelasticProcess.hh"
#include "G4XiZeroInelasticProcess.hh"
#include "G4XiMinusInelasticProcess.hh"
#include "G4AntiXiZeroInelasticProcess.hh"
#include "G4AntiXiMinusInelasticProcess.hh"
#include "G4OmegaMinusInelasticProcess.hh"
#include "G4AntiOmegaMinusInelasticProcess.hh"
#include "G4AntiProtonAnnihilationAtRest.hh"
#include "G4AntiNeutronAnnihilationAtRest.hh"
#include "G4PionMinusAbsorptionAtRest.hh"
#include "G4KaonMinusAbsorption.hh"
// cross sections
#include "G4PiNuclearCrossSection.hh"
#include "G4ProtonInelasticCrossSection.hh"
#include "G4NeutronInelasticCrossSection.hh"
// models
#include "G4LElastic.hh"
#include "G4CascadeInterface.hh"
#include "G4LEPionPlusInelastic.hh"
#include "G4LEPionMinusInelastic.hh"
#include "G4LEKaonPlusInelastic.hh"
#include "G4LEKaonMinusInelastic.hh"
#include "G4LEKaonZeroLInelastic.hh"
#include "G4LEKaonZeroSInelastic.hh"
#include "G4LEProtonInelastic.hh"
#include "G4LENeutronInelastic.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4LEAntiProtonInelastic.hh"
#include "G4LEAntiNeutronInelastic.hh"
#include "G4LELambdaInelastic.hh"
#include "G4LEAntiLambdaInelastic.hh"
#include "G4LESigmaPlusInelastic.hh"
#include "G4LESigmaMinusInelastic.hh"
#include "G4LEAntiSigmaPlusInelastic.hh"
#include "G4LEAntiSigmaMinusInelastic.hh"
#include "G4LEXiZeroInelastic.hh"
#include "G4LEXiMinusInelastic.hh"
#include "G4LEAntiXiZeroInelastic.hh"
#include "G4LEAntiXiMinusInelastic.hh"
#include "G4LEOmegaMinusInelastic.hh"
#include "G4LEAntiOmegaMinusInelastic.hh"
#include "G4HEAntiProtonInelastic.hh"
#include "G4HEAntiNeutronInelastic.hh"
#include "G4HELambdaInelastic.hh"
#include "G4HEAntiLambdaInelastic.hh"
#include "G4HESigmaPlusInelastic.hh"
#include "G4HESigmaMinusInelastic.hh"
#include "G4HEAntiSigmaPlusInelastic.hh"
#include "G4HEAntiSigmaMinusInelastic.hh"
#include "G4HEXiZeroInelastic.hh"
#include "G4HEXiMinusInelastic.hh"
#include "G4HEAntiXiZeroInelastic.hh"
#include "G4HEAntiXiMinusInelastic.hh"
#include "G4HEOmegaMinusInelastic.hh"
#include "G4HEAntiOmegaMinusInelastic.hh"
#include "G4TheoFSGenerator.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSModel.hh"
RE01HadronPhysics::RE01HadronPhysics(const G4String& name)
:G4VPhysicsConstructor(name)
{;}
RE01HadronPhysics::~RE01HadronPhysics()
{;}
void RE01HadronPhysics::ConstructParticle()
{
// Construct all mesons
G4MesonConstructor pMesonConstructor;
pMesonConstructor.ConstructParticle();
// Construct all baryons
G4BaryonConstructor pBaryonConstructor;
pBaryonConstructor.ConstructParticle();
// Construct resonaces and quarks
G4ShortLivedConstructor pShortLivedConstructor;
pShortLivedConstructor.ConstructParticle();
}
void RE01HadronPhysics::ConstructProcess()
{
// Hadronic Elastic Process and Model (the same for all hadrons)
G4HadronElasticProcess* elasticProcess = new G4HadronElasticProcess();
G4LElastic* elasticModel = new G4LElastic();
elasticProcess->RegisterMe(elasticModel);
// Hadronic inelastic models
// Bertini cascade model: use for p,n,pi+,pi- between 0 and 9.9 GeV
G4CascadeInterface* bertiniModel = new G4CascadeInterface();
bertiniModel->SetMaxEnergy(9.9*GeV);
// Low energy parameterized models : use between 9.5 and 25 GeV
G4double LEPUpperLimit = 25*GeV;
G4double LEPpnpiLimit = 9.5*GeV;
G4LEKaonZeroLInelastic* LEPk0LModel = new G4LEKaonZeroLInelastic();
LEPk0LModel->SetMaxEnergy(LEPUpperLimit);
G4LEKaonZeroSInelastic* LEPk0SModel = new G4LEKaonZeroSInelastic();
LEPk0SModel->SetMaxEnergy(LEPUpperLimit);
// Quark-Gluon String Model: use for p,n,pi+,pi- between 12 GeV and 100 TeV
G4TheoFSGenerator* QGSPModel = new G4TheoFSGenerator();
G4GeneratorPrecompoundInterface* theCascade =
new G4GeneratorPrecompoundInterface();
G4ExcitationHandler* exHandler = new G4ExcitationHandler();
G4PreCompoundModel* preCompound = new G4PreCompoundModel(exHandler);
theCascade->SetDeExcitation(preCompound);
QGSPModel->SetTransport(theCascade);
G4QGSMFragmentation* frag = new G4QGSMFragmentation();
G4ExcitedStringDecay* stringDecay = new G4ExcitedStringDecay(frag);
G4QGSModel<G4QGSParticipants>* stringModel =
new G4QGSModel<G4QGSParticipants>();
stringModel->SetFragmentationModel(stringDecay);
QGSPModel->SetHighEnergyGenerator(stringModel);
QGSPModel->SetMinEnergy(12*GeV);
QGSPModel->SetMaxEnergy(100*TeV);
//
G4ProcessManager * pManager = 0;
///////////////////
// //
// pi+ physics //
// //
///////////////////
pManager = G4PionPlus::PionPlus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4PionPlusInelasticProcess* pipinelProc = new G4PionPlusInelasticProcess();
G4PiNuclearCrossSection* pion_XC = new G4PiNuclearCrossSection();
pipinelProc->AddDataSet(pion_XC);
pipinelProc->RegisterMe(bertiniModel);
G4LEPionPlusInelastic* LEPpipModel = new G4LEPionPlusInelastic();
LEPpipModel->SetMinEnergy(LEPpnpiLimit);
LEPpipModel->SetMaxEnergy(LEPUpperLimit);
pipinelProc->RegisterMe(LEPpipModel);
pipinelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(pipinelProc);
///////////////////
// //
// pi- physics //
// //
///////////////////
pManager = G4PionMinus::PionMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4PionMinusInelasticProcess* piminelProc = new G4PionMinusInelasticProcess();
piminelProc->AddDataSet(pion_XC);
piminelProc->RegisterMe(bertiniModel);
G4LEPionMinusInelastic* LEPpimModel = new G4LEPionMinusInelastic();
LEPpimModel->SetMinEnergy(LEPpnpiLimit);
LEPpimModel->SetMaxEnergy(LEPUpperLimit);
piminelProc->RegisterMe(LEPpimModel);
piminelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(piminelProc);
// pi- absorption at rest
G4PionMinusAbsorptionAtRest* pimAbsorb = new G4PionMinusAbsorptionAtRest();
pManager->AddRestProcess(pimAbsorb);
///////////////////
// //
// K+ physics //
// //
///////////////////
pManager = G4KaonPlus::KaonPlus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4KaonPlusInelasticProcess* kpinelProc = new G4KaonPlusInelasticProcess();
G4LEKaonPlusInelastic* LEPkpModel = new G4LEKaonPlusInelastic();
LEPkpModel->SetMaxEnergy(LEPUpperLimit);
kpinelProc->RegisterMe(LEPkpModel);
kpinelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(kpinelProc);
///////////////////
// //
// K- physics //
// //
///////////////////
pManager = G4KaonMinus::KaonMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4KaonMinusInelasticProcess* kminelProc = new G4KaonMinusInelasticProcess();
G4LEKaonMinusInelastic* LEPkmModel = new G4LEKaonMinusInelastic();
LEPkmModel->SetMaxEnergy(LEPUpperLimit);
kminelProc->RegisterMe(LEPkmModel);
kminelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(kminelProc);
// K- absorption at rest
G4KaonMinusAbsorption* kmAbsorb = new G4KaonMinusAbsorption();
pManager->AddRestProcess(kmAbsorb);
///////////////////
// //
// K0L physics //
// //
///////////////////
pManager = G4KaonZeroLong::KaonZeroLong()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4KaonZeroLInelasticProcess* k0LinelProc = new G4KaonZeroLInelasticProcess();
k0LinelProc->RegisterMe(LEPk0LModel);
k0LinelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(k0LinelProc);
///////////////////
// //
// K0S physics //
// //
///////////////////
pManager = G4KaonZeroShort::KaonZeroShort()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4KaonZeroSInelasticProcess* k0SinelProc = new G4KaonZeroSInelasticProcess();
k0SinelProc->RegisterMe(LEPk0SModel);
k0SinelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(k0SinelProc);
///////////////////
// //
// Proton //
// //
///////////////////
pManager = G4Proton::Proton()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4ProtonInelasticProcess* pinelProc = new G4ProtonInelasticProcess();
G4ProtonInelasticCrossSection* proton_XC =
new G4ProtonInelasticCrossSection();
pinelProc->AddDataSet(proton_XC);
pinelProc->RegisterMe(bertiniModel);
G4LEProtonInelastic* LEPpModel = new G4LEProtonInelastic();
LEPpModel->SetMinEnergy(LEPpnpiLimit);
LEPpModel->SetMaxEnergy(LEPUpperLimit);
pinelProc->RegisterMe(LEPpModel);
pinelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(pinelProc);
///////////////////
// //
// Anti-Proton //
// //
///////////////////
pManager = G4AntiProton::AntiProton()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiProtonInelasticProcess* apinelProc =
new G4AntiProtonInelasticProcess();
G4LEAntiProtonInelastic* LEPapModel = new G4LEAntiProtonInelastic();
apinelProc->RegisterMe(LEPapModel);
G4HEAntiProtonInelastic* HEPapModel = new G4HEAntiProtonInelastic();
apinelProc->RegisterMe(HEPapModel);
pManager->AddDiscreteProcess(apinelProc);
// anti-proton annihilation at rest
G4AntiProtonAnnihilationAtRest* apAnnihil =
new G4AntiProtonAnnihilationAtRest();
pManager->AddRestProcess(apAnnihil);
///////////////////
// //
// Neutron //
// //
///////////////////
pManager = G4Neutron::Neutron()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4NeutronInelasticProcess* ninelProc = new G4NeutronInelasticProcess();
G4NeutronInelasticCrossSection* neutron_XC =
new G4NeutronInelasticCrossSection();
ninelProc->AddDataSet(neutron_XC);
ninelProc->RegisterMe(bertiniModel);
G4LENeutronInelastic* LEPnModel = new G4LENeutronInelastic();
LEPnModel->SetMinEnergy(LEPpnpiLimit);
LEPnModel->SetMaxEnergy(LEPUpperLimit);
ninelProc->RegisterMe(LEPnModel);
ninelProc->RegisterMe(QGSPModel);
pManager->AddDiscreteProcess(ninelProc);
// neutron-induced fission
G4HadronFissionProcess* neutronFission = new G4HadronFissionProcess();
G4LFission* neutronFissionModel = new G4LFission();
neutronFissionModel->SetMinEnergy(0.);
neutronFissionModel->SetMaxEnergy(20*TeV);
neutronFission->RegisterMe(neutronFissionModel);
pManager->AddDiscreteProcess(neutronFission);
// neutron capture
G4HadronCaptureProcess* neutronCapture = new G4HadronCaptureProcess();
G4LCapture* neutronCaptureModel = new G4LCapture();
neutronCaptureModel->SetMinEnergy(0.);
neutronCaptureModel->SetMaxEnergy(20*TeV);
neutronCapture->RegisterMe(neutronCaptureModel);
pManager->AddDiscreteProcess(neutronCapture);
///////////////////
// //
// Anti-Neutron //
// //
///////////////////
pManager = G4AntiNeutron::AntiNeutron()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiNeutronInelasticProcess* aninelProc =
new G4AntiNeutronInelasticProcess();
G4LEAntiNeutronInelastic* LEPanModel = new G4LEAntiNeutronInelastic();
aninelProc->RegisterMe(LEPanModel);
G4HEAntiNeutronInelastic* HEPanModel = new G4HEAntiNeutronInelastic();
aninelProc->RegisterMe(HEPanModel);
pManager->AddDiscreteProcess(aninelProc);
// anti-neutron annihilation at rest
G4AntiNeutronAnnihilationAtRest* anAnnihil =
new G4AntiNeutronAnnihilationAtRest();
pManager->AddRestProcess(anAnnihil);
///////////////////
// //
// Lambda //
// //
///////////////////
pManager = G4Lambda::Lambda()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4LambdaInelasticProcess* linelProc =
new G4LambdaInelasticProcess();
G4LELambdaInelastic* LEPlModel = new G4LELambdaInelastic();
linelProc->RegisterMe(LEPlModel);
G4HELambdaInelastic* HEPlModel = new G4HELambdaInelastic();
linelProc->RegisterMe(HEPlModel);
pManager->AddDiscreteProcess(linelProc);
///////////////////
// //
// Anti-Lambda //
// //
///////////////////
pManager = G4AntiLambda::AntiLambda()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiLambdaInelasticProcess* alinelProc =
new G4AntiLambdaInelasticProcess();
G4LEAntiLambdaInelastic* LEPalModel = new G4LEAntiLambdaInelastic();
alinelProc->RegisterMe(LEPalModel);
G4HEAntiLambdaInelastic* HEPalModel = new G4HEAntiLambdaInelastic();
alinelProc->RegisterMe(HEPalModel);
pManager->AddDiscreteProcess(alinelProc);
///////////////////
// //
// Sigma- //
// //
///////////////////
pManager = G4SigmaMinus::SigmaMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4SigmaMinusInelasticProcess* sminelProc =
new G4SigmaMinusInelasticProcess();
G4LESigmaMinusInelastic* LEPsmModel = new G4LESigmaMinusInelastic();
sminelProc->RegisterMe(LEPsmModel);
G4HESigmaMinusInelastic* HEPsmModel = new G4HESigmaMinusInelastic();
sminelProc->RegisterMe(HEPsmModel);
pManager->AddDiscreteProcess(sminelProc);
///////////////////
// //
// Anti-Sigma- //
// //
///////////////////
pManager = G4AntiSigmaMinus::AntiSigmaMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiSigmaMinusInelasticProcess* asminelProc =
new G4AntiSigmaMinusInelasticProcess();
G4LEAntiSigmaMinusInelastic* LEPasmModel =
new G4LEAntiSigmaMinusInelastic();
asminelProc->RegisterMe(LEPasmModel);
G4HEAntiSigmaMinusInelastic* HEPasmModel =
new G4HEAntiSigmaMinusInelastic();
asminelProc->RegisterMe(HEPasmModel);
pManager->AddDiscreteProcess(asminelProc);
///////////////////
// //
// Sigma+ //
// //
///////////////////
pManager = G4SigmaPlus::SigmaPlus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4SigmaPlusInelasticProcess* spinelProc = new G4SigmaPlusInelasticProcess();
G4LESigmaPlusInelastic* LEPspModel = new G4LESigmaPlusInelastic();
spinelProc->RegisterMe(LEPspModel);
G4HESigmaPlusInelastic* HEPspModel = new G4HESigmaPlusInelastic();
spinelProc->RegisterMe(HEPspModel);
pManager->AddDiscreteProcess(spinelProc);
///////////////////
// //
// Anti-Sigma+ //
// //
///////////////////
pManager = G4AntiSigmaPlus::AntiSigmaPlus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiSigmaPlusInelasticProcess* aspinelProc =
new G4AntiSigmaPlusInelasticProcess();
G4LEAntiSigmaPlusInelastic* LEPaspModel =
new G4LEAntiSigmaPlusInelastic();
aspinelProc->RegisterMe(LEPaspModel);
G4HEAntiSigmaPlusInelastic* HEPaspModel =
new G4HEAntiSigmaPlusInelastic();
aspinelProc->RegisterMe(HEPaspModel);
pManager->AddDiscreteProcess(aspinelProc);
///////////////////
// //
// Xi- //
// //
///////////////////
pManager = G4XiMinus::XiMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4XiMinusInelasticProcess* xminelProc = new G4XiMinusInelasticProcess();
G4LEXiMinusInelastic* LEPxmModel = new G4LEXiMinusInelastic();
xminelProc->RegisterMe(LEPxmModel);
G4HEXiMinusInelastic* HEPxmModel = new G4HEXiMinusInelastic();
xminelProc->RegisterMe(HEPxmModel);
pManager->AddDiscreteProcess(xminelProc);
///////////////////
// //
// Anti-Xi- //
// //
///////////////////
pManager = G4AntiXiMinus::AntiXiMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiXiMinusInelasticProcess* axminelProc =
new G4AntiXiMinusInelasticProcess();
G4LEAntiXiMinusInelastic* LEPaxmModel = new G4LEAntiXiMinusInelastic();
axminelProc->RegisterMe(LEPaxmModel);
G4HEAntiXiMinusInelastic* HEPaxmModel = new G4HEAntiXiMinusInelastic();
axminelProc->RegisterMe(HEPaxmModel);
pManager->AddDiscreteProcess(axminelProc);
///////////////////
// //
// Xi0 //
// //
///////////////////
pManager = G4XiZero::XiZero()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4XiZeroInelasticProcess* x0inelProc = new G4XiZeroInelasticProcess();
G4LEXiZeroInelastic* LEPx0Model = new G4LEXiZeroInelastic();
x0inelProc->RegisterMe(LEPx0Model);
G4HEXiZeroInelastic* HEPx0Model = new G4HEXiZeroInelastic();
x0inelProc->RegisterMe(HEPx0Model);
pManager->AddDiscreteProcess(x0inelProc);
///////////////////
// //
// Anti-Xi0 //
// //
///////////////////
pManager = G4AntiXiZero::AntiXiZero()->GetProcessManager();
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiXiZeroInelasticProcess* ax0inelProc =
new G4AntiXiZeroInelasticProcess();
G4LEAntiXiZeroInelastic* LEPax0Model = new G4LEAntiXiZeroInelastic();
ax0inelProc->RegisterMe(LEPax0Model);
G4HEAntiXiZeroInelastic* HEPax0Model = new G4HEAntiXiZeroInelastic();
ax0inelProc->RegisterMe(HEPax0Model);
pManager->AddDiscreteProcess(ax0inelProc);
///////////////////
// //
// Omega- //
// //
///////////////////
pManager = G4OmegaMinus::OmegaMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4OmegaMinusInelasticProcess* ominelProc =
new G4OmegaMinusInelasticProcess();
G4LEOmegaMinusInelastic* LEPomModel = new G4LEOmegaMinusInelastic();
ominelProc->RegisterMe(LEPomModel);
G4HEOmegaMinusInelastic* HEPomModel = new G4HEOmegaMinusInelastic();
ominelProc->RegisterMe(HEPomModel);
pManager->AddDiscreteProcess(ominelProc);
///////////////////
// //
// Anti-Omega- //
// //
///////////////////
pManager = G4AntiOmegaMinus::AntiOmegaMinus()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AntiOmegaMinusInelasticProcess* aominelProc =
new G4AntiOmegaMinusInelasticProcess();
G4LEAntiOmegaMinusInelastic* LEPaomModel =
new G4LEAntiOmegaMinusInelastic();
aominelProc->RegisterMe(LEPaomModel);
G4HEAntiOmegaMinusInelastic* HEPaomModel =
new G4HEAntiOmegaMinusInelastic();
aominelProc->RegisterMe(HEPaomModel);
pManager->AddDiscreteProcess(aominelProc);
}
@@ -0,0 +1,170 @@
//
// ********************************************************************
// * 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: RE01IonPhysics.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01IonPhysics.hh"
#include "G4ParticleTable.hh"
#include "G4ProcessManager.hh"
#include "G4IonConstructor.hh"
// processes
#include "G4MultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4ionIonisation.hh"
#include "G4HadronElasticProcess.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4AlphaInelasticProcess.hh"
// models
#include "G4LElastic.hh"
#include "G4LEDeuteronInelastic.hh"
#include "G4LETritonInelastic.hh"
#include "G4LEAlphaInelastic.hh"
RE01IonPhysics::RE01IonPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{;}
RE01IonPhysics::~RE01IonPhysics()
{;}
void RE01IonPhysics::ConstructParticle()
{
// Construct light ions (d, t, 3He, alpha, and generic ion)
G4IonConstructor ionConstruct;
ionConstruct.ConstructParticle();
}
void RE01IonPhysics::ConstructProcess()
{
// Hadronic Elastic Process and Model (for all ions except generic ion)
G4HadronElasticProcess* elasticProcess = new G4HadronElasticProcess();
G4LElastic* elasticModel = new G4LElastic();
elasticProcess->RegisterMe(elasticModel);
// Hadronic inelastic models
G4ProcessManager * pManager = 0;
///////////////////
// //
// Deuteron //
// //
///////////////////
pManager = G4Deuteron::Deuteron()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4DeuteronInelasticProcess* dinelProc = new G4DeuteronInelasticProcess();
G4LEDeuteronInelastic* LEPdModel = new G4LEDeuteronInelastic();
dinelProc->RegisterMe(LEPdModel);
pManager->AddDiscreteProcess(dinelProc);
///////////////////
// //
// Triton //
// //
///////////////////
pManager = G4Triton::Triton()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4TritonInelasticProcess* tinelProc = new G4TritonInelasticProcess();
G4LETritonInelastic* LEPtModel = new G4LETritonInelastic();
tinelProc->RegisterMe(LEPtModel);
pManager->AddDiscreteProcess(tinelProc);
///////////////////
// //
// 3He //
// //
///////////////////
pManager = G4He3::He3()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// NO INELASTIC PROCESS AVAILABLE FOR 3HE
///////////////////
// //
// Alpha //
// //
///////////////////
pManager = G4Alpha::Alpha()->GetProcessManager();
// EM processes
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// hadron elastic
pManager->AddDiscreteProcess(elasticProcess);
// hadron inelastic
G4AlphaInelasticProcess* ainelProc = new G4AlphaInelasticProcess();
G4LEAlphaInelastic* LEPaModel = new G4LEAlphaInelastic();
ainelProc->RegisterMe(LEPaModel);
pManager->AddDiscreteProcess(ainelProc);
///////////////////
// //
// generic ion //
// //
///////////////////
pManager = G4GenericIon::GenericIon()->GetProcessManager();
// Only EM processes for generic ion
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4ionIonisation(), -1, 2, 2);
}
@@ -0,0 +1,129 @@
//
// ********************************************************************
// * 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: RE01LeptonPhysics.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01LeptonPhysics.hh"
#include "G4ParticleTable.hh"
#include "G4ProcessManager.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4MuonMinus.hh"
#include "G4MuonPlus.hh"
#include "G4TauMinus.hh"
#include "G4TauPlus.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4NeutrinoTau.hh"
#include "G4AntiNeutrinoTau.hh"
RE01LeptonPhysics::RE01LeptonPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{;}
RE01LeptonPhysics::~RE01LeptonPhysics()
{;}
void RE01LeptonPhysics::ConstructParticle()
{
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonMinus::MuonMinusDefinition();
G4MuonPlus::MuonPlusDefinition();
G4TauMinus::TauMinusDefinition();
G4TauPlus::TauPlusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
G4NeutrinoTau::NeutrinoTauDefinition();
G4AntiNeutrinoTau::AntiNeutrinoTauDefinition();
}
void RE01LeptonPhysics::ConstructProcess()
{
G4ProcessManager * pManager = 0;
// Electron physics
pManager = G4Electron::Electron()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4eIonisation(), -1, 2, 2);
pManager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
//Positron physics
pManager = G4Positron::Positron()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4eIonisation(), -1, 2, 2);
pManager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
pManager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
// Muon-
pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4MuIonisation(), -1, 2, 2);
pManager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
pManager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
// Muon+
pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4MuIonisation(), -1, 2, 2);
pManager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
pManager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
// Tau-
pManager = G4TauMinus::TauMinus()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
// Tau+
pManager = G4TauPlus::TauPlus()->GetProcessManager();
pManager->AddProcess(new G4MultipleScattering(), -1, 1, 1);
pManager->AddProcess(new G4hIonisation(), -1, 2, 2);
}
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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: RE01PhysicsList.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01PhysicsList.hh"
#include "RE01DecayPhysics.hh"
#include "RE01BosonPhysics.hh"
#include "RE01LeptonPhysics.hh"
#include "RE01HadronPhysics.hh"
#include "RE01IonPhysics.hh"
RE01PhysicsList::RE01PhysicsList(): G4VModularPhysicsList()
{
// default cut value (1.0mm)
defaultCutValue = 1.0*mm;
// SetVerboseLevel(1);
// Particle decays
RegisterPhysics( new RE01DecayPhysics("decay"));
// Bosons (gamma + geantinos)
RegisterPhysics( new RE01BosonPhysics("boson"));
// Leptons
RegisterPhysics( new RE01LeptonPhysics("lepton"));
// Hadron Physics
RegisterPhysics( new RE01HadronPhysics("hadron"));
// Ion Physics
RegisterPhysics( new RE01IonPhysics("ion"));
}
RE01PhysicsList::~RE01PhysicsList()
{;}
void RE01PhysicsList::SetCuts()
{
// Use default cut values gamma and e processes
SetCutsWithDefault();
}
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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: RE01PrimaryGeneratorAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4HEPEvtInterface.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "RE01PrimaryGeneratorMessenger.hh"
RE01PrimaryGeneratorAction::RE01PrimaryGeneratorAction()
{
const char* filename = "pythia_event.data";
HEPEvt = new G4HEPEvtInterface(filename);
G4int n_particle = 1;
G4ParticleGun* fParticleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="mu+");
fParticleGun->SetParticleDefinition(particle);
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
fParticleGun->SetParticleEnergy(100.*GeV);
fParticleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
particleGun = fParticleGun;
messenger = new RE01PrimaryGeneratorMessenger(this);
useHEPEvt = true;
}
RE01PrimaryGeneratorAction::~RE01PrimaryGeneratorAction()
{
delete HEPEvt;
delete particleGun;
delete messenger;
}
void RE01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
if(useHEPEvt)
{ HEPEvt->GeneratePrimaryVertex(anEvent); }
else
{ particleGun->GeneratePrimaryVertex(anEvent); }
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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: RE01PrimaryGeneratorMessenger.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01PrimaryGeneratorMessenger.hh"
#include "RE01PrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
RE01PrimaryGeneratorMessenger::RE01PrimaryGeneratorMessenger(RE01PrimaryGeneratorAction * mpga)
:myAction(mpga)
{
mydetDirectory = new G4UIdirectory("/mydet/");
mydetDirectory->SetGuidance("RE01 detector control commands.");
genCmd = new G4UIcmdWithAString("/mydet/generator",this);
genCmd->SetGuidance("Select primary generator.");
genCmd->SetGuidance(" Available generators : PYTHIA, particleGun");
genCmd->SetParameterName("generator",true);
genCmd->SetDefaultValue("PYTHIA");
genCmd->SetCandidates("PYTHIA particleGun");
}
RE01PrimaryGeneratorMessenger::~RE01PrimaryGeneratorMessenger()
{
delete genCmd;
delete mydetDirectory;
}
void RE01PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command==genCmd )
{ myAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
}
G4String RE01PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String cv;
if( command==genCmd )
{
if(myAction->GetHEPEvtGenerator())
{ cv = "PYTHIA"; }
else
{ cv = "particleGun"; }
}
return cv;
}
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * 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: RE01RegionInformation.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01RegionInformation.hh"
#include "G4ios.hh"
RE01RegionInformation::RE01RegionInformation()
:isWorld(false),isTracker(false),isCalorimeter(false)
{;}
RE01RegionInformation::~RE01RegionInformation()
{;}
void RE01RegionInformation::Print() const
{
G4cout << "I'm ";
if(isWorld) { G4cout << "World."; }
else if(isTracker) { G4cout << "Tracker."; }
else if(isCalorimeter) { G4cout << "Calorimeter."; }
else { G4cout << "unknown."; }
G4cout << G4endl;
}
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: RE01RunAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01RunAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4ios.hh"
RE01RunAction::RE01RunAction()
{}
RE01RunAction::~RE01RunAction()
{}
void RE01RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
}
void RE01RunAction::EndOfRunAction(const G4Run*)
{ }
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * 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: RE01StackingAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01StackingAction.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
#include "G4HCofThisEvent.hh"
#include "G4Track.hh"
#include "G4TrackStatus.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4ios.hh"
#include "RE01TrackInformation.hh"
#include "RE01CalorimeterHit.hh"
RE01StackingAction::RE01StackingAction()
:stage(0),trackerHitsColID(-1),calorimeterHitsColID(-1)
{ ; }
RE01StackingAction::~RE01StackingAction()
{ ; }
G4ClassificationOfNewTrack
RE01StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
G4ClassificationOfNewTrack classification = fUrgent;
if(stage==0)
{
RE01TrackInformation* trackInfo;
if(aTrack->GetTrackStatus()==fSuspend) // Track reached to calorimeter
{
trackInfo = (RE01TrackInformation*)(aTrack->GetUserInformation());
trackInfo->SetTrackingStatus(0);
trackInfo->SetSourceTrackInformation(aTrack);
// G4cout << "Track " << aTrack->GetTrackID() << " (parentID " << aTrack->GetParentID()
// << ") has reached to calorimeter and has been suspended at " << aTrack->GetPosition() << G4endl;
classification = fWaiting;
}
else if(aTrack->GetParentID()==0) // Primary particle
{
trackInfo = new RE01TrackInformation(aTrack);
trackInfo->SetTrackingStatus(1);
G4Track* theTrack = (G4Track*)aTrack;
theTrack->SetUserInformation(trackInfo);
}
}
return classification;
}
G4VHitsCollection* RE01StackingAction::GetCalCollection()
{
G4SDManager* SDMan = G4SDManager::GetSDMpointer();
G4RunManager* runMan = G4RunManager::GetRunManager();
if(calorimeterHitsColID<0)
{ calorimeterHitsColID = SDMan->GetCollectionID("calCollection"); }
if(calorimeterHitsColID>=0)
{
const G4Event* currentEvent = runMan->GetCurrentEvent();
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
return HCE->GetHC(calorimeterHitsColID);
}
return 0;
}
void RE01StackingAction::NewStage()
{
if(stage==0)
{
// display trajetory information in the tracking region
G4cout << G4endl;
G4cout << "Tracks in tracking region have been processed. -- Stage 0 over." << G4endl;
G4cout << G4endl;
}
else
{
// display calorimeter information caused by a "source" track in the tracker region
// G4cout << G4endl;
// G4cout << "Processing one shower originated by a source track in tracker region is over." << G4endl;
// G4cout << G4endl;
RE01CalorimeterHitsCollection* CHC = (RE01CalorimeterHitsCollection*)GetCalCollection();
if(CHC)
{
int n_hit = CHC->entries();
G4double totE = 0;
G4int n_hitByATrack = 0;
for(int i=0;i<n_hit;i++)
{
G4double edepByATrack = (*CHC)[i]->GetEdepByATrack();
if(edepByATrack>0.)
{
totE += edepByATrack;
if(n_hitByATrack==0)
{ (*CHC)[i]->GetTrackInformation()->Print(); }
n_hitByATrack++;
G4cout << "Cell[" << (*CHC)[i]->GetZ() << "," << (*CHC)[i]->GetPhi() << "] "
<< edepByATrack/GeV << " [GeV]" << G4endl;
(*CHC)[i]->ClearEdepByATrack();
}
}
if(n_hitByATrack>0)
{
G4cout << "### Total energy deposition in calorimeter by a source track in "
<< n_hitByATrack << " cells : " << totE / GeV << " (GeV)" << G4endl;
G4cout << G4endl;
}
}
}
// Transfer all tracks in Urgent stack to Waiting stack, since all tracks
// in Waiting stack have already been transfered to Urgent stack before
// invokation of this method.
stackManager->TransferStackedTracks(fUrgent,fWaiting);
// Then, transfer only one track to Urgent stack.
stackManager->TransferOneStackedTrack(fWaiting,fUrgent);
stage++;
}
void RE01StackingAction::PrepareNewEvent()
{
stage = 0;
}
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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: RE01SteppingAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01SteppingAction.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
#include "G4TrackStatus.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Region.hh"
#include "RE01RegionInformation.hh"
RE01SteppingAction::RE01SteppingAction()
{;}
RE01SteppingAction::~RE01SteppingAction()
{;}
void RE01SteppingAction::UserSteppingAction(const G4Step * theStep)
{
// Suspend a track if it is entering into the calorimeter
// check if it is alive
G4Track * theTrack = theStep->GetTrack();
if(theTrack->GetTrackStatus()!=fAlive) { return; }
// get region information
G4StepPoint * thePrePoint = theStep->GetPreStepPoint();
G4LogicalVolume * thePreLV = thePrePoint->GetPhysicalVolume()->GetLogicalVolume();
RE01RegionInformation* thePreRInfo
= (RE01RegionInformation*)(thePreLV->GetRegion()->GetUserInformation());
G4StepPoint * thePostPoint = theStep->GetPostStepPoint();
G4LogicalVolume * thePostLV = thePostPoint->GetPhysicalVolume()->GetLogicalVolume();
RE01RegionInformation* thePostRInfo
= (RE01RegionInformation*)(thePostLV->GetRegion()->GetUserInformation());
// check if it is entering to the calorimeter volume
if(!(thePreRInfo->IsCalorimeter()) && (thePostRInfo->IsCalorimeter()))
{ theTrack->SetTrackStatus(fSuspend); }
}
@@ -0,0 +1,126 @@
//
// ********************************************************************
// * 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: RE01TrackInformation.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01TrackInformation.hh"
#include "G4ios.hh"
G4Allocator<RE01TrackInformation> aTrackInformationAllocator;
RE01TrackInformation::RE01TrackInformation()
{
originalTrackID = 0;
particleDefinition = 0;
originalPosition = G4ThreeVector(0.,0.,0.);
originalMomentum = G4ThreeVector(0.,0.,0.);
originalEnergy = 0.;
originalTime = 0.;
trackingStatus = 1;
sourceTrackID = -1;
sourceTrackID = -1;
sourceDefinition = 0;
sourcePosition = G4ThreeVector(0.,0.,0.);
sourceMomentum = G4ThreeVector(0.,0.,0.);
sourceEnergy = 0.;
sourceTime = 0.;
}
RE01TrackInformation::RE01TrackInformation(const G4Track* aTrack)
{
originalTrackID = aTrack->GetTrackID();
particleDefinition = aTrack->GetDefinition();
originalPosition = aTrack->GetPosition();
originalMomentum = aTrack->GetMomentum();
originalEnergy = aTrack->GetTotalEnergy();
originalTime = aTrack->GetGlobalTime();
trackingStatus = 1;
sourceTrackID = -1;
sourceDefinition = 0;
sourcePosition = G4ThreeVector(0.,0.,0.);
sourceMomentum = G4ThreeVector(0.,0.,0.);
sourceEnergy = 0.;
sourceTime = 0.;
}
RE01TrackInformation::RE01TrackInformation(const RE01TrackInformation* aTrackInfo)
{
originalTrackID = aTrackInfo->originalTrackID;
particleDefinition = aTrackInfo->particleDefinition;
originalPosition = aTrackInfo->originalPosition;
originalMomentum = aTrackInfo->originalMomentum;
originalEnergy = aTrackInfo->originalEnergy;
originalTime = aTrackInfo->originalTime;
trackingStatus = aTrackInfo->trackingStatus;
sourceTrackID = aTrackInfo->sourceTrackID;
sourceDefinition = aTrackInfo->sourceDefinition;
sourcePosition = aTrackInfo->sourcePosition;
sourceMomentum = aTrackInfo->sourceMomentum;
sourceEnergy = aTrackInfo->sourceEnergy;
sourceTime = aTrackInfo->sourceTime;
}
RE01TrackInformation::~RE01TrackInformation()
{ ; }
RE01TrackInformation& RE01TrackInformation::operator =(const RE01TrackInformation& aTrackInfo)
{
originalTrackID = aTrackInfo.originalTrackID;
particleDefinition = aTrackInfo.particleDefinition;
originalPosition = aTrackInfo.originalPosition;
originalMomentum = aTrackInfo.originalMomentum;
originalEnergy = aTrackInfo.originalEnergy;
originalTime = aTrackInfo.originalTime;
trackingStatus = aTrackInfo.trackingStatus;
sourceTrackID = aTrackInfo.sourceTrackID;
sourceDefinition = aTrackInfo.sourceDefinition;
sourcePosition = aTrackInfo.sourcePosition;
sourceMomentum = aTrackInfo.sourceMomentum;
sourceEnergy = aTrackInfo.sourceEnergy;
sourceTime = aTrackInfo.sourceTime;
return *this;
}
void RE01TrackInformation::SetSourceTrackInformation(const G4Track* aTrack)
{
sourceTrackID = aTrack->GetTrackID();
sourceDefinition = aTrack->GetDefinition();
sourcePosition = aTrack->GetPosition();
sourceMomentum = aTrack->GetMomentum();
sourceEnergy = aTrack->GetTotalEnergy();
sourceTime = aTrack->GetGlobalTime();
}
void RE01TrackInformation::Print() const
{
G4cout
<< "Source track ID " << sourceTrackID << " (" << sourceDefinition->GetParticleName() << ","
<< sourceEnergy/GeV << "[GeV]) at " << sourcePosition << G4endl;
G4cout
<< "Original primary track ID " << originalTrackID << " (" << particleDefinition->GetParticleName() << ","
<< originalEnergy/GeV << "[GeV])" << G4endl;
}
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * 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: RE01TrackerHit.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01TrackerHit.hh"
#include "G4VVisManager.hh"
#include "G4Circle.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
G4Allocator<RE01TrackerHit> RE01TrackerHitAllocator;
RE01TrackerHit::RE01TrackerHit()
{;}
RE01TrackerHit::~RE01TrackerHit()
{;}
RE01TrackerHit::RE01TrackerHit(const RE01TrackerHit &right)
: G4VHit()
{
edep = right.edep;
pos = right.pos;
trackID = right.trackID;
}
const RE01TrackerHit& RE01TrackerHit::operator=(const RE01TrackerHit &right)
{
edep = right.edep;
pos = right.pos;
trackID = right.trackID;
return *this;
}
G4int RE01TrackerHit::operator==(const RE01TrackerHit &right) const
{
return (this==&right) ? 1 : 0;
}
void RE01TrackerHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Circle circle(pos);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.,0.,0.);
G4VisAttributes attribs(colour);
circle.SetVisAttributes(attribs);
pVVisManager->Draw(circle);
}
}
void RE01TrackerHit::Print()
{
G4cout << "TrackID " << trackID << " Position " << pos << " : " << edep/keV << " [keV]" << G4endl;
}
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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: RE01TrackerParametrisation.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01TrackerParametrisation.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4Tubs.hh"
RE01TrackerParametrisation::RE01TrackerParametrisation()
{
#include "RE01DetectorParameterDef.icc"
}
RE01TrackerParametrisation::~RE01TrackerParametrisation()
{;}
void RE01TrackerParametrisation::ComputeTransformation
(const G4int, G4VPhysicalVolume* physVol) const
{
G4ThreeVector origin;
physVol->SetTranslation(origin);
}
void RE01TrackerParametrisation::ComputeDimensions
(G4Tubs& trackerLayer, const G4int copyNo, const G4VPhysicalVolume*) const
{
trackerLayer.SetInnerRadius(tracker_radius[copyNo]);
trackerLayer.SetOuterRadius(tracker_radius[copyNo]+tracker_thick);
trackerLayer.SetZHalfLength(tracker_length[copyNo]);
trackerLayer.SetStartPhiAngle(trkTubs_sphi);
trackerLayer.SetDeltaPhiAngle(trkTubs_dphi);
}
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * 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: RE01TrackerSD.cc,v 1.1 2004/11/26 07:37:43 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01TrackerSD.hh"
#include "RE01TrackerHit.hh"
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"
#include "G4TouchableHistory.hh"
#include "G4ios.hh"
#include "RE01TrackInformation.hh"
RE01TrackerSD::RE01TrackerSD(G4String name)
:G4VSensitiveDetector(name)
{
G4String HCname;
collectionName.insert(HCname="trackerCollection");
}
RE01TrackerSD::~RE01TrackerSD(){;}
void RE01TrackerSD::Initialize(G4HCofThisEvent* HCE)
{
static int HCID = -1;
trackerCollection = new RE01TrackerHitsCollection
(SensitiveDetectorName,collectionName[0]);
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection(HCID,trackerCollection);
}
G4bool RE01TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep==0.) return false;
RE01TrackerHit* newHit = new RE01TrackerHit();
newHit->SetEdep( edep );
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
RE01TrackInformation* trackInfo = (RE01TrackInformation*)(aStep->GetTrack()->GetUserInformation());
if(trackInfo->GetTrackingStatus()>0)
{ newHit->SetTrackID( aStep->GetTrack()->GetTrackID() ); }
else
{ newHit->SetTrackID( -1 ); }
trackerCollection->insert( newHit );
return true;
}
void RE01TrackerSD::EndOfEvent(G4HCofThisEvent*)
{
}
void RE01TrackerSD::clear()
{
}
void RE01TrackerSD::DrawAll()
{
}
void RE01TrackerSD::PrintAll()
{
}
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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: RE01TrackingAction.cc,v 1.1 2004/11/26 07:37:43 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01TrackingAction.hh"
#include "G4TrackingManager.hh"
#include "G4Track.hh"
#include "RE01Trajectory.hh"
#include "RE01TrackInformation.hh"
void RE01TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{
// Create trajectory only for track in tracking region
RE01TrackInformation* trackInfo = (RE01TrackInformation*)(aTrack->GetUserInformation());
if(trackInfo->GetTrackingStatus() > 0)
{
fpTrackingManager->SetStoreTrajectory(true);
fpTrackingManager->SetTrajectory(new RE01Trajectory(aTrack));
}
else
{ fpTrackingManager->SetStoreTrajectory(false); }
}
void RE01TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
if(secondaries)
{
RE01TrackInformation* info = (RE01TrackInformation*)(aTrack->GetUserInformation());
size_t nSeco = secondaries->size();
if(nSeco>0)
{
for(size_t i=0;i<nSeco;i++)
{
RE01TrackInformation* infoNew = new RE01TrackInformation(info);
(*secondaries)[i]->SetUserInformation(infoNew);
}
}
}
}
@@ -0,0 +1,219 @@
//
// ********************************************************************
// * 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: RE01Trajectory.cc,v 1.1 2004/11/26 07:37:43 asaim Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
#include "RE01Trajectory.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleTypes.hh"
#include "G4Polyline.hh"
#include "G4Circle.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4VVisManager.hh"
#include "G4UnitsTable.hh"
#include "G4DynamicParticle.hh"
#include "G4PrimaryParticle.hh"
#include "RE01TrackInformation.hh"
G4Allocator<RE01Trajectory> myTrajectoryAllocator;
RE01Trajectory::RE01Trajectory()
:G4VTrajectory()
{
fpParticleDefinition = 0;
ParticleName = "";
PDGCharge = 0;
PDGEncoding = 0;
fTrackID = 0;
fParentID = 0;
fTrackStatus = 0;
positionRecord = 0;
momentum = G4ThreeVector(0.,0.,0.);
vertexPosition = G4ThreeVector(0.,0.,0.);
globalTime = 0.;
}
RE01Trajectory::RE01Trajectory(const G4Track* aTrack)
:G4VTrajectory()
{
fpParticleDefinition = aTrack->GetDefinition();
ParticleName = fpParticleDefinition->GetParticleName();
PDGCharge = fpParticleDefinition->GetPDGCharge();
PDGEncoding = fpParticleDefinition->GetPDGEncoding();
if(ParticleName=="unknown")
{
G4PrimaryParticle*pp = aTrack->GetDynamicParticle()->GetPrimaryParticle();
if(pp)
{
if(pp->GetCharge()<DBL_MAX) PDGCharge = pp->GetCharge();
PDGEncoding = pp->GetPDGcode();
if(pp->GetG4code()!=0)
{
ParticleName += " : ";
ParticleName += pp->GetG4code()->GetParticleName();
}
}
}
fTrackID = aTrack->GetTrackID();
RE01TrackInformation* trackInfo
= (RE01TrackInformation*)(aTrack->GetUserInformation());
fTrackStatus = trackInfo->GetTrackingStatus();
if(fTrackStatus == 1)
{ fParentID = aTrack->GetParentID(); }
else if(fTrackStatus == 2)
{ fParentID = trackInfo->GetSourceTrackID(); }
else
{ fParentID = -1; }
positionRecord = new RE01TrajectoryPointContainer();
positionRecord->push_back(new G4TrajectoryPoint(aTrack->GetPosition()));
momentum = aTrack->GetMomentum();
vertexPosition = aTrack->GetPosition();
globalTime = aTrack->GetGlobalTime();
}
RE01Trajectory::RE01Trajectory(RE01Trajectory & right)
:G4VTrajectory()
{
ParticleName = right.ParticleName;
fpParticleDefinition = right.fpParticleDefinition;
PDGCharge = right.PDGCharge;
PDGEncoding = right.PDGEncoding;
fTrackID = right.fTrackID;
fParentID = right.fParentID;
fTrackStatus = right.fTrackStatus;
positionRecord = new RE01TrajectoryPointContainer();
for(size_t i=0;i<right.positionRecord->size();i++)
{
G4TrajectoryPoint* rightPoint = (G4TrajectoryPoint*)((*(right.positionRecord))[i]);
positionRecord->push_back(new G4TrajectoryPoint(*rightPoint));
}
momentum = right.momentum;
vertexPosition = right.vertexPosition;
globalTime = right.globalTime;
}
RE01Trajectory::~RE01Trajectory()
{
size_t i;
for(i=0;i<positionRecord->size();i++){
delete (*positionRecord)[i];
}
positionRecord->clear();
delete positionRecord;
}
void RE01Trajectory::ShowTrajectory(std::ostream& os) const
{
os << G4endl << "TrackID =" << fTrackID
<< " : ParentID=" << fParentID << " : TrackStatus=" << fTrackStatus << G4endl;
os << "Particle name : " << ParticleName << " PDG code : " << PDGEncoding
<< " Charge : " << PDGCharge << G4endl;
os << "Original momentum : " <<
G4BestUnit(momentum,"Energy") << G4endl;
os << "Vertex : " << G4BestUnit(vertexPosition,"Length")
<< " Global time : " << G4BestUnit(globalTime,"Time") << G4endl;
os << " Current trajectory has " << positionRecord->size()
<< " points." << G4endl;
for( size_t i=0 ; i < positionRecord->size() ; i++){
G4TrajectoryPoint* aTrajectoryPoint = (G4TrajectoryPoint*)((*positionRecord)[i]);
os << "Point[" << i << "]"
<< " Position= " << aTrajectoryPoint->GetPosition() << G4endl;
}
}
void RE01Trajectory::DrawTrajectory(G4int) const
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
G4ThreeVector pos;
G4Polyline pPolyline;
for (size_t i = 0; i < positionRecord->size() ; i++) {
G4TrajectoryPoint* aTrajectoryPoint = (G4TrajectoryPoint*)((*positionRecord)[i]);
pos = aTrajectoryPoint->GetPosition();
pPolyline.push_back( pos );
}
G4Colour colour(0.2,0.2,0.2);
if(fpParticleDefinition==G4Gamma::GammaDefinition())
colour = G4Colour(0.,0.,1.);
else if(fpParticleDefinition==G4Electron::ElectronDefinition()
||fpParticleDefinition==G4Positron::PositronDefinition())
colour = G4Colour(1.,1.,0.);
else if(fpParticleDefinition==G4MuonMinus::MuonMinusDefinition()
||fpParticleDefinition==G4MuonPlus::MuonPlusDefinition())
colour = G4Colour(0.,1.,0.);
else if(fpParticleDefinition->GetParticleType()=="meson")
{
if(PDGCharge!=0.)
colour = G4Colour(1.,0.,0.);
else
colour = G4Colour(0.5,0.,0.);
}
else if(fpParticleDefinition->GetParticleType()=="baryon")
{
if(PDGCharge!=0.)
colour = G4Colour(0.,1.,1.);
else
colour = G4Colour(0.,0.5,0.5);
}
G4VisAttributes attribs(colour);
pPolyline.SetVisAttributes(attribs);
if(pVVisManager) pVVisManager->Draw(pPolyline);
}
void RE01Trajectory::AppendStep(const G4Step* aStep)
{
positionRecord->push_back( new G4TrajectoryPoint(aStep->GetPostStepPoint()->
GetPosition() ));
}
G4ParticleDefinition* RE01Trajectory::GetParticleDefinition()
{
return (G4ParticleTable::GetParticleTable()->FindParticle(ParticleName));
}
void RE01Trajectory::MergeTrajectory(G4VTrajectory* secondTrajectory)
{
if(!secondTrajectory) return;
RE01Trajectory* seco = (RE01Trajectory*)secondTrajectory;
G4int ent = seco->GetPointEntries();
for(int i=1;i<ent;i++) // initial point of the second trajectory should not be merged
{
positionRecord->push_back((*(seco->positionRecord))[i]);
}
delete (*seco->positionRecord)[0];
seco->positionRecord->clear();
}