Skip to content

Commit

Permalink
test: try it
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 28, 2024
1 parent 6c9c250 commit ae05cdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/iguana/algorithms/physics/InclusiveKinematics/Algorithm.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "Algorithm.h"
#include "iguana/services/RCDBReader.h"

// ROOT
#include <Math/Vector4D.h>
Expand Down Expand Up @@ -33,6 +32,9 @@ namespace iguana::physics {
i_qz = result_schema.getEntryOrder("qz");
i_qE = result_schema.getEntryOrder("qE");

// instantiate RCDB reader
m_rcdb = std::make_unique<RCDBReader>("RCDB|" + GetName());

// parse config file
ParseYAMLConfig();
o_runnum = ConcurrentParamFactory::Create<int>();
Expand Down Expand Up @@ -177,8 +179,12 @@ namespace iguana::physics {
m_log->Trace("-> calling Reload({}, {})", runnum, key);
o_runnum->Save(runnum, key);

// get the beam energy //////////////////////////////////////////////////////////
auto beam_energy = m_rcdb->GetBeamEnergy(runnum);
m_log->Error("Beam energy = {}", beam_energy);
/////////////////////////////////////////////////////////////////////////////////

// parse config params
auto beam_energy = GetOptionScalar<double>("beam_energy", {"initial_state", GetConfig()->InRange("runs", runnum), "beam_energy"});
auto beam_direction = GetOptionVector<double>("beam_direction", {"initial_state", GetConfig()->InRange("runs", runnum), "beam_direction"});
auto target_particle = GetOptionScalar<std::string>("target_particle", {"initial_state", GetConfig()->InRange("runs", runnum), "target_particle"});

Expand Down
3 changes: 3 additions & 0 deletions src/iguana/algorithms/physics/InclusiveKinematics/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "iguana/algorithms/Algorithm.h"
#include "iguana/algorithms/TypeDefs.h"
#include "iguana/services/ConcurrentParam.h"
#include "iguana/services/RCDBReader.h"

namespace iguana::physics {

Expand Down Expand Up @@ -114,6 +115,8 @@ namespace iguana::physics {
enum method_lepton_finder { highest_energy_FD_trigger };
method_reconstruction o_method_reconstruction;
method_lepton_finder o_method_lepton_finder;

std::unique_ptr<RCDBReader> m_rcdb;
};

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
physics::InclusiveKinematics:

initial_state: # FIXME: add run ranges
initial_state:
- default:
beam_energy: 10.6
beam_direction: [ 0.0, 0.0, 1.0 ]
target_particle: proton

Expand Down

0 comments on commit ae05cdf

Please sign in to comment.