EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicJEventProcessor.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicJEventProcessor.h
1 
2 #include <mutex>
3 
4 #include <JANA/JEventProcessor.h>
5 
6 #ifndef _EIC_JEVENT_PROCESSOR_
7 #define _EIC_JEVENT_PROCESSOR_
8 
9 #include <FairRun.h>
10 
11 class EicJEventProcessor:public JEventProcessor {
12  //protected:
13  //std::mutex mymutex;
14 
15  public:
16  void Init(void) {
17  printf("EicJEventProcessor::Init() ... %u\n\n", (unsigned)pthread_self());
18  };
19 
20  void Process(const std::shared_ptr<const JEvent>& aEvent) {
21  printf("EicJEventProcessor::Process() #1 ... %u\n", (unsigned)pthread_self());
22 
23  //auto fRun = FairRun::Instance();
24  //if (fRun) fRun->RunCoreProcessNextEvent();
25 
26  // If your application needs to do something serially, like write
27  // to a file, then use a lock to do that here.
28  //std::lock_guard<std::mutex> lck(mymutex);
29  };
30 
31  void Finish(void) {
32  printf("EicJEventProcessor::Finish() ...%u\n\n", (unsigned)pthread_self());
33 
34  auto fRun = FairRun::Instance();
35  //fRun->RunCoreImportNextEvent(); fRun->RunCoreProcessNextEvent();
36  //while (fRun->RunCoreImportNextEvent()) fRun->RunCoreProcessNextEvent();
37 
38  if (fRun) fRun->RunCoreFinish();
39  };
40 };
41 
42 #endif
43