Iguana 1.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
18 // load the iguana algorithms library
19 gSystem->Load("libIguanaAlgorithms");
20
21 // start the inclusive kinematics algorithm
23 algo.Start();
24
25 // run the inclusive kinematics action function for a scattered electron lepton momentum,
26 // and print out the resulting inclusive kinematics
27 auto key = algo.PrepareEvent(5032);
28 auto result = algo.ComputeFromLepton(0.3, 0.3, 5.0, key);
29 std::cout << "kinematics:"
30 << "\n Q2 = " << result.Q2
31 << "\n x = " << result.x
32 << "\n W = " << result.W
33 << std::endl;
34
35 // stop the algorithm
36 algo.Stop();
37}
Algorithm: Calculate inclusive kinematics quantities
Definition Algorithm.h:20
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