Project
Loading...
Searching...
No Matches
O2RunSim.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12// This file is an adaption of FairRoot::FairRunAna commit a6c5cfbe143d3391e (dev branch)
13// created 28.9.2017 by S. Wenzel
14
15#ifndef O2_O2RUNSIM_H
16#define O2_O2RUNSIM_H
17
18#include "FairRunSim.h" // for FairRunSim
19#include "Rtypes.h" // for Bool_t, Double_t, UInt_t, etc
20#include <TGeoManager.h>
21#include <iostream>
22
23#include "FairField.h" // for FairField
24#include "FairFileHeader.h" // for FairFileHeader
25#include <fairlogger/Logger.h> // for FairLogger, MESSAGE_ORIGIN
26#include "FairMCEventHeader.h" // for FairMCEventHeader
27#include "FairModule.h" // for FairModule
28#include "FairPrimaryGenerator.h" // for FairPrimaryGenerator
29#include "FairRootManager.h" // for FairRootManager
30#include "FairRunIdGenerator.h" // for FairRunIdGenerator
31#include "FairTask.h" // for FairTask
33
35
36namespace o2
37{
38namespace steer
39{
40
41class O2RunSim : public FairRunSim
42{
43 public:
44 O2RunSim(bool devicemode, bool evalmat) : FairRunSim(), mDeviceMode(devicemode), mEvalMat(evalmat) {}
45 ~O2RunSim() override = default;
46
47 void Init() final
48 {
49 LOG(info) << "O2RUNSIM SPECIFIC INIT CALLED";
50
52
53 // the geometry manager that FairGeoLoader used to create here (its ASCII media part is not used by ALICE)
54 new TGeoManager("FAIRGeom", "FAIR geometry");
55
56 if (mDeviceMode) {
57 fApp = new O2MCApplication("Fair", "The Fair VMC App", ListOfModules, MatFname);
58 } else {
59 if (!mEvalMat) {
60 fApp = new O2MCApplicationBase("Fair", "The Fair VMC App", ListOfModules, MatFname);
61 } else {
62 fApp = new O2MCApplicationEvalMat("Fair", "The Fair VMC App", ListOfModules, MatFname);
63 }
64 }
65
67
69 fRunId = genid.generateId();
70
72
73 // Set global Parameter Info
74 if (fPythiaDecayer) {
78 }
79 }
80 if (fUserDecay) {
82 if (fUserDecayConfig) {
84 }
85 }
86
87 if (fField) {
88 fField->Init();
89 }
91
92 fSimSetup();
93 fApp->InitMC("foo", "bar");
95 }
96
97 void Run(int n = 0, int b = 0) final
98 {
100 }
101
102 private:
103 bool mDeviceMode{false};
104 bool mEvalMat{false};
105
106 ClassDefOverride(O2RunSim, 0);
107};
108} // namespace steer
109} // namespace o2
110
111#endif //O2_O2RUNANA_H
virtual void Init()
Definition FairField.h:54
void SetRunId(UInt_t runid)
void InitMC(const char *setup, const char *cuts)
void SetPythiaDecayer(Bool_t decayer)
void SetField(FairField *field)
void SetGenerator(FairPrimaryGenerator *fxGenerator)
void SetUserDecayConfig(const TString decayerConf)
void SetPythiaDecayerConfig(const TString decayerConf)
void SetUserDecay(Bool_t decay)
void WriteFileHeader(FairFileHeader *f)
unsigned int generateId(void)
TString MatFname
/‍** Array of used modules *‍/
Definition FairRunSim.h:206
virtual void Run(Int_t NEvents=0, Int_t NotUsed=0)
std::function< void()> fSimSetup
/‍** Allow importing TGeometry to VMC *‍/
Definition FairRunSim.h:221
TString fPythiaDecayerConfig
/‍** flag for using Pythia decayer*‍/
Definition FairRunSim.h:210
FairField * fField
/‍** Singleton Instance *‍/
Definition FairRunSim.h:201
FairPrimaryGenerator * fGen
/‍** flag for use Beam Energy *‍/
Definition FairRunSim.h:198
TString fUserDecayConfig
Definition FairRunSim.h:212
Bool_t fUserDecay
/‍** Macro for Pythia decay configuration*‍/
Definition FairRunSim.h:211
TObjArray * ListOfModules
/‍** Array of user defined particles*‍/
Definition FairRunSim.h:205
Bool_t fPythiaDecayer
/‍** Geometry Model (TGeo or G3)*‍/
Definition FairRunSim.h:209
FairMCApplication * fApp
/‍** Internal counter*‍/
Definition FairRunSim.h:195
FairRootManager * fRootManager
Definition FairRun.h:191
UInt_t fRunId
Definition FairRun.h:199
FairFileHeader * fFileHeader
Definition FairRun.h:205
~O2RunSim() override=default
O2RunSim(bool devicemode, bool evalmat)
Definition O2RunSim.h:44
void Run(int n=0, int b=0) final
Definition O2RunSim.h:97
void Init() final
Definition O2RunSim.h:47
GLdouble n
Definition glcorearb.h:1982
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"