ATLAS Offline Software
EvgenOTFTopUpSvc.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 XAOD_ANALYSIS
6 
7 #ifndef EVGENPRODTOOLS_EVGENOTFTOPUPSVC_H
8 #define EVGENPRODTOOLS_EVGENOTFTOPUPSVC_H
9 
12 #include <string>
13 
18 class EvgenOTFTopUpSvc : public extends<AthService, IEvgenOTFTopUpSvc> {
19 public:
20 
21  // Constructor and destructor
22  EvgenOTFTopUpSvc(const std::string& name, ISvcLocator* pSvcLocator);
23 
25 
26  // Standard sequence functions - don't actually need an excecute
27  // Could use init() as a chance to run OTF for the first time,
28  // but that applied to the OTF algorithm, not this service
29  virtual StatusCode finalize() override;
30 
31  // Getters
32  virtual long getNPerFile() const override { return m_nPerFile; }
33  virtual long getNUsedSoFar() const override { return m_nUsedSoFar; }
34  virtual double getEfficiency() const override { return m_efficiency; }
35  virtual bool getNewFileFlag() const override { return m_newFileFlag; }
36 
37  // Setters - first for Pythia/Herwig to call when they use up events
38  virtual void usedEvents() override { ++m_nUsedSoFar; }
39  virtual void usedEvents( const int n ) override { m_nUsedSoFar+=n; }
40 
41  // New file created by the OTF generator algorithm
42  virtual void newFile( std::string& s ) override
44 
45  // New file grabbed by the showering generator
46  virtual const std::string& getFile() override
47  { m_newFileFlag=false; return m_newFileName; }
48 
49 private:
50 
52  long m_nPerFile;
53  long m_nUsedSoFar;
54  double m_efficiency;
56  std::string m_newFileName;
57 
58  long m_nTotal;
60 };
61 
62 #endif
63 
64 #endif
EvgenOTFTopUpSvc::finalize
virtual StatusCode finalize() override
Definition: EvgenOTFTopUpSvc.cxx:22
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
EvgenOTFTopUpSvc::m_nIterations
long m_nIterations
Book-keeping: total number of OTF iterations.
Definition: EvgenOTFTopUpSvc.h:59
EvgenOTFTopUpSvc::m_nUsedSoFar
long m_nUsedSoFar
Number of events used so far by Pythia/Herwig (counter)
Definition: EvgenOTFTopUpSvc.h:53
EvgenOTFTopUpSvc::getEfficiency
virtual double getEfficiency() const override
Definition: EvgenOTFTopUpSvc.h:34
EvgenOTFTopUpSvc::getNPerFile
virtual long getNPerFile() const override
Definition: EvgenOTFTopUpSvc.h:32
EvgenOTFTopUpSvc::newFile
virtual void newFile(std::string &s) override
Definition: EvgenOTFTopUpSvc.h:42
EvgenOTFTopUpSvc::m_execDuringInit
bool m_execDuringInit
Execute OTF during initialization? (Set in JO)
Definition: EvgenOTFTopUpSvc.h:51
EvgenOTFTopUpSvc::m_nTotal
long m_nTotal
Book-keeping: total number of generated events.
Definition: EvgenOTFTopUpSvc.h:58
IEvgenOTFTopUpSvc.h
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EvgenOTFTopUpSvc::getNUsedSoFar
virtual long getNUsedSoFar() const override
Definition: EvgenOTFTopUpSvc.h:33
EvgenOTFTopUpSvc::m_newFileFlag
bool m_newFileFlag
Just produced a new file with the OTF generator
Definition: EvgenOTFTopUpSvc.h:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
EvgenOTFTopUpSvc::usedEvents
virtual void usedEvents(const int n) override
Definition: EvgenOTFTopUpSvc.h:39
EvgenOTFTopUpSvc::~EvgenOTFTopUpSvc
~EvgenOTFTopUpSvc()
Nothing to delete...
Definition: EvgenOTFTopUpSvc.h:24
EvgenOTFTopUpSvc::m_nPerFile
long m_nPerFile
Number of events per LHE file (Set in JO)
Definition: EvgenOTFTopUpSvc.h:52
EvgenOTFTopUpSvc::usedEvents
virtual void usedEvents() override
Definition: EvgenOTFTopUpSvc.h:38
EvgenOTFTopUpSvc::m_newFileName
std::string m_newFileName
Name of the new OTF generated file.
Definition: EvgenOTFTopUpSvc.h:56
EvgenOTFTopUpSvc::m_efficiency
double m_efficiency
Rough efficiency in Pythia/Herwig (Set in JO)
Definition: EvgenOTFTopUpSvc.h:54
EvgenOTFTopUpSvc::EvgenOTFTopUpSvc
EvgenOTFTopUpSvc(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EvgenOTFTopUpSvc.cxx:9
AthService.h
EvgenOTFTopUpSvc
Service to hold some information for topping up algorithms that are running on the fly.
Definition: EvgenOTFTopUpSvc.h:18
EvgenOTFTopUpSvc::getFile
virtual const std::string & getFile() override
Definition: EvgenOTFTopUpSvc.h:46
EvgenOTFTopUpSvc::getNewFileFlag
virtual bool getNewFileFlag() const override
Definition: EvgenOTFTopUpSvc.h:35