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