From 0e173742797e1cebd39bcfef5bb30618907f9ef8 Mon Sep 17 00:00:00 2001 From: Sylvester Joosten <sjoosten@anl.gov> Date: Fri, 21 May 2021 10:13:17 -0500 Subject: [PATCH] Function name consistency --- src/docs/part2/adding_detectors.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/docs/part2/adding_detectors.md b/src/docs/part2/adding_detectors.md index 59bf03b..8bbdd1a 100644 --- a/src/docs/part2/adding_detectors.md +++ b/src/docs/part2/adding_detectors.md @@ -48,11 +48,11 @@ dd4hep_add_plugin(${a_lib_name} SOURCES ### Building the geometry (cpp + xml) The work of constructing the detector is done in a static function (here called -`create_detector`) that is registered using the DD4hep plugin macro +`build_detector`) that is registered using the DD4hep plugin macro `DECLARE_DETELEMENT`. ```cpp -static Ref_t create_detector(Detector& dtor, xml_h e, SensitiveDetector sens) +static Ref_t build_detector(Detector& dtor, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; Material air = dtor.air(); @@ -61,7 +61,7 @@ static Ref_t create_detector(Detector& dtor, xml_h e, SensitiveDetector sens) DECLARE_DETELEMENT(MyGEMTrackerEndcap, build_detector) ``` -The argument signature of the `create_detector` is: +The argument signature of the `build_detector` is: - `Detector& dtor`: This handle provides the main hook to the detector tree (`dd4hep::Detector`). - `xml_h e`: Handle to the XML `<detector>` tag associated with the detector in the "compact" detector description file (more on this later). This provides @@ -71,7 +71,7 @@ The argument signature of the `create_detector` is: The DD4hep plugin macro `DECLARE_DETELEMENT(MyGEMTrackerEndcap, build_detector)` stamps out the necessary boiler plate code to register a new detector called -`MyGEMTrackerEndcap` which is build by calling `create_detector`. +`MyGEMTrackerEndcap` which is build by calling `build_detector`. #### Compact detector description entry element @@ -138,7 +138,7 @@ We will now look at the function in `src/GEMTrackerDisc_geo.cpp`. Note that **this is not a good example to copy**, rather it is a simple example to walk through. ```cpp -static Ref_t create_detector(Detector& lcdd, xml_h e, SensitiveDetector sens) +static Ref_t build_detector(Detector& lcdd, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; @@ -191,7 +191,7 @@ static Ref_t create_detector(Detector& lcdd, xml_h e, SensitiveDetector sens) assembly->GetShape()->ComputeBBox() ; return sdet; } -DECLARE_DETELEMENT(my_GEMTracker, create_detector) +DECLARE_DETELEMENT(my_GEMTracker, build_detector) ``` Here is the XML again: ```xml @@ -302,7 +302,7 @@ Here you see a different strategy: build a module, then build layers constructed The corresponding detector constructor function is in `src/TrapEndcapTracker_geo.cpp` ```cpp -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { +static Ref_t build_detector(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; xml_det_t x_det = e; Material vacuum = description.vacuum(); @@ -428,8 +428,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } // clang-format off -DECLARE_DETELEMENT(TrapEndcapTracker, create_detector) -DECLARE_DETELEMENT(MyGEMTrackerEndcap, create_detector) +DECLARE_DETELEMENT(TrapEndcapTracker, build_detector) +DECLARE_DETELEMENT(MyGEMTrackerEndcap, build_detector) ```  -- GitLab