Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4AssemblyTriplet.icc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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