You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/developing/Creating-a-new-Event-Bus-Object.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ If the objects already in an Event module do not suit your purposes, you can def
7
7
* In the header file, include `ClassDef( ClassName , 1 );` at the bottom of your class declaration (right before the closing bracket `};`).
8
8
* At the top of the implementation file, include `ClassImp( ClassName );` right after the include statement.
9
9
* Your class shouldn't use `TRef` (or any derived class)
10
-
* Your object needs to be "registered" with the software so that ROOT can put it in our event model dictionary. This is done by adding a line to the `CMakeLists.txt` file in the module you are putting the new object. For example, the `Recon` module has an object shared by Hcal and Ecal in it. This object is not put inside a collection, so no other parameters are needed.
10
+
* Your object needs to be "registered" with the software so that ROOT can put it in our event model dictionary. This is done by adding lines to `LinkDef.h`in the module you are putting the new object. For example, the `Recon` module has an object shared by Hcal and Ecal in it. This object is not put inside a collection, so no other lines are needed.
#pragma link C++ class ldmx::HgcrocDigiCollection+;
15
15
```
16
16
17
17
* If you class is going to be inside an STL container, then you need
@@ -21,6 +21,14 @@ Method | Description
21
21
`Print()` | Summarize object in a one line description of the form: `MyObject { param1 = val, param2 = val,...}` output to input ostream.
22
22
`operator<` | This is used to sort the collection before inputting into event bus.
23
23
24
+
and you should add the STL container class to the `LinkDef.h` file as well, for example
25
+
```cpp
26
+
// for a std::vector
27
+
#pragma link C++ class std::vector<ClassName>+;
28
+
// and/or for a std::map with int keys
29
+
#pragma link C++ class std::map<int, ClassName>+;
30
+
```
31
+
24
32
* If your class is going to be outside an STL container (i.e. put into the event bus by itself), then you need
25
33
26
34
Method | Description
@@ -44,3 +52,7 @@ cd Framework
44
52
git clean -xxfd
45
53
```
46
54
This last step is only necessary for developments built off of ldmx-sw prior to v3.3.4.
55
+
56
+
### CMake Registration
57
+
If you are developing off of ldmx-sw prior to v4.5.3, then instead of editing the `LinkDef.h` file directly, you would register within the `CMakeLists.txt` file and then some CMake code writes a LinkDef file for you.
58
+
This extra indirection did not save much effort and got in the way of developing manual schema evolution, so it was dropped.
0 commit comments