EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairMCApplication.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairMCApplication.h
1 // -------------------------------------------------------------------------
2 // ----- FairMCApplication header file -----
3 // ----- Created 06/01/04 by M. Al-Turany -----
4 // -------------------------------------------------------------------------
5 
6 #ifndef FAIR_MC_APPLICATION_H
7 #define FAIR_MC_APPLICATION_H
8 
9 #include "TVirtualMCApplication.h"
10 #include "TLorentzVector.h"
11 #include "FairTask.h"
12 #include "FairRunInfo.h"
13 
14 #include <map>
15 
16 class FairRootManager;
17 class FairGenericStack;
18 class FairModule;
19 class FairLogger;
20 class FairDetector;
21 class FairField;
23 class FairTrajFilter;
24 class FairVolume;
25 class FairRadLenManager;
26 class FairRadGridManager;
27 class FairRadMapManager;
28 class FairEventHeader;
29 class FairMCEventHeader;
30 
31 class TChain;
32 class TRefArray;
33 class TObjArray;
34 class TTask;
35 
43 class FairMCApplication : public TVirtualMCApplication
44 {
45  public:
52  FairMCApplication(const char* name, const char* title, TObjArray* ModList, const char* MatName);
58  virtual ~FairMCApplication();
61  static FairMCApplication* Instance();
62  virtual void AddDecayModes();
64  virtual void AddParticles(); // MC Application
66  virtual void AddIons(); // MC Application
71  void AddTask(TTask* fTask);
73  virtual void BeginEvent(); // MC Application
75  virtual void BeginPrimary(); // MC Application
77  virtual void ConstructGeometry(); // MC Application
79  virtual void ConstructOpGeometry(); // MC Application
80 #if ROOT_VERSION_CODE < 333824
81 
82  virtual void Field(const Double_t* x, Double_t* b) const; // MC Application
83 #endif
84 
85  virtual void FinishEvent(); // MC Application
87  virtual void FinishPrimary(); // MC Application
89  void FinishRun();
91  virtual void GeneratePrimaries(); // MC Application
93  FairDetector* GetDetector(const char* DetName);
95  FairField* GetField() {return fxField;}
99  TTask* GetListOfTasks();
101  TChain* GetChain();
103  virtual void InitGeometry(); // MC Application
105  void InitMC(const char* setup, const char* cuts);
107  void InitTasks();
109  virtual void PostTrack(); // MC Application
111  virtual void PreTrack(); // MC Application
115  void RunMC(Int_t nofEvents);
120  void SetField(FairField* field);
125  void SetGenerator(FairPrimaryGenerator* fxGenerator);
129  void SetParTask();
134  void SetPythiaDecayer(Bool_t decayer) {fPythiaDecayer=decayer;}
138  void SetPythiaDecayerConfig(const TString decayerConf) {fPythiaDecayerConfig=decayerConf;}
142  void SetRadiationLengthReg(Bool_t RadLen);
146  void SetRadiationMapReg(Bool_t RadMap);
150  void SetTrackingDebugMode( Bool_t set ) {fDebug = set;}
155  void SetUserDecay(Bool_t decay) {fUserDecay= decay;}
159  void SetUserDecayConfig(const TString decayerConf) {fUserDecayConfig= decayerConf;}
161  virtual void Stepping(); // MC Application
163  virtual void StopRun();
165  virtual Double_t TrackingRmax() const; // MC Application
167  virtual Double_t TrackingZmax() const; // MC Application
168 
169  void AddMeshList ( TObjArray* meshList );
170 
171  private:
172  // methods
173  void RegisterStack();
174 
175  Int_t GetIonPdg(Int_t z, Int_t a) const;
176 
177  // data members
179  TIterator* fActDetIter;
180 
181  TRefArray* fActiveDetectors;
184 
185  TIterator* fDetIter;
186 
187  TRefArray* fDetectors;
189  TRefArray* fDetMap;
192 
193  TIterator* fModIter;
194 
195  TObjArray* fModules;
198 
202 
204 
206 
207  TRefArray* fSenVolumes;
208 
209  FairField* fxField; //
213  Int_t fMcVersion; // mc Version
216 
217  Bool_t fTrajAccepted;
218 
219  Bool_t fUserDecay;
222 
223  Bool_t fDebug;
224 
229  std::multimap <Int_t, FairVolume* > fVolMap;
230 
231  std::multimap <Int_t, FairVolume* >::iterator fVolIter;
232 
234  protected:
235  std::map <Int_t, Int_t > fModVolMap;
236 
237  std::map <Int_t, Int_t >::iterator fModVolIter;
238  private:
239  TLorentzVector fTrkPos;
240 
241  Bool_t fRadLength;
242 
245 
246  Bool_t fRadMap;
247 
249 
251 
253 
255 
256  ClassDef(FairMCApplication,2) //Interface to MonteCarlo application
257 
258  private:
260  FairMCApplication& operator=(const FairMCApplication&);
261 
263 };
264 
265 // inline functions
266 
267 inline FairMCApplication* FairMCApplication::Instance()
268 { return (FairMCApplication*)(TVirtualMCApplication::Instance());}
269 
270 #endif