Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:56

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 // Class G4AssemblyTriplet - inline implementation
0027 //
0028 // ----------------------------------------------------------------------
0029 
0030 inline
0031 G4AssemblyTriplet::G4AssemblyTriplet()
0032 {
0033   G4ThreeVector v(0.,0.,0.);
0034   fTranslation = v;
0035 }
0036 
0037 inline
0038 G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume,
0039                                       G4ThreeVector& translation,
0040                                       G4RotationMatrix* pRotation,
0041                                       G4bool isReflection )
0042   : fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ),
0043     fIsReflection(isReflection)
0044 {
0045 }
0046 
0047 inline
0048 G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly,
0049                                       G4ThreeVector& translation,
0050                                       G4RotationMatrix* pRotation,
0051                                       G4bool isReflection )
0052   : fTranslation( translation ), fRotation( pRotation ),
0053     fAssembly( pAssembly ), fIsReflection(isReflection) 
0054 {
0055 }
0056 
0057 inline
0058 G4AssemblyTriplet::G4AssemblyTriplet( const G4AssemblyTriplet& scopy )
0059 {
0060   fVolume       = scopy.GetVolume();
0061   fRotation     = scopy.GetRotation();
0062   fTranslation  = scopy.GetTranslation();
0063   fAssembly     = scopy.GetAssembly();
0064   fIsReflection = scopy.IsReflection();
0065 }
0066 
0067 inline
0068 G4AssemblyTriplet::~G4AssemblyTriplet() = default;
0069 
0070 inline
0071 G4LogicalVolume* G4AssemblyTriplet::GetVolume() const
0072 {
0073   return fVolume;
0074 }
0075 
0076 inline
0077 void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume )
0078 {
0079   if ( fAssembly != nullptr ) 
0080   {
0081     G4Exception("G4AssemblyTriplet::SetVolume()",
0082                 "GeomVol1001", JustWarning,
0083                 "There is an assembly already set, it will be ignored.");
0084   }
0085   fVolume = pVolume;
0086   fAssembly = nullptr;
0087 }
0088 
0089 inline
0090 G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const
0091 {
0092   return fAssembly;
0093 }
0094 
0095 inline
0096 void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly )
0097 {
0098   if ( fVolume != nullptr ) 
0099   {
0100     G4Exception("G4AssemblyTriplet::SetAssembly()",
0101                 "GeomVol1001", JustWarning,
0102                 "There is a volume already set, it will be ignored.");
0103   }
0104   fAssembly = pAssembly;
0105   fVolume = nullptr;
0106 }
0107 
0108 inline
0109 G4ThreeVector G4AssemblyTriplet::GetTranslation() const
0110 {
0111   return fTranslation;
0112 }
0113 
0114 inline
0115 void G4AssemblyTriplet::SetTranslation( G4ThreeVector& translation )
0116 {
0117   fTranslation = translation;
0118 }
0119 
0120 inline
0121 G4RotationMatrix* G4AssemblyTriplet::GetRotation() const
0122 {
0123   return fRotation;
0124 }
0125 
0126 inline
0127 void G4AssemblyTriplet::SetRotation( G4RotationMatrix* pRotation )
0128 {
0129   fRotation = pRotation;
0130 }
0131 
0132 inline
0133 G4bool G4AssemblyTriplet::IsReflection() const
0134 {
0135   return fIsReflection;
0136 }  
0137 
0138 inline
0139 G4AssemblyTriplet&
0140 G4AssemblyTriplet::operator=( const G4AssemblyTriplet& scopy )
0141 {
0142   if( this != &scopy )
0143   {
0144     fVolume       = scopy.GetVolume();
0145     fRotation     = scopy.GetRotation();
0146     fTranslation  = scopy.GetTranslation();
0147     fAssembly     = scopy.GetAssembly();
0148     fIsReflection = scopy.IsReflection();
0149   }
0150   
0151   return *this;
0152 }