Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-01 07:54:12

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file DetectorALICE06.cc
0027 /// \brief Implementation of the DetectorALICE06 class
0028 
0029 #include "DetectorALICE06.hh"
0030 
0031 #include "Materials.hh"
0032 #include "SensitiveDetector.hh"
0033 
0034 #include "G4Box.hh"
0035 #include "G4FieldManager.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4Material.hh"
0038 #include "G4PVPlacement.hh"
0039 #include "G4Region.hh"
0040 #include "G4SDManager.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4TransportationManager.hh"
0043 #include "G4UniformMagField.hh"
0044 #include "G4UnitsTable.hh"
0045 #include "G4ios.hh"
0046 
0047 #include <cmath>
0048 
0049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0050 
0051 DetectorALICE06::DetectorALICE06() : fRadiatorDescription(0) {}
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0054 
0055 DetectorALICE06::~DetectorALICE06()
0056 {
0057   // delete fRadiatorDescription;
0058   // the description is deleted in detector construction
0059 }
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0062 
0063 G4VPhysicalVolume* DetectorALICE06::Construct()
0064 {
0065   // Geometry parameters
0066   //
0067 
0068   G4cout << "DetectorALICE06 setup" << G4endl;
0069 
0070   G4double worldSizeZ = 600. * cm;
0071   G4double worldSizeR = 22. * cm;
0072 
0073   // Radiator and detector parameters
0074 
0075   G4double radThickness = 0.020 * mm;
0076   G4double gasGap = 0.500 * mm;
0077   G4double foilGasRatio = radThickness / (radThickness + gasGap);
0078   G4int foilNumber = 120;
0079 
0080   G4double absorberThickness = 37 * mm;
0081   G4double absorberRadius = 100. * mm;
0082 
0083   G4double electrodeThick = 100.0 * micrometer;
0084   G4double pipeLength = 160.0 * cm;
0085   G4double mylarThick = 20.0 * micrometer;
0086   G4double detGap = 0.01 * mm;
0087 
0088   G4double startZ = 100.0 * mm;
0089 
0090   // Materials
0091   //
0092 
0093   // Change to create materials using NIST
0094   G4Material* air = Materials::GetInstance()->GetMaterial("Air");
0095   G4Material* ch2 = Materials::GetInstance()->GetMaterial("CH2");
0096   G4Material* xe15CO2 = Materials::GetInstance()->GetMaterial("Xe15CO2");
0097 
0098   G4double foilDensity = ch2->GetDensity();
0099   G4double gasDensity = air->GetDensity();
0100   G4double totDensity = foilDensity * foilGasRatio + gasDensity * (1.0 - foilGasRatio);
0101 
0102   G4double fractionFoil = foilDensity * foilGasRatio / totDensity;
0103   G4double fractionGas = 1.0 - fractionFoil;
0104   G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
0105   radiatorMat->AddMaterial(ch2, fractionFoil);
0106   radiatorMat->AddMaterial(air, fractionGas);
0107 
0108   // Radiator description
0109   fRadiatorDescription = new RadiatorDescription;
0110   fRadiatorDescription->fFoilMaterial = ch2;  // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
0111   fRadiatorDescription->fGasMaterial = air;  // CO2; // He; //
0112   fRadiatorDescription->fFoilThickness = radThickness;
0113   fRadiatorDescription->fGasThickness = gasGap;
0114   fRadiatorDescription->fFoilNumber = foilNumber;
0115 
0116   G4Material* worldMaterial = air;  // CO2;
0117   G4Material* absorberMaterial = xe15CO2;
0118 
0119   // Volumes
0120   //
0121 
0122   G4VSolid* solidWorld = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ / 2.);
0123 
0124   G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, worldMaterial, "World");
0125 
0126   G4VPhysicalVolume* physicsWorld =
0127     new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
0128 
0129   // TR radiator envelope
0130 
0131   G4double radThick = foilNumber * (radThickness + gasGap) - gasGap + detGap;
0132   G4double radZ = startZ + 0.5 * radThick;
0133 
0134   G4VSolid* solidRadiator =
0135     new G4Box("Radiator", 1.1 * absorberRadius, 1.1 * absorberRadius, 0.5 * radThick);
0136 
0137   G4LogicalVolume* logicRadiator = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
0138 
0139   new G4PVPlacement(0, G4ThreeVector(0, 0, radZ), "Radiator", logicRadiator, physicsWorld, false,
0140                     0);
0141 
0142   fRadiatorDescription->fLogicalVolume = logicRadiator;
0143 
0144   // Create region for radiator
0145 
0146   G4Region* radRegion = new G4Region("XTRradiator");
0147   radRegion->AddRootLogicalVolume(logicRadiator);
0148 
0149   // Drift Electrode on both sides of Radiator
0150   // (not placed)
0151 
0152   G4double zElectrode1 = radZ - radThick / 2. - electrodeThick / 2.;
0153   G4double zElectrode2 = radZ + radThick / 2. + electrodeThick / 2.;
0154 
0155   G4cout << "zElectrode1 = " << zElectrode1 / mm << " mm" << G4endl;
0156   G4cout << "zElectrode2 = " << zElectrode2 / mm << " mm" << G4endl;
0157   G4cout << "fElectrodeThick = " << electrodeThick / mm << " mm" << G4endl << G4endl;
0158 
0159   // Helium Pipe
0160   // (not placed)
0161 
0162   // Distance between pipe and radiator / absorber
0163   G4double pipeDist = 1. * cm;
0164   G4double zPipe = zElectrode2 + electrodeThick / 2. + pipeDist / 2. + pipeLength / 2.;
0165 
0166   G4cout << "zPipe = " << zPipe / mm << " mm" << G4endl;
0167   G4cout << "pipeLength = " << pipeLength / mm << " mm" << G4endl << G4endl;
0168 
0169   // Mylar Foil on both sides of helium pipe
0170   // (not placed)
0171 
0172   G4double zMylar1 = zPipe - pipeLength / 2. - mylarThick / 2. - 0.001 * mm;
0173   G4double zMylar2 = zPipe + pipeLength / 2. + mylarThick / 2. + 0.001 * mm;
0174 
0175   G4cout << "zMylar1 = " << zMylar1 / mm << " mm" << G4endl;
0176   G4cout << "zMylar2 = " << zMylar2 / mm << " mm" << G4endl;
0177   G4cout << "fMylarThick = " << mylarThick / mm << " mm" << G4endl << G4endl;
0178 
0179   // Mylar Foil on Chamber
0180   // (not placed)
0181 
0182   G4double zMylar = zElectrode2 + electrodeThick / 2. + mylarThick / 2. + 1.0 * mm;
0183   zMylar += (pipeLength + pipeDist);
0184 
0185   G4cout << "zMylar = " << zMylar / mm << " mm" << G4endl;
0186   G4cout << "mylarThick = " << mylarThick / mm << " mm" << G4endl << G4endl;
0187 
0188   // Absorber
0189 
0190   G4double absorberZ = zMylar + mylarThick + absorberThickness / 2.;
0191 
0192   G4VSolid* solidAbsorber = new G4Box("Absorber", absorberRadius, 10. * mm, absorberThickness / 2.);
0193 
0194   G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
0195 
0196   new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ), "Absorber", logicAbsorber, physicsWorld,
0197                     false, 0);
0198 
0199   G4Region* regGasDet = new G4Region("XTRdEdxDetector");
0200   regGasDet->AddRootLogicalVolume(logicAbsorber);
0201 
0202   // Sensitive Detectors: Absorber
0203 
0204   SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
0205   G4SDManager::GetSDMpointer()->AddNewDetector(sd);
0206   logicAbsorber->SetSensitiveDetector(sd);
0207 
0208   // Print geometry parameters
0209 
0210   G4cout << "\n The  WORLD   is made of " << worldSizeZ / mm << "mm of "
0211          << worldMaterial->GetName();
0212   G4cout << ", the transverse size (R) of the world is " << worldSizeR / mm << " mm. " << G4endl;
0213   G4cout << " The ABSORBER is made of " << absorberThickness / mm << "mm of "
0214          << absorberMaterial->GetName();
0215   G4cout << ", the transverse size (R) is " << absorberRadius / mm << " mm. " << G4endl;
0216   G4cout << " Z position of the (middle of the) absorber " << absorberZ / mm << "  mm." << G4endl;
0217 
0218   G4cout << "radZ = " << radZ / mm << " mm" << G4endl;
0219   G4cout << "startZ = " << startZ / mm << " mm" << G4endl;
0220 
0221   G4cout << "fRadThick = " << radThick / mm << " mm" << G4endl;
0222   G4cout << "fFoilNumber = " << foilNumber << G4endl;
0223   G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
0224   G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
0225   G4cout << G4endl;
0226 
0227   return physicsWorld;
0228 }
0229 
0230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......