Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -37,11 +37,18 @@
#include "RE05TrackingAction.hh"
#include "RE05SteppingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05ActionInitialization::RE05ActionInitialization()
{;}
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05ActionInitialization::~RE05ActionInitialization()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05ActionInitialization::Build() const
{
@@ -64,6 +71,8 @@ void RE05ActionInitialization::Build() const
SetUserAction(stepping_action);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05ActionInitialization::BuildForMaster() const
{
//
@@ -71,3 +80,4 @@ void RE05ActionInitialization::BuildForMaster() const
SetUserAction(run_action);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05CalorimeterHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterHit.cc
/// \brief Implementation of the RE05CalorimeterHit class
@@ -43,61 +43,80 @@
G4ThreadLocal G4Allocator<RE05CalorimeterHit>* RE05CalorimeterHitAllocator=0;
std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit()
{pLogV=0;}
: G4VHit(),
fZCellID(-1),fPhiCellID(-1),fEdep(0.),fPos(),fRot(),fLogV(0)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi)
: ZCellID(z), PhiCellID(phi), pLogV(logVol)
{;}
: G4VHit(),
fZCellID(z), fPhiCellID(phi),fEdep(0.),fPos(),fRot(),fLogV(logVol)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::~RE05CalorimeterHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit(const RE05CalorimeterHit &right)
: G4VHit()
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
fZCellID = right.fZCellID;
fPhiCellID = right.fPhiCellID;
fEdep = right.fEdep;
fPos = right.fPos;
fRot = right.fRot;
fLogV = right.fLogV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05CalorimeterHit& RE05CalorimeterHit::operator=(const RE05CalorimeterHit &right)
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
fZCellID = right.fZCellID;
fPhiCellID = right.fPhiCellID;
fEdep = right.fEdep;
fPos = right.fPos;
fRot = right.fRot;
fLogV = right.fLogV;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05CalorimeterHit::operator==(const RE05CalorimeterHit &right) const
{
return ((ZCellID==right.ZCellID)&&(PhiCellID==right.PhiCellID));
return ((fZCellID==right.fZCellID)&&(fPhiCellID==right.fPhiCellID));
}
std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Transform3D trans(rot,pos);
G4Transform3D trans(fRot,fPos);
G4VisAttributes attribs;
const G4VisAttributes* pVA = pLogV->GetVisAttributes();
const G4VisAttributes* pVA = fLogV->GetVisAttributes();
if(pVA) attribs = *pVA;
G4Colour colour(1.,0.,0.);
attribs.SetColour(colour);
attribs.SetForceSolid(true);
pVVisManager->Draw(*pLogV,attribs,trans);
pVVisManager->Draw(*fLogV,attribs,trans);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -107,11 +126,13 @@ const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
fAttDefs["ZID"] = G4AttDef("ZID","Z Cell ID","Physics","","G4int");
fAttDefs["PhiID"] = G4AttDef("PhiID","Phi Cell ID","Physics","","G4int");
fAttDefs["EDep"] =
G4AttDef("EDep","Energy deposited","Physics","G4BestUnit","G4double");
G4AttDef("EDep","Energy defPosited","Physics","G4BestUnit","G4double");
}
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -119,16 +140,19 @@ std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
attValues->push_back
(G4AttValue("HitType","RE05CalorimeterHit",""));
attValues->push_back
(G4AttValue("ZID",G4UIcommand::ConvertToString(ZCellID),""));
(G4AttValue("ZID",G4UIcommand::ConvertToString(fZCellID),""));
attValues->push_back
(G4AttValue("PhiID",G4UIcommand::ConvertToString(PhiCellID),""));
(G4AttValue("PhiID",G4UIcommand::ConvertToString(fPhiCellID),""));
attValues->push_back
(G4AttValue("EDep",G4BestUnit(edep,"Energy"),""));
(G4AttValue("EDep",G4BestUnit(fEdep,"Energy"),""));
//G4cout << "Checking...\n" << G4AttCheck(attValues, GetAttDefs());
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
/// \file RE05/src/RE05CalorimeterParallelWorld.cc
/// \brief Implementation of the RE05CalorimeterParallelWorld class
//
#include "RE05CalorimeterParallelWorld.hh"
#include "RE05CalorimeterSD.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"
#include "G4VisAttributes.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParallelWorld::
RE05CalorimeterParallelWorld(G4String& parallelWorldName)
: G4VUserParallelWorld(parallelWorldName)
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParallelWorld::~RE05CalorimeterParallelWorld()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParallelWorld::Construct()
{
G4Material* dummyMat = 0;
// the ReadOut World:
G4VPhysicalVolume* ROWorldPhys = GetWorld();
G4LogicalVolume* ROWorldLog = ROWorldPhys->GetLogicalVolume();
// Calorimeter volume:
G4VSolid* caloROtub
= new G4Tubs("caloROtub",fCaloTubs_rmin,fCaloTubs_rmax,
fCaloTubs_dz,fCaloTubs_sphi,fCaloTubs_dphi);
G4LogicalVolume* caloROlog
= new G4LogicalVolume(caloROtub,dummyMat,"caloROlogical",0,0,0);
// G4VPhysicalVolume* caloROphys =
new G4PVPlacement(0,G4ThreeVector(),caloROlog,"calROphysical",
ROWorldLog,false,0);
// -------------------------------
// Calorimeter readout division:
// -------------------------------
// Phi division first: 48 sectors
G4VSolid* caloROphiDivisionTub
= new G4Tubs("caloROphiDivision", fCaloCell_rmin, fCaloCell_rmax,
fCaloCell_dz, fCaloCell_sphi, fCaloCell_dphi);
G4LogicalVolume* caloROphiDivisionLog
= new G4LogicalVolume(caloROphiDivisionTub, dummyMat,
"caloROphiDivisionLogical",0,0,0);
// G4VPhysicalVolume* caloROphiDivisionPhys =
new G4PVReplica("caloROphiDivisionPhysical", caloROphiDivisionLog,
caloROlog, kPhi, fSegmentsinPhi, fCaloCell_dphi);
// then z division: 20 slices:
G4VSolid* caloROcellTub
= new G4Tubs("caloROcellTub", fCaloRing_rmin, fCaloRing_rmax,
fCaloRing_dz, fCaloRing_sphi, fCaloRing_dphi);
G4LogicalVolume * caloROcellLog
= new G4LogicalVolume(caloROcellTub, dummyMat, "caloROcellLogical",0,0,0);
// G4VPhysicalVolume * caloROcellPhys =
new G4PVReplica("caloROcellPhysical", caloROcellLog, caloROphiDivisionLog,
kZAxis, fSegmentsinZ,2.*fCaloRing_dz);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParallelWorld::ConstructSD()
{
G4String calorimeterSDname = "/mydet/calorimeter";
RE05CalorimeterSD * calorimeterSD = new RE05CalorimeterSD(calorimeterSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(calorimeterSD);
SetSensitiveDetector("caloROcellLogical",calorimeterSD);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterParametrisation.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05CalorimeterParametrisation.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterParametrisation.cc
/// \brief Implementation of the RE05CalorimeterParametrisation class
@@ -36,13 +36,20 @@
#include "G4Tubs.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParametrisation::RE05CalorimeterParametrisation()
: G4VPVParameterisation()
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParametrisation::~RE05CalorimeterParametrisation()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParametrisation::ComputeTransformation
(const G4int,G4VPhysicalVolume *physVol) const
@@ -51,14 +58,18 @@ void RE05CalorimeterParametrisation::ComputeTransformation
physVol->SetTranslation(origin);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParametrisation::ComputeDimensions
(G4Tubs & calorimeterLayer, const G4int copyNo, const G4VPhysicalVolume*) const
{
G4double innerRad = caloTubs_rmin
+ copyNo*(absorber_thick+scinti_thick);
G4double innerRad = fCaloTubs_rmin
+ copyNo*(fAbsorber_thick+fScinti_thick);
calorimeterLayer.SetInnerRadius(innerRad);
calorimeterLayer.SetOuterRadius(innerRad+absorber_thick);
calorimeterLayer.SetZHalfLength(caloTubs_dz);
calorimeterLayer.SetStartPhiAngle(caloTubs_sphi,false);
calorimeterLayer.SetDeltaPhiAngle(caloTubs_dphi);
calorimeterLayer.SetOuterRadius(innerRad+fAbsorber_thick);
calorimeterLayer.SetZHalfLength(fCaloTubs_dz);
calorimeterLayer.SetStartPhiAngle(fCaloTubs_sphi,false);
calorimeterLayer.SetDeltaPhiAngle(fCaloTubs_dphi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterSD.cc 69920 2013-05-17 13:36:37Z gcosmo $
// $Id: RE05CalorimeterSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterSD.cc
/// \brief Implementation of the RE05CalorimeterSD class
@@ -45,7 +45,7 @@
RE05CalorimeterSD::RE05CalorimeterSD(G4String name)
:G4VSensitiveDetector(name),
numberOfCellsInZ(20),numberOfCellsInPhi(48)
fNumberOfCellsInZ(20),fNumberOfCellsInPhi(48)
{
G4String HCname;
collectionName.insert(HCname="calCollection");
@@ -54,16 +54,18 @@ RE05CalorimeterSD::RE05CalorimeterSD(G4String name)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterSD::~RE05CalorimeterSD()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::Initialize(G4HCofThisEvent*)
{
CalCollection = new RE05CalorimeterHitsCollection
fCalCollection = new RE05CalorimeterHitsCollection
(SensitiveDetectorName,collectionName[0]);
for(G4int j=0;j<numberOfCellsInZ;j++)
for(G4int k=0;k<numberOfCellsInPhi;k++)
for(G4int j=0;j<fNumberOfCellsInZ;j++)
for(G4int k=0;k<fNumberOfCellsInPhi;k++)
{
CellID[j][k] = -1;
fCellID[j][k] = -1;
}
verboseLevel = 0;
}
@@ -74,7 +76,7 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
{
//***** RE05CalorimeterSD has been migrated to Geant4 version 10 that does not
//***** support Readout Geometry in multi-threaded mode. Now RE05CalorimeterSD
//***** is assigned to a dedicaed parallel world. The pointer "aStep" points to
//***** is assigned to a dedicated parallel world. The pointer "aStep" points to
//***** a G4Step object for the parallel world.
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -85,7 +87,7 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
G4int copyIDinZ = touchable->GetReplicaNumber(0);
G4int copyIDinPhi = touchable->GetReplicaNumber(1);
if(CellID[copyIDinZ][copyIDinPhi]==-1)
if(fCellID[copyIDinZ][copyIDinPhi]==-1)
{
RE05CalorimeterHit* calHit
= new RE05CalorimeterHit
@@ -95,17 +97,17 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
aTrans.Invert();
calHit->SetPos(aTrans.NetTranslation());
calHit->SetRot(aTrans.NetRotation());
G4int icell = CalCollection->insert( calHit );
CellID[copyIDinZ][copyIDinPhi] = icell - 1;
G4int icell = fCalCollection->insert( calHit );
fCellID[copyIDinZ][copyIDinPhi] = icell - 1;
if(verboseLevel>0)
{ G4cout << " New Calorimeter Hit on CellID "
{ G4cout << " New Calorimeter Hit on fCellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
else
{
(*CalCollection)[CellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
(*fCalCollection)[fCellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
if(verboseLevel>0)
{ G4cout << " Energy added to CellID "
{ G4cout << " Energy added to fCellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
@@ -119,18 +121,22 @@ void RE05CalorimeterSD::EndOfEvent(G4HCofThisEvent*HCE)
static G4int HCID = -1;
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection( HCID, CalCollection );
HCE->AddHitsCollection( HCID, fCalCollection );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05DetectorConstruction.cc 69920 2013-05-17 13:36:37Z gcosmo $
// $Id: RE05DetectorConstruction.cc 101676 2016-11-21 09:25:51Z gcosmo $
//
/// \file RE05/src/RE05DetectorConstruction.cc
/// \brief Implementation of the RE05DetectorConstruction class
@@ -59,6 +59,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05DetectorConstruction::RE05DetectorConstruction()
: G4VUserDetectorConstruction()
{
#include "RE05DetectorParameterDef.icc"
@@ -68,18 +69,7 @@ RE05DetectorConstruction::RE05DetectorConstruction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05DetectorConstruction::~RE05DetectorConstruction()
{
delete Scinti;
delete Silicon;
delete Ar;
delete Lead;
delete Air;
delete O;
delete N;
delete C;
delete H;
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -92,27 +82,27 @@ void RE05DetectorConstruction::DefineMaterials()
G4double a, z, density;
G4int nel;
H = new G4Element("Hydrogen", "H", z=1., a= 1.01*g/mole);
C = new G4Element("Carbon", "C", z=6., a= 12.01*g/mole);
N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
O = new G4Element("Oxygen", "O", z=8., a= 16.00*g/mole);
G4Element* H = new G4Element("Hydrogen", "H", z=1., a= 1.01*g/mole);
G4Element* C = new G4Element("Carbon", "C", z=6., a= 12.01*g/mole);
G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
G4Element* O = new G4Element("Oxygen", "O", z=8., a= 16.00*g/mole);
Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
Air->AddElement(N, 70.*perCent);
Air->AddElement(O, 30.*perCent);
fAir = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
fAir->AddElement(N, 70.*perCent);
fAir->AddElement(O, 30.*perCent);
Lead =
fLead =
new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
Ar =
fAr =
new G4Material("ArgonGas",z=18., a= 39.95*g/mole, density=1.782*mg/cm3);
Silicon =
fSilicon =
new G4Material("Silicon", z=14., a= 28.09*g/mole, density= 2.33*g/cm3);
Scinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
Scinti->AddElement(C, 9);
Scinti->AddElement(H, 10);
fScinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
fScinti->AddElement(C, 9);
fScinti->AddElement(H, 10);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -127,41 +117,41 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ experimental hall
G4Box * experimentalHall_box
= new G4Box("expHall_b",expHall_x,expHall_y,expHall_z);
= new G4Box("expHall_b",fExpHall_x,fExpHall_y,fExpHall_z);
G4LogicalVolume * experimentalHall_log
= new G4LogicalVolume(experimentalHall_box,Air,"expHall_L",0,0,0);
= new G4LogicalVolume(experimentalHall_box,fAir,"expHall_L",0,0,0);
G4VPhysicalVolume * experimentalHall_phys
= new G4PVPlacement(0,G4ThreeVector(),experimentalHall_log,"expHall_P",
0,false,0);
experimentalHall_log->SetVisAttributes(G4VisAttributes::GetInvisible());
//------------------------------ 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",
G4VSolid * fTracker_tubs
= new G4Tubs("trkTubs_tubs",fTrkTubs_rmin,fTrkTubs_rmax,fTrkTubs_dz,
fTrkTubs_sphi,fTrkTubs_dphi);
G4LogicalVolume * fTracker_log
= new G4LogicalVolume(fTracker_tubs,fAr,"trackerT_L",0,0,0);
// G4VPhysicalVolume * fTracker_phys =
new G4PVPlacement(0,G4ThreeVector(),fTracker_log,"tracker_phys",
experimentalHall_log,false,0);
G4VisAttributes* tracker_logVisAtt
G4VisAttributes* fTracker_logVisAtt
= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
tracker_log->SetVisAttributes(tracker_logVisAtt);
fTracker_log->SetVisAttributes(fTracker_logVisAtt);
//------------------------------ 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);
= new G4Tubs("trackerLayer_tubs",fTrkTubs_rmin,fTrkTubs_rmax,fTrkTubs_dz,
fTrkTubs_sphi,fTrkTubs_dphi);
G4LogicalVolume * trackerLayer_log
= new G4LogicalVolume(trackerLayer_tubs,Silicon,"trackerB_L",0,0,0);
= new G4LogicalVolume(trackerLayer_tubs,fSilicon,"trackerB_L",0,0,0);
G4VPVParameterisation * trackerParam
= new RE05TrackerParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume *trackerLayer_phys =
new G4PVParameterised("trackerLayer_phys",trackerLayer_log,tracker_log,
kXAxis, notrkLayers, trackerParam);
new G4PVParameterised("trackerLayer_phys",trackerLayer_log,fTracker_log,
kXAxis, fNotrkLayers, trackerParam);
G4VisAttributes* trackerLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.5,0.0,1.0));
trackerLayer_logVisAtt->SetForceWireframe(true);
@@ -169,10 +159,10 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ calorimeter
G4VSolid * calorimeter_tubs
= new G4Tubs("calorimeter_tubs",caloTubs_rmin,caloTubs_rmax,
caloTubs_dz,caloTubs_sphi,caloTubs_dphi);
= new G4Tubs("calorimeter_tubs",fCaloTubs_rmin,fCaloTubs_rmax,
fCaloTubs_dz,fCaloTubs_sphi,fCaloTubs_dphi);
G4LogicalVolume * calorimeter_log
= new G4LogicalVolume(calorimeter_tubs,Scinti,"caloT_L",0,0,0);
= new G4LogicalVolume(calorimeter_tubs,fScinti,"caloT_L",0,0,0);
// G4VPhysicalVolume * calorimeter_phys =
new G4PVPlacement(0,G4ThreeVector(),calorimeter_log,"caloM_P",
experimentalHall_log,false,0);
@@ -185,16 +175,16 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
// 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);
= new G4Tubs("caloLayer_tubs",fCaloRing_rmin,fCaloRing_rmax,
fCaloRing_dz,fCaloRing_sphi,fCaloRing_dphi);
G4LogicalVolume * caloLayer_log
= new G4LogicalVolume(caloLayer_tubs,Lead,"caloR_L",0,0,0);
= new G4LogicalVolume(caloLayer_tubs,fLead,"caloR_L",0,0,0);
G4VPVParameterisation * calorimeterParam
= new RE05CalorimeterParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume * caloLayer_phys =
new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
kXAxis, nocaloLayers, calorimeterParam);
kXAxis, fNocaloLayers, calorimeterParam);
G4VisAttributes* caloLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.7,1.0,0.0));
caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
@@ -202,16 +192,16 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ muon counters
// As an example of CSG volumes with rotation
G4VSolid * muoncounter_box
= new G4Box("muoncounter_box",muBox_width,muBox_thick,
muBox_length);
= new G4Box("muoncounter_box",fMuBox_width,fMuBox_thick,
fMuBox_length);
G4LogicalVolume * muoncounter_log
= new G4LogicalVolume(muoncounter_box,Scinti,"mucounter_L",0,0,0);
for(int i=0; i<nomucounter ; i++)
= new G4LogicalVolume(muoncounter_box,fScinti,"mucounter_L",0,0,0);
for(int i=0; i<fNomucounter ; i++)
{
G4double phi, x, y, z;
phi = 360.*deg/nomucounter*i;
x = muBox_radius*std::sin(phi);
y = muBox_radius*std::cos(phi);
phi = 360.*deg/fNomucounter*i;
x = fMuBox_radius*std::sin(phi);
y = fMuBox_radius*std::cos(phi);
z = 0.*cm;
G4RotationMatrix rm;
rm.rotateZ(phi);
@@ -245,10 +235,13 @@ void RE05DetectorConstruction::ConstructSDandField()
//------------------------------------------------------------------
G4String trackerSDname = "/mydet/tracker";
RE05TrackerSD * trackerSD = new RE05TrackerSD(trackerSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(trackerSD);
SetSensitiveDetector("trackerB_L",trackerSD);
G4String muonSDname = "/mydet/muon";
RE05MuonSD * muonSD = new RE05MuonSD(muonSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(muonSD);
SetSensitiveDetector("mucounter_L",muonSD);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,56 +24,56 @@
// ********************************************************************
//
expHall_x = 600.*cm;
expHall_y = 600.*cm;
expHall_z = 600.*cm;
fExpHall_x = 600.*cm;
fExpHall_y = 600.*cm;
fExpHall_z = 600.*cm;
trkTubs_rmax = 50.*cm;
trkTubs_rmin = 20.*cm;
trkTubs_dz = 100.*cm;
trkTubs_sphi = 0.*deg;
trkTubs_dphi = 360.*deg;
fTrkTubs_rmax = 50.*cm;
fTrkTubs_rmin = 20.*cm;
fTrkTubs_dz = 100.*cm;
fTrkTubs_sphi = 0.*deg;
fTrkTubs_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;
fNotrkLayers = 5;
fTracker_radius[0] = 25.*cm;
fTracker_radius[1] = 30.*cm;
fTracker_radius[2] = 35.*cm;
fTracker_radius[3] = 40.*cm;
fTracker_radius[4] = 45.*cm;
tracker_thick = 0.5*cm;
fTracker_thick = 0.5*cm;
for(int il=0;il<5;il++)
{
tracker_length[il] = tracker_radius[il];
fTracker_length[il] = fTracker_radius[il];
}
caloTubs_rmax = 300.*cm;
caloTubs_rmin = 50.*cm;
caloTubs_dz = 200.*cm;
caloTubs_sphi = 0.*deg;
caloTubs_dphi = 360.*deg;
fCaloTubs_rmax = 300.*cm;
fCaloTubs_rmin = 50.*cm;
fCaloTubs_dz = 200.*cm;
fCaloTubs_sphi = 0.*deg;
fCaloTubs_dphi = 360.*deg;
absorber_thick = 3.*cm;
scinti_thick = 2.*cm;
nocaloLayers = int((caloTubs_rmax-caloTubs_rmin)/(absorber_thick+scinti_thick));
fAbsorber_thick = 3.*cm;
fScinti_thick = 2.*cm;
fNocaloLayers = int((fCaloTubs_rmax-fCaloTubs_rmin)/(fAbsorber_thick+fScinti_thick));
segmentsinPhi = 48;
caloCell_rmax = caloTubs_rmax;
caloCell_rmin = caloTubs_rmin;
caloCell_dz = caloTubs_dz;
caloCell_sphi = caloTubs_sphi;
caloCell_dphi = caloTubs_dphi/segmentsinPhi;
fSegmentsinPhi = 48;
fCaloCell_rmax = fCaloTubs_rmax;
fCaloCell_rmin = fCaloTubs_rmin;
fCaloCell_dz = fCaloTubs_dz;
fCaloCell_sphi = fCaloTubs_sphi;
fCaloCell_dphi = fCaloTubs_dphi/fSegmentsinPhi;
segmentsinZ = 20;
caloRing_rmax = caloCell_rmax;
caloRing_rmin = caloCell_rmin;
caloRing_dz = caloCell_dz/segmentsinZ ;
caloRing_sphi = caloCell_sphi;
caloRing_dphi = caloCell_dphi;
fSegmentsinZ = 20;
fCaloRing_rmax = fCaloCell_rmax;
fCaloRing_rmin = fCaloCell_rmin;
fCaloRing_dz = fCaloCell_dz/fSegmentsinZ ;
fCaloRing_sphi = fCaloCell_sphi;
fCaloRing_dphi = fCaloCell_dphi;
nomucounter = 4;
muBox_radius = 350.*cm;
muBox_width = muBox_radius - 5.*cm;
muBox_thick = 1.*cm;
muBox_length = expHall_z - 10.*cm;
fNomucounter = 4;
fMuBox_radius = 350.*cm;
fMuBox_width = fMuBox_radius - 5.*cm;
fMuBox_thick = 1.*cm;
fMuBox_length = fExpHall_z - 10.*cm;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05EventAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05EventAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05EventAction.cc
/// \brief Implementation of the RE05EventAction class
@@ -47,33 +47,41 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05EventAction::RE05EventAction()
{
trackerCollID = -1;
calorimeterCollID = -1;
muonCollID = -1;
}
: G4UserEventAction(),
fTrackerCollID(-1),
fCalorimeterCollID(-1),
fMuonCollID(-1)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05EventAction::~RE05EventAction()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05EventAction::BeginOfEventAction(const G4Event*)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
if(trackerCollID<0||calorimeterCollID<0||muonCollID<0)
if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0)
{
G4String colNam;
trackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
calorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
muonCollID = SDman->GetCollectionID(colNam="muonCollection");
fTrackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
fCalorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
fMuonCollID = SDman->GetCollectionID(colNam="muonCollection");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05EventAction::EndOfEventAction(const G4Event* evt)
{
G4cout << ">>> Event " << evt->GetEventID() << G4endl;
if(trackerCollID<0||calorimeterCollID<0||muonCollID<0) return;
if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RE05TrackerHitsCollection* THC = 0;
@@ -81,9 +89,9 @@ void RE05EventAction::EndOfEventAction(const G4Event* evt)
RE05MuonHitsCollection* MHC = 0;
if(HCE)
{
THC = (RE05TrackerHitsCollection*)(HCE->GetHC(trackerCollID));
CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
MHC = (RE05MuonHitsCollection*)(HCE->GetHC(muonCollID));
THC = (RE05TrackerHitsCollection*)(HCE->GetHC(fTrackerCollID));
CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(fCalorimeterCollID));
MHC = (RE05MuonHitsCollection*)(HCE->GetHC(fMuonCollID));
}
if(THC)
@@ -111,3 +119,4 @@ void RE05EventAction::EndOfEventAction(const G4Event* evt)
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05Field.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05Field.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05Field.cc
/// \brief Implementation of the RE05Field class
@@ -32,23 +32,32 @@
#include "RE05Field.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05Field::RE05Field()
: G4MagneticField()
{
Bz = 3.0*tesla;
rmax_sq = sqr(50.*cm);
zmax = 100.*cm;
fBz = 3.0*tesla;
fRmax_sq = sqr(50.*cm);
fZmax = 100.*cm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05Field::~RE05Field()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05Field::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; }
if(std::abs(Point[2])<fZmax && (sqr(Point[0])+sqr(Point[1]))<fRmax_sq)
{ Bfield[2] = fBz; }
else
{ Bfield[2] = 0.; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05MuonHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05MuonHit.cc
/// \brief Implementation of the RE05MuonHit class
@@ -41,26 +41,37 @@
G4ThreadLocal G4Allocator<RE05MuonHit>* RE05MuonHitAllocator=0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::RE05MuonHit()
{;}
: G4VHit(),fEdep(0.),fPos()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::~RE05MuonHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::RE05MuonHit(const RE05MuonHit &right)
: G4VHit()
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05MuonHit& RE05MuonHit::operator=(const RE05MuonHit &right)
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05MuonHit::operator==(const RE05MuonHit &right) const
{
return (this==&right) ? 1 : 0;
@@ -68,12 +79,14 @@ G4int RE05MuonHit::operator==(const RE05MuonHit &right) const
std::map<G4String,G4AttDef> RE05MuonHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Circle circle(pos);
G4Circle circle(fPos);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.,0.,0.);
@@ -83,6 +96,8 @@ void RE05MuonHit::Draw()
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05MuonHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -93,6 +108,8 @@ const std::map<G4String,G4AttDef>* RE05MuonHit::GetAttDefs() const
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05MuonHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -103,7 +120,9 @@ std::vector<G4AttValue>* RE05MuonHit::CreateAttValues() const
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonSD.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05MuonSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05MuonSD.cc
/// \brief Implementation of the RE05MuonSD class
@@ -38,26 +38,36 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonSD::RE05MuonSD(G4String name)
:G4VSensitiveDetector(name)
:G4VSensitiveDetector(name),
fMuonCollection(0), fPositionResolution(0.)
{
G4String HCname;
collectionName.insert(HCname="muonCollection");
positionResolution = 5*cm;
fPositionResolution = 5*cm;
}
RE05MuonSD::~RE05MuonSD(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonSD::~RE05MuonSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::Initialize(G4HCofThisEvent*HCE)
{
static int HCID = -1;
muonCollection = new RE05MuonHitsCollection
fMuonCollection = new RE05MuonHitsCollection
(SensitiveDetectorName,collectionName[0]);
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection(HCID,muonCollection);
HCE->AddHitsCollection(HCID,fMuonCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -65,15 +75,15 @@ G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
if(edep==0.) return true;
RE05MuonHit* aHit;
int nHit = muonCollection->entries();
int nHit = fMuonCollection->entries();
G4ThreeVector hitpos = aStep->GetPreStepPoint()->GetPosition();
for(int i=0;i<nHit;i++)
{
aHit = (*muonCollection)[i];
aHit = (*fMuonCollection)[i];
G4ThreeVector pos = aHit->GetPos();
G4double dist2 = sqr(pos.x()-hitpos.x())
+sqr(pos.y()-hitpos.y())+sqr(pos.z()-hitpos.z());
if(dist2<=sqr(positionResolution))
if(dist2<=sqr(fPositionResolution))
aHit->AddEdep(edep);
return true;
}
@@ -81,23 +91,29 @@ G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
aHit = new RE05MuonHit();
aHit->SetEdep( edep );
aHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
muonCollection->insert( aHit );
fMuonCollection->insert( aHit );
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::EndOfEvent(G4HCofThisEvent*)
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorAction.cc 83391 2014-08-21 14:35:11Z gcosmo $
// $Id: RE05PrimaryGeneratorAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05PrimaryGeneratorAction.cc
/// \brief Implementation of the RE05PrimaryGeneratorAction class
@@ -38,61 +38,66 @@
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4SystemOfUnits.hh"
G4VPrimaryGenerator* RE05PrimaryGeneratorAction::HEPEvt = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::RE05PrimaryGeneratorAction()
{
if(!HEPEvt)
{
const char* filename = "pythia_event.data";
HEPEvt = new G4HEPEvtInterface(filename,1);
}
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 RE05PrimaryGeneratorMessenger(this);
useHEPEvt = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4AutoLock.hh"
namespace {
G4Mutex RE05PrimGenDestrMutex = G4MUTEX_INITIALIZER;
G4Mutex RE05PrimGenMutex = G4MUTEX_INITIALIZER;
}
G4VPrimaryGenerator* RE05PrimaryGeneratorAction::fHEPEvt = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::RE05PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0),
fMessenger(0),
fUseHEPEvt(false)
{
if(!fHEPEvt)
{
const char* filename = "pythia_event.data";
fHEPEvt = new G4HEPEvtInterface(filename,1);
}
G4int n_particle = 1;
G4ParticleGun* particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="mu+");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
particleGun->SetParticleEnergy(100.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
fParticleGun = particleGun;
fMessenger = new RE05PrimaryGeneratorMessenger(this);
fUseHEPEvt = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::~RE05PrimaryGeneratorAction()
{
G4AutoLock lock(&RE05PrimGenDestrMutex);
if(HEPEvt) { delete HEPEvt; HEPEvt=0; }
delete particleGun;
delete messenger;
if(fHEPEvt) { delete fHEPEvt; fHEPEvt=0; }
delete fParticleGun;
delete fMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
if(useHEPEvt)
if(fUseHEPEvt)
{
G4AutoLock lock(&RE05PrimGenMutex);
HEPEvt->GeneratePrimaryVertex(anEvent);
fHEPEvt->GeneratePrimaryVertex(anEvent);
}
else
{ particleGun->GeneratePrimaryVertex(anEvent); }
{ fParticleGun->GeneratePrimaryVertex(anEvent); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorMessenger.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05PrimaryGeneratorMessenger.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05PrimaryGeneratorMessenger.cc
/// \brief Implementation of the RE05PrimaryGeneratorMessenger class
@@ -35,39 +35,48 @@
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
RE05PrimaryGeneratorMessenger::RE05PrimaryGeneratorMessenger(RE05PrimaryGeneratorAction * mpga)
:myAction(mpga)
{
mydetDirectory = new G4UIdirectory("/mydet/");
mydetDirectory->SetGuidance("RE05 detector control commands.");
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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");
RE05PrimaryGeneratorMessenger::RE05PrimaryGeneratorMessenger(RE05PrimaryGeneratorAction * mpga)
: G4UImessenger(),
fMyAction(mpga), fMydetDirectory(0), fGenCmd(0)
{
fMydetDirectory = new G4UIdirectory("/mydet/");
fMydetDirectory->SetGuidance("RE05 detector control commands.");
fGenCmd = new G4UIcmdWithAString("/mydet/generator",this);
fGenCmd->SetGuidance("Select primary generator.");
fGenCmd->SetGuidance(" Available generators : PYTHIA, particleGun");
fGenCmd->SetParameterName("generator",true);
fGenCmd->SetDefaultValue("PYTHIA");
fGenCmd->SetCandidates("PYTHIA particleGun");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorMessenger::~RE05PrimaryGeneratorMessenger()
{
delete genCmd;
delete mydetDirectory;
delete fGenCmd;
delete fMydetDirectory;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command==genCmd )
{ myAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
if( command==fGenCmd )
{ fMyAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4String RE05PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String cv;
if( command==genCmd )
if( command==fGenCmd )
{
if(myAction->GetHEPEvtGenerator())
if(fMyAction->GetHEPEvtGenerator())
{ cv = "PYTHIA"; }
else
{ cv = "particleGun"; }
@@ -76,3 +85,4 @@ G4String RE05PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand * command)
return cv;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05RunAction.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05RunAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05RunAction.cc
/// \brief Implementation of the RE05RunAction class
@@ -35,14 +35,12 @@
#include "RE05RunAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05RunAction::RE05RunAction()
: G4UserRunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingAction.cc 77724 2013-11-27 17:11:16Z gcosmo $
// $Id: RE05StackingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05StackingAction.cc
/// \brief Implementation of the RE05StackingAction class
@@ -42,23 +42,31 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingAction::RE05StackingAction()
: trkHits(0), muonHits(0), stage(0)
: G4UserStackingAction(),
fTrkHits(0), fMuonHits(0), fMessenger(0),
fStage(0),
fReqMuon(2),
fReqIso(10),
fAngRoI(30.0*deg)
{
angRoI = 30.0*deg;
reqMuon = 2;
reqIso = 10;
theMessenger = new RE05StackingActionMessenger(this);
fMessenger = new RE05StackingActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingAction::~RE05StackingAction()
{ delete theMessenger; }
{ delete fMessenger; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
G4ClassificationOfNewTrack classification = fWaiting;
switch(stage)
switch(fStage)
{
case 0: // Stage 0 : Primary muons only
if(aTrack->GetParentID()==0)
@@ -86,7 +94,7 @@ RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
classification = fUrgent;
break;
}
if((angRoI<0.)||InsideRoI(aTrack,angRoI))
if((fAngRoI<0.)||InsideRoI(aTrack,fAngRoI))
{
classification = fUrgent;
break;
@@ -96,20 +104,22 @@ RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
return classification;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05StackingAction::InsideRoI(const G4Track * aTrack,G4double ang)
{
if(!muonHits)
{ muonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!muonHits)
if(!fMuonHits)
{ fMuonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!fMuonHits)
{ G4cerr << "muonCollection NOT FOUND" << G4endl;
return true; }
G4int nhits = muonHits->entries();
G4int nhits = fMuonHits->entries();
const G4ThreeVector trPos = aTrack->GetPosition();
for(G4int i=0;i<nhits;i++)
{
G4ThreeVector muHitPos = (*muonHits)[i]->GetPos();
G4ThreeVector muHitPos = (*fMuonHits)[i]->GetPos();
G4double angl = muHitPos.angle(trPos);
if(angl<ang) { return true; }
}
@@ -117,6 +127,8 @@ G4bool RE05StackingAction::InsideRoI(const G4Track * aTrack,G4double ang)
return false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VHitsCollection* RE05StackingAction::GetCollection(G4String colName)
{
G4SDManager* SDMan = G4SDManager::GetSDMpointer();
@@ -131,23 +143,25 @@ G4VHitsCollection* RE05StackingAction::GetCollection(G4String colName)
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingAction::NewStage()
{
stage++;
fStage++;
G4int nhits;
if(stage==1)
if(fStage==1)
{
// Stage 0->1 : check if at least "reqMuon" hits on muon chamber
// Stage 0->1 : check if at least "fReqMuon" hits on muon chamber
// otherwise abort current event
if(!muonHits)
{ muonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!muonHits)
if(!fMuonHits)
{ fMuonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!fMuonHits)
{ G4cerr << "muonCollection NOT FOUND" << G4endl;
return; }
nhits = muonHits->entries();
nhits = fMuonHits->entries();
//// G4cout << "Stage 0->1 : " << nhits << " hits found in the muon chamber."
//// << G4endl;
if(nhits<reqMuon)
if(nhits<fReqMuon)
{
stackManager->clear();
//// G4cout << "++++++++ event aborted" << G4endl;
@@ -157,35 +171,35 @@ void RE05StackingAction::NewStage()
return;
}
else if(stage==2)
else if(fStage==2)
{
// Stage 1->2 : check the isolation of muon tracks
// at least "reqIsoMuon" isolated muons
// at least "fReqIsoMuon" isolated muons
// otherwise abort current event.
// Isolation requires "reqIso" or less hits
// Isolation requires "fReqIso" or less hits
// (including own hits) in the RoI region
// in the tracker layers.
nhits = muonHits->entries();
if(!trkHits)
{ trkHits = (RE05TrackerHitsCollection*)GetCollection("trackerCollection"); }
if(!trkHits)
nhits = fMuonHits->entries();
if(!fTrkHits)
{ fTrkHits = (RE05TrackerHitsCollection*)GetCollection("trackerCollection"); }
if(!fTrkHits)
{ G4cerr << "trackerCollection NOT FOUND" << G4endl;
return; }
G4int nTrkhits = trkHits->entries();
G4int nTrkhits = fTrkHits->entries();
G4int isoMuon = 0;
for(G4int j=0;j<nhits;j++)
{
G4ThreeVector hitPos = (*muonHits)[j]->GetPos();
G4ThreeVector hitPos = (*fMuonHits)[j]->GetPos();
G4int nhitIn = 0;
for(G4int jj=0;(jj<nTrkhits)&&(nhitIn<=reqIso);jj++)
for(G4int jj=0;(jj<nTrkhits)&&(nhitIn<=fReqIso);jj++)
{
G4ThreeVector trkhitPos = (*trkHits)[jj]->GetPos();
if(trkhitPos.angle(hitPos)<angRoI) nhitIn++;
G4ThreeVector trkhitPos = (*fTrkHits)[jj]->GetPos();
if(trkhitPos.angle(hitPos)<fAngRoI) nhitIn++;
}
if(nhitIn<=reqIso) isoMuon++;
if(nhitIn<=fReqIso) isoMuon++;
}
//// G4cout << "Stage 1->2 : " << isoMuon << " isolated muon found." << G4endl;
if(isoMuon<reqIsoMuon)
if(isoMuon<fReqIsoMuon)
{
stackManager->clear();
//// G4cout << "++++++++ event aborted" << G4endl;
@@ -197,16 +211,18 @@ void RE05StackingAction::NewStage()
else
{
// Other stage change : just re-classify
// Other fStage change : just re-classify
stackManager->ReClassify();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingAction::PrepareNewEvent()
{
stage = 0;
trkHits = 0;
muonHits = 0;
fStage = 0;
fTrkHits = 0;
fMuonHits = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingActionMessenger.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05StackingActionMessenger.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05StackingActionMessenger.cc
/// \brief Implementation of the RE05StackingActionMessenger class
@@ -35,67 +35,78 @@
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingActionMessenger::RE05StackingActionMessenger(RE05StackingAction * msa)
:myAction(msa)
: G4UImessenger(),
fMyAction(msa),
fMuonCmd(0), fIsoMuonCmd(0), fIsoCmd(0), fRoiCmd(0)
{
muonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
muonCmd->SetGuidance("Number of muon for the trigger.");
muonCmd->SetParameterName("N",true);
muonCmd->SetDefaultValue(2);
muonCmd->SetRange("N>=0");
fMuonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
fMuonCmd->SetGuidance("Number of muon for the trigger.");
fMuonCmd->SetParameterName("N",true);
fMuonCmd->SetDefaultValue(2);
fMuonCmd->SetRange("N>=0");
isomuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
isomuonCmd->SetGuidance("Number of isolated muon for the trigger.");
isomuonCmd->SetParameterName("N",true);
isomuonCmd->SetDefaultValue(2);
isomuonCmd->SetRange("N>=0");
fIsoMuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
fIsoMuonCmd->SetGuidance("Number of isolated muon for the trigger.");
fIsoMuonCmd->SetParameterName("N",true);
fIsoMuonCmd->SetDefaultValue(2);
fIsoMuonCmd->SetRange("N>=0");
isoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
isoCmd->SetGuidance("Maximum allowed number of hits in tracker");
isoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
isoCmd->SetParameterName("N",true);
isoCmd->SetDefaultValue(10);
isoCmd->SetRange("N>=0");
fIsoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
fIsoCmd->SetGuidance("Maximum allowed number of hits in tracker");
fIsoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
fIsoCmd->SetParameterName("N",true);
fIsoCmd->SetDefaultValue(10);
fIsoCmd->SetRange("N>=0");
roiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
roiCmd->SetGuidance("Define RoI angle");
roiCmd->SetParameterName("theta",true,true);
roiCmd->SetDefaultUnit("deg");
fRoiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
fRoiCmd->SetGuidance("Define RoI angle");
fRoiCmd->SetParameterName("theta",true,true);
fRoiCmd->SetDefaultUnit("deg");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingActionMessenger::~RE05StackingActionMessenger()
{
delete muonCmd;
delete isomuonCmd;
delete isoCmd;
delete roiCmd;
delete fMuonCmd;
delete fIsoMuonCmd;
delete fIsoCmd;
delete fRoiCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command==muonCmd )
{ myAction->SetNRequestMuon(muonCmd->GetNewIntValue(newValue)); }
else if( command==isomuonCmd )
{ myAction->SetNRequestIsoMuon(isomuonCmd->GetNewIntValue(newValue)); }
else if( command==isoCmd )
{ myAction->SetNIsolation(isoCmd->GetNewIntValue(newValue)); }
else if( command==roiCmd )
{ myAction->SetRoIAngle(roiCmd->GetNewDoubleValue(newValue)); }
if( command==fMuonCmd )
{ fMyAction->SetNRequestMuon(fMuonCmd->GetNewIntValue(newValue)); }
else if( command==fIsoMuonCmd )
{ fMyAction->SetNRequestIsoMuon(fIsoMuonCmd->GetNewIntValue(newValue)); }
else if( command==fIsoCmd )
{ fMyAction->SetNIsolation(fIsoCmd->GetNewIntValue(newValue)); }
else if( command==fRoiCmd )
{ fMyAction->SetRoIAngle(fRoiCmd->GetNewDoubleValue(newValue)); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4String RE05StackingActionMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String cv;
if( command==muonCmd )
{ cv = muonCmd->ConvertToString(myAction->GetNRequestMuon()); }
else if( command==isomuonCmd )
{ cv = isomuonCmd->ConvertToString(myAction->GetNRequestIsoMuon()); }
else if( command==isoCmd )
{ cv = isoCmd->ConvertToString(myAction->GetNIsolation()); }
else if( command==roiCmd )
{ cv = roiCmd->ConvertToString(myAction->GetRoIAngle(),"deg"); }
if( command==fMuonCmd )
{ cv = fMuonCmd->ConvertToString(fMyAction->GetNRequestMuon()); }
else if( command==fIsoMuonCmd )
{ cv = fIsoMuonCmd->ConvertToString(fMyAction->GetNRequestIsoMuon()); }
else if( command==fIsoCmd )
{ cv = fIsoCmd->ConvertToString(fMyAction->GetNIsolation()); }
else if( command==fRoiCmd )
{ cv = fRoiCmd->ConvertToString(fMyAction->GetRoIAngle(),"deg"); }
return cv;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05SteppingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05SteppingAction.cc
/// \brief Implementation of the RE05SteppingAction class
@@ -39,11 +39,18 @@
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingAction::RE05SteppingAction()
{;}
: G4UserSteppingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingAction::~RE05SteppingAction()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05SteppingAction::UserSteppingAction(const G4Step * theStep)
{
@@ -75,4 +82,4 @@ void RE05SteppingAction::UserSteppingAction(const G4Step * theStep)
theTrack->SetTrackStatus(fSuspend);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingVerbose.cc 66521 2012-12-19 12:22:01Z ihrivnac $
// $Id: RE05SteppingVerbose.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05SteppingVerbose.cc
/// \brief Implementation of the RE05SteppingVerbose class
@@ -40,6 +40,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingVerbose::RE05SteppingVerbose()
: G4SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05TrackerHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerHit.cc
/// \brief Implementation of the RE05TrackerHit class
@@ -40,40 +40,53 @@
#include "G4AttCheck.hh"
G4ThreadLocal G4Allocator<RE05TrackerHit>* RE05TrackerHitAllocator=0;
std::map<G4String,G4AttDef> RE05TrackerHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::RE05TrackerHit()
{;}
: G4VHit(),
fEdep(0.),fPos()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::~RE05TrackerHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::RE05TrackerHit(const RE05TrackerHit &right)
: G4VHit()
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05TrackerHit& RE05TrackerHit::operator=(const RE05TrackerHit &right)
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05TrackerHit::operator==(const RE05TrackerHit &right) const
{
return (this==&right) ? 1 : 0;
}
std::map<G4String,G4AttDef> RE05TrackerHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Circle circle(pos);
G4Circle circle(fPos);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.,0.,0.);
@@ -83,6 +96,8 @@ void RE05TrackerHit::Draw()
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05TrackerHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -93,6 +108,8 @@ const std::map<G4String,G4AttDef>* RE05TrackerHit::GetAttDefs() const
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05TrackerHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -103,7 +120,10 @@ std::vector<G4AttValue>* RE05TrackerHit::CreateAttValues() const
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerParametrisation.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackerParametrisation.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerParametrisation.cc
/// \brief Implementation of the RE05TrackerParametrisation class
@@ -36,15 +36,22 @@
#include "G4Tubs.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerParametrisation::RE05TrackerParametrisation()
: G4VPVParameterisation()
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerParametrisation::~RE05TrackerParametrisation()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerParametrisation::ComputeTransformation
(const G4int, G4VPhysicalVolume* physVol) const
@@ -53,12 +60,16 @@ void RE05TrackerParametrisation::ComputeTransformation
physVol->SetTranslation(origin);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerParametrisation::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,false);
trackerLayer.SetDeltaPhiAngle(trkTubs_dphi);
trackerLayer.SetInnerRadius(fTracker_radius[copyNo]);
trackerLayer.SetOuterRadius(fTracker_radius[copyNo]+fTracker_thick);
trackerLayer.SetZHalfLength(fTracker_length[copyNo]);
trackerLayer.SetStartPhiAngle(fTrkTubs_sphi,false);
trackerLayer.SetDeltaPhiAngle(fTrkTubs_dphi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerSD.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackerSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerSD.cc
/// \brief Implementation of the RE05TrackerSD class
@@ -36,25 +36,35 @@
#include "G4TouchableHistory.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerSD::RE05TrackerSD(G4String name)
:G4VSensitiveDetector(name)
: G4VSensitiveDetector(name),
fTrackerCollection(0)
{
G4String HCname;
collectionName.insert(HCname="trackerCollection");
}
RE05TrackerSD::~RE05TrackerSD(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerSD::~RE05TrackerSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::Initialize(G4HCofThisEvent* HCE)
{
static int HCID = -1;
trackerCollection = new RE05TrackerHitsCollection
fTrackerCollection = new RE05TrackerHitsCollection
(SensitiveDetectorName,collectionName[0]);
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection(HCID,trackerCollection);
HCE->AddHitsCollection(HCID,fTrackerCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -63,23 +73,29 @@ G4bool RE05TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
RE05TrackerHit* newHit = new RE05TrackerHit();
newHit->SetEdep( edep );
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
trackerCollection->insert( newHit );
fTrackerCollection->insert( newHit );
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::EndOfEvent(G4HCofThisEvent*)
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackingAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackingAction.cc
/// \brief Implementation of the RE05TrackingAction class
@@ -33,6 +33,8 @@
#include "G4TrackingManager.hh"
#include "G4Track.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{
// Create trajectory only for primaries
@@ -42,4 +44,4 @@ void RE05TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{ fpTrackingManager->SetStoreTrajectory(false); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -32,11 +32,18 @@
#include "RE05WorkerInitialization.hh"
#include "RE05SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05WorkerInitialization::RE05WorkerInitialization()
{;}
: G4UserWorkerInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05WorkerInitialization::~RE05WorkerInitialization()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05WorkerInitialization::WorkerInitialize() const
{
@@ -44,3 +51,4 @@ void RE05WorkerInitialization::WorkerInitialize() const
G4VSteppingVerbose::SetInstance(verbosity);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......