00001 // -*- C++ -*- 00002 // 00003 // MadGraphReader.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef THEPEG_MadGraphReader_H 00010 #define THEPEG_MadGraphReader_H 00011 // This is the declaration of the MadGraphReader class. 00012 00013 #include "ThePEG/LesHouches/LesHouchesFileReader.h" 00014 00015 namespace ThePEG { 00016 00024 class MadGraphReader: public LesHouchesFileReader { 00025 00026 public: 00027 00033 MadGraphReader() 00034 : fixedScale(91.188*GeV), fixedAEM(0.007546772), fixedAS(0.12), 00035 doInitCuts(false) {} 00037 00038 public: 00039 00046 virtual void open(); 00047 00056 virtual long scan(); 00057 00063 virtual bool doReadEvent(); 00065 00066 public: 00067 00074 void persistentOutput(PersistentOStream & os) const; 00075 00081 void persistentInput(PersistentIStream & is, int version); 00083 00087 static void Init(); 00088 00089 protected: 00090 00097 virtual IBPtr clone() const; 00098 00103 virtual IBPtr fullclone() const; 00105 00106 protected: 00107 00110 00116 virtual void doinit(); 00117 00122 CutsPtr initCuts(); 00123 00129 virtual void initPDFs(); 00130 00135 virtual bool preInitialize() const; 00136 00141 virtual void dofinish() { 00142 LesHouchesFileReader::dofinish(); 00143 if ( stats.accepted() > 0 ) useMe(); 00144 } 00146 00147 protected: 00148 00154 string scanCuts(string); 00155 00159 long numberOfEvents(string); 00160 00161 protected: 00162 00168 Energy fixedScale; 00169 00175 double fixedAEM; 00176 00182 double fixedAS; 00183 00188 map<string,double> cuts; 00189 00193 bool doInitCuts; 00194 00195 public: 00196 00201 struct WeightedExcetion: public Exception {}; 00202 00203 private: 00204 00208 static ClassDescription<MadGraphReader> initMadGraphReader; 00209 00213 MadGraphReader & operator=(const MadGraphReader &); 00214 00215 }; 00216 00217 } 00218 00219 00220 #include "ThePEG/Utilities/ClassTraits.h" 00221 00222 namespace ThePEG { 00223 00230 template <> 00231 struct BaseClassTrait<MadGraphReader,1>: public ClassTraitsType { 00233 typedef LesHouchesFileReader NthBase; 00234 }; 00235 00241 template <> 00242 struct ClassTraits<MadGraphReader> 00243 : public ClassTraitsBase<MadGraphReader> { 00245 static string className() { return "ThePEG::MadGraphReader"; } 00249 static string library() { return "MadGraphReader.so"; } 00250 00251 }; 00252 00255 } 00256 00257 #endif /* THEPEG_MadGraphReader_H */