Back to home page

EIC code displayed by LXR

 
 

    


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

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