FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMQSimDevice.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
16 #ifndef FAIRMQSIMDEVICE_H_
17 #define FAIRMQSIMDEVICE_H_
18 
19 #include "FairMQRunDevice.h"
20 
21 #include <Rtypes.h>
22 #include <TString.h>
23 #include <cstdint>
24 #include <string>
25 
26 class FairRunSim;
27 class FairField;
28 class FairParIo;
30 class TObjArray;
31 class FairSink;
32 
34 {
35  public:
37  virtual ~FairMQSimDevice() {}
38 
39  virtual void SetParamUpdateChannelName(const TString& tString) { fUpdateChannelName = tString; }
40 
41  // ------ FairRunSim setters ------
42  void SetNofEvents(int64_t nofev) { fNofEvents = nofev; }
43  void SetTransportName(const std::string& str) { fTransportName = str; }
44  void SetMaterials(const std::string& str) { fMaterialsFile = str; }
45  void SetMagneticField(FairField* field) { fMagneticField = field; }
46  void SetDetectorArray(TObjArray* array) { fDetectorArray = array; }
47  void SetGenerator(FairPrimaryGenerator* primGen) { fPrimaryGenerator = primGen; }
48  void SetStoreTraj(bool flag = true) { fStoreTrajFlag = flag; }
49  void SetTaskArray(TObjArray* array) { fTaskArray = array; }
50  void SetFirstParameter(FairParIo* par) { fFirstParameter = par; }
51  void SetSecondParameter(FairParIo* par) { fSecondParameter = par; }
52  void SetUserConfig(const TString& Config) { fUserConfig = Config; }
53  void SetUserCuts(const TString& Cuts) { fUserCuts = Cuts; }
54  void SetSink(FairSink* sink) { fSink = sink; }
55  // ------ ---------- -------- ------
56 
57  void InitializeRun();
58 
59  virtual void SendBranches();
60 
61  protected:
62  virtual void InitTask();
63  virtual void PreRun();
64  virtual void PostRun() {}
65  virtual bool ConditionalRun();
66 
67  private:
68  UInt_t fSimDeviceId;
69  std::string fUpdateChannelName;
70 
71  bool fRunInitialized; // false, set to true after initialization in the run stage (!)
72 
73  FairRunSim* fRunSim;
74  // ------ FairRunSim settings ------
75  int64_t fNofEvents;
76  std::string fTransportName;
77  std::string fMaterialsFile;
78  FairField* fMagneticField;
79  TObjArray* fDetectorArray;
80  FairPrimaryGenerator* fPrimaryGenerator;
81  bool fStoreTrajFlag;
82  TObjArray* fTaskArray;
83  FairParIo* fFirstParameter; // first (prefered) input for parameters
84  FairParIo* fSecondParameter; // second input (used if not found in first input)
85  TString fUserConfig;
86  TString fUserCuts;
87  FairSink* fSink;
88  // ------ ---------- -------- ------
89 
90  void UpdateParameterServer();
91 
93  FairMQSimDevice& operator=(const FairMQSimDevice&);
94 };
95 
96 #endif /* FAIRMQSIMDEVICE_H_ */
void SetFirstParameter(FairParIo *par)
virtual ~FairMQSimDevice()
void SetNofEvents(int64_t nofev)
virtual void PreRun()
virtual void InitTask()
void SetUserCuts(const TString &Cuts)
virtual bool ConditionalRun()
void SetTransportName(const std::string &str)
void SetMaterials(const std::string &str)
void SetUserConfig(const TString &Config)
virtual void SetParamUpdateChannelName(const TString &tString)
void SetMagneticField(FairField *field)
virtual void PostRun()
void SetSink(FairSink *sink)
virtual void SendBranches()
void SetTaskArray(TObjArray *array)
FairMQExParamsParOne * par
void SetDetectorArray(TObjArray *array)
void SetGenerator(FairPrimaryGenerator *primGen)
void SetStoreTraj(bool flag=true)
void SetSecondParameter(FairParIo *par)
void Config()
Configuration macro for Geant3 VirtualMC.
Definition: flConfig.C:10