From 9155a99bdf15068c94ed15e361944256e0a8e1f2 Mon Sep 17 00:00:00 2001 From: Placido Fernandez Declara <9625282+fdplacido@users.noreply.github.com> Date: Fri, 3 Jun 2022 15:24:38 +0200 Subject: [PATCH] add documentation on how to use uniqueidgensvc (#84) --- doc/uniqueIDGen.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/uniqueIDGen.md diff --git a/doc/uniqueIDGen.md b/doc/uniqueIDGen.md new file mode 100644 index 00000000..7b478d33 --- /dev/null +++ b/doc/uniqueIDGen.md @@ -0,0 +1,35 @@ +# How to use UniqueIDGenSvc + +A Service to generate unique identifiers can be used with the following inputs: +- Event number, Run number and Algorithm name +- Seed number: set in the options python file + +To set a seed for the UniqueIDGenSvc, add the following to an options file: + +```python +from Configurables import UniqueIDGenSvc +UniqueIDGenSvc().Seed = 987654321 +``` + +Declare the service in the header file: + +```cpp +#include + +SmartIF m_service; +``` + +Initialize the service: + +```cpp +StatusCode SomeGaudiAlgorithm::initialize() { + m_service = serviceLocator()->service("UniqueIDGenSvc"); +``` + +Then use the service during execution: + +```cpp +StatusCode MarlinProcessorWrapper::execute() { + m_service->getUniqueID(1, 2, name()); +} +```