Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:17:05

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