TauolaHEPEVTEvent.h

00001 #ifndef _TauolaHEPEVTEvent_h_included_
00002 #define _TauolaHEPEVTEvent_h_included_
00003 
00004 /**
00005  * @class TauolaHEPEVTParticle
00006  *
00007  * @brief Single particle of HEPEVT event record
00008  *
00009  * This class implements the virtual methods of
00010  * TauolaEvent. In this way it provides an
00011  * interface between the generic TauolaEvent class
00012  * and information stored in HEPEVT event record.
00013  *
00014  * @author Tomasz Przedzinski
00015  * @date 24 November 2011
00016  */
00017 
00018 #include <iostream>
00019 #include "TauolaEvent.h"
00020 #include "TauolaParticle.h"
00021 #include "TauolaHEPEVTParticle.h"
00022 
00023 namespace Tauolapp
00024 {
00025 
00026 // Uncomment this line to use interface to common block HEPEVT
00027 // But first be sure about suitable for you value of NMXHEP
00028 // and whether phep, vhep should be declared float or double
00029 //#define USE_HEPEVT_INTERFACE
00030 
00031 #ifdef USE_HEPEVT_INTERFACE
00032 
00033 // Change this value to match HEPEVT size
00034 const int NMXHEP = 10000;
00035 
00036 extern "C" struct {
00037   int    nevhep;            // serial number
00038   int    nhep;              // number of particles
00039   int    isthep[NMXHEP];    // status code
00040   int    idhep [NMXHEP];    // particle PDG ID
00041   int    jmohep[NMXHEP][2]; // parent particles
00042   int    jdahep[NMXHEP][2]; // childreen particles
00043   double phep  [NMXHEP][5]; // four-momentum, mass [GeV]
00044   double vhep  [NMXHEP][4]; // vertex [mm]
00045 } hepevt_;
00046 
00047 #endif
00048 
00049 class TauolaHEPEVTParticle;
00050 
00051 class TauolaHEPEVTEvent : public TauolaEvent {
00052 
00053  public:
00054 
00055   /** Default destructor */
00056   ~TauolaHEPEVTEvent();
00057 
00058   /** Default constructor */
00059   TauolaHEPEVTEvent();
00060 
00061   /** Add particle at the end of event record */
00062   void addParticle(TauolaHEPEVTParticle *p);
00063 
00064   /** Get particle at index 'i' */
00065   TauolaHEPEVTParticle *getParticle(int i);
00066 
00067   /** Get higher-most index of the particles in event (nhep) */
00068   int getParticleCount();
00069 
00070   /** Implementation of TauolaEvent virtual method.
00071       This returns a list of particles in the event with
00072       pdg id = "pdgID". */
00073   std::vector<TauolaParticle*> findParticles(int pdgID);
00074 
00075   /** Implementation of TauolaEven virtual method.
00076       This returns a list of particles in the event with
00077       pdg id = "pdgID" and stable status code. */
00078   std::vector<TauolaParticle*> findStableParticles(int pdgID);
00079 
00080   /** Print out list of particles in the event */
00081   void print();
00082   
00083   /** Remove all particles from the event */
00084   void clear();
00085 
00086 #ifdef USE_HEPEVT_INTERFACE
00087   /** Fill TauolaHEPEVTEvent from HEPEVT common block */
00088   static void read_event_from_HEPEVT(TauolaHEPEVTEvent *evt);
00089   
00090   /** Write to HEPEVT common block content of TauolaHEPEVTEvent */
00091   static void write_event_to_HEPEVT(TauolaHEPEVTEvent *evt);
00092 #endif
00093 
00094  private:
00095 
00096   /** List of all particles */
00097   std::vector<TauolaHEPEVTParticle*> particle_list;
00098 };
00099 
00100 } // namespace Tauolapp
00101 #endif
00102 
Generated on Sun Oct 20 20:24:11 2013 for C++InterfacetoTauola by  doxygen 1.6.3