FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMQTransportDevice.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 FAIRMQTRANSPORTDEVICE_H_
17 #define FAIRMQTRANSPORTDEVICE_H_
18 
19 #include "FairMQRunDevice.h"
20 
21 #include <Rtypes.h>
22 #include <TString.h>
23 #include <cstdint>
24 #include <string>
25 
27 class FairRunSim;
28 class FairField;
29 class FairParIo;
30 class TObjArray;
31 class FairSink;
32 class FairMCApplication;
33 class FairGenericStack;
34 class TVirtualMC;
35 
37 {
38  public:
40  virtual ~FairMQTransportDevice();
41 
42  // ------ FairRunSim setters ------
43  void SetNofEvents(int64_t nofev) { fNofEvents = nofev; };
44  void SetTransportName(const std::string& str) { fTransportName = str; };
45  void SetMaterials(const std::string& str) { fMaterialsFile = str; };
46  void SetMagneticField(FairField* field) { fMagneticField = field; };
47  void SetDetectorArray(TObjArray* array) { fDetectorArray = array; };
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  void SetParamUpdateChannelName(TString tString) { fUpdateChannelName = tString; }
60 
61  void RunInPullMode(bool tb = true) { fRunConditional = !tb; };
62  void RunInReqMode(bool tb = true) { fRunConditional = tb; };
63 
64  protected:
65  bool TransportData(FairMQParts&, int);
66  // bool TransportData(FairMQMessagePtr&, int);
67  virtual void Init();
68  virtual void InitTask();
69  virtual void PreRun();
70  virtual void PostRun();
71  virtual bool ConditionalRun();
72 
73  private:
74  UInt_t fRunId;
75  UInt_t fTransportDeviceId;
76  std::string fGeneratorChannelName;
77  std::string fUpdateChannelName;
78 
79  bool fRunConditional; // if true run ConditionalRun, if false run TransportData
80  bool fRunInitialized; // false, set to true after initialization in the run stage (!)
81 
82  TVirtualMC* fVMC;
83  FairGenericStack* fStack;
84  FairMCApplication* fMCApplication;
85  FairRunSim* fRunSim;
86  // ------ FairRunSim settings ------
87  int64_t fNofEvents;
88  std::string fTransportName;
89  std::string fMaterialsFile;
90  FairField* fMagneticField;
91  TObjArray* fDetectorArray;
92  bool fStoreTrajFlag;
93  TObjArray* fTaskArray;
94  FairParIo* fFirstParameter; // first (prefered) input for parameters
95  FairParIo* fSecondParameter; // second input (used if not found in first input)
96  TString fUserConfig;
97  TString fUserCuts;
98  FairSink* fSink;
99  // ------ ---------- -------- ------
100 
101  FairMCSplitEventHeader* fMCSplitEventHeader;
102 
103  void UpdateParameterServer();
104 
106  FairMQTransportDevice& operator=(const FairMQTransportDevice&);
107 };
108 
109 #endif /* FAIRMQTRANSPORTDEVICE_H_ */
void SetDetectorArray(TObjArray *array)
void SetUserCuts(const TString &Cuts)
void SetMagneticField(FairField *field)
void RunInPullMode(bool tb=true)
void SetSecondParameter(FairParIo *par)
void SetSink(FairSink *sink)
void SetMaterials(const std::string &str)
void SetFirstParameter(FairParIo *par)
void RunInReqMode(bool tb=true)
void SetUserConfig(const TString &Config)
FairMQExParamsParOne * par
void SetTransportName(const std::string &str)
void SetTaskArray(TObjArray *array)
void SetStoreTraj(bool flag=true)
void SetNofEvents(int64_t nofev)
void SetParamUpdateChannelName(TString tString)
bool TransportData(FairMQParts &, int)
void Config()
Configuration macro for Geant3 VirtualMC.
Definition: flConfig.C:10