Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // EventManipulator.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_EventManipulator_H
0010 #define ThePEG_EventManipulator_H
0011 // This is the declaration of the EventManipulator class.
0012 
0013 #include "ThePEG/Interface/Interfaced.h"
0014 #include "ThePEG/Handlers/EventHandler.fh"
0015 #include <stdexcept>
0016 
0017 namespace ThePEG {
0018 
0019 /**
0020  * An object of the EventManipulator class may be assigned to a
0021  * FullEventGenerator object. The manipulate() method is called for
0022  * each event generated, after the AnalysisHandlers have been called,
0023  * and may manipulate the event in any way needed. The manipulator may
0024  * alseo add StepHandlers to the EventHandler which produced the
0025  * event. The manipulate() method returns an integer which should be
0026  * zero if nothing was done to the event. If the EventHandler has
0027  * steps left to do, these are performed, after which the
0028  * <code>AnalysisHandler</code>s are called with the return value from
0029  * the previous manipulate() call. Then manipulate is called again and
0030  * the procedure is repeated until the EventHandler has no more steps
0031  * to do.
0032  *
0033  * @see \ref EventManipulatorInterfaces "The interfaces"
0034  * defined for EventManipulator.
0035  * @see FullEventGenerator
0036  * @see AnalysisHandler
0037  * @see EventHandler
0038  * @see StepHandler
0039  * 
0040  */
0041 class EventManipulator: public Interfaced {
0042 
0043 public:
0044 
0045   /**
0046    * Manipulate an event and the event handler.
0047    * @param eh the EventHandler in charge of the generation.
0048    * @param event the Event to be manipulated.
0049    * @return zero if the event was not manipulated. Otherwise return
0050    * an integer which will be given to the
0051    * <code>AnalysisHandler</code>s of the current FullEventGenerator.
0052    */
0053   virtual int manipulate(tEHPtr eh, tEventPtr event) = 0;
0054 
0055 public:
0056 
0057   /**
0058    * Standard Init function used to initialize the interface.
0059    */
0060   static void Init();
0061 
0062 protected:
0063 
0064 private:
0065 
0066   /**
0067    * Describe an abstract class without persistent data.
0068    */
0069   static AbstractNoPIOClassDescription<EventManipulator> initEventManipulator;
0070 
0071   /**
0072    *  Private and non-existent assignment operator.
0073    */
0074   EventManipulator & operator=(const EventManipulator &) = delete;
0075 
0076 };
0077 
0078 /** @cond TRAITSPECIALIZATIONS */
0079 
0080 /**
0081  * This template specialization informs ThePEG about the
0082  * base class of EventManipulator.
0083  */
0084 template <>
0085 struct BaseClassTrait<EventManipulator,1>: public ClassTraitsType {
0086   /** Typedef of the base class of EventManipulator. */
0087   typedef Interfaced NthBase;
0088 };
0089 
0090 /**
0091  * This template specialization informs ThePEG about the name of the
0092  * DecayHandler class and the shared object where it is defined.
0093  */
0094 template <>
0095 struct ClassTraits<EventManipulator>:
0096     public ClassTraitsBase<EventManipulator> {
0097   /** Return the class name. */
0098   static string className() {  return "ThePEG::EventManipulator"; }
0099 };
0100 
0101 /** @endcond */
0102 
0103 }
0104 
0105 #endif /* ThePEG_EventManipulator_H */