Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef THEPEG_RivetAnalysis_H
0003 #define THEPEG_RivetAnalysis_H
0004 //
0005 // This is the declaration of the RivetAnalysis class.
0006 //
0007 
0008 #include "ThePEG/Handlers/AnalysisHandler.h"
0009 #include "Rivet/AnalysisHandler.hh"
0010 
0011 namespace ThePEG {
0012 
0013 /**
0014  * Here is the documentation of the RivetAnalysis class.
0015  *
0016  * @see \ref RivetAnalysisInterfaces "The interfaces"
0017  * defined for RivetAnalysis.
0018  */
0019 class RivetAnalysis: public ThePEG::AnalysisHandler {
0020 
0021 public:
0022   
0023   /**
0024    * The default constructor.
0025    */
0026   RivetAnalysis();
0027   
0028 public:
0029   
0030   /** @name Virtual functions required by the AnalysisHandler class. */
0031   //@{
0032   /**
0033    * Analyze a given Event. Note that a fully generated event
0034    * may be presented several times, if it has been manipulated in
0035    * between. The default version of this function will call transform
0036    * to make a lorentz transformation of the whole event, then extract
0037    * all final state particles and call analyze(tPVector) of this
0038    * analysis object and those of all associated analysis objects. The
0039    * default version will not, however, do anything on events which
0040    * have not been fully generated, or have been manipulated in any
0041    * way.
0042    * @param event pointer to the Event to be analyzed.
0043    * @param ieve the event number.
0044    * @param loop the number of times this event has been presented.
0045    * If negative the event is now fully generated.
0046    * @param state a number different from zero if the event has been
0047    * manipulated in some way since it was last presented.
0048    */
0049   virtual void analyze(ThePEG::tEventPtr event, long ieve, int loop, int state);
0050   //@}
0051   
0052 public:
0053   
0054   /** @name Functions used by the persistent I/O system. */
0055   //@{
0056   /**
0057    * Function used to write out object persistently.
0058    * @param os the persistent output stream written to.
0059    */
0060   void persistentOutput(ThePEG::PersistentOStream & os) const;
0061   
0062   /**
0063    * Function used to read in object persistently.
0064    * @param is the persistent input stream read from.
0065    * @param version the version number of the object when written.
0066    */
0067   void persistentInput(ThePEG::PersistentIStream & is, int version);
0068   //@}
0069 
0070   /**
0071    * The standard Init function used to initialize the interfaces.
0072    * Called exactly once for each class by the class description system
0073    * before the main function starts or
0074    * when this class is dynamically loaded.
0075    */
0076   static void Init();
0077 
0078 protected:
0079 
0080   /** @name Clone Methods. */
0081   //@{
0082   /**
0083    * Make a simple clone of this object.
0084    * @return a pointer to the new object.
0085    */
0086   virtual ThePEG::IBPtr clone() const;
0087 
0088   /** Make a clone of this object, possibly modifying the cloned object
0089    * to make it sane.
0090    * @return a pointer to the new object.
0091    */
0092   virtual ThePEG::IBPtr fullclone() const;
0093   //@}
0094 
0095 protected:
0096 
0097   /** @name Standard Interfaced functions. */
0098   //@{
0099   /**
0100    * Initialize this object. Called in the read phase.
0101    */
0102   virtual void doinit();
0103 
0104   /**
0105    * Initialize this object. Called in the run phase just before
0106    * a run begins.
0107    */
0108   virtual void doinitrun();
0109 
0110   /**
0111    * Finalize this object. Called in the run phase just after a
0112    * run has ended. Used eg. to write out statistics.
0113    */
0114   virtual void dofinish();
0115   //@}
0116 
0117 private:
0118 
0119   /**
0120    * The static object used to initialize the description of this class.
0121    * Indicates that this is a concrete class with persistent data.
0122    */
0123   static ThePEG::ClassDescription<RivetAnalysis> initRivetAnalysis;
0124 
0125   /**
0126    * The assignment operator is private and must never be called.
0127    * In fact, it should not even be implemented.
0128    */
0129   RivetAnalysis & operator=(const RivetAnalysis &) = delete;
0130 
0131 private:
0132 
0133   /**
0134    *  The Analyses to use
0135    */
0136   vector<string> _analyses;
0137 
0138   /**
0139    *   Yoda files to be preloaded
0140    */
0141   vector<string> _preload;
0142 
0143   /**
0144    * Search paths for finding rivet analyses. 
0145    */
0146   vector<string> _paths;
0147 
0148   /**
0149    * The base name of the output file.
0150    */
0151   string _filename;
0152 
0153   /**
0154    * Enable debugging information from Rivet
0155    */
0156   bool _debug;
0157 
0158   /**
0159    *  The RivetAnalysisHandler
0160    */
0161   Rivet::AnalysisHandler * _rivet;
0162 
0163   /**
0164    *  Event count
0165    */
0166   unsigned long _nevent;
0167 
0168   /**
0169    *  Disable beam check
0170    */
0171   bool _checkBeams;
0172 };
0173 
0174 }
0175 
0176 #endif /* THEPEG_RivetAnalysis_H */