Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-10 10:18:06

0001 #pragma once
0002 
0003 #include <TObject.h>
0004 
0005 class G4Material;
0006 class G4VPhysicalVolume;
0007 class G4LogicalVolume;
0008 class G4Colour;
0009 class G4VSolid;
0010 class G4OpticalSurface;
0011 // Want to help ROOT dictionary builder, but at the same time have "typedef CLHEP:: ..." working in the source code;
0012 // FIXME: a better way to handle this?;
0013 #ifdef _GEANT_SOURCE_CODE_
0014 #include <G4RotationMatrix.hh>
0015 #include <G4ThreeVector.hh>
0016 #else
0017 class G4RotationMatrix;
0018 class G4ThreeVector;
0019 #endif
0020 
0021 namespace IRT2 {
0022 
0023 class G4ObjectCopy: public TObject {
0024  public:
0025  G4ObjectCopy(G4VPhysicalVolume *phys = 0): m_PhysicalVolume(phys) {};
0026   ~G4ObjectCopy() {};
0027 
0028   G4VPhysicalVolume *m_PhysicalVolume; //!
0029 
0030 #ifndef DISABLE_ROOT_IO
0031   ClassDef(G4ObjectCopy, 1);
0032 #endif
0033 };
0034 
0035 class G4Object: public TObject {
0036 public:
0037  G4Object(G4VSolid *solid = 0, G4Material *material = 0): m_Solid(solid), m_Material(material), 
0038     m_LogicalVolume(0)/*, m_CopyCounter(0)*/ {};
0039   ~G4Object() {};
0040 
0041   void DefineIntersectionCut(G4VSolid *cut, G4RotationMatrix *rotation, const G4ThreeVector &translation, bool flip);
0042   void DefineSubtractionCut (G4VSolid *cut, G4RotationMatrix *rotation, const G4ThreeVector &translation, bool flip);
0043   void DefineUnion(G4VSolid *solid);
0044   G4VSolid *GetSolid( void ) { return m_Solid; };
0045 
0046   void SetColor(const G4Colour &color);
0047 
0048   void PlaceWedgeCopies(G4VPhysicalVolume *mother);
0049   virtual void AdjustWedgeCopies(G4VPhysicalVolume * /*mother*/) {};
0050 
0051   G4LogicalVolume *GetLogicalVolume( void ) const { return m_LogicalVolume; };
0052   
0053   virtual G4ObjectCopy *CreateCopy(G4VPhysicalVolume *phys) { return new G4ObjectCopy(phys); };
0054   void AddCopy(G4ObjectCopy *copy) { m_Copies.push_back(copy); };
0055   G4ObjectCopy *GetCopy(unsigned id) const {
0056     return (id < m_Copies.size() ? m_Copies[id] : 0);
0057   }; 
0058 
0059   virtual G4OpticalSurface *GetMirrorSurface( void ) const { return 0; };
0060 
0061   G4Material *GetMaterial( void ) const { return m_Material; };
0062 
0063  protected:
0064   G4VSolid *m_Solid;                   //!
0065   std::vector<G4ObjectCopy*> m_Copies; //!
0066 
0067  private:
0068   G4Material *m_Material;              //!
0069 
0070   G4LogicalVolume *m_LogicalVolume;    //!
0071   //unsigned m_CopyCounter;              //!
0072 
0073  public:
0074   // This call is deferred to the moment after all cuts on this solid are applied;
0075   void DefineLogicalVolume( void );
0076 
0077 #ifndef DISABLE_ROOT_IO
0078   ClassDef(G4Object, 2)
0079 #endif
0080 };
0081 
0082 } // namespace IRT2