Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:02

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 // $Id: PHG4GDMLWriteDefine.hh 68053 2013-03-13 14:39:51Z gcosmo $
0028 //
0029 //
0030 // class PHG4GDMLWriteDefine
0031 //
0032 // Class description:
0033 //
0034 // GDML writer class for positionings and transformations.
0035 
0036 // History:
0037 // - Created.                                  Zoltan Torzsok, November 2007
0038 // -------------------------------------------------------------------------
0039 
0040 #ifndef _PHG4GDMLWRITEDEFINE_INCLUDED_
0041 #define _PHG4GDMLWRITEDEFINE_INCLUDED_
0042 
0043 #include <Geant4/G4Types.hh>
0044 #include <Geant4/G4ThreeVector.hh>
0045 #include <Geant4/G4RotationMatrix.hh>
0046 
0047 #include "PHG4GDMLWrite.hh"
0048 
0049 class PHG4GDMLWriteDefine : public PHG4GDMLWrite
0050 {
0051 
0052   public:
0053 
0054     G4ThreeVector GetAngles(const G4RotationMatrix&);
0055     void ScaleWrite(xercesc::DOMElement* element,
0056                     const G4String& name, const G4ThreeVector& scl)
0057          { Scale_vectorWrite(element,"scale",name,scl); }
0058     void RotationWrite(xercesc::DOMElement* element,
0059                     const G4String& name, const G4ThreeVector& rot)
0060          { Rotation_vectorWrite(element,"rotation",name,rot); }
0061     void PositionWrite(xercesc::DOMElement* element,
0062                     const G4String& name, const G4ThreeVector& pos)
0063          { Position_vectorWrite(element,"position",name,pos); }
0064     void FirstrotationWrite(xercesc::DOMElement* element,
0065                     const G4String& name, const G4ThreeVector& rot)
0066          { Rotation_vectorWrite(element,"firstrotation",name,rot); }
0067     void FirstpositionWrite(xercesc::DOMElement* element,
0068                     const G4String& name, const G4ThreeVector& pos)
0069          { Position_vectorWrite(element,"firstposition",name,pos); }
0070     void AddPosition(const G4String& name, const G4ThreeVector& pos)
0071          { Position_vectorWrite(defineElement,"position",name,pos); }
0072 
0073     virtual void DefineWrite(xercesc::DOMElement*);
0074 
0075   protected:
0076 
0077     PHG4GDMLWriteDefine();
0078     virtual ~PHG4GDMLWriteDefine();
0079 
0080     void Scale_vectorWrite(xercesc::DOMElement*, const G4String&,
0081                               const G4String&, const G4ThreeVector&);
0082     void Rotation_vectorWrite(xercesc::DOMElement*, const G4String&,
0083                               const G4String&, const G4ThreeVector&);
0084     void Position_vectorWrite(xercesc::DOMElement*, const G4String&,
0085                               const G4String&, const G4ThreeVector&);
0086 
0087   protected:
0088 
0089     static const G4double kRelativePrecision;
0090     static const G4double kAngularPrecision;
0091     static const G4double kLinearPrecision;
0092   
0093     xercesc::DOMElement* defineElement;
0094 
0095 };
0096 
0097 #endif