Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:21

0001 // -*- C++ -*-
0002 //
0003 // EventConfig.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef ThePEG_EventConfig_H
0010 #define ThePEG_EventConfig_H
0011 
0012 /** \file EventConfig.h
0013 
0014  * This is the main config header file for the Event classes. Do not
0015  * make changes in this file. If these classes are used outside of
0016  * ThePEG you probably need to need to modify base classes persistency
0017  * scheme etc. If so, edit a copy of the file which can be included
0018  * instead of this file using the macro
0019  * <code>ThePEG_ALTERNATIVE_EVENT_RECORD</code>.
0020  */
0021 
0022 #ifndef ThePEG_NOT_ThePEG
0023 
0024 #include "ThePEG/Config/ThePEG.h"
0025 #include "ThePEG/Utilities/Rebinder.fh"
0026 #include "ThePEG/Persistency/PersistentOStream.fh"
0027 #include "ThePEG/Persistency/PersistentIStream.fh"
0028 
0029 #ifndef ThePEG_ALTERNATIVE_EVENT_RECORD
0030 
0031 #include "ThePEG/Vectors/Lorentz5Vector.h"
0032 #include "ThePEG/Vectors/LorentzRotation.h"
0033 
0034 namespace ThePEG {
0035 
0036 /** EventRecordBase is the base class of all event record classes. It
0037  *  must be typedefed to a class which allows for garbage
0038  *  collection, since none of the event record classes are deleted
0039  *  explicitly.
0040  */
0041 typedef Base EventRecordBase;
0042 /** Alias for a reference counted pointer to EventRecordBase. */
0043 typedef Ptr<EventRecordBase>::pointer EventBasePtr;
0044 /** Alias for a reference counted pointer to const EventRecordBase. */
0045 typedef Ptr<EventRecordBase>::const_pointer cEventBasePtr;
0046 /** Alias for a transient pointer to EventRecordBase. */
0047 typedef Ptr<EventRecordBase>::transient_pointer tEventBasePtr;
0048 /** Alias for a transient pointer to const EventRecordBase. */
0049 typedef Ptr<EventRecordBase>::transient_const_pointer tcEventBasePtr;
0050 
0051 /** Alias for a rebinder object able to relate pointers to original
0052  *  objects to pointers to their clones. */
0053 typedef Rebinder<EventRecordBase> EventTranslationMap;
0054 
0055 
0056 /** ParticleClass is the name used for Particle in the event record classes. */
0057 typedef Particle ParticleClass;
0058 /** ParticleDataClass is the name used for ParticleData in the event
0059  *  record classes. */
0060 typedef ParticleData ParticleDataClass;
0061 
0062 /** Alias for a reference counted pointer to ParticleDataClass. */
0063 typedef Ptr<ParticleDataClass>::pointer EventPDPtr;
0064 /** Alias for a reference counted pointer to const ParticleDataClass. */
0065 typedef Ptr<ParticleDataClass>::const_pointer cEventPDPtr;
0066 /** Alias for a transient pointer to ParticleDataClass. */
0067 typedef Ptr<ParticleDataClass>::transient_pointer tEventPDPtr;
0068 /** Alias for a transient pointer to const ParticleDataClass. */
0069 typedef Ptr<ParticleDataClass>::transient_const_pointer tcEventPDPtr;
0070 
0071 /** A vector of transient pointers to Particle. */
0072 typedef vector<tPPtr> tParticleVector;
0073 /** A vector of pointers to Particle. */
0074 typedef vector<PPtr> ParticleVector;
0075 /** A set of pointers to Particle. */
0076 typedef set<PPtr, less<PPtr> > ParticleSet;
0077 /** A set of transient pointers to Particle. */
0078 typedef set<tPPtr, less<tPPtr> > tParticleSet;
0079 /** A set of transient pointers to const Particle. */
0080 typedef set<tcPPtr, less<tcPPtr> > tcParticleSet;
0081 /** A vector of pointers to Step. */
0082 typedef vector<StepPtr> StepVector;
0083 /** A vector of pointers to SubProcess. */
0084 typedef vector<SubProPtr> SubProcessVector;
0085 /** A vector of transient pointers to SubProcess. */
0086 typedef vector<tSubProPtr> tSubProcessVector;
0087 /** A vector of pointers to Collision. */
0088 typedef vector<CollPtr> CollisionVector;
0089 /** A set of pointers to Step. */
0090 typedef set<StepPtr, less<StepPtr> > StepSet;
0091 /** A set of pointers to SubProcess. */
0092 typedef set<SubProPtr, less<SubProPtr> > SubProcessSet;
0093 
0094 /** A helper class to facilitate persistent input and output. */
0095 struct EventConfig {
0096 
0097   /**
0098    * Optional pointer to the current EventGenerator.
0099    * If \a currentGenerator is set during persistent output, only the
0100    * PDG number of a particle type is written rather than the full
0101    * ParticleData object. Also only the name of handlers is written
0102    * rather than the full objects. When this is read back in again,
0103    * the \a currentGenerator must be set so that conversion from
0104    * name/number back to objects can be done.
0105    */
0106   static tcEventBasePtr currentGenerator;
0107 
0108   /** Write a handler object to a persistent stream. */
0109   static void putHandler(PersistentOStream & os, tcEventBasePtr h);
0110   /** Read a handler object from a persistent stream. */
0111   static void getHandler(PersistentIStream & is, tcEventBasePtr & h);
0112   /** Write a ParticleData object to a persistent stream. */
0113   static void putParticleData(PersistentOStream & os, tcEventPDPtr pd);
0114   /** Read a ParticleData object from a persistent stream. */
0115   static void getParticleData(PersistentIStream & is, cEventPDPtr & pd);
0116   /** Return the name of a handler object. */
0117   static string nameHandler(tcEventBasePtr h);
0118 
0119 };
0120 
0121 }
0122 
0123 #else
0124 
0125 #include ThePEG_ALTERNATIVE_EVENT_RECORD
0126 
0127 #endif
0128 
0129 #endif /* ThePEG_NOT_ThePEG */
0130 
0131 
0132 #endif /* ThePEG_EventConfig_H */
0133