Iguana 0.0.0
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
iguana_ex_cpp_ROOT_macro.C
Go to the documentation of this file.
1
10
11#include <TSystem.h>
12#include <iguana/algorithms/physics/InclusiveKinematics/Algorithm.h>
13
16
17 // load the iguana algorithms library
18 gSystem->Load("libIguanaAlgorithms");
19
20 // start the inclusive kinematics algorithm
22 algo.Start();
23
24 // run the inclusive kinematics action function for a scattered electron lepton momentum,
25 // and print out the resulting inclusive kinematics
26 auto key = algo.PrepareEvent(5032);
27 auto result = algo.ComputeFromLepton(0.3, 0.3, 5.0, key);
28 std::cout << "kinematics:"
29 << "\n Q2 = " << result.Q2
30 << "\n x = " << result.x
31 << "\n W = " << result.W
32 << std::endl;
33
34 // stop the algorithm
35 algo.Stop();
36}
Algorithm: Calculate inclusive kinematics quantities defined in iguana::physics::InclusiveKinematicsV...
Definition Algorithm.h:54
void Stop() override
Finalize this algorithm after all events are processed.
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks
InclusiveKinematicsVars ComputeFromLepton(vector_element_t const lepton_px, vector_element_t const lepton_py, vector_element_t const lepton_pz, concurrent_key_t const key) const
Action Function: compute kinematics from the scattered lepton.
concurrent_key_t PrepareEvent(int const runnum, double const beam_energy=-1) const
Action Function: prepare the event
void iguana_ex_cpp_ROOT_macro()
example ROOT macro function