Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:16:24

0001 #pragma once
0002 
0003 #include <Acts/Geometry/GeometryContext.hpp>
0004 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0005 #include <JANA/JEvent.h>
0006 #include <JANA/JEventProcessor.h>
0007 #include <TDirectory.h>
0008 #include <spdlog/logger.h>
0009 #include <memory>
0010 
0011 #include "extensions/spdlog/SpdlogMixin.h"
0012 
0013 class GeometryNavigationSteps_processor
0014     : public JEventProcessor,
0015       public eicrecon::SpdlogMixin // this automates proper log initialization
0016 {
0017 public:
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   /// Directory to store histograms to
0046   TDirectory* m_dir_main{};
0047   Acts::GeometryContext m_geoContext;
0048   Acts::MagneticFieldContext m_fieldContext;
0049   std::shared_ptr<spdlog::logger> m_log;
0050 };