Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Specialized generic detector constructor
0015 // 
0016 //==========================================================================
0017 // Framework include files
0018 #define  DD4HEP_USE_SURFACEINSTALL_HELPER  Lhe_SiTrackerEndcapSurfacePlugin
0019 #include "DD4hep/SurfaceInstaller.h"
0020 
0021 /// Install measurement surfaces
0022 template <typename UserData> 
0023 void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv)   {
0024   dd4hep::Volume comp_vol = pv.volume();
0025   if ( comp_vol.isSensitive() )  {  
0026     dd4hep::Volume mod_vol = parentVolume(component);
0027     dd4hep::Trapezoid comp_shape(comp_vol.solid()), mod_shape(mod_vol.solid());
0028 
0029     if ( !comp_shape.isValid() || !mod_shape.isValid() )   {
0030       invalidInstaller("Components and/or modules are not Trapezoid -- invalid shapes");
0031     }
0032     else if ( !handleUsingCache(component,comp_vol) )  {
0033       const double* trans = placementTranslation(component);
0034       double half_mod_thickness  = mod_shape->GetDy1();
0035       //double half_comp_thickness = comp_shape->GetDy1();
0036       double si_position         = trans[1];
0037       double outer_thickness = half_mod_thickness + si_position;
0038       double inner_thickness = half_mod_thickness - si_position;
0039       Vector3D u(0.,0.,-1.), v(-1.,0.,0.), n(0.,-1.,0.), o(0.,0.,0.);
0040 
0041       VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D),
0042                     inner_thickness, outer_thickness, u, v, n, o);
0043       addSurface(component,surf);
0044     }
0045   }
0046 }