Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 John Lajoie
0003 
0004 #pragma once
0005 
0006 #include <JANA/JEvent.h>
0007 #include <edm4hep/MCParticleCollection.h>
0008 #include <edm4eic/InclusiveKinematicsCollection.h>
0009 #include <edm4eic/ReconstructedParticleCollection.h>
0010 #include <memory>
0011 #include <string>
0012 #include <utility>
0013 #include <vector>
0014 
0015 #include "algorithms/reco/TransformBreitFrame.h"
0016 #include "extensions/jana/JOmniFactory.h"
0017 #include "services/algorithms_init/AlgorithmsInit_service.h"
0018 
0019 namespace eicrecon {
0020 
0021     class TransformBreitFrame_factory : public JOmniFactory<TransformBreitFrame_factory> {
0022 
0023     public:
0024       // algorithm to run
0025       using Algo = eicrecon::TransformBreitFrame;
0026     private:
0027       std::unique_ptr<Algo> m_algo;
0028 
0029       // input collection
0030       PodioInput<edm4hep::MCParticle> m_in_mcpart {this};
0031       PodioInput<edm4eic::InclusiveKinematics> m_in_kine {this};
0032       PodioInput<edm4eic::ReconstructedParticle> m_in_part {this};
0033 
0034       // output collection
0035       PodioOutput<edm4eic::ReconstructedParticle> m_out_part {this};
0036 
0037       Service<AlgorithmsInit_service> m_algorithmsInit {this};
0038 
0039     public:
0040 
0041       void Configure() {
0042         m_algo = std::make_unique<Algo>(GetPrefix());
0043         m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0044         m_algo->init();
0045       }
0046 
0047       void ChangeRun(int64_t run_number) {
0048         /* nothing to do */
0049       }
0050 
0051       void Process(int64_t run_number, int64_t event_number) {
0052         m_algo->process(
0053           {m_in_mcpart(),m_in_kine(),m_in_part()},
0054           {m_out_part().get()}
0055         );
0056       }
0057 
0058     };  // end TransfromBreitFrame_factory definition
0059 
0060 }  // end eicrecon namespace