Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:07:26

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