Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:52:43

0001 #pragma once
0002 
0003 #include <JANA/JEvent.h>
0004 #include <JANA/JEventProcessor.h>
0005 #include <TDirectory.h>
0006 #include <spdlog/fwd.h>
0007 #include <memory>
0008 
0009 class TrackingTest_processor : public JEventProcessor {
0010 public:
0011   //----------------------------
0012   // Init
0013   //
0014   // This is called once before the first call to the Process method
0015   // below. You may, for example, want to open an output file here.
0016   // Only one thread will call this.
0017   void Init() override;
0018 
0019   //----------------------------
0020   // Process
0021   //
0022   // This is called for every event. Multiple threads may call this
0023   // simultaneously. If you write something to an output file here
0024   // then make sure to protect it with a mutex or similar mechanism.
0025   // Minimize what is done while locked since that directly affects
0026   // the multi-threaded performance.
0027   void Process(const std::shared_ptr<const JEvent>& event) override;
0028 
0029   //----------------------------
0030   // Finish
0031   //
0032   // This is called once after all events have been processed. You may,
0033   // for example, want to close an output file here.
0034   // Only one thread will call this.
0035   void Finish() override;
0036 
0037 private:
0038   //----------------------------
0039   // Test imminent tracking output
0040   void ProcessTrackingResults(const std::shared_ptr<const JEvent>& event);
0041 
0042   void ProcessTrackingMatching(const std::shared_ptr<const JEvent>& event);
0043 
0044   void ProcessGloablMatching(const std::shared_ptr<const JEvent>& event);
0045 
0046   std::shared_ptr<spdlog::logger> m_log;
0047   TDirectory* m_dir_main{};
0048 };