Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:17:59

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