ATLAS Offline Software
EvgenOTFTopUpSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 
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
30 
31  // Getters
32  virtual long getNPerFile() const { return m_nPerFile; }
33  virtual long getNUsedSoFar() const { return m_nUsedSoFar; }
34  virtual double getEfficiency() const { return m_efficiency; }
35  virtual bool getNewFileFlag() const { return m_newFileFlag; }
36 
37  // Setters - first for Pythia/Herwig to call when they use up events
38  virtual void usedEvents() { ++m_nUsedSoFar; }
39  virtual void usedEvents( const int n ) { m_nUsedSoFar+=n; }
40 
41  // New file created by the OTF generator algorithm
42  virtual void newFile( std::string& s ) { ++m_nIterations; m_newFileFlag=true; m_newFileName=s; m_nUsedSoFar=0; }
43 
44  // New file grabbed by the showering generator
45  virtual const std::string& getFile() { m_newFileFlag=false; return m_newFileName; }
46 
47  static const InterfaceID& interfaceID() { return IID_IEvgenOTFTopUpSvc; }
48  StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
49 
50 private:
51 
53  long m_nPerFile;
54  long m_nUsedSoFar;
55  double m_efficiency;
57  std::string m_newFileName;
58 
59  long m_nTotal;
61 };
62 
63 #endif
64 
65 #endif
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
EvgenOTFTopUpSvc::getNewFileFlag
virtual bool getNewFileFlag() const
Definition: EvgenOTFTopUpSvc.h:35
EvgenOTFTopUpSvc::m_nIterations
long m_nIterations
Book-keeping: total number of OTF iterations.
Definition: EvgenOTFTopUpSvc.h:60
EvgenOTFTopUpSvc::m_nUsedSoFar
long m_nUsedSoFar
Number of events used so far by Pythia/Herwig (counter)
Definition: EvgenOTFTopUpSvc.h:54
EvgenOTFTopUpSvc::getEfficiency
virtual double getEfficiency() const
Definition: EvgenOTFTopUpSvc.h:34
EvgenOTFTopUpSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: EvgenOTFTopUpSvc.h:47
EvgenOTFTopUpSvc::m_execDuringInit
bool m_execDuringInit
Execute OTF during initialization? (Set in JO)
Definition: EvgenOTFTopUpSvc.h:52
EvgenOTFTopUpSvc::m_nTotal
long m_nTotal
Book-keeping: total number of generated events.
Definition: EvgenOTFTopUpSvc.h:59
EvgenOTFTopUpSvc::getNUsedSoFar
virtual long getNUsedSoFar() const
Definition: EvgenOTFTopUpSvc.h:33
EvgenOTFTopUpSvc::getFile
virtual const std::string & getFile()
Definition: EvgenOTFTopUpSvc.h:45
IEvgenOTFTopUpSvc
Definition: IEvgenOTFTopUpSvc.h:18
EvgenOTFTopUpSvc::finalize
StatusCode finalize()
Definition: EvgenOTFTopUpSvc.cxx:22
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
AthService
Definition: AthService.h:32
EvgenOTFTopUpSvc::usedEvents
virtual void usedEvents(const int n)
Definition: EvgenOTFTopUpSvc.h:39
EvgenOTFTopUpSvc::m_newFileFlag
bool m_newFileFlag
Just produced a new file with the OTF generator
Definition: EvgenOTFTopUpSvc.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EvgenOTFTopUpSvc::~EvgenOTFTopUpSvc
~EvgenOTFTopUpSvc()
Nothing to delete...
Definition: EvgenOTFTopUpSvc.h:24
EvgenOTFTopUpSvc::getNPerFile
virtual long getNPerFile() const
Definition: EvgenOTFTopUpSvc.h:32
EvgenOTFTopUpSvc::m_nPerFile
long m_nPerFile
Number of events per LHE file (Set in JO)
Definition: EvgenOTFTopUpSvc.h:53
EvgenOTFTopUpSvc::newFile
virtual void newFile(std::string &s)
Definition: EvgenOTFTopUpSvc.h:42
EvgenOTFTopUpSvc::m_newFileName
std::string m_newFileName
Name of the new OTF generated file.
Definition: EvgenOTFTopUpSvc.h:57
EvgenOTFTopUpSvc::m_efficiency
double m_efficiency
Rough efficiency in Pythia/Herwig (Set in JO)
Definition: EvgenOTFTopUpSvc.h:55
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::queryInterface
StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Query the interfaces - this is copied and pasted :(.
Definition: EvgenOTFTopUpSvc.cxx:28
EvgenOTFTopUpSvc::usedEvents
virtual void usedEvents()
Definition: EvgenOTFTopUpSvc.h:38