Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:35

0001 //____________________________________________________________________________..
0002 //
0003 // This is a template for a Fun4All SubsysReco module with all methods from the
0004 // $OFFLINE_MAIN/include/fun4all/SubsysReco.h baseclass
0005 // You do not have to implement all of them, you can just remove unused methods
0006 // here and in LocalPolOffMon.h.
0007 //
0008 // LocalPolOffMon(const std::string &name = "LocalPolOffMon")
0009 // everything is keyed to LocalPolOffMon, duplicate names do work but it makes
0010 // e.g. finding culprits in logs difficult or getting a pointer to the module
0011 // from the command line
0012 //
0013 // LocalPolOffMon::~LocalPolOffMon()
0014 // this is called when the Fun4AllServer is deleted at the end of running. Be
0015 // mindful what you delete - you do loose ownership of object you put on the node tree
0016 //
0017 // int LocalPolOffMon::Init(PHCompositeNode *topNode)
0018 // This method is called when the module is registered with the Fun4AllServer. You
0019 // can create historgrams here or put objects on the node tree but be aware that
0020 // modules which haven't been registered yet did not put antyhing on the node tree
0021 //
0022 // int LocalPolOffMon::InitRun(PHCompositeNode *topNode)
0023 // This method is called when the first event is read (or generated). At
0024 // this point the run number is known (which is mainly interesting for raw data
0025 // processing). Also all objects are on the node tree in case your module's action
0026 // depends on what else is around. Last chance to put nodes under the DST Node
0027 // We mix events during readback if branches are added after the first event
0028 //
0029 // int LocalPolOffMon::process_event(PHCompositeNode *topNode)
0030 // called for every event. Return codes trigger actions, you find them in
0031 // $OFFLINE_MAIN/include/fun4all/Fun4AllReturnCodes.h
0032 //   everything is good:
0033 //     return Fun4AllReturnCodes::EVENT_OK
0034 //   abort event reconstruction, clear everything and process next event:
0035 //     return Fun4AllReturnCodes::ABORT_EVENT; 
0036 //   proceed but do not save this event in output (needs output manager setting):
0037 //     return Fun4AllReturnCodes::DISCARD_EVENT; 
0038 //   abort processing:
0039 //     return Fun4AllReturnCodes::ABORT_RUN
0040 // all other integers will lead to an error and abort of processing
0041 //
0042 // int LocalPolOffMon::ResetEvent(PHCompositeNode *topNode)
0043 // If you have internal data structures (arrays, stl containers) which needs clearing
0044 // after each event, this is the place to do that. The nodes under the DST node are cleared
0045 // by the framework
0046 //
0047 // int LocalPolOffMon::EndRun(const int runnumber)
0048 // This method is called at the end of a run when an event from a new run is
0049 // encountered. Useful when analyzing multiple runs (raw data). Also called at
0050 // the end of processing (before the End() method)
0051 //
0052 // int LocalPolOffMon::End(PHCompositeNode *topNode)
0053 // This is called at the end of processing. It needs to be called by the macro
0054 // by Fun4AllServer::End(), so do not forget this in your macro
0055 //
0056 // int LocalPolOffMon::Reset(PHCompositeNode *topNode)
0057 // not really used - it is called before the dtor is called
0058 //
0059 // void LocalPolOffMon::Print(const std::string &what) const
0060 // Called from the command line - useful to print information when you need it
0061 //
0062 //____________________________________________________________________________..
0063 
0064 #include "LocalPolOffMon.h"
0065 
0066 #include <fun4all/Fun4AllReturnCodes.h>
0067 
0068 #include <phool/PHCompositeNode.h>
0069 
0070 //____________________________________________________________________________..
0071 LocalPolOffMon::LocalPolOffMon(const std::string &name):
0072  SubsysReco(name)
0073 {
0074   std::cout << "LocalPolOffMon::LocalPolOffMon(const std::string &name) Calling ctor" << std::endl;
0075 }
0076 
0077 //____________________________________________________________________________..
0078 LocalPolOffMon::~LocalPolOffMon()
0079 {
0080   std::cout << "LocalPolOffMon::~LocalPolOffMon() Calling dtor" << std::endl;
0081 }
0082 
0083 //____________________________________________________________________________..
0084 int LocalPolOffMon::Init(PHCompositeNode * /*topNode*/)
0085 {
0086   std::cout << "LocalPolOffMon::Init(PHCompositeNode *topNode) Initializing" << std::endl;
0087   return Fun4AllReturnCodes::EVENT_OK;
0088 }
0089 
0090 //____________________________________________________________________________..
0091 int LocalPolOffMon::InitRun(PHCompositeNode * /*topNode*/)
0092 {
0093   std::cout << "LocalPolOffMon::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
0094   return Fun4AllReturnCodes::EVENT_OK;
0095 }
0096 
0097 //____________________________________________________________________________..
0098 int LocalPolOffMon::process_event(PHCompositeNode * /*topNode*/)
0099 {
0100   std::cout << "LocalPolOffMon::process_event(PHCompositeNode *topNode) Processing Event" << std::endl;
0101   return Fun4AllReturnCodes::EVENT_OK;
0102 }
0103 
0104 //____________________________________________________________________________..
0105 int LocalPolOffMon::ResetEvent(PHCompositeNode * /*topNode*/)
0106 {
0107   std::cout << "LocalPolOffMon::ResetEvent(PHCompositeNode *topNode) Resetting internal structures, prepare for next event" << std::endl;
0108   return Fun4AllReturnCodes::EVENT_OK;
0109 }
0110 
0111 //____________________________________________________________________________..
0112 int LocalPolOffMon::EndRun(const int runnumber)
0113 {
0114   std::cout << "LocalPolOffMon::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
0115   return Fun4AllReturnCodes::EVENT_OK;
0116 }
0117 
0118 //____________________________________________________________________________..
0119 int LocalPolOffMon::End(PHCompositeNode * /*topNode*/)
0120 {
0121   std::cout << "LocalPolOffMon::End(PHCompositeNode *topNode) This is the End..." << std::endl;
0122   return Fun4AllReturnCodes::EVENT_OK;
0123 }
0124 
0125 //____________________________________________________________________________..
0126 int LocalPolOffMon::Reset(PHCompositeNode * /*topNode*/)
0127 {
0128  std::cout << "LocalPolOffMon::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
0129   return Fun4AllReturnCodes::EVENT_OK;
0130 }
0131 
0132 //____________________________________________________________________________..
0133 void LocalPolOffMon::Print(const std::string &what) const
0134 {
0135   std::cout << "LocalPolOffMon::Print(const std::string &what) const Printing info for " << what << std::endl;
0136 }