Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:03:00

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