ATLAS Offline Software
BB4LPowhegLesHouchesFileReader.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // myLesHouchesReader.h is - (c) Silvia Ferrario Ravasio and Tomas Jezo
4 // inspired by LesHouchesFileReader.h which is a part of ThePEG
5 //
6 #ifndef THEPEG_BB4LPowhegLesHouchesFileReader_H
7 #define THEPEG_BB4LPowhegLesHouchesFileReader_H
8 // This is the declaration of the BB4LPowhegLesHouchesFileReader class.
9 
10 #include "ThePEG/LesHouches/LesHouchesReader.h"
11 #include "ThePEG/PDT/Decayer.h"
12 #include "ThePEG/Utilities/CFileLineReader.h"
13 #include <string>
14 #include <stdio.h>
15 #include "herwig7_interface.h"
17 
19 
20 namespace ThePEG {
21 
22 
39 class ATLAS_NOT_THREAD_SAFE BB4LPowhegLesHouchesFileReader: public LesHouchesReader {
40 
41 public:
42 
48  BB4LPowhegLesHouchesFileReader() : m_neve(0), m_ieve(0), m_theQNumbers(false),
49  m_theIncludeFxFxTags(false),
50  m_theIncludeCentral(true) {}
51 
57 
63 
64 public:
65 
72  virtual void initialize(LesHouchesEventHandler & eh);
73 
79  virtual void open ();
80 
84  virtual void close();
85 
86 
92  virtual bool doReadEvent ();
94 
98  string filename() const { return m_theFileName; }
99 
105 
106  double eventWeight() {return powheg_weight;}
107 
108 public:
109 
116  void persistentOutput(PersistentOStream & os) const;
117 
123  void persistentInput(PersistentIStream & is, int version);
125 
129  static void Init ();
130 
131 
136  void erase_substr(std::string& subject, const std::string& search);
137 
138 
139 protected:
140 
147  virtual IBPtr clone() const;
148 
153  virtual IBPtr fullclone() const;
155 
163  virtual void doinit ();
164 
169  virtual bool preInitialize() const;
170  //@
171 
172 protected:
173 
177  CFileLineReader m_cfile;
178 
179 protected:
180 
184  long m_neve;
185 
189  long m_ieve;
190 
196  string m_LHFVersion;
197 
203 
208 
213 
218  map<string,string> m_initAttributes;
219 
224 
229  map<string,string> m_eventAttributes;
230 
231 private:
232 
237 
242 
247 
252 
256  DecayerPtr m_theDecayer;
257 
261  map<string,string> m_scalemap;
262 
267  map<string,double> m_optionalWeightsTemp;
268  map<string,string> m_optionalWeightsLabel;
269 
270 
271 private:
272 
276  static ClassDescription<BB4LPowhegLesHouchesFileReader> m_initBB4LPowhegLesHouchesFileReader;
277 
282 
283 public:
284 
288  class powhegLesHouchesFileError: public Exception {};
291 };
292 
293 }
294 
295 
296 #include "ThePEG/Utilities/ClassTraits.h"
297 
298 namespace ThePEG {
299 
306 template <>
307 struct BaseClassTrait<BB4LPowhegLesHouchesFileReader,1>: public ClassTraitsType {
309  typedef LesHouchesReader NthBase;
310 };
311 
317 template <>
318 struct ClassTraits<BB4LPowhegLesHouchesFileReader>
319  : public ClassTraitsBase<BB4LPowhegLesHouchesFileReader> {
323  static string className() { return "ThePEG::BB4LPowhegLesHouchesFileReader"; }
329  static string library() { return "libpowhegHerwigBB4L.so"; }
330 
331 };
332 
335 }
336 
337 #endif /* THEPEG_BB4LPowhegLesHouchesFileReader_H */
ThePEG::BB4LPowhegLesHouchesFileReader::clone
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::BB4LPowhegLesHouchesFileReader::m_cfile
CFileLineReader m_cfile
The wrapper around the C FILE stream from which to read.
Definition: BB4LPowhegLesHouchesFileReader.h:177
ThePEG::BB4LPowhegLesHouchesFileReader::doReadEvent
virtual bool doReadEvent()
Read the next event from the file or stream into the corresponding protected variables.
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
ThePEG::BB4LPowhegLesHouchesFileReader::m_theIncludeFxFxTags
bool m_theIncludeFxFxTags
Include/Read FxFx tags.
Definition: BB4LPowhegLesHouchesFileReader.h:246
ThePEG::BB4LPowhegLesHouchesFileReader::BB4LPowhegLesHouchesFileReader
BB4LPowhegLesHouchesFileReader(const BB4LPowhegLesHouchesFileReader &)
Copy-constructor.
ThePEG::BB4LPowhegLesHouchesFileReader::m_LHFVersion
string m_LHFVersion
If the file is a standard Les Houches formatted file (LHF) this is its version number.
Definition: BB4LPowhegLesHouchesFileReader.h:196
ThePEG::BB4LPowhegLesHouchesFileReader::m_headerBlock
string m_headerBlock
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:207
ThePEG::BB4LPowhegLesHouchesFileReader::erase_substr
void erase_substr(std::string &subject, const std::string &search)
Erases all occurences of a substring from a string.
ThePEG::BB4LPowhegLesHouchesFileReader::operator=
BB4LPowhegLesHouchesFileReader & operator=(const BB4LPowhegLesHouchesFileReader &)=delete
Private and non-existent assignment operator.
ThePEG::BB4LPowhegLesHouchesFileReader::optWeightsNamesFunc
virtual vector< string > optWeightsNamesFunc()
Return the optional weights information string ("Names")
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::BB4LPowhegLesHouchesFileReader::m_initAttributes
map< string, string > m_initAttributes
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:218
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:36
ThePEG::BB4LPowhegLesHouchesFileReader::m_theFileName
string m_theFileName
The name of the file from where to read events.
Definition: BB4LPowhegLesHouchesFileReader.h:236
ThePEG::BB4LPowhegLesHouchesFileReader::m_initBB4LPowhegLesHouchesFileReader
static ClassDescription< BB4LPowhegLesHouchesFileReader > m_initBB4LPowhegLesHouchesFileReader
Describe an abstract base class with persistent data.
Definition: BB4LPowhegLesHouchesFileReader.h:276
ThePEG::BB4LPowhegLesHouchesFileReader::open
virtual void open()
Open a file with events.
ThePEG::BB4LPowhegLesHouchesFileReader::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG
Definition: BB4LPowhegLesHouchesFileReader.h:20
ThePEG::BB4LPowhegLesHouchesFileReader::m_ieve
long m_ieve
The current event number.
Definition: BB4LPowhegLesHouchesFileReader.h:189
vector< string >
ThePEG::BB4LPowhegLesHouchesFileReader::Init
static void Init()
Standard Init function used to initialize the interfaces.
ThePEG::BB4LPowhegLesHouchesFileReader::~BB4LPowhegLesHouchesFileReader
virtual ~BB4LPowhegLesHouchesFileReader()
Destructor.
ThePEG::BB4LPowhegLesHouchesFileReader::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::BB4LPowhegLesHouchesFileReader::m_scalemap
map< string, string > m_scalemap
Further information on the weights.
Definition: BB4LPowhegLesHouchesFileReader.h:261
ThePEG::BB4LPowhegLesHouchesFileReader::eventWeight
double eventWeight()
Definition: BB4LPowhegLesHouchesFileReader.h:106
ThePEG::BB4LPowhegLesHouchesFileReader::m_eventComments
string m_eventComments
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:223
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ThePEG::BB4LPowhegLesHouchesFileReader::m_optionalWeightsLabel
map< string, string > m_optionalWeightsLabel
Definition: BB4LPowhegLesHouchesFileReader.h:268
ThePEG::BB4LPowhegLesHouchesFileReader::m_initComments
string m_initComments
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:212
ThePEG::BB4LPowhegLesHouchesFileReader
BB4LPowhegLesHouchesFileReader is an base class to be used for objects which reads event files from m...
Definition: BB4LPowhegLesHouchesFileReader.h:39
ThePEG::BB4LPowhegLesHouchesFileReader::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
ThePEG::BB4LPowhegLesHouchesFileReader::filename
string filename() const
Return the name of the file from where to read events.
Definition: BB4LPowhegLesHouchesFileReader.h:98
ThePEG::BB4LPowhegLesHouchesFileReader::BB4LPowhegLesHouchesFileReader
BB4LPowhegLesHouchesFileReader()
Default constructor.
Definition: BB4LPowhegLesHouchesFileReader.h:48
ThePEG::BB4LPowhegLesHouchesFileReader::m_neve
long m_neve
The number of events in this file.
Definition: BB4LPowhegLesHouchesFileReader.h:184
ThePEG::BB4LPowhegLesHouchesFileReader::close
virtual void close()
Close the file from which events have been read.
get_generator_info.version
version
Definition: get_generator_info.py:33
ThePEG::BB4LPowhegLesHouchesFileReader::preInitialize
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
ThePEG::BB4LPowhegLesHouchesFileReader::m_theIncludeCentral
bool m_theIncludeCentral
Include central weight (for backup use)
Definition: BB4LPowhegLesHouchesFileReader.h:251
ThePEG::BB4LPowhegLesHouchesFileReader::initialize
virtual void initialize(LesHouchesEventHandler &eh)
Initialize.
ThePEG::BB4LPowhegLesHouchesFileReader::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
ThePEG::BB4LPowhegLesHouchesFileReader::m_theDecayer
DecayerPtr m_theDecayer
Decayer for any decay modes read from the file.
Definition: BB4LPowhegLesHouchesFileReader.h:256
powheg_weight
double powheg_weight
Definition: BB4LPowhegLesHouchesFileReader.h:18
ThePEG::BB4LPowhegLesHouchesFileReader::m_optionalWeightsTemp
map< string, double > m_optionalWeightsTemp
Temporary holder for optional weights.
Definition: BB4LPowhegLesHouchesFileReader.h:267
ThePEG::BB4LPowhegLesHouchesFileReader::m_eventAttributes
map< string, string > m_eventAttributes
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:229
ThePEG::BB4LPowhegLesHouchesFileReader::m_theQNumbers
bool m_theQNumbers
Whether or not to search for QNUMBERS stuff.
Definition: BB4LPowhegLesHouchesFileReader.h:241
checker_macros.h
Define macros for attributes used to control the static checker.
ThePEG::BB4LPowhegLesHouchesFileReader::m_outsideBlock
string m_outsideBlock
If LHF.
Definition: BB4LPowhegLesHouchesFileReader.h:202
herwig7_interface.h