File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # How to use UniqueIDGenSvc
2
+
3
+ A Service to generate unique identifiers can be used with the following inputs:
4
+ - Event number, Run number and Algorithm name
5
+ - Seed number: set in the options python file
6
+
7
+ To set a seed for the UniqueIDGenSvc, add the following to an options file:
8
+
9
+ ``` python
10
+ from Configurables import UniqueIDGenSvc
11
+ UniqueIDGenSvc().Seed = 987654321
12
+ ```
13
+
14
+ Declare the service in the header file:
15
+
16
+ ``` cpp
17
+ #include < k4FWCore/IUniqueIDGenSvc.h>
18
+
19
+ SmartIF<IUniqueIDGenSvc> m_service;
20
+ ```
21
+
22
+ Initialize the service:
23
+
24
+ ``` cpp
25
+ StatusCode SomeGaudiAlgorithm::initialize () {
26
+ m_service = serviceLocator()->service("UniqueIDGenSvc");
27
+ ```
28
+
29
+ Then use the service during execution:
30
+
31
+ ```cpp
32
+ StatusCode MarlinProcessorWrapper::execute() {
33
+ m_service->getUniqueID(1, 2, name());
34
+ }
35
+ ```
You can’t perform that action at this time.
0 commit comments