ATLAS Offline Software
Loading...
Searching...
No Matches
Sherpa_i.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef SHERPA_I_SHERPA_I_H
6#define SHERPA_I_SHERPA_I_H
7
8#include "GaudiKernel/Algorithm.h"
10
11#include "AtlasHepMC/GenEvent.h"
12
13namespace SHERPA {
14 class Sherpa;
15}
16
17
18class Sherpa_i : public GenModule {
19public:
20 Sherpa_i(const std::string& name, ISvcLocator* pSvcLocator);
21 StatusCode genInitialize();
22 StatusCode callGenerator();
23 StatusCode genFinalize();
24 StatusCode fillEvt(HepMC::GenEvent* evt);
25 #ifndef IS_SHERPA_3
26 void getParameters(int &argc, char** &argv);
27 #endif
28 void compilePlugin(const std::string&);
29
30protected:
31
32 SHERPA::Sherpa * p_sherpa{};
33
34 #ifdef IS_SHERPA_3
36 std::map<std::string,std::string> m_inputfiles;
37 #else
39 std::string m_basefragment;
40
42 StringProperty m_runcard{this, "RunCard", ""};
43
45 StringArrayProperty m_params{this, "Parameters", {} };
46 #endif
47
49 StringArrayProperty m_openloopslibs{this, "OpenLoopsLibs", {} };
50
52 StringArrayProperty m_extrafiles{this, "ExtraFiles", {} };
53
55 IntegerProperty m_ncores{this, "NCores", 1};
56
58 DoubleProperty m_memorymb{this, "MemoryMB", 2500.};
59
61 StringProperty m_plugincode{this, "PluginCode", ""};
62
64 DoubleProperty m_variation_weight_cap{this, "VariationWeightCap", 10.0};
65
66 DoubleProperty m_xsscale{this, "CrossSectionScaleFactor", 1.0};
67 BooleanProperty m_cleanup{this, "CleanupGeneratedFiles", true};
68
69 //Gen_tf run args.
70 IntegerProperty m_dsid{this, "Dsid", 999999, "Dataset ID number"};
71};
72
73
74
75#include "ATOOLS/Math/Random.H"
76
77class Atlas_RNG: public ATOOLS::External_RNG {
78 CLHEP::HepRandomEngine* p_engine;
79 std::string m_filename;
80 std::once_flag m_once_flag_atlas_rng;
81
82public:
83 Atlas_RNG(CLHEP::HepRandomEngine*);
84 ~Atlas_RNG();
85 double Get();
86 bool CanRestoreStatus() const { return true; }
87 void SaveStatus();
88 void RestoreStatus();
89 const std::string GenerateUID() const;
90
91};
92
93
94#endif // SHERPA_I_SHERPA_I_H
95
96
Atlas_RNG(CLHEP::HepRandomEngine *)
Definition Sherpa_i.cxx:372
bool CanRestoreStatus() const
Definition Sherpa_i.h:86
void SaveStatus()
Definition Sherpa_i.cxx:398
CLHEP::HepRandomEngine * p_engine
Definition Sherpa_i.h:78
double Get()
Definition Sherpa_i.cxx:379
void RestoreStatus()
Definition Sherpa_i.cxx:411
std::string m_filename
Definition Sherpa_i.h:79
std::once_flag m_once_flag_atlas_rng
Definition Sherpa_i.h:80
const std::string GenerateUID() const
Definition Sherpa_i.cxx:385
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition GenModule.cxx:14
StringArrayProperty m_extrafiles
List of any additional needed files, e.g. custom libraries, PDF sets (from JO file)
Definition Sherpa_i.h:52
StatusCode genFinalize()
For finalising the generator, if required.
Definition Sherpa_i.cxx:253
std::string m_basefragment
Sherpa base settings (read from base fragment file)
Definition Sherpa_i.h:39
IntegerProperty m_ncores
Number of cores recommended for multi-core integration file.
Definition Sherpa_i.h:55
StringProperty m_runcard
FIXME unused?
Definition Sherpa_i.h:42
StatusCode genInitialize()
For initializing the generator, if required.
Definition Sherpa_i.cxx:50
SHERPA::Sherpa * p_sherpa
Definition Sherpa_i.h:32
StringProperty m_plugincode
Optional code for plugin library to compile and load at run time.
Definition Sherpa_i.h:61
StringArrayProperty m_params
List of additional Sherpa parameters beyond run card snippet (from JO file)
Definition Sherpa_i.h:45
BooleanProperty m_cleanup
Definition Sherpa_i.h:67
IntegerProperty m_dsid
Definition Sherpa_i.h:70
void compilePlugin(const std::string &)
Definition Sherpa_i.cxx:341
Sherpa_i(const std::string &name, ISvcLocator *pSvcLocator)
Definition Sherpa_i.cxx:39
StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition Sherpa_i.cxx:184
DoubleProperty m_variation_weight_cap
Variation weight cap factor.
Definition Sherpa_i.h:64
DoubleProperty m_xsscale
Definition Sherpa_i.h:66
DoubleProperty m_memorymb
Memory required for integration/evgen.
Definition Sherpa_i.h:58
StringArrayProperty m_openloopslibs
List of needed OpenLoops process libraries (from JO file)
Definition Sherpa_i.h:49
StatusCode fillEvt(HepMC::GenEvent *evt)
For filling the HepMC event object.
Definition Sherpa_i.cxx:204
void getParameters(int &argc, char **&argv)
Definition Sherpa_i.cxx:277