ATLAS Offline Software
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 
24 namespace ThePEG {
25 
26 
43 class powhegLesHouchesFileReader: public LesHouchesReader {
44 
45 public:
46 
53  m_theIncludeFxFxTags(false),
54  m_theIncludeCentral(false) {}
55 
61 
67 
68 public:
69 
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 
109 
110 
111 public:
112 
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 
139  void erase_substr(std::string& subject, const std::string& search);
140 
141 
142 protected:
143 
150  virtual IBPtr clone() const;
151 
156  virtual IBPtr fullclone() const;
158 
166  virtual void doinit();
167 
172  virtual bool preInitialize() const;
173  //@
174 
175 protected:
176 
180  CFileLineReader m_cfile;
181 
182 protected:
183 
187  long m_neve;
188 
192  long m_ieve;
193 
199  string m_LHFVersion;
200 
206 
211 
216 
221  map<string,string> m_initAttributes;
222 
227 
232  map<string,string> m_eventAttributes;
233 
234 private:
235 
240 
245 
250 
255 
259  DecayerPtr m_theDecayer;
260 
264  map<string,string> m_scalemap;
265 
270  map<string,double> m_optionalWeightsTemp;
271 
272  map<string,string> m_optionalWeightsLabel;
273 
274 
275 private:
276 
280  static const ClassDescription<powhegLesHouchesFileReader> m_initpowhegLesHouchesFileReader;
281 
286 
287 public:
288 
292  class powhegLesHouchesFileError: public Exception {};
295 };
296 
297 }
298 
299 
300 #include "ThePEG/Utilities/ClassTraits.h"
301 
302 namespace ThePEG {
303 
310 template <>
311 struct BaseClassTrait<powhegLesHouchesFileReader,1>: public ClassTraitsType {
313  typedef LesHouchesReader NthBase;
314 };
315 
321 template <>
322 struct ClassTraits<powhegLesHouchesFileReader>
323  : public ClassTraitsBase<powhegLesHouchesFileReader> {
327  static string className() { return "ThePEG::powhegLesHouchesFileReader"; }
333  static string library() { return "libpowhegHerwig.so"; }
334 
335 };
336 
339 }
340 
341 #endif /* THEPEG_powhegLesHouchesFileReader_H */
342 
ThePEG::powhegLesHouchesFileReader::m_ieve
long m_ieve
The current event number.
Definition: PowhegLesHouchesFileReader.h:192
ThePEG::powhegLesHouchesFileReader::m_initAttributes
map< string, string > m_initAttributes
If LHF.
Definition: PowhegLesHouchesFileReader.h:221
ThePEG::powhegLesHouchesFileReader::m_initpowhegLesHouchesFileReader
static const ClassDescription< powhegLesHouchesFileReader > m_initpowhegLesHouchesFileReader
Describe an abstract base class with persistent data.
Definition: PowhegLesHouchesFileReader.h:280
ThePEG::powhegLesHouchesFileReader::m_LHFVersion
string m_LHFVersion
If the file is a standard Les Houches formatted file (LHF) this is its version number.
Definition: PowhegLesHouchesFileReader.h:199
ThePEG::powhegLesHouchesFileReader::m_theIncludeFxFxTags
bool m_theIncludeFxFxTags
Include/Read FxFx tags.
Definition: PowhegLesHouchesFileReader.h:249
ThePEG::powhegLesHouchesFileReader::~powhegLesHouchesFileReader
virtual ~powhegLesHouchesFileReader()
Destructor.
Definition: PowhegLesHouchesFileReader.cxx:54
ThePEG::powhegLesHouchesFileReader::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
Definition: PowhegLesHouchesFileReader.cxx:68
ThePEG::powhegLesHouchesFileReader::m_eventComments
string m_eventComments
If LHF.
Definition: PowhegLesHouchesFileReader.h:226
ThePEG::powhegLesHouchesFileReader::m_eventAttributes
map< string, string > m_eventAttributes
If LHF.
Definition: PowhegLesHouchesFileReader.h:232
ThePEG::powhegLesHouchesFileReader::ATLAS_NOT_THREAD_SAFE
static void Init ATLAS_NOT_THREAD_SAFE()
Standard Init function used to initialize the interfaces.
search
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:738
ThePEG::powhegLesHouchesFileReader::m_cfile
CFileLineReader m_cfile
The wrapper around the C FILE stream from which to read.
Definition: PowhegLesHouchesFileReader.h:180
ThePEG::powhegLesHouchesFileReader::powhegLesHouchesFileReader
powhegLesHouchesFileReader()
Default constructor.
Definition: PowhegLesHouchesFileReader.h:52
ThePEG::powhegLesHouchesFileReader::open
virtual void open()
Open a file with events.
Definition: PowhegLesHouchesFileReader.cxx:480
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:31
ThePEG::powhegLesHouchesFileReader::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Definition: PowhegLesHouchesFileReader.cxx:819
ThePEG::powhegLesHouchesFileReader::m_theIncludeCentral
bool m_theIncludeCentral
Include central weight (for backup use)
Definition: PowhegLesHouchesFileReader.h:254
ThePEG::powhegLesHouchesFileReader::filename
string filename() const
Return the name of the file from where to read events.
Definition: PowhegLesHouchesFileReader.h:102
ThePEG::powhegLesHouchesFileReader::m_optionalWeightsLabel
map< string, string > m_optionalWeightsLabel
Definition: PowhegLesHouchesFileReader.h:272
ThePEG
Definition: PowhegLesHouchesFileReader.h:24
ThePEG::powhegLesHouchesFileReader::m_theFileName
string m_theFileName
The name of the file from where to read events.
Definition: PowhegLesHouchesFileReader.h:239
ThePEG::powhegLesHouchesFileReader::close
virtual void close()
Close the file from which events have been read.
Definition: PowhegLesHouchesFileReader.cxx:815
vector< string >
ThePEG::powhegLesHouchesFileReader
powhegLesHouchesFileReader is an base class to be used for objects which reads event files from matri...
Definition: PowhegLesHouchesFileReader.h:43
ThePEG::powhegLesHouchesFileReader::preInitialize
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
Definition: PowhegLesHouchesFileReader.cxx:64
ThePEG::powhegLesHouchesFileReader::erase_substr
void erase_substr(std::string &subject, const std::string &search)
Erases all occurences of a substring from a string.
Definition: PowhegLesHouchesFileReader.cxx:912
ThePEG::powhegLesHouchesFileReader::operator=
powhegLesHouchesFileReader & operator=(const powhegLesHouchesFileReader &)
Private and non-existent assignment operator.
ThePEG::powhegLesHouchesFileReader::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Definition: PowhegLesHouchesFileReader.cxx:56
ThePEG::powhegLesHouchesFileReader::optWeightsNamesFunc
virtual vector< string > optWeightsNamesFunc()
Return the optional weights information string ("Names")
Definition: PowhegLesHouchesFileReader.cxx:478
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ThePEG::powhegLesHouchesFileReader::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Definition: PowhegLesHouchesFileReader.cxx:60
ThePEG::powhegLesHouchesFileReader::m_initComments
string m_initComments
If LHF.
Definition: PowhegLesHouchesFileReader.h:215
ThePEG::powhegLesHouchesFileReader::doReadEvent
virtual bool doReadEvent()
Read the next event from the file or stream into the corresponding protected variables.
Definition: PowhegLesHouchesFileReader.cxx:624
ThePEG::powhegLesHouchesFileReader::m_neve
long m_neve
The number of events in this file.
Definition: PowhegLesHouchesFileReader.h:187
ThePEG::powhegLesHouchesFileReader::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Definition: PowhegLesHouchesFileReader.cxx:825
get_generator_info.version
version
Definition: get_generator_info.py:33
ThePEG::powhegLesHouchesFileReader::m_outsideBlock
string m_outsideBlock
If LHF.
Definition: PowhegLesHouchesFileReader.h:205
ThePEG::powhegLesHouchesFileReader::m_optionalWeightsTemp
map< string, double > m_optionalWeightsTemp
Temporary holder for optional weights.
Definition: PowhegLesHouchesFileReader.h:270
ThePEG::powhegLesHouchesFileReader::m_theDecayer
DecayerPtr m_theDecayer
Decayer for any decay modes read from the file.
Definition: PowhegLesHouchesFileReader.h:259
ThePEG::powhegLesHouchesFileReader::initialize
virtual void initialize(LesHouchesEventHandler &eh)
Initialize.
Definition: PowhegLesHouchesFileReader.cxx:469
ThePEG::powhegLesHouchesFileReader::m_scalemap
map< string, string > m_scalemap
Further information on the weights.
Definition: PowhegLesHouchesFileReader.h:264
checker_macros.h
Define macros for attributes used to control the static checker.
ThePEG::powhegLesHouchesFileReader::m_headerBlock
string m_headerBlock
If LHF.
Definition: PowhegLesHouchesFileReader.h:210
ThePEG::powhegLesHouchesFileReader::m_theQNumbers
bool m_theQNumbers
Whether or not to search for QNUMBERS stuff.
Definition: PowhegLesHouchesFileReader.h:244
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition: Init.cxx:31