Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:37

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 persistency/P01/src/ExP01ChamberParameterisation.cc
0027 /// \brief Implementation of the ExP01ChamberParameterisation class
0028 //
0029 //
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #include "ExP01ChamberParameterisation.hh"
0035 
0036 #include "G4Box.hh"
0037 #include "G4ThreeVector.hh"
0038 #include "G4VPhysicalVolume.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 ExP01ChamberParameterisation::ExP01ChamberParameterisation(
0043   G4int NoChambers,
0044   G4double startZ,  //  Z of center of first
0045   G4double spacingZ,  //  Z spacing of centers
0046   G4double widthChamber, G4double lengthInitial, G4double lengthFinal)
0047   : G4VPVParameterisation()
0048 {
0049   fNoChambers = NoChambers;
0050   fStartZ = startZ;
0051   fHalfWidth = widthChamber * 0.5;
0052   fSpacing = spacingZ;
0053   fHalfLengthFirst = 0.5 * lengthInitial;
0054   // fHalfLengthLast = lengthFinal;
0055   fHalfLengthIncr = 0;
0056   if (NoChambers > 0) {
0057     fHalfLengthIncr = 0.5 * (lengthFinal - lengthInitial) / NoChambers;
0058 
0059     if (spacingZ < widthChamber) {
0060       G4Exception("ExN02ChamberParameterisation::ExN02ChamberParameterisation()", "InvalidSetup",
0061                   FatalException, "Width>Spacing");
0062     }
0063   }
0064 }
0065 
0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0067 
0068 ExP01ChamberParameterisation::~ExP01ChamberParameterisation() {}
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0071 
0072 void ExP01ChamberParameterisation::ComputeTransformation(const G4int copyNo,
0073                                                          G4VPhysicalVolume* physVol) const
0074 {
0075   G4double Zposition = fStartZ + (copyNo + 1) * fSpacing;
0076   G4ThreeVector origin(0, 0, Zposition);
0077   physVol->SetTranslation(origin);
0078   physVol->SetRotation(0);
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 void ExP01ChamberParameterisation::ComputeDimensions(G4Box& trackerChamber, const G4int copyNo,
0084                                                      const G4VPhysicalVolume*) const
0085 {
0086   G4double halfLength = fHalfLengthFirst + copyNo * fHalfLengthIncr;
0087   trackerChamber.SetXHalfLength(halfLength);
0088   trackerChamber.SetYHalfLength(halfLength);
0089   trackerChamber.SetZHalfLength(fHalfWidth);
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......