Back to home page

EIC code displayed by LXR

 
 

    


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

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