Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:16:46

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef FUN4ALL_SUBSYSRECO_H
0004 #define FUN4ALL_SUBSYSRECO_H
0005 
0006 #include "Fun4AllBase.h"
0007 
0008 #include <string>
0009 
0010 class PHCompositeNode;
0011 
0012 /** Base class for all reconstruction and analysis modules to be
0013  *  used under the Fun4All framework.
0014  *
0015  *  If you write a reconstruction/analysis module, you must derive
0016  *  from this base class and you have to implement this class methods.
0017  *  None of these are strictly required as far as C++ is concerned, but as
0018  *  far as your job is concerned, at least process_event(), to do the
0019  *  job, and InitRun(), to initialize, should be implemented.
0020  *
0021  */
0022 
0023 class SubsysReco : public Fun4AllBase
0024 {
0025  public:
0026   /** dtor.
0027       Does nothing as this is a base class only.
0028   */
0029   ~SubsysReco() override {}
0030 
0031   /// Called at the end of all processing.
0032   virtual int End(PHCompositeNode * /*topNode*/) { return 0; }
0033 
0034   /// Called at the end of each run.
0035   virtual int EndRun(const int /*runnumber*/) { return 0; }
0036 
0037   /** Called during initialization.
0038       Typically this is where you can book histograms, and e.g.
0039       register them to Fun4AllServer (so they can be output to file
0040       using Fun4AllServer::dumpHistos() method).
0041    */
0042   virtual int Init(PHCompositeNode * /*topNode*/) { return 0; }
0043 
0044   /** Called for first event when run number is known.
0045       Typically this is where you may want to fetch data from
0046       database, because you know the run number.
0047    */
0048   virtual int InitRun(PHCompositeNode * /*topNode*/) { return 0; }
0049 
0050   /** Called for each event.
0051       This is where you do the real work.
0052   */
0053   virtual int process_event(PHCompositeNode * /*topNode*/) { return 0; }
0054 
0055   /// Reset.
0056   virtual int Reset(PHCompositeNode * /*topNode*/) { return 0; }
0057 
0058   /// Clean up after each event.
0059   virtual int ResetEvent(PHCompositeNode * /*topNode*/) { return 0; }
0060 
0061   void Print(const std::string & /*what*/ = "ALL") const override {}
0062 
0063  protected:
0064   /** ctor.
0065       @param name is the reference used inside the Fun4AllServer
0066   */
0067   SubsysReco(const std::string &name = "NONAME")
0068     : Fun4AllBase(name)
0069   {
0070   }
0071 };
0072 
0073 #endif