Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OnlMonServer Class Reference

#include </dev/shm/kenichi/update-github-e1039-doc/e1039-core/online/onlmonserver/OnlMonServer.h>

+ Inheritance diagram for OnlMonServer:
+ Collaboration diagram for OnlMonServer:

Public Member Functions

virtual ~OnlMonServer ()
 
int End ()
 
void StartServer ()
 
bool CloseExistingServer (const int port)
 Close an existing server process if such exists. More...
 
void HandleConnection (TSocket *sock)
 
void SetOnline (const bool val)
 
bool GetOnline ()
 
void SetGoEnd (const bool val)
 
bool GetGoEnd ()
 
void SetServerReady (const bool val)
 
bool GetServerReady ()
 
pthread_mutex_t * GetMutex ()
 
void GetMutex (pthread_mutex_t &lock)
 
void SetThreadId (pthread_t &id)
 
- Public Member Functions inherited from Fun4AllServer
virtual ~Fun4AllServer ()
 
virtual bool registerHisto (const char *hname, TNamed *h1d, const int replace=0)
 
virtual bool registerHisto (TNamed *h1d, const int replace=0)
 
template<typename T >
T * makeHisto (T *t)
 
virtual int isHistoRegistered (const std::string &name) const
 
int registerSubsystem (SubsysReco *subsystem, const std::string &topnodename="TOP")
 
int unregisterSubsystem (SubsysReco *subsystem)
 
SubsysRecogetSubsysReco (const std::string &name)
 
int registerOutputManager (Fun4AllOutputManager *manager)
 
Fun4AllOutputManagergetOutputManager (const std::string &name)
 
int registerHistoManager (Fun4AllHistoManager *manager)
 
Fun4AllHistoManagergetHistoManager (const std::string &name)
 
TNamed * getHisto (const std::string &hname) const
 
TNamed * getHisto (const unsigned int ihisto) const
 
const char * getHistoName (const unsigned int ihisto) const
 
virtual void Print (const std::string &what="ALL") const
 
void InitAll ()
 
int BeginRunTimeStamp (PHTimeStamp &TimeStp)
 
int dumpHistos (const std::string &filename="", const std::string &openmode="RECREATE")
 
int process_event (PHCompositeNode *topNode)
 
int Reset ()
 
virtual int BeginRun (const int runno)
 
virtual int EndRun (const int runno=0)
 
PHCompositeNodetopNode () const
 
PHCompositeNodetopNode (const std::string &name)
 
int outfileclose ()
 
virtual int process_event ()
 
PHCompositeNodegetNode (const char *name, const char *topnodename="TOP")
 
int AddTopNode (const std::string &name)
 
int MakeNodesTransient (PHCompositeNode *startNode)
 
int MakeNodesPersistent (PHCompositeNode *startNode)
 
int AddComplaint (const std::string &complaint, const std::string &remedy)
 
int registerInputManager (Fun4AllInputManager *InManager)
 
Fun4AllInputManagergetInputManager (const char *name)
 
int PrdfEvents () const
 
int DstEvents () const
 
int run (const int nevnts=0, const bool require_nevents=false)
 run n events (0 means up to end of file) More...
 
int skip (const int nevnts=0)
 skip n events (0 means up to the end of file). Skip means read, don't process. More...
 
int fileopen (const char *managername="NONE", const char *filename="NONE")
 
int fileclose (const std::string &managername="")
 
int SegmentNumber ()
 
int ResetNodeTree ()
 
int BranchSelect (const char *managername, const char *branch, int iflag)
 
int BranchSelect (const char *branch, int iflag)
 
int setBranches (const char *managername)
 
int setBranches ()
 
virtual int DisconnectDB ()
 
virtual void identify (std::ostream &out=std::cout) const
 
unsigned GetTopNodes (std::vector< std::string > &names) const
 
void GetInputFullFileList (std::vector< std::string > &fnames) const
 
void GetOutputManagerList (std::vector< std::string > &names) const
 
void GetModuleList (std::vector< std::string > &names) const
 
Fun4AllSyncManagergetSyncManager (const std::string &name="DefaultSyncManager")
 
int registerSyncManager (Fun4AllSyncManager *newmaster)
 
int retcodestats (const int iret)
 
void EventNumber (const int evtno)
 
void NodeIdentify (const std::string &name)
 
void KeepDBConnection (const int i=1)
 
void PrintTimer (const std::string &name="")
 
- Public Member Functions inherited from Fun4AllBase
virtual ~Fun4AllBase ()
 
virtual const std::string Name () const
 Returns the name of this module. More...
 
virtual void Name (const std::string &name)
 Sets the name of this module. More...
 
virtual void Verbosity (const int ival)
 Sets the verbosity of this module (0 by default=quiet). More...
 
virtual void Verbosity (enu_Verbosity ival)
 Sets the verbosity of this module (0 by default=quiet). More...
 
virtual int Verbosity () const
 Gets the verbosity of this module. More...
 

Static Public Member Functions

static OnlMonServerinstance ()
 
static void SetHost (const std::string host)
 
static void SetPort (const int port)
 
static void SetPort0 (const int port)
 
static void SetNumPorts (const int num)
 
static std::string GetHost ()
 
static int GetPort ()
 
static int GetPort0 ()
 
static int GetNumPorts ()
 
static void * FuncServer (void *arg)
 
- Static Public Member Functions inherited from Fun4AllServer
static Fun4AllServerinstance ()
 

Protected Member Functions

 OnlMonServer (const std::string &name="OnlMonServer")
 
- Protected Member Functions inherited from Fun4AllServer
 Fun4AllServer (const std::string &name="Fun4AllServer")
 
int InitNodeTree (PHCompositeNode *topNode)
 
int CountOutNodes (PHCompositeNode *startNode)
 
int CountOutNodesRecursive (PHCompositeNode *startNode, const int icount)
 
int UpdateEventSelector (Fun4AllOutputManager *manager)
 
int unregisterSubsystemsNow ()
 
int setRun (const int runnumber)
 
- Protected Member Functions inherited from Fun4AllBase
 Fun4AllBase (const std::string &name="NONAME")
 

Protected Attributes

pthread_mutex_t mutex
 
pthread_t serverthreadid
 
- Protected Attributes inherited from Fun4AllServer
int OutNodeCount
 
int bortime_override
 
int ScreamEveryEvent
 
int unregistersubsystem
 
int runnumber
 
int eventnumber
 
std::vector< std::string > ComplaintList
 
PHCompositeNodeTopNode
 
std::vector< std::pair
< SubsysReco
*, PHCompositeNode * > > 
Subsystems
 
std::vector< std::pair
< SubsysReco
*, PHCompositeNode * > > 
DeleteSubsystems
 
std::vector< int > RetCodes
 
std::vector
< Fun4AllOutputManager * > 
OutputManager
 
std::vector< TDirectory * > TDirCollection
 
Fun4AllHistoManagerServerHistoManager
 
std::vector
< Fun4AllHistoManager * > 
HistoManager
 
std::map< std::string,
PHCompositeNode * > 
topnodemap
 
PHTimeStampbeginruntimestamp
 
std::string default_Tdirectory
 
Fun4AllSyncManagerdefaultSyncManager
 
std::vector< Fun4AllSyncManager * > SyncManagers
 
std::map< int, int > retcodesmap
 
std::map< const std::string,
PHTimer
timer_map
 
TH1 * FrameWorkVars
 
int keep_db_connected
 
- Protected Attributes inherited from Fun4AllBase
std::string ThisName
 
int verbosity
 The verbosity level. 0 means not verbose at all. More...
 

Additional Inherited Members

- Public Types inherited from Fun4AllBase
enum  enu_Verbosity {
  VERBOSITY_QUIET = 0, VERBOSITY_SOME = 1, VERBOSITY_MORE = 2, VERBOSITY_EVEN_MORE = 3,
  VERBOSITY_A_LOT = 4, VERBOSITY_MAX = INT_MAX - 10
}
 
- Static Protected Attributes inherited from Fun4AllServer
static Fun4AllServer__instance = 0
 

Detailed Description

Definition at line 8 of file OnlMonServer.h.

Constructor & Destructor Documentation

OnlMonServer::~OnlMonServer ( )
virtual

Definition at line 61 of file OnlMonServer.cc.

OnlMonServer::OnlMonServer ( const std::string &  name = "OnlMonServer")
protected

Definition at line 44 of file OnlMonServer.cc.

References mutex.

Member Function Documentation

bool OnlMonServer::CloseExistingServer ( const int  port)

Close an existing server process if such exists.

It is possible that multiple decoding processes run in parallel on multiple runs. This function tries to keep the server of only the lastest process (which is expected to hanle the lastest run).

Actually this function does not work properly, as found on 2019-07-05. The existing onlmon server does suicides itself, but its port is kept open until the whole server process finishes. Thus probably we need to use multiple ports, as done in the original PHENIX code.

Definition at line 127 of file OnlMonServer.cc.

Referenced by FuncServer().

+ Here is the caller graph for this function:

int OnlMonServer::End ( )
virtual

Reimplemented from Fun4AllServer.

Definition at line 96 of file OnlMonServer.cc.

References Fun4AllServer::End().

Referenced by Fun4MainDaq(), and Fun4MainDaqE906().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void * OnlMonServer::FuncServer ( void *  arg)
static

Definition at line 143 of file OnlMonServer.cc.

References CloseExistingServer(), GetGoEnd(), HandleConnection(), se, SetServerReady(), and Fun4AllBase::Verbosity().

Referenced by StartServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool OnlMonServer::GetGoEnd ( )
inline

Definition at line 44 of file OnlMonServer.h.

Referenced by FuncServer().

+ Here is the caller graph for this function:

static std::string OnlMonServer::GetHost ( )
inlinestatic

Definition at line 32 of file OnlMonServer.h.

Referenced by OnlMonComm::ConnectServer().

+ Here is the caller graph for this function:

pthread_mutex_t* OnlMonServer::GetMutex ( )
inline

Definition at line 49 of file OnlMonServer.h.

References mutex.

Referenced by OnlMonClient::process_event(), and OnlMonClient::SendHist().

+ Here is the caller graph for this function:

void OnlMonServer::GetMutex ( pthread_mutex_t &  lock)
inline

Definition at line 50 of file OnlMonServer.h.

References mutex.

static int OnlMonServer::GetNumPorts ( )
inlinestatic

Definition at line 35 of file OnlMonServer.h.

Referenced by OnlMonComm::ConnectServer().

+ Here is the caller graph for this function:

bool OnlMonServer::GetOnline ( )
inline

Definition at line 42 of file OnlMonServer.h.

static int OnlMonServer::GetPort ( )
inlinestatic

Definition at line 33 of file OnlMonServer.h.

Referenced by OnlMonComm::ConnectServer().

+ Here is the caller graph for this function:

static int OnlMonServer::GetPort0 ( )
inlinestatic

Definition at line 34 of file OnlMonServer.h.

Referenced by OnlMonComm::ConnectServer().

+ Here is the caller graph for this function:

bool OnlMonServer::GetServerReady ( )
inline

Definition at line 46 of file OnlMonServer.h.

void OnlMonServer::HandleConnection ( TSocket *  sock)

Definition at line 207 of file OnlMonServer.cc.

References OnlMonComm::FindFullSpillRange(), OnlMonComm::GetSpillSelectability(), Fun4AllServer::getSubsysReco(), OnlMonComm::instance(), NULL, OnlMonClient::SendHist(), and Fun4AllBase::Verbosity().

Referenced by FuncServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

OnlMonServer * OnlMonServer::instance ( )
static

Definition at line 34 of file OnlMonServer.cc.

Referenced by Fun4MainDaq(), Fun4MainDaqE906(), OnlMonClient::Init(), OnlMonClient::InitRun(), OnlMonClient::process_event(), OnlMonClient::SendHist(), and TestOnlMonServer().

+ Here is the caller graph for this function:

void OnlMonServer::SetGoEnd ( const bool  val)
inline

Definition at line 43 of file OnlMonServer.h.

static void OnlMonServer::SetHost ( const std::string  host)
inlinestatic

Definition at line 27 of file OnlMonServer.h.

Referenced by OnlMon4MainDaq().

+ Here is the caller graph for this function:

static void OnlMonServer::SetNumPorts ( const int  num)
inlinestatic

Definition at line 30 of file OnlMonServer.h.

Referenced by ConfigServer().

+ Here is the caller graph for this function:

void OnlMonServer::SetOnline ( const bool  val)
inline

Definition at line 41 of file OnlMonServer.h.

Referenced by Fun4MainDaq().

+ Here is the caller graph for this function:

static void OnlMonServer::SetPort ( const int  port)
inlinestatic

Definition at line 28 of file OnlMonServer.h.

Referenced by ConfigServer(), and OnlMonComm::ConnectServer().

+ Here is the caller graph for this function:

static void OnlMonServer::SetPort0 ( const int  port)
inlinestatic

Definition at line 29 of file OnlMonServer.h.

Referenced by ConfigServer().

+ Here is the caller graph for this function:

void OnlMonServer::SetServerReady ( const bool  val)
inline

Definition at line 45 of file OnlMonServer.h.

Referenced by FuncServer().

+ Here is the caller graph for this function:

void OnlMonServer::SetThreadId ( pthread_t &  id)
inline

Definition at line 51 of file OnlMonServer.h.

References serverthreadid.

Referenced by StartServer().

+ Here is the caller graph for this function:

void OnlMonServer::StartServer ( )

Definition at line 66 of file OnlMonServer.cc.

References FuncServer(), NULL, ServerThread, SetThreadId(), and Fun4AllBase::Verbosity().

Referenced by Fun4MainDaq(), Fun4MainDaqE906(), and TestOnlMonServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

pthread_mutex_t OnlMonServer::mutex
protected

Definition at line 58 of file OnlMonServer.h.

Referenced by GetMutex(), and OnlMonServer().

pthread_t OnlMonServer::serverthreadid
protected

Definition at line 59 of file OnlMonServer.h.

Referenced by SetThreadId().


The documentation for this class was generated from the following files: