Skip to content

Commit

Permalink
Introduce FairExampleRunSim
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianTackeGSI committed Aug 14, 2023
1 parent f5575d3 commit f959e28
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/MQ/pixelDetector/src/devices/FairMQSimDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "FairMQSimDevice.h"

#include "FairExampleRunSim.h"
#include "FairModule.h"
#include "FairParSet.h"
#include "FairPrimaryGenerator.h"
Expand Down Expand Up @@ -44,7 +45,7 @@ FairMQSimDevice::FairMQSimDevice()

void FairMQSimDevice::InitTask()
{
fRunSim = std::make_unique<FairRunSim>();
fRunSim = std::make_unique<FairExampleRunSim>(fTransportName.c_str());

SetupRunSink(*fRunSim);

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "FairMQTransportDevice.h"

#include "FairExampleRunSim.h"
#include "FairGenericStack.h"
#include "FairMCApplication.h"
#include "FairMCSplitEventHeader.h"
Expand Down Expand Up @@ -65,7 +66,7 @@ void FairMQTransportDevice::Init()

void FairMQTransportDevice::InitTask()
{
fRunSim = std::make_unique<FairRunSim>();
fRunSim = std::make_unique<FairExampleRunSim>(fTransportName.c_str());

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

fRunSim->SetName(fTransportName.c_str());

if (fUserConfig.Length() > 0)
fRunSim->SetUserConfig(fUserConfig);
if (fUserCuts.Length() > 0)
Expand Down
1 change: 1 addition & 0 deletions examples/common/mcstack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
set(target ExMCStack)

set(sources
FairExampleRunSim.cxx
FairMCTrack.cxx
FairStack.cxx
)
Expand Down
15 changes: 15 additions & 0 deletions examples/common/mcstack/FairExampleRunSim.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/********************************************************************************
* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/

#include "FairExampleRunSim.h"

FairExampleRunSim::FairExampleRunSim(const char* mcEngine)
: FairRunSim()
{
SetName(mcEngine);
}
28 changes: 28 additions & 0 deletions examples/common/mcstack/FairExampleRunSim.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/********************************************************************************
* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#ifndef FAIREXAMPLERUNSIM_H
#define FAIREXAMPLERUNSIM_H

#include "FairRunSim.h"

/**
* \brief RunSim with specific behaviour for an experiment
*
* One can derive from the FairRun classes.
* But please only call public APIs from inside any member
* functions.
*/
class FairExampleRunSim : public FairRunSim
{
public:
explicit FairExampleRunSim(const char* mcEngine);
~FairExampleRunSim() override = default;
ClassDefOverride(FairExampleRunSim, 0);
};

#endif
8 changes: 4 additions & 4 deletions examples/common/mcstack/LinkDef.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
// $Id: ZdcLinkDef.h,v 1.1.1.1
Expand All @@ -14,8 +14,8 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class FairExampleRunSim+;
#pragma link C++ class FairStack+;
#pragma link C++ class FairMCTrack+;

#endif

0 comments on commit f959e28

Please sign in to comment.