Skip to content

Commit ad96bcf

Browse files
Introduce FairExampleRunSim
1 parent a0a4de1 commit ad96bcf

File tree

8 files changed

+57
-10
lines changed

8 files changed

+57
-10
lines changed

examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "FairMQSimDevice.h"
1616

17+
#include "FairExampleRunSim.h"
1718
#include "FairModule.h"
1819
#include "FairParSet.h"
1920
#include "FairPrimaryGenerator.h"
@@ -44,7 +45,7 @@ FairMQSimDevice::FairMQSimDevice()
4445

4546
void FairMQSimDevice::InitTask()
4647
{
47-
fRunSim = std::make_unique<FairRunSim>();
48+
fRunSim = std::make_unique<FairExampleRunSim>(fTransportName.c_str());
4849

4950
SetupRunSink(*fRunSim);
5051

@@ -56,7 +57,6 @@ void FairMQSimDevice::InitTask()
5657
rtdb->setSecondInput(fSecondParameter);
5758
}
5859

59-
fRunSim->SetName(fTransportName.c_str());
6060
// fRunSim->SetSimulationConfig(new FairVMCConfig());
6161
fRunSim->SetIsMT(kFALSE);
6262

examples/MQ/pixelSimSplit/src/devices/FairMQTransportDevice.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "FairMQTransportDevice.h"
1616

17+
#include "FairExampleRunSim.h"
1718
#include "FairGenericStack.h"
1819
#include "FairMCApplication.h"
1920
#include "FairMCSplitEventHeader.h"
@@ -65,7 +66,7 @@ void FairMQTransportDevice::Init()
6566

6667
void FairMQTransportDevice::InitTask()
6768
{
68-
fRunSim = std::make_unique<FairRunSim>();
69+
fRunSim = std::make_unique<FairExampleRunSim>(fTransportName.c_str());
6970

7071
fMCSplitEventHeader = new FairMCSplitEventHeader(fRunId, 0, 0, 0);
7172
fRunSim->SetMCEventHeader(fMCSplitEventHeader);
@@ -81,8 +82,6 @@ void FairMQTransportDevice::InitTask()
8182
rtdb->setSecondInput(fSecondParameter);
8283
}
8384

84-
fRunSim->SetName(fTransportName.c_str());
85-
8685
if (fUserConfig.Length() > 0)
8786
fRunSim->SetUserConfig(fUserConfig);
8887
if (fUserCuts.Length() > 0)

examples/common/mcstack/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
set(target ExMCStack)
1010

1111
set(sources
12+
FairExampleRunSim.cxx
1213
FairMCTrack.cxx
1314
FairStack.cxx
1415
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/********************************************************************************
2+
* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
8+
9+
#include "FairExampleRunSim.h"
10+
11+
FairExampleRunSim::FairExampleRunSim(const char* mcEngine)
12+
: FairRunSim()
13+
{
14+
SetName(mcEngine);
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/********************************************************************************
2+
* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3+
* *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
6+
* copied verbatim in the file "LICENSE" *
7+
********************************************************************************/
8+
#ifndef FAIREXAMPLERUNSIM_H
9+
#define FAIREXAMPLERUNSIM_H
10+
11+
#include "FairRunSim.h"
12+
13+
/**
14+
* \brief RunSim with specific behaviour for an experiment
15+
*
16+
* One can derive from the FairRun classes.
17+
* But please only call public APIs from inside any member
18+
* functions.
19+
*/
20+
class FairExampleRunSim : public FairRunSim
21+
{
22+
public:
23+
explicit FairExampleRunSim(const char* mcEngine);
24+
~FairExampleRunSim() override = default;
25+
ClassDefOverride(FairExampleRunSim, 0);
26+
};
27+
28+
#endif

examples/common/mcstack/LinkDef.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
4-
* This software is distributed under the terms of the *
5-
* GNU Lesser General Public Licence (LGPL) version 3, *
4+
* This software is distributed under the terms of the *
5+
* GNU Lesser General Public Licence (LGPL) version 3, *
66
* copied verbatim in the file "LICENSE" *
77
********************************************************************************/
88
// $Id: ZdcLinkDef.h,v 1.1.1.1
@@ -14,8 +14,8 @@
1414
#pragma link off all classes;
1515
#pragma link off all functions;
1616

17+
#pragma link C++ class FairExampleRunSim+;
1718
#pragma link C++ class FairStack+;
1819
#pragma link C++ class FairMCTrack+;
1920

2021
#endif
21-

examples/simulation/Tutorial1/src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ install(TARGETS ${target} LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR})
6363
install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
6464

6565
add_executable(tut1 runTutorial1.cxx)
66-
target_link_libraries(tut1 PRIVATE ExSimulation1)
66+
target_link_libraries(tut1
67+
PRIVATE
68+
ExSimulation1
69+
FairRoot::ExMCStack)
6770

6871
install(TARGETS tut1
6972
RUNTIME DESTINATION ${PROJECT_INSTALL_DATADIR}/examples/simulation/Tutorial1/bin

examples/simulation/Tutorial2/macros/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ endforeach()
2525
add_library(${prefix}_check_compile OBJECT ${macrofiles})
2626
target_link_libraries(${prefix}_check_compile PRIVATE
2727
FairRoot::ExSimulation2
28+
FairRoot::ExMCStack
2829
FairRoot::ExPassive
2930
FairRoot::Generators)
3031

0 commit comments

Comments
 (0)