DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceExamplePlugin.cpp
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 //
15 // Specialized generic detector plugin
16 //
17 //==========================================================================
18 // Framework include files
19 namespace { struct UserData { /* int a,b,c; */ }; }
20 #define SURFACEINSTALLER_DATA UserData
21 #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_SurfaceExamplePlugin
23 
24 namespace {
25  template <> void Installer<UserData>::handle_arguments(int argc, char** argv) {
26  for(int i=0; i<argc; ++i) {
27  double value = -1;
28  char* ptr = ::strchr(argv[i],'=');
29  if ( ptr ) {
30  value = DD4hep::_toDouble(++ptr);
31  }
32  std::cout << "SurfaceExamplePlugin: argument[" << i << "] = " << argv[i]
33  << " value = " << value << std::endl;
34  }
35  }
36 
38  template <>
39  void Installer<UserData>::install(DetElement /* component */, PlacedVolume /* pv */) {
40  // Do here whatever is necessary ....
41  }
42 }
DD4hep::Geometry::DetElement DetElement
double _toDouble(const std::string &value)
String conversions: string to double value.
Definition: Handle.cpp:103