Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 08:28:13

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 DetectorWatase86.cc
0027 /// \brief Implementation of the DetectorWatase86 class
0028 
0029 #include "DetectorWatase86.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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0048 
0049 DetectorWatase86::DetectorWatase86() : fRadiatorDescription(0) {}
0050 
0051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0052 
0053 DetectorWatase86::~DetectorWatase86()
0054 {
0055   // delete fRadiatorDescription;
0056   // the description is deleted in detector construction
0057 }
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0060 
0061 G4VPhysicalVolume* DetectorWatase86::Construct()
0062 {
0063   // Geometry parameters
0064   //
0065 
0066   G4cout << "DetectorWatase86 setup" << G4endl;
0067 
0068   G4double worldSizeZ = 400. * cm;
0069   G4double worldSizeR = 20. * cm;
0070 
0071   // Radiator and detector parameters
0072 
0073   G4double radThickness = 0.04 * mm;
0074   G4double gasGap = 0.126 * mm;
0075   G4double foilGasRatio = radThickness / (radThickness + gasGap);
0076   G4double foilNumber = 300;
0077 
0078   G4double absorberThickness = 30.0 * mm;
0079   G4double absorberRadius = 100. * mm;
0080 
0081   G4double windowThick = 51.0 * micrometer;
0082   G4double electrodeThick = 10.0 * micrometer;
0083   G4double gapThick = 10.0 * cm;
0084   G4double detGap = 0.01 * mm;
0085 
0086   G4double startZ = 100.0 * mm;
0087 
0088   // Materials
0089   //
0090 
0091   // Change to create materials using NIST
0092   G4Material* li = Materials::GetInstance()->GetMaterial("Li");
0093   G4Material* he = Materials::GetInstance()->GetMaterial("He");
0094   G4Material* xe10CH4 = Materials::GetInstance()->GetMaterial("Xe10CH4");
0095 
0096   G4double foilDensity = li->GetDensity();
0097   G4double gasDensity = he->GetDensity();
0098   G4double totDensity = foilDensity * foilGasRatio + gasDensity * (1.0 - foilGasRatio);
0099 
0100   G4double fractionFoil = foilDensity * foilGasRatio / totDensity;
0101   G4double fractionGas = gasDensity * (1.0 - foilGasRatio) / totDensity;
0102   G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
0103   radiatorMat->AddMaterial(li, fractionFoil);
0104   radiatorMat->AddMaterial(he, fractionGas);
0105 
0106   // Radiator description
0107   fRadiatorDescription = new RadiatorDescription;
0108   fRadiatorDescription->fFoilMaterial = li;  // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
0109   fRadiatorDescription->fGasMaterial = he;  // CO2; // He; //
0110   fRadiatorDescription->fFoilThickness = radThickness;
0111   fRadiatorDescription->fGasThickness = gasGap;
0112   fRadiatorDescription->fFoilNumber = foilNumber;
0113 
0114   G4Material* worldMaterial = he;  // CO2;
0115   G4Material* absorberMaterial = xe10CH4;
0116 
0117   // Volumes
0118   //
0119 
0120   G4VSolid* solidWorld = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ / 2.);
0121 
0122   G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, worldMaterial, "World");
0123 
0124   G4VPhysicalVolume* physicsWorld =
0125     new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
0126 
0127   // TR radiator envelope
0128 
0129   G4double radThick = foilNumber * (radThickness + gasGap) - gasGap + detGap;
0130   G4double radZ = startZ + 0.5 * radThick;
0131 
0132   G4VSolid* solidRadiator =
0133     new G4Box("Radiator", 1.1 * absorberRadius, 1.1 * absorberRadius, 0.5 * radThick);
0134 
0135   G4LogicalVolume* logicRadiator = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
0136 
0137   new G4PVPlacement(0, G4ThreeVector(0, 0, radZ), "Radiator", logicRadiator, physicsWorld, false,
0138                     0);
0139 
0140   fRadiatorDescription->fLogicalVolume = logicRadiator;
0141 
0142   // create region for radiator
0143 
0144   G4Region* radRegion = new G4Region("XTRradiator");
0145   radRegion->AddRootLogicalVolume(logicRadiator);
0146 
0147   G4double windowZ = startZ + radThick + windowThick / 2. + 15.0 * mm;
0148 
0149   G4double gapZ = windowZ + windowThick / 2. + gapThick / 2. + 0.01 * mm;
0150 
0151   G4double electrodeZ = gapZ + gapThick / 2. + electrodeThick / 2. + 0.01 * mm;
0152 
0153   // Absorber
0154 
0155   G4double absorberZ = electrodeZ + electrodeThick / 2. + absorberThickness / 2. + 0.01 * mm;
0156 
0157   G4VSolid* solidAbsorber =
0158     new G4Box("Absorber", absorberRadius, absorberRadius, absorberThickness / 2.);
0159 
0160   G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
0161 
0162   new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ), "Absorber", logicAbsorber, physicsWorld,
0163                     false, 0);
0164 
0165   G4Region* regGasDet = new G4Region("XTRdEdxDetector");
0166   regGasDet->AddRootLogicalVolume(logicAbsorber);
0167 
0168   // Sensitive Detectors: Absorber
0169 
0170   SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
0171   G4SDManager::GetSDMpointer()->AddNewDetector(sd);
0172   logicAbsorber->SetSensitiveDetector(sd);
0173 
0174   // Print geometry parameters
0175 
0176   G4cout << "\n The  WORLD   is made of " << worldSizeZ / mm << "mm of "
0177          << worldMaterial->GetName();
0178   G4cout << ", the transverse size (R) of the world is " << worldSizeR / mm << " mm. " << G4endl;
0179   G4cout << " The ABSORBER is made of " << absorberThickness / mm << "mm of "
0180          << absorberMaterial->GetName();
0181   G4cout << ", the transverse size (R) is " << absorberRadius / mm << " mm. " << G4endl;
0182   G4cout << " Z position of the (middle of the) absorber " << absorberZ / mm << "  mm." << G4endl;
0183 
0184   G4cout << "radZ = " << radZ / mm << " mm" << G4endl;
0185   G4cout << "startZ = " << startZ / mm << " mm" << G4endl;
0186 
0187   G4cout << "fRadThick = " << radThick / mm << " mm" << G4endl;
0188   G4cout << "fFoilNumber = " << foilNumber << G4endl;
0189   G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
0190   G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
0191   G4cout << G4endl;
0192 
0193   return physicsWorld;
0194 }
0195 
0196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......