Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# Setup the project
|
||||
#
|
||||
cmake_minimum_required(VERSION 3.16...3.21)
|
||||
cmake_minimum_required(VERSION 3.16...3.27)
|
||||
project(B2b)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -59,29 +59,31 @@ int main(int argc,char** argv)
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
auto* runManager =
|
||||
auto runManager =
|
||||
G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
|
||||
|
||||
// Set mandatory initialization classes
|
||||
//
|
||||
runManager->SetUserInitialization(new B2b::DetectorConstruction());
|
||||
|
||||
G4VModularPhysicsList* physicsList = new FTFP_BERT;
|
||||
auto physicsList = new FTFP_BERT;
|
||||
physicsList->RegisterPhysics(new G4StepLimiterPhysics());
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
// Set user action classes
|
||||
runManager->SetUserInitialization(new B2::ActionInitialization());
|
||||
|
||||
// Initialize visualization
|
||||
//
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
// Initialize visualization with the default graphics system
|
||||
auto visManager = new G4VisExecutive(argc, argv);
|
||||
// Constructors can also take optional arguments:
|
||||
// - a graphics system of choice, eg. "OGL"
|
||||
// - and a verbosity argument - see /vis/verbose guidance.
|
||||
// auto visManager = new G4VisExecutive(argc, argv, "OGL", "Quiet");
|
||||
// auto visManager = new G4VisExecutive("Quiet");
|
||||
visManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
auto UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
// Process macro or start UI session
|
||||
//
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,13 +61,12 @@ namespace B2b
|
||||
class ChamberParameterisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
|
||||
ChamberParameterisation(G4int noChambers,
|
||||
G4double startZ,
|
||||
G4double spacing,
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal );
|
||||
G4double startZ,
|
||||
G4double spacing,
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal );
|
||||
|
||||
~ChamberParameterisation() override = default;
|
||||
|
||||
@@ -78,7 +77,6 @@ class ChamberParameterisation : public G4VPVParameterisation
|
||||
const G4VPhysicalVolume* physVol) const override;
|
||||
|
||||
private: // Dummy declarations to get rid of warnings ...
|
||||
|
||||
void ComputeDimensions (G4Box&,const G4int,
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
void ComputeDimensions (G4Trd&,const G4int,
|
||||
@@ -105,7 +103,6 @@ class ChamberParameterisation : public G4VPVParameterisation
|
||||
const G4VPhysicalVolume*) const override {}
|
||||
|
||||
private:
|
||||
|
||||
G4int fNoChambers;
|
||||
G4double fStartZ;
|
||||
G4double fHalfWidth; // The half-width of each tracker chamber
|
||||
|
||||
@@ -56,9 +56,6 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
|
||||
G4ParticleGun* GetParticleGun() {return fParticleGun;}
|
||||
|
||||
// Set methods
|
||||
void SetRandomFlag(G4bool );
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
};
|
||||
|
||||
@@ -232,12 +232,13 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
|
||||
// Visualization attributes
|
||||
|
||||
auto boxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
G4VisAttributes boxVisAtt(G4Colour::White());
|
||||
|
||||
worldLV ->SetVisAttributes(boxVisAtt);
|
||||
fLogicTarget ->SetVisAttributes(boxVisAtt);
|
||||
trackerLV ->SetVisAttributes(boxVisAtt);
|
||||
|
||||
auto chamberVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0));
|
||||
G4VisAttributes chamberVisAtt(G4Colour::Yellow());
|
||||
fLogicChamber->SetVisAttributes(chamberVisAtt);
|
||||
|
||||
// Example of User Limits
|
||||
|
||||
@@ -50,7 +50,7 @@ void EventAction::EndOfEventAction(const G4Event* event)
|
||||
// get number of stored trajectories
|
||||
|
||||
G4TrajectoryContainer* trajectoryContainer = event->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
std::size_t n_trajectories = 0;
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
|
||||
// periodic printing
|
||||
|
||||
@@ -58,8 +58,7 @@ void TrackerHit::Draw()
|
||||
G4Circle circle(fPos);
|
||||
circle.SetScreenSize(4.);
|
||||
circle.SetFillStyle(G4Circle::filled);
|
||||
G4Colour colour(1.,0.,0.);
|
||||
G4VisAttributes attribs(colour);
|
||||
G4VisAttributes attribs(G4Colour::Red());
|
||||
circle.SetVisAttributes(attribs);
|
||||
pVVisManager->Draw(circle);
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ G4bool TrackerSD::ProcessHits(G4Step* aStep,
|
||||
void TrackerSD::EndOfEvent(G4HCofThisEvent*)
|
||||
{
|
||||
if ( verboseLevel>1 ) {
|
||||
G4int nofHits = fHitsCollection->entries();
|
||||
std::size_t nofHits = fHitsCollection->entries();
|
||||
G4cout << G4endl
|
||||
<< "-------->Hits Collection: in this event they are " << nofHits
|
||||
<< " hits in the tracker chambers: " << G4endl;
|
||||
for ( G4int i=0; i<nofHits; i++ ) (*fHitsCollection)[i]->Print();
|
||||
for ( std::size_t i=0; i<nofHits; i++ ) (*fHitsCollection)[i]->Print();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
# Macro file for the visualization setting for the initialization phase
|
||||
# of the B2 example when running in interactive mode
|
||||
#
|
||||
|
||||
# Use these open statements to open selected visualization
|
||||
#
|
||||
# Use this open statement to create an OpenGL view:
|
||||
/vis/open OGL 600x600-0+0
|
||||
#
|
||||
# Use this open statement to create an OpenInventor view:
|
||||
#/vis/open OI
|
||||
#
|
||||
# Use this open statement to create a .prim file suitable for
|
||||
# viewing in DAWN:
|
||||
#/vis/open DAWNFILE
|
||||
#
|
||||
# Use this open statement to create a .heprep file suitable for
|
||||
# viewing in HepRApp:
|
||||
#/vis/open HepRepFile
|
||||
#
|
||||
# Use this open statement to create a .wrl file suitable for
|
||||
# viewing in a VRML viewer:
|
||||
#/vis/open VRML2FILE
|
||||
# Open a viewer
|
||||
/vis/open
|
||||
# This opens the default viewer - see examples/basic/B1/vis.mac for a
|
||||
# more comprehensive overview of options. Also the documentation.
|
||||
#
|
||||
# Disable auto refresh and quieten vis messages whilst scene and
|
||||
# trajectories are established:
|
||||
|
||||
Reference in New Issue
Block a user