DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
SiTrackerEndcap_surfaces.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 //
14 // Specialized generic detector constructor
15 //
16 //==========================================================================
17 // Framework include files
18 #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_SiTrackerEndcapSurfacePlugin
20 
22 template <typename UserData>
23 void Installer<UserData>::install(dd4hep::DetElement component, dd4hep::PlacedVolume pv) {
24  dd4hep::Volume comp_vol = pv.volume();
25  if ( comp_vol.isSensitive() ) {
26  dd4hep::Volume mod_vol = parentVolume(component);
27  dd4hep::Trapezoid comp_shape(comp_vol.solid()), mod_shape(mod_vol.solid());
28 
29  if ( !comp_shape.isValid() || !mod_shape.isValid() ) {
30  invalidInstaller("Components and/or modules are not Trapezoid -- invalid shapes");
31  }
32  else if ( !handleUsingCache(component,comp_vol) ) {
33  const double* trans = placementTranslation(component);
34  double half_mod_thickness = mod_shape->GetDy1();
35  //double half_comp_thickness = comp_shape->GetDy1();
36  double si_position = trans[1];
37  double outer_thickness = half_mod_thickness + si_position;
38  double inner_thickness = half_mod_thickness - si_position;
39  Vector3D u(0.,0.,-1.), v(-1.,0.,0.), n(0.,-1.,0.), o(0.,0.,0.);
40 
41  VolPlane surf(comp_vol,Type(Type::Sensitive,Type::Measurement1D),
42  inner_thickness, outer_thickness, u, v, n, o);
43  addSurface(component,surf);
44  }
45  }
46 }
SurfaceInstaller.h
v
View * v
Definition: MultiView.cpp:28
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:173
dd4hep::Volume::solid
Solid solid() const
Access to Solid (Shape)
Definition: Volumes.cpp:1223
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
dd4hep::Volume::isSensitive
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive detector)
Definition: Volumes.cpp:1293
dd4hep::Trd2
Class describing a Trd2 shape.
Definition: Shapes.h:1163
dd4hep::rec::VolPlane
VolSurfaceHandle< VolPlaneImpl > VolPlane
Definition: Surface.h:474
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:378
dd4hep::PlacedVolume::volume
Volume volume() const
Logical volume of this placement.
Definition: Volumes.cpp:452
dd4hep::sim::Setup::Sensitive
Geant4Handle< Geant4Sensitive > Sensitive
Definition: Geant4Config.h:73