Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:55

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include <DDG4/Factories.h>
0016 // Geant4 include files
0017 #include <G4ExtendedMaterial.hh>
0018 #include <G4LogicalCrystalVolume.hh>
0019 
0020 // Forward declarations
0021 namespace  {  class ChannelingCrystalVolume;  }
0022 
0023 /// Namespace example name of the user
0024 namespace dd4hep   {
0025 
0026   /// Class member specialization to create a G4LogicalCrystalVolume
0027   /** Class member specialization to create a G4LogicalCrystalVolume
0028    *  
0029    *  \author  M.Frank
0030    *  \version 1.0
0031    *  \ingroup DD4HEP_SIMULATION
0032    */
0033   template <> G4LogicalVolume* 
0034   Geant4LogicalVolumeFactory<ChannelingCrystalVolume>::create(dd4hep::Detector& /* description */,
0035                                   Volume      volume,
0036                                   G4VSolid*   solid,
0037                                   G4Material* material)
0038   {
0039     G4ExtendedMaterial* mat = dynamic_cast<G4ExtendedMaterial*>(material);
0040     if ( !mat )   {
0041       except("ChannelingCrystalVolume", 
0042          "====> Material %s is no G4ExtendedMaterial!", material->GetName().c_str());
0043     }
0044     auto* ptr = new G4LogicalCrystalVolume(solid, mat, volume.name());
0045     printout(ALWAYS,"ChannelingCrystalVolume",
0046          "====> Created specialize logical volume [G4LogicalCrystalVolume]: %s",
0047          volume.name());
0048     return ptr;
0049   }
0050 }      // End namespace dd4hep
0051 
0052 DECLARE_GEANT4LOGICALVOLUME(ChannelingCrystalVolume)