Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SubProcessHandler.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_SubProcessHandler_H
0010 #define ThePEG_SubProcessHandler_H
0011 // This is the declaration of the SubProcessHandler class.
0012 
0013 #include "ThePEG/Config/ThePEG.h"
0014 #include "ThePEG/Utilities/Interval.h"
0015 #include "ThePEG/Handlers/HandlerGroup.h"
0016 #include "ThePEG/Handlers/HandlerBase.h"
0017 #include "ThePEG/MatrixElement/MEBase.fh"
0018 #include "ThePEG/Cuts/Cuts.fh"
0019 #include "SubProcessHandler.fh"
0020 
0021 namespace ThePEG {
0022 
0023 /**
0024  * The SubProcessHandler class is used to handle a set of MEBase
0025  * objects together with a PartonExtractor. It is used by the
0026  * StandardEventHandler to group together different ways of extracting
0027  * partons from incoming particles with associated hard parton-parton
0028  * matrix elements.
0029  *
0030  * Just as the EventHandler class, a SubProcessHandler keeps a full
0031  * set of <code>HandlerGroup</code>s, which may be filled with
0032  * defaults which overrides the ones specified in the EventHandler in
0033  * each event the SubProcessHandler is chosen.
0034  *
0035  * The SubProcessHandler has also a Cuts object which is
0036  * responsible for restricting the kinematics of the sub-process and
0037  * produced collision. This object takes precedence over the one in
0038  * the EventHandler in each event the SubProcessHandler is chosen.
0039  *
0040  * @see \ref SubProcessHandlerInterfaces "The interfaces"
0041  * defined for SubProcessHandler.
0042  * @see MEBase
0043  * @see PartonExtractor
0044  * @see EventHandler
0045  * @see StandardEventHandler
0046  * @see HandlerGroup
0047  * @see Cuts
0048  */
0049 class SubProcessHandler: public HandlerBase {
0050 
0051 public:
0052 
0053   /** A vector of HandlerGroup pointers. */
0054   typedef vector<HandlerGroupBase *> GroupVector;
0055 
0056   /** A vector of ReweightBase pointers. */
0057   typedef vector<ReweightPtr> ReweightVector;
0058 
0059 public:
0060 
0061   /** @name Standard constructors and destructors. */
0062   //@{
0063   /**
0064    * Default constructor.
0065    */
0066   SubProcessHandler();
0067 
0068   /**
0069    * Copy-constructor.
0070    */
0071   SubProcessHandler(const SubProcessHandler &);
0072 
0073   /**
0074    * Default destructor.
0075    */
0076   virtual ~SubProcessHandler();
0077   //@}
0078 
0079 public:
0080 
0081   /** @name Access objects assigned to the SubProcessHandler. */
0082   //@{
0083   /**
0084    * Return a pointer to the parton extractor used.
0085    */
0086   tPExtrPtr pExtractor() const { return thePartonExtractor; }
0087 
0088   /**
0089    * Return a reference to the vector of parton matrix elements used.
0090    */
0091   const MEVector & MEs() const { return theMEs; }
0092 
0093   /**
0094    * Return a pointer to the kinematical cuts used.
0095    */
0096   tCutsPtr cuts() const { return theCuts; }
0097 
0098   /**
0099    * Return a pointer (possibly null) to the assigned main
0100    * CascadeHandler to be used as CKKW-reweighter.
0101    */
0102   tCascHdlPtr CKKWHandler() const;
0103 
0104   /**
0105    * Access a step handler group.
0106    */
0107   const HandlerGroupBase & handlerGroup(Group::Handler) const;
0108 
0109   /**
0110    * Access the step handler groups.
0111    */
0112   const GroupVector & groups() const { return theGroups; }
0113 
0114   /**
0115    * Return a reference to the vector of parton matrix elements used.
0116    */
0117   MEVector & MEs() { return theMEs; }
0118   //@}
0119 
0120 public:
0121 
0122   /** @name Functions used by the persistent I/O system. */
0123   //@{
0124   /**
0125    * Function used to write out object persistently.
0126    * @param os the persistent output stream written to.
0127    */
0128   void persistentOutput(PersistentOStream & os) const;
0129 
0130   /**
0131    * Function used to read in object persistently.
0132    * @param is the persistent input stream read from.
0133    * @param version the version number of the object when written.
0134    */
0135   void persistentInput(PersistentIStream & is, int version);
0136   //@}
0137 
0138   /**
0139    * Standard Init function used to initialize the interface.
0140    */
0141   static void Init();
0142 
0143 protected:
0144 
0145   /** @name Clone Methods. */
0146   //@{
0147   /**
0148    * Make a simple clone of this object.
0149    * @return a pointer to the new object.
0150    */
0151   virtual IBPtr clone() const;
0152 
0153   /** Make a clone of this object, possibly modifying the cloned object
0154    * to make it sane.
0155    * @return a pointer to the new object.
0156    */
0157   virtual IBPtr fullclone() const;
0158   //@}
0159 
0160   /** @name Standard Interfaced functions. */
0161   //@{
0162 
0163   /**
0164    * Initialize this object after the setup phase before saving an
0165    * EventGenerator to disk.
0166    * @throws InitException if object could not be initialized properly.
0167    */
0168   virtual void doinit();
0169 
0170   /**
0171    * Initialize this object. Called in the run phase just before
0172    * a run begins.
0173    */
0174   virtual void doinitrun();
0175   //@}
0176 
0177 private:
0178 
0179   /**
0180    * Setup the step handler groups.
0181    */
0182   void setupGroups();
0183 
0184 private:
0185 
0186   /**
0187    * The pointer to the parton extractor used.
0188    */
0189   PExtrPtr thePartonExtractor;
0190 
0191   /**
0192    * The vector of partonic matrix elements to be used.
0193    */
0194   MEVector theMEs;
0195 
0196   /**
0197    * The pointer to the kinematical cuts used.
0198    */
0199   CutsPtr theCuts;
0200 
0201   /**
0202    * The SubProcessHandler group.
0203    */
0204   HandlerGroup<SubProcessHandler> theSubprocessGroup;
0205 
0206   /**
0207    * The CascadeHandler group.
0208    */
0209   HandlerGroup<CascadeHandler> theCascadeGroup;
0210 
0211   /**
0212    * The MultipleInteractionHandler group.
0213    */
0214   HandlerGroup<MultipleInteractionHandler> theMultiGroup;
0215 
0216   /**
0217    * The HadronizationHandler group.
0218    */
0219   HandlerGroup<HadronizationHandler> theHadronizationGroup;
0220 
0221   /**
0222    * The DecayHandler group.
0223    */
0224   HandlerGroup<DecayHandler> theDecayGroup;
0225 
0226   /**
0227    * The step handler groups.
0228    */
0229   GroupVector theGroups;
0230 
0231   /**
0232    * The pre- and re-weight objects modifying all matrix element in
0233    * this sub-process hander.
0234    */
0235   ReweightVector reweights;
0236   /**
0237    * The pre- and re-weight objects modifying all matrix element in
0238    * this sub-process hander.
0239    */
0240   ReweightVector preweights;
0241 
0242 private:
0243 
0244   ThePEG_DECLARE_PREPOST_GROUP(SubProcessHandler,Post);
0245   ThePEG_DECLARE_GROUPINTERFACE(CascadeHandler,CascHdlPtr);
0246   ThePEG_DECLARE_GROUPINTERFACE(MultipleInteractionHandler,MIHdlPtr);
0247   ThePEG_DECLARE_GROUPINTERFACE(HadronizationHandler,HadrHdlPtr);
0248   ThePEG_DECLARE_GROUPINTERFACE(DecayHandler,DecayHdlPtr);
0249 
0250   /**
0251    * Describe a concreta class with persistent data.
0252    */
0253   static ClassDescription<SubProcessHandler> initSubProcessHandler;
0254 
0255 private:
0256 
0257   /**
0258    * Private and non-existent assignment operator.
0259    */
0260   const SubProcessHandler & operator=(const SubProcessHandler &) = delete;
0261 
0262 };
0263 
0264 /** @cond TRAITSPECIALIZATIONS */
0265 
0266 /** This template specialization informs ThePEG about the
0267  *  base classes of SubProcessHandler. */
0268 template <>
0269 struct BaseClassTrait<SubProcessHandler,1>: public ClassTraitsType {
0270   /** Typedef of the first base class of SubProcessHandler. */
0271   typedef HandlerBase NthBase;
0272 };
0273 
0274 /** This template specialization informs ThePEG about the name of
0275  *  the SubProcessHandler class and the shared object where it is defined. */
0276 template <>
0277 struct ClassTraits<SubProcessHandler>:
0278     public ClassTraitsBase<SubProcessHandler> {
0279   /** Return a platform-independent class name */
0280   static string className() { return "ThePEG::SubProcessHandler"; }
0281 };
0282 
0283 /** @endcond */
0284 
0285 }
0286 
0287 #endif /* ThePEG_SubProcessHandler_H */