Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:23:58

0001 // -*- C++ -*-
0002 //
0003 // HerwigUI.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef SRC_HERWIG_UI_H
0010 #define SRC_HERWIG_UI_H
0011 
0012 #include <vector>
0013 #include <string>
0014 #include <iosfwd>
0015 
0016 namespace Herwig {
0017 
0018 /**
0019  * Definition of the possible run modes of Herwig
0020  */
0021 namespace RunMode {
0022   enum Mode { ERROR, INIT, READ, BUILD, INTEGRATE, MERGEGRIDS, RUN };
0023 }
0024 
0025 /**
0026  * HerwigUI is an interface to abstract the command line parameters.
0027  *
0028  * This allows any inheriting class to configure Herwig wihtout actually 
0029  * having to interact via main()
0030  */
0031  class HerwigUI {
0032 
0033  public:
0034 
0035    /// Requested Herwig run mode
0036    virtual RunMode::Mode runMode() const = 0;
0037 
0038    /// Repository name to operate on
0039    virtual std::string repository() const = 0;
0040 
0041    /// Name of the file to be read
0042    virtual std::string inputfile() const = 0;
0043 
0044    /// Name of the setup file to be read, to modify the repository
0045    virtual std::string setupfile() const = 0;
0046 
0047    /// Try to resume execution from an earlier interrupted run.
0048    virtual bool resume() const = 0;
0049 
0050    /// Require verbose progress markers
0051    virtual bool tics() const = 0;
0052 
0053    /// A user-defined tag to append to the run name.
0054    virtual std::string tag() const = 0;
0055 
0056    /// An identifier for the integration job to be handled
0057    virtual std::string integrationList() const = 0;
0058 
0059    /// Directories from which Herwig reads input files,  will be prepended to the search path.
0060    virtual const std::vector<std::string> & prependReadDirectories() const = 0;
0061 
0062    /// Directories from which Herwig reads input files,  will be appended to the search path.
0063    virtual const std::vector<std::string> & appendReadDirectories() const = 0;
0064 
0065    /// The number of events to generate
0066    virtual long N() const = 0;
0067 
0068    /// The seed to use
0069    virtual int seed() const = 0;
0070 
0071    /// The number of jobs to fork
0072    virtual int jobs() const = 0;
0073 
0074    /// The number of subprocesses to integrate per integratoin job
0075    virtual unsigned int jobSize() const = 0;
0076 
0077    /// The maximum number of integration jobs
0078    virtual unsigned int maxJobs() const = 0;
0079 
0080    /// Bail out and print usage information
0081    virtual void quitWithHelp() const = 0;
0082 
0083    /// Bail out and be quiet
0084    virtual void quit() const = 0;
0085 
0086    /// Destructor
0087    virtual ~HerwigUI() {}
0088 
0089    /// Return true, if this is an integration job
0090    bool integrationJob() const {
0091      return runMode() == RunMode::INTEGRATE;
0092    }
0093 
0094    /// Return the standard out stream to be used
0095    virtual std::ostream& outStream() const = 0;
0096 
0097    /// Return the standard err stream to be used
0098    virtual std::ostream& errStream() const = 0;
0099 
0100    /// Return the standard in stream to be used
0101    virtual std::istream& inStream() const = 0;
0102 
0103  };
0104 
0105 }
0106 
0107 #endif