Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // Author: Rachid Mazini 27 // Rachid.Mazini@cern.ch 28 // Language: C++ 29 // Tested on : g++ (egcs.2.1.1, RH6. 30 // Prerequisites: None 31 // Purpose: Source file defining 32 // FCAL. 33 // Developped: 10-March-2000 R.M. 34 // 35 // 36 //-------------------------------------------- 37 38 #include <fstream> 39 #include <cstdlib> 40 41 #include "FCALEMModule.hh" 42 43 #include "FCALMaterialConsultant.hh" 44 45 #include "G4SDManager.hh" 46 #include "FCALEMModuleSD.hh" 47 48 #include "G4PhysicalConstants.hh" 49 #include "G4SystemOfUnits.hh" 50 #include "G4Box.hh" 51 #include "G4Tubs.hh" 52 #include "G4LogicalVolume.hh" 53 #include "G4VPhysicalVolume.hh" 54 #include "G4PVPlacement.hh" 55 #include "G4SubtractionSolid.hh" 56 57 #include "G4ThreeVector.hh" 58 #include "G4VisAttributes.hh" 59 #include "G4Colour.hh" 60 61 FCALEMModule::FCALEMModule() : 62 FcalEmModuleSD(0) 63 { 64 F1LArGapID = new G4int[2400]; 65 F1LArIX = new G4int[2400]; 66 F1LArJY = new G4int[2400]; 67 F1LArITile = new G4int[2400]; 68 F1LArGapPosX = new G4double[2400]; 69 F1LArGapPosY = new G4double[2400]; 70 } 71 72 73 FCALEMModule::~FCALEMModule(){ 74 delete [] F1LArGapID; 75 delete [] F1LArGapPosX; 76 delete [] F1LArGapPosY; 77 delete [] F1LArIX; 78 delete [] F1LArJY; 79 delete [] F1LArITile; 80 } 81 82 83 void FCALEMModule::InitializeGeometry() { 84 #include "FCALEMModuleParameters.input" 85 std::ifstream File 86 ("geom_data/FCal1Electrodes.dat"); 87 88 if(!File) G4cerr << "Failed to open file FC 89 File.seekg(0); 90 91 NF1LarGap = 0; 92 while(!(File.eof())) { 93 NF1LarGap++; 94 File >> F1LArGapID[NF1LarGap] >> F1LArGapP 95 >> F1LArIX[NF1LarGap] >> F1LArJY[NF1LarGap 96 }; 97 G4cout << "********" << " Number of Rods in 98 } 99 100 101 102 G4LogicalVolume * FCALEMModule::Construct() 103 { 104 //----------------------------- 105 // construction of materials 106 //----------------------------- 107 FCALMaterialConsultant *FCALMaterials = 108 FCALMaterialConsultant::GetInstance(); 109 110 G4VisAttributes * ColorOfEMModule = new G4Vi 111 // G4VisAttributes * ColorOfLArg = new G4VisA 112 113 //---------------------------- 114 // Read Parameters 115 //---------------------------- 116 InitializeGeometry(); 117 118 //----------------------------------------- 119 // Logical to be returned (FCAL EM module) 120 //----------------------------------------- 121 G4Tubs * SolidEmModule = 122 new G4Tubs("EmModuleSold", EmModuleRMin, E 123 EmModuleStartPhi,EmModuleDPhi); 124 G4LogicalVolume * LogicalEmModule = 125 new G4LogicalVolume(SolidEmModule, FCALMat 126 "EmModuleLogical"); 127 128 LogicalEmModule->SetSmartless(FCALEmSmart); 129 130 LogicalEmModule->SetVisAttributes(ColorOfEM 131 // LogicalEmModule->SetVisAttributes(G4VisA 132 133 134 //--------------------- 135 // FCAL Cable Troff 136 //--------------------- 137 G4Tubs * SolidF1CableTroff = 138 new G4Tubs("F1CableTroffSolid", F1CableTro 139 F1CableTroffLenght, F1CableTroffStart 140 G4LogicalVolume * LogicalF1CableTroff = 141 new G4LogicalVolume(SolidF1CableTroff, FCA 142 "F1CableTroffLogical"); 143 144 G4ThreeVector F1CableTroffTrans(0.,0.,0.); 145 G4RotationMatrix F1CableTroffRot; 146 147 G4int i=0; 148 for(i=0 ; i < NCableTroff ; i++) 149 { 150 // G4VPhysicalVolume * PhysicalF1CableTro 151 new G4PVPlacement(G4Transform3D(F1CableTroff 152 LogicalF1CableTroff,"F1CableTroffPhysi 153 LogicalEmModule,0,i+1); 154 155 F1CableTroffRot.rotateZ(F1CableTroffRotZ 156 } 157 158 LogicalF1CableTroff->SetVisAttributes(ColorO 159 // LogicalF1CableTroff->SetVisAttributes(G4V 160 161 162 //---------------------- 163 // LArg gaps 164 //---------------------- 165 166 G4Tubs * SolidF1LArGap = 167 new G4Tubs("F1LArGapSolid",F1LArGapRmin, F 168 F1LArGapStartPhi,F1LArGapDPhi); 169 170 G4LogicalVolume * LogicalF1LArGap = 171 new G4LogicalVolume(SolidF1LArGap, FCALMa 172 "LArg Gap"); 173 174 for(i=1; i < NF1LarGap; i++){ 175 // G4VPhysicalVolume * PhysicalF1LArGap = 176 new G4PVPlacement(0,G4ThreeVector(F1LAr 177 LogicalF1LArGap,"F1LArGapPhysical", Lo 178 }; 179 180 // LogicalF1LArGap->SetVisAttributes(ColorO 181 LogicalF1LArGap->SetVisAttributes(G4VisAttr 182 183 184 // Sensitive Volumes 185 G4SDManager* SDman = G4SDManager::GetSDMpoi 186 187 if(!FcalEmModuleSD) 188 { 189 FcalEmModuleSD = new FCALEMModuleSD("FC 190 SDman->AddNewDetector(FcalEmModuleSD); 191 } 192 LogicalF1LArGap->SetSensitiveDetector(FcalE 193 194 195 196 return LogicalEmModule; 197 198 } 199 200 201 G4int FCALEMModule::GetF1TileID(G4int GapID) 202 { return F1LArITile[GapID]; } 203 204 G4double FCALEMModule::GetF1LArGapPosX(G4int G 205 { return F1LArGapPosX[GapID]; } 206 207 208