ATLAS Offline Software
Sherpa_i.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 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 
13 namespace SHERPA {
14  class Sherpa;
15 }
16 
17 
18 class Sherpa_i : public GenModule {
19 public:
20  Sherpa_i(const std::string& name, ISvcLocator* pSvcLocator);
24  StatusCode fillEvt(HepMC::GenEvent* evt);
25  #ifndef IS_SHERPA_3
26  void getParameters(int &argc, char** &argv);
27  #endif
28  void compilePlugin(std::string);
29 
30 protected:
31 
32  SHERPA::Sherpa * p_sherpa{};
33 
34  #ifdef IS_SHERPA_3
35  std::map<std::string,std::string> m_inputfiles;
37  #else
38  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 
77 class Atlas_RNG: public ATOOLS::External_RNG {
78  CLHEP::HepRandomEngine* p_engine;
79  std::string m_filename;
80 
81 public:
82  Atlas_RNG(CLHEP::HepRandomEngine*);
83  ~Atlas_RNG();
84  double Get();
85  bool CanRestoreStatus() const { return true; }
86  void SaveStatus();
87  void RestoreStatus();
88 
89 };
90 
91 
92 #endif // SHERPA_I_SHERPA_I_H
93 
94 
Atlas_RNG::Get
double Get()
Definition: Sherpa_i.cxx:399
Sherpa_i::m_runcard
StringProperty m_runcard
FIXME unused?
Definition: Sherpa_i.h:42
Sherpa_i::getParameters
void getParameters(int &argc, char **&argv)
Definition: Sherpa_i.cxx:294
GenEvent.h
Atlas_RNG::CanRestoreStatus
bool CanRestoreStatus() const
Definition: Sherpa_i.h:85
Sherpa_i::m_basefragment
std::string m_basefragment
Sherpa base settings (read from base fragment file)
Definition: Sherpa_i.h:39
Atlas_RNG::m_filename
std::string m_filename
Definition: Sherpa_i.h:79
Sherpa_i::fillEvt
StatusCode fillEvt(HepMC::GenEvent *evt)
For filling the HepMC event object.
Definition: Sherpa_i.cxx:220
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Sherpa_i::p_sherpa
SHERPA::Sherpa * p_sherpa
Definition: Sherpa_i.h:32
Sherpa_i::m_xsscale
DoubleProperty m_xsscale
Definition: Sherpa_i.h:66
Sherpa_i::m_memorymb
DoubleProperty m_memorymb
Memory required for integration/evgen.
Definition: Sherpa_i.h:58
Sherpa_i::m_plugincode
StringProperty m_plugincode
Optional code for plugin library to compile and load at run time.
Definition: Sherpa_i.h:61
Sherpa_i::m_variation_weight_cap
DoubleProperty m_variation_weight_cap
Variation weight cap factor.
Definition: Sherpa_i.h:64
Atlas_RNG
Definition: Sherpa_i.h:77
Sherpa_i::m_ncores
IntegerProperty m_ncores
Number of cores recommended for multi-core integration file.
Definition: Sherpa_i.h:55
GenModule
Base class for common behaviour of generator interfaces.
Definition: GenModule.h:39
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SHERPA
Definition: Sherpa_i.h:13
Sherpa_i::Sherpa_i
Sherpa_i(const std::string &name, ISvcLocator *pSvcLocator)
Definition: Sherpa_i.cxx:38
Sherpa_i::m_dsid
IntegerProperty m_dsid
Definition: Sherpa_i.h:70
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
Atlas_RNG::p_engine
CLHEP::HepRandomEngine * p_engine
Definition: Sherpa_i.h:78
Atlas_RNG::~Atlas_RNG
~Atlas_RNG()
Definition: Sherpa_i.cxx:397
Sherpa_i::genFinalize
StatusCode genFinalize()
For finalising the generator, if required.
Definition: Sherpa_i.cxx:269
Sherpa_i::m_cleanup
BooleanProperty m_cleanup
Definition: Sherpa_i.h:67
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Sherpa_i::compilePlugin
void compilePlugin(std::string)
Definition: Sherpa_i.cxx:353
Atlas_RNG::Atlas_RNG
Atlas_RNG(CLHEP::HepRandomEngine *)
Definition: Sherpa_i.cxx:379
Sherpa_i::genInitialize
StatusCode genInitialize()
For initializing the generator, if required.
Definition: Sherpa_i.cxx:49
GenModule.h
Sherpa_i::m_params
StringArrayProperty m_params
List of additional Sherpa parameters beyond run card snippet (from JO file)
Definition: Sherpa_i.h:45
Atlas_RNG::RestoreStatus
void RestoreStatus()
Definition: Sherpa_i.cxx:407
Sherpa_i
Definition: Sherpa_i.h:18
Sherpa_i::m_openloopslibs
StringArrayProperty m_openloopslibs
List of needed OpenLoops process libraries (from JO file)
Definition: Sherpa_i.h:49
Sherpa_i::m_extrafiles
StringArrayProperty m_extrafiles
List of any additional needed files, e.g. custom libraries, PDF sets (from JO file)
Definition: Sherpa_i.h:52
Sherpa_i::callGenerator
StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition: Sherpa_i.cxx:200
Atlas_RNG::SaveStatus
void SaveStatus()
Definition: Sherpa_i.cxx:405