Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:08

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