File indexing completed on 2026-09-14 08:28:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "ExGflash2ParallelWorld.hh"
0031
0032
0033 #include "G4AutoDelete.hh"
0034 #include "G4Box.hh"
0035 #include "G4Colour.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4Material.hh"
0038 #include "G4NistManager.hh"
0039 #include "G4PVPlacement.hh"
0040 #include "G4SystemOfUnits.hh"
0041 #include "G4ThreeVector.hh"
0042 #include "G4VPhysicalVolume.hh"
0043 #include "G4VisAttributes.hh"
0044 #include "globals.hh"
0045
0046
0047 #include "GFlashHitMaker.hh"
0048 #include "GFlashHomoShowerParameterisation.hh"
0049 #include "GFlashParticleBounds.hh"
0050 #include "GFlashShowerModel.hh"
0051
0052 #include "G4FastSimulationManager.hh"
0053
0054
0055
0056 ExGflash2ParallelWorld::ExGflash2ParallelWorld(G4String aWorldName)
0057 : G4VUserParallelWorld(aWorldName)
0058 {
0059 G4cout << "ExGflash2ParallelWorld::Parralel world constructor" << G4endl;
0060 }
0061
0062
0063
0064 ExGflash2ParallelWorld::~ExGflash2ParallelWorld()
0065 {
0066 delete fFastShowerModel;
0067 delete fParameterisation;
0068 delete fParticleBounds;
0069 delete fHitMaker;
0070 }
0071
0072
0073
0074 void ExGflash2ParallelWorld::Construct()
0075 {
0076
0077 G4Material* dummy = nullptr;
0078
0079
0080 auto ghostLogicalVolume = GetWorld()->GetLogicalVolume();
0081
0082
0083
0084 G4int nbOfCrystals = 10;
0085
0086
0087
0088
0089
0090
0091 G4double calo_xside = 31 * cm;
0092 G4double calo_yside = 31 * cm;
0093 G4double calo_zside = 24 * cm;
0094
0095 G4double crystalWidth = 3 * cm;
0096 G4double crystalLength = 24 * cm;
0097
0098 calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
0099 calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
0100 calo_zside = crystalLength;
0101
0102 auto calo_box = new G4Box("CMS calorimeter",
0103 calo_xside / 2.,
0104 calo_yside / 2., calo_zside / 2.);
0105 auto calo_log = new G4LogicalVolume(calo_box,
0106 dummy,
0107 "calo log",
0108 nullptr,
0109 nullptr,
0110 nullptr);
0111
0112 G4double xpos = 0.0;
0113 G4double ypos = 0.0;
0114 G4double zpos = 100.0 * cm;
0115 new G4PVPlacement(nullptr, G4ThreeVector(xpos, ypos, zpos), calo_log, "calorimeter",
0116 ghostLogicalVolume, false, 1);
0117
0118 auto caloVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
0119 calo_log->SetVisAttributes(caloVisAtt);
0120
0121
0122 fRegion = new G4Region("crystals");
0123 calo_log->SetRegion(fRegion);
0124 fRegion->AddRootLogicalVolume(calo_log);
0125 }
0126
0127
0128
0129 void ExGflash2ParallelWorld::ConstructSD()
0130 {
0131
0132 G4NistManager* nistManager = G4NistManager::Instance();
0133 G4Material* pbWO4 = nistManager->FindOrBuildMaterial("G4_PbWO4");
0134
0135
0136
0137
0138 G4cout << "Creating shower parameterization models" << G4endl;
0139 fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
0140 fParameterisation = new GFlashHomoShowerParameterisation(pbWO4);
0141 fFastShowerModel->SetParameterisation(*fParameterisation);
0142
0143 fParticleBounds = new GFlashParticleBounds();
0144 fFastShowerModel->SetParticleBounds(*fParticleBounds);
0145
0146 fHitMaker = new GFlashHitMaker();
0147 fFastShowerModel->SetHitMaker(*fHitMaker);
0148 G4cout << "end shower parameterization." << G4endl;
0149
0150 }
0151
0152