File indexing completed on 2025-01-18 09:16:57
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
0035
0036
0037
0038 #include <fstream>
0039 #include <cstdlib>
0040
0041 #include "FCALEMModule.hh"
0042
0043 #include "FCALMaterialConsultant.hh"
0044
0045 #include "G4SDManager.hh"
0046 #include "FCALEMModuleSD.hh"
0047
0048 #include "G4PhysicalConstants.hh"
0049 #include "G4SystemOfUnits.hh"
0050 #include "G4Box.hh"
0051 #include "G4Tubs.hh"
0052 #include "G4LogicalVolume.hh"
0053 #include "G4VPhysicalVolume.hh"
0054 #include "G4PVPlacement.hh"
0055 #include "G4SubtractionSolid.hh"
0056
0057 #include "G4ThreeVector.hh"
0058 #include "G4VisAttributes.hh"
0059 #include "G4Colour.hh"
0060
0061 FCALEMModule::FCALEMModule() :
0062 FcalEmModuleSD(0)
0063 {
0064 F1LArGapID = new G4int[2400];
0065 F1LArIX = new G4int[2400];
0066 F1LArJY = new G4int[2400];
0067 F1LArITile = new G4int[2400];
0068 F1LArGapPosX = new G4double[2400];
0069 F1LArGapPosY = new G4double[2400];
0070 }
0071
0072
0073 FCALEMModule::~FCALEMModule(){
0074 delete [] F1LArGapID;
0075 delete [] F1LArGapPosX;
0076 delete [] F1LArGapPosY;
0077 delete [] F1LArIX;
0078 delete [] F1LArJY;
0079 delete [] F1LArITile;
0080 }
0081
0082
0083 void FCALEMModule::InitializeGeometry() {
0084 #include "FCALEMModuleParameters.input"
0085 std::ifstream File
0086 ("geom_data/FCal1Electrodes.dat");
0087
0088 if(!File) G4cerr << "Failed to open file FCal1Electrodes data file " << G4endl;
0089 File.seekg(0);
0090
0091 NF1LarGap = 0;
0092 while(!(File.eof())) {
0093 NF1LarGap++;
0094 File >> F1LArGapID[NF1LarGap] >> F1LArGapPosX[NF1LarGap] >> F1LArGapPosY[NF1LarGap]
0095 >> F1LArIX[NF1LarGap] >> F1LArJY[NF1LarGap] >> F1LArITile[NF1LarGap];
0096 };
0097 G4cout << "********" << " Number of Rods in FCAL1 : " << NF1LarGap-1 << G4endl;;
0098 }
0099
0100
0101
0102 G4LogicalVolume * FCALEMModule::Construct()
0103 {
0104
0105
0106
0107 FCALMaterialConsultant *FCALMaterials =
0108 FCALMaterialConsultant::GetInstance();
0109
0110 G4VisAttributes * ColorOfEMModule = new G4VisAttributes(G4Colour(1.,0.,0.5));
0111
0112
0113
0114
0115
0116 InitializeGeometry();
0117
0118
0119
0120
0121 G4Tubs * SolidEmModule =
0122 new G4Tubs("EmModuleSold", EmModuleRMin, EmModuleRMax, EmModuleLenght,
0123 EmModuleStartPhi,EmModuleDPhi);
0124 G4LogicalVolume * LogicalEmModule =
0125 new G4LogicalVolume(SolidEmModule, FCALMaterials->Material("Copper"),
0126 "EmModuleLogical");
0127
0128 LogicalEmModule->SetSmartless(FCALEmSmart);
0129
0130 LogicalEmModule->SetVisAttributes(ColorOfEMModule);
0131
0132
0133
0134
0135
0136
0137 G4Tubs * SolidF1CableTroff =
0138 new G4Tubs("F1CableTroffSolid", F1CableTroffRMin, F1CableTroffRMax,
0139 F1CableTroffLenght, F1CableTroffStartPhi, F1CableTroffDPhi);
0140 G4LogicalVolume * LogicalF1CableTroff =
0141 new G4LogicalVolume(SolidF1CableTroff, FCALMaterials->Material("FCAL1CuArKap"),
0142 "F1CableTroffLogical");
0143
0144 G4ThreeVector F1CableTroffTrans(0.,0.,0.);
0145 G4RotationMatrix F1CableTroffRot;
0146
0147 G4int i=0;
0148 for(i=0 ; i < NCableTroff ; i++)
0149 {
0150
0151 new G4PVPlacement(G4Transform3D(F1CableTroffRot,F1CableTroffTrans),
0152 LogicalF1CableTroff,"F1CableTroffPhysical",
0153 LogicalEmModule,0,i+1);
0154
0155 F1CableTroffRot.rotateZ(F1CableTroffRotZ);
0156 }
0157
0158 LogicalF1CableTroff->SetVisAttributes(ColorOfEMModule);
0159
0160
0161
0162
0163
0164
0165
0166 G4Tubs * SolidF1LArGap =
0167 new G4Tubs("F1LArGapSolid",F1LArGapRmin, F1LArGapRmax, F1LArGapLenght,
0168 F1LArGapStartPhi,F1LArGapDPhi);
0169
0170 G4LogicalVolume * LogicalF1LArGap =
0171 new G4LogicalVolume(SolidF1LArGap, FCALMaterials->Material("LiquidArgon"),
0172 "LArg Gap");
0173
0174 for(i=1; i < NF1LarGap; i++){
0175
0176 new G4PVPlacement(0,G4ThreeVector(F1LArGapPosX[i]*cm,F1LArGapPosY[i]*cm,0.*cm),
0177 LogicalF1LArGap,"F1LArGapPhysical", LogicalEmModule, 0, i);
0178 };
0179
0180
0181 LogicalF1LArGap->SetVisAttributes(G4VisAttributes::GetInvisible());
0182
0183
0184
0185 G4SDManager* SDman = G4SDManager::GetSDMpointer();
0186
0187 if(!FcalEmModuleSD)
0188 {
0189 FcalEmModuleSD = new FCALEMModuleSD("FCALTB/EmModuleSD");
0190 SDman->AddNewDetector(FcalEmModuleSD);
0191 }
0192 LogicalF1LArGap->SetSensitiveDetector(FcalEmModuleSD);
0193
0194
0195
0196 return LogicalEmModule;
0197
0198 }
0199
0200
0201 G4int FCALEMModule::GetF1TileID(G4int GapID)
0202 { return F1LArITile[GapID]; }
0203
0204 G4double FCALEMModule::GetF1LArGapPosX(G4int GapID)
0205 { return F1LArGapPosX[GapID]; }
0206
0207