Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:58:16

0001 // Copyright 2020, Jefferson Science Associates, LLC.
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 
0004 
0005 #include <JANA/JEventProcessor.h>
0006 
0007 #include <map>
0008 using std::map;
0009 
0010 class TTree;
0011 
0012 class JEventProcessorJANARATE:public JEventProcessor
0013 {
0014     public:
0015 
0016     virtual void Init(void);
0017     virtual void Process(const std::shared_ptr<const JEvent>& aEvent);
0018     virtual void Finish(void);
0019 
0020         pthread_mutex_t mutex;
0021         bool initialized;
0022         bool finalized;
0023         int prescale;
0024         
0025         struct itimerval start_tmr;
0026         struct itimerval end_tmr;
0027 //      struct itimerval last_tmr;
0028         
0029         unsigned int Ncalls;
0030 //      unsigned int last_Ncalls;
0031 //      unsigned int PERIOD_EVENTS;
0032         
0033         typedef struct{
0034             double tot_rate;            ///< Instantaneous rate due to all threads
0035             double tot_integrated_rate; ///< Total integrated rate for entire job due to all threads
0036             double thread_rate;         ///< Last instantaneous rate of this thread (updated every 2 seconds)
0037             double thread_delta_sec;    ///< Time to process the previous event (not this one!)
0038             double cpu;
0039             double mem_MB;
0040             unsigned int threadid;      ///< pthreadid of this thread
0041         }rate_t;
0042         
0043         rate_t rate;
0044         
0045         TTree *rate_tree;
0046 };