Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 08:29:08

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 ChamberParameterisation.cc
0027 /// \brief Implementation of the B2b::ChamberParameterisation class
0028 
0029 #include "ChamberParameterisation.hh"
0030 
0031 #include "G4SystemOfUnits.hh"
0032 #include "G4ThreeVector.hh"
0033 #include "G4Tubs.hh"
0034 #include "G4VPhysicalVolume.hh"
0035 
0036 namespace B2b
0037 {
0038 
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 ChamberParameterisation::ChamberParameterisation(G4int noChambers,
0042                                                  G4double startZ,  //  Z of center of first
0043                                                  G4double spacingZ,  //  Z spacing of centers
0044                                                  G4double widthChamber, G4double lengthInitial,
0045                                                  G4double lengthFinal)
0046 {
0047   fNoChambers = noChambers;
0048   fStartZ = startZ;
0049   fHalfWidth = 0.5 * widthChamber;
0050   fSpacing = spacingZ;
0051   fRmaxFirst = 0.5 * lengthInitial;
0052   if (noChambers > 0) {
0053     fRmaxIncr = 0.5 * (lengthFinal - lengthInitial) / (noChambers - 1);
0054     if (spacingZ < widthChamber) {
0055       G4Exception("ChamberParameterisation::ChamberParameterisation()", "InvalidSetup",
0056                   FatalException, "Width>Spacing");
0057     }
0058   }
0059 }
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0062 
0063 void ChamberParameterisation::ComputeTransformation(const G4int copyNo,
0064                                                     G4VPhysicalVolume* physVol) const
0065 {
0066   // Note: copyNo will start with zero!
0067   G4double Zposition = fStartZ + copyNo * fSpacing;
0068   G4ThreeVector origin(0, 0, Zposition);
0069   physVol->SetTranslation(origin);
0070   physVol->SetRotation(nullptr);
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0074 
0075 void ChamberParameterisation::ComputeDimensions(G4Tubs& trackerChamber, const G4int copyNo,
0076                                                 const G4VPhysicalVolume*) const
0077 {
0078   // Note: copyNo will start with zero!
0079   G4double rmax = fRmaxFirst + copyNo * fRmaxIncr;
0080   trackerChamber.SetInnerRadius(0);
0081   trackerChamber.SetOuterRadius(rmax);
0082   trackerChamber.SetZHalfLength(fHalfWidth);
0083   trackerChamber.SetStartPhiAngle(0. * deg);
0084   trackerChamber.SetDeltaPhiAngle(360. * deg);
0085 }
0086 
0087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0088 
0089 }  // namespace B2b