ATLAS Offline Software
Loading...
Searching...
No Matches
PowhegLesHouchesFileReader.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4// -*- C++ -*-
5//
6// powhegLesHouchesReader.h is - (c) Silvia Ferrario Ravasio and Tomas Jezo
7// inspired by LesHouchesFileReader.h which is a part of ThePEG
8//
9#ifndef THEPEG_powhegLesHouchesFileReader_H
10#define THEPEG_powhegLesHouchesFileReader_H
11// This is the declaration of the powhegLesHouchesFileReader class.
12
14#include "ThePEG/LesHouches/LesHouchesReader.h"
15#include "Herwig7_i/PowhegLesHouchesFileReader.fh"
16#include "ThePEG/PDT/Decayer.h"
17#include "ThePEG/Utilities/CFileLineReader.h"
18#include <string>
19#include <map>
20
21
22
23
24namespace ThePEG {
25
26
43class powhegLesHouchesFileReader: public LesHouchesReader {
44
45public:
46
49
55
61
67
68public:
69
72
76 virtual void initialize(LesHouchesEventHandler & eh);
77
83 virtual void open();
84
88 virtual void close();
89
90
96 virtual bool doReadEvent();
98
102 string filename() const { return m_theFileName; }
103
107
109
110
111public:
112
115
119 void persistentOutput(PersistentOStream & os) const;
120
126 void persistentInput(PersistentIStream & is, int version);
128
132 static void Init ATLAS_NOT_THREAD_SAFE ();
133
134
138
139 void erase_substr(std::string& subject, const std::string& search);
140
141
142protected:
143
146
150 virtual IBPtr clone() const;
151
156 virtual IBPtr fullclone() const;
158
161
166 virtual void doinit();
167
172 virtual bool preInitialize() const;
173 //@
174
175protected:
176
180 CFileLineReader m_cfile;
181
182protected:
183
187 long m_neve;
188
192 long m_ieve;
193
200
206
211
216
222
227
233
234private:
235
240
245
250
255
259 DecayerPtr m_theDecayer;
260
265
269
271
273
274
275private:
276
280 static const ClassDescription<powhegLesHouchesFileReader> m_initpowhegLesHouchesFileReader;
281
286
287public:
288
292 class powhegLesHouchesFileError: public Exception {};
294
295};
296
297}
298
299
300#include "ThePEG/Utilities/ClassTraits.h"
301
302namespace ThePEG {
303
305
310template <>
311struct BaseClassTrait<powhegLesHouchesFileReader,1>: public ClassTraitsType {
313 typedef LesHouchesReader NthBase;
314};
315
321template <>
322struct ClassTraits<powhegLesHouchesFileReader>
323 : public ClassTraitsBase<powhegLesHouchesFileReader> {
327 static string className() { return "ThePEG::powhegLesHouchesFileReader"; }
333 static string library() { return "libpowhegHerwig.so"; }
334
335};
336
338
339}
340
341#endif /* THEPEG_powhegLesHouchesFileReader_H */
342
Define macros for attributes used to control the static checker.
powhegLesHouchesFileReader is an base class to be used for objects which reads event files from matri...
map< string, string > m_eventAttributes
If LHF.
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
static const ClassDescription< powhegLesHouchesFileReader > m_initpowhegLesHouchesFileReader
Describe an abstract base class with persistent data.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual vector< string > optWeightsNamesFunc()
Return the optional weights information string ("Names")
map< string, string > m_initAttributes
If LHF.
string filename() const
Return the name of the file from where to read events.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
bool m_theIncludeFxFxTags
Include/Read FxFx tags.
virtual IBPtr clone() const
Make a simple clone of this object.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
CFileLineReader m_cfile
The wrapper around the C FILE stream from which to read.
map< string, double > m_optionalWeightsTemp
Temporary holder for optional weights.
bool m_theQNumbers
Whether or not to search for QNUMBERS stuff.
bool m_theIncludeCentral
Include central weight (for backup use)
void erase_substr(std::string &subject, const std::string &search)
Erases all occurences of a substring from a string.
static void Init ATLAS_NOT_THREAD_SAFE()
Standard Init function used to initialize the interfaces.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
long m_neve
The number of events in this file.
string m_theFileName
The name of the file from where to read events.
virtual void close()
Close the file from which events have been read.
string m_LHFVersion
If the file is a standard Les Houches formatted file (LHF) this is its version number.
powhegLesHouchesFileReader & operator=(const powhegLesHouchesFileReader &)
Private and non-existent assignment operator.
DecayerPtr m_theDecayer
Decayer for any decay modes read from the file.
virtual void open()
Open a file with events.
map< string, string > m_scalemap
Further information on the weights.
virtual bool doReadEvent()
Read the next event from the file or stream into the corresponding protected variables.
STL class.
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition hcg.cxx:739
void initialize()