Import Geant4 11.1.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file DetectorConstruction.cc
|
||||
/// \file B2/B2a/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the B2a::DetectorConstruction class
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
@@ -142,44 +142,37 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
<< G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
|
||||
<< " mm" << G4endl;
|
||||
|
||||
G4Box* worldS
|
||||
= new G4Box("world", //its name
|
||||
worldLength/2,worldLength/2,worldLength/2); //its size
|
||||
G4LogicalVolume* worldLV
|
||||
= new G4LogicalVolume(
|
||||
worldS, //its solid
|
||||
air, //its material
|
||||
"World"); //its name
|
||||
auto worldS = new G4Box("world", // its name
|
||||
worldLength / 2, worldLength / 2, worldLength / 2); // its size
|
||||
auto worldLV = new G4LogicalVolume(worldS, // its solid
|
||||
air, // its material
|
||||
"World"); // its name
|
||||
|
||||
// Must place the World Physical volume unrotated at (0,0,0).
|
||||
//
|
||||
G4VPhysicalVolume* worldPV
|
||||
= new G4PVPlacement(
|
||||
0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
worldLV, // its logical volume
|
||||
"World", // its name
|
||||
0, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
auto worldPV = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
worldLV, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
// Target
|
||||
|
||||
G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetLength+trackerSize));
|
||||
|
||||
G4Tubs* targetS
|
||||
= new G4Tubs("target",0.,targetRadius,targetLength,0.*deg,360.*deg);
|
||||
fLogicTarget
|
||||
= new G4LogicalVolume(targetS, fTargetMaterial,"Target",0,0,0);
|
||||
new G4PVPlacement(0, // no rotation
|
||||
positionTarget, // at (x,y,z)
|
||||
fLogicTarget, // its logical volume
|
||||
"Target", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
auto targetS = new G4Tubs("target", 0., targetRadius, targetLength, 0. * deg, 360. * deg);
|
||||
fLogicTarget = new G4LogicalVolume(targetS, fTargetMaterial, "Target", nullptr, nullptr, nullptr);
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
positionTarget, // at (x,y,z)
|
||||
fLogicTarget, // its logical volume
|
||||
"Target", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
G4cout << "Target is " << 2*targetLength/cm << " cm of "
|
||||
<< fTargetMaterial->GetName() << G4endl;
|
||||
@@ -188,23 +181,21 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
|
||||
G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
|
||||
|
||||
G4Tubs* trackerS
|
||||
= new G4Tubs("tracker",0,trackerSize,trackerSize, 0.*deg, 360.*deg);
|
||||
G4LogicalVolume* trackerLV
|
||||
= new G4LogicalVolume(trackerS, air, "Tracker",0,0,0);
|
||||
new G4PVPlacement(0, // no rotation
|
||||
positionTracker, // at (x,y,z)
|
||||
trackerLV, // its logical volume
|
||||
"Tracker", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
auto trackerS = new G4Tubs("tracker", 0, trackerSize, trackerSize, 0. * deg, 360. * deg);
|
||||
auto trackerLV = new G4LogicalVolume(trackerS, air, "Tracker", nullptr, nullptr, nullptr);
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
positionTracker, // at (x,y,z)
|
||||
trackerLV, // its logical volume
|
||||
"Tracker", // its name
|
||||
worldLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
0, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
// Visualization attributes
|
||||
|
||||
G4VisAttributes* boxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
G4VisAttributes* chamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
|
||||
auto boxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
|
||||
auto chamberVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 0.0));
|
||||
|
||||
worldLV ->SetVisAttributes(boxVisAtt);
|
||||
fLogicTarget ->SetVisAttributes(boxVisAtt);
|
||||
@@ -241,23 +232,21 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
G4double Zposition = firstPosition + copyNo * chamberSpacing;
|
||||
G4double rmax = rmaxFirst + copyNo * rmaxIncr;
|
||||
|
||||
G4Tubs* chamberS
|
||||
= new G4Tubs("Chamber_solid", 0, rmax, halfWidth, 0.*deg, 360.*deg);
|
||||
auto chamberS = new G4Tubs("Chamber_solid", 0, rmax, halfWidth, 0. * deg, 360. * deg);
|
||||
|
||||
fLogicChamber[copyNo] =
|
||||
new G4LogicalVolume(chamberS,fChamberMaterial,"Chamber_LV",0,0,0);
|
||||
new G4LogicalVolume(chamberS, fChamberMaterial, "Chamber_LV", nullptr, nullptr, nullptr);
|
||||
|
||||
fLogicChamber[copyNo]->SetVisAttributes(chamberVisAtt);
|
||||
|
||||
new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(0,0,Zposition), // at (x,y,z)
|
||||
fLogicChamber[copyNo], // its logical volume
|
||||
"Chamber_PV", // its name
|
||||
trackerLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
copyNo, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(0, 0, Zposition), // at (x,y,z)
|
||||
fLogicChamber[copyNo], // its logical volume
|
||||
"Chamber_PV", // its name
|
||||
trackerLV, // its mother volume
|
||||
false, // no boolean operations
|
||||
copyNo, // copy number
|
||||
fCheckOverlaps); // checking overlaps
|
||||
}
|
||||
|
||||
// Example of User Limits
|
||||
@@ -291,8 +280,7 @@ void DetectorConstruction::ConstructSDandField()
|
||||
// Sensitive detectors
|
||||
|
||||
G4String trackerChamberSDname = "/TrackerChamberSD";
|
||||
TrackerSD* aTrackerSD = new TrackerSD(trackerChamberSDname,
|
||||
"TrackerHitsCollection");
|
||||
auto aTrackerSD = new TrackerSD(trackerChamberSDname, "TrackerHitsCollection");
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(aTrackerSD);
|
||||
// Setting aTrackerSD to all logical volumes with the same name
|
||||
// of "Chamber_LV".
|
||||
|
||||
Reference in New Issue
Block a user