ThePEG  1.8.0
LesHouchesFileReader.h
1 // -*- C++ -*-
2 //
3 // LesHouchesFileReader.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef THEPEG_LesHouchesFileReader_H
10 #define THEPEG_LesHouchesFileReader_H
11 // This is the declaration of the LesHouchesFileReader class.
12 
13 #include "ThePEG/LesHouches/LesHouchesReader.h"
14 #include "LesHouchesFileReader.fh"
15 #include "ThePEG/PDT/Decayer.h"
16 #include "ThePEG/Utilities/CFileLineReader.h"
17 #include <stdio.h>
18 
19 namespace ThePEG {
20 
38 
39 public:
40 
46  LesHouchesFileReader() : neve(0), ieve(0), theQNumbers(false) {}
47 
53 
57  virtual ~LesHouchesFileReader();
59 
60 public:
61 
68  virtual void initialize(LesHouchesEventHandler & eh);
69 
75  virtual void open();
76 
80  virtual void close();
81 
87  virtual bool doReadEvent();
89 
93  string filename() const { return theFileName; }
94 
95 public:
96 
103  void persistentOutput(PersistentOStream & os) const;
104 
110  void persistentInput(PersistentIStream & is, int version);
112 
116  static void Init();
117 
118 protected:
119 
126  virtual IBPtr clone() const;
127 
132  virtual IBPtr fullclone() const;
134 
142  virtual void doinit();
143 
148  virtual bool preInitialize() const;
149  //@
150 
151 protected:
152 
157 
158 protected:
159 
163  long neve;
164 
168  long ieve;
169 
175  string LHFVersion;
176 
181  string outsideBlock;
182 
186  string headerBlock;
187 
191  string initComments;
192 
197  map<string,string> initAttributes;
198 
203 
208  map<string,string> eventAttributes;
209 
210 private:
211 
215  string theFileName;
216 
221 
226 
227 private:
228 
233 
238 
239 public:
240 
244  class LesHouchesFileError: public Exception {};
247 };
248 
249 }
250 
251 
252 #include "ThePEG/Utilities/ClassTraits.h"
253 
254 namespace ThePEG {
255 
262 template <>
263 struct BaseClassTrait<LesHouchesFileReader,1>: public ClassTraitsType {
265  typedef LesHouchesReader NthBase;
266 };
267 
273 template <>
274 struct ClassTraits<LesHouchesFileReader>
275  : public ClassTraitsBase<LesHouchesFileReader> {
279  static string className() { return "ThePEG::LesHouchesFileReader"; }
285  static string library() { return "LesHouches.so"; }
286 
287 };
288 
291 }
292 
293 #endif /* THEPEG_LesHouchesFileReader_H */