Skip to content
Snippets Groups Projects
Commit 0e173742 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Function name consistency

parent 23fc7392
Branches
No related tags found
No related merge requests found
Pipeline #10161 passed
......@@ -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)
```
![gem tracker](../gem_tracker_part2.png)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment