Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:15:20

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 #include "HitReconstructionAnalysis.h"
0010 #include "TrackingOccupancyAnalysis.h"
0011 
0012 class TrackingOccupancy_processor : public JEventProcessor {
0013 public:
0014   //----------------------------
0015   // Init
0016   //
0017   // This is called once before the first call to the Process method
0018   // below. You may, for example, want to open an output file here.
0019   // Only one thread will call this.
0020   void Init() override;
0021 
0022   //----------------------------
0023   // Process
0024   //
0025   // This is called for every event. Multiple threads may call this
0026   // simultaneously. If you write something to an output file here
0027   // then make sure to protect it with a mutex or similar mechanism.
0028   // Minimize what is done while locked since that directly affects
0029   // the multi-threaded performance.
0030   void Process(const std::shared_ptr<const JEvent>& event) override;
0031 
0032   //----------------------------
0033   // Finish
0034   //
0035   // This is called once after all events have been processed. You may,
0036   // for example, want to close an output file here.
0037   // Only one thread will call this.
0038   void Finish() override;
0039 
0040 private:
0041   TrackingOccupancyAnalysis m_occupancy_analysis;
0042   HitReconstructionAnalysis m_hit_reco_analysis;
0043 
0044   TDirectory* m_dir_main{}; /// Main TDirectory for this plugin 'occupancy_ana'
0045 
0046   std::shared_ptr<spdlog::logger> m_log;
0047 };