Herwig++
2.7.0
|
00001 // -*- C++ -*- 00002 #ifndef HERWIG_PGSInterface_H 00003 #define HERWIG_PGSInterface_H 00004 // 00005 // This is the declaration of the PGSInterface class. 00006 // 00007 00008 #include "ThePEG/Handlers/AnalysisHandler.h" 00009 #include "ThePEG/Vectors/Lorentz5Vector.h" 00010 #include "HepMC/GenEvent.h" 00011 #include "HepMC/IO_HEPEVT.h" 00012 00013 namespace Herwig { 00014 using namespace ThePEG; 00015 00019 enum ObjectType { 00020 Photon=0, 00021 Electron, 00022 Muon, 00023 Tau, 00024 Jet, 00025 HeavyCharged 00026 }; 00027 00031 enum bTag { 00032 None=0, 00033 Loose, 00034 Tight, 00035 Both , 00036 }; 00037 00041 struct ReconstructedObject { 00042 00046 ObjectType type; 00047 00051 Lorentz5Momentum momentum; 00052 00056 double charge; 00057 00061 Energy emenergy; 00062 00066 Energy hadenergy; 00067 00071 Energy trackenergy; 00072 00076 int numtracks; 00077 00081 int PDGcode; 00082 00086 bTag btagging; 00087 00091 Energy ET; 00092 00096 Energy isolationET; 00097 00101 Energy isolationpT; 00102 00106 double hadronicem; 00107 00111 double ep; 00112 00116 Energy trkisoEnergy; 00117 00121 int npi0; 00122 00126 Energy taupTpi0; 00127 00131 Energy taupTtracks; 00132 00136 Energy ptHightestTrack; 00137 00141 Energy clusterWidth; 00142 }; 00143 00150 class PGSInterface: public AnalysisHandler { 00151 00152 public: 00153 00157 inline PGSInterface() : _pgs_param_file("lhc.par") 00158 {} 00159 00179 virtual void analyze(tEventPtr event, long ieve, int loop, int state); 00181 00185 inline vector<ReconstructedObject> reconstructedObjects() const { 00186 return _objects; 00187 } 00188 00192 inline pair<Energy,double> missingETCalorimeter() const { 00193 return _calorimeterMET; 00194 } 00198 inline pair<Energy,double> missingETCorrected() const { 00199 return _muonMET; 00200 } 00201 00202 public: 00203 00210 void persistentOutput(PersistentOStream & os) const; 00211 00217 void persistentInput(PersistentIStream & is, int version); 00219 00226 static void Init(); 00227 00228 protected: 00229 00236 inline virtual IBPtr clone() const {return new_ptr(*this);} 00237 00242 inline virtual IBPtr fullclone() const {return new_ptr(*this);} 00244 00245 00246 protected: 00247 00254 virtual void doinitrun(); 00255 00260 virtual void dofinish(); 00262 00263 private: 00264 00269 static ClassDescription<PGSInterface> initPGSInterface; 00270 00275 PGSInterface & operator=(const PGSInterface &); 00276 00277 private: 00278 00282 HepMC::IO_HEPEVT * _converter; 00283 00287 string _pgs_param_file; 00288 00292 vector<ReconstructedObject> _objects; 00293 00297 pair <Energy,double> _calorimeterMET; 00298 00302 pair <Energy,double> _muonMET; 00303 }; 00304 00305 } 00306 00307 #include "ThePEG/Utilities/ClassTraits.h" 00308 00309 namespace ThePEG { 00310 00315 template <> 00316 struct BaseClassTrait<Herwig::PGSInterface,1> { 00318 typedef AnalysisHandler NthBase; 00319 }; 00320 00323 template <> 00324 struct ClassTraits<Herwig::PGSInterface> 00325 : public ClassTraitsBase<Herwig::PGSInterface> { 00327 static string className() { return "Herwig::PGSInterface"; } 00335 static string library() { return "HwPGSInterface.so"; } 00336 }; 00337 00340 } 00341 00342 #endif /* HERWIG_PGSInterface_H */