Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:50

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