Iguana LATEST
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
iguana::clas12::rga::ProtonEnergyLossCorrection Class Reference

#include <Algorithm.h>

Detailed Description

Algorithm: Apply period-dependent momentum/angle corrections to reconstructed protons in REC::Particle

Input and Output Banks:
See Run function(s) for the banks that are processed by this algorithm.
Type: Transformer
This algorithm will change values within input bank(s).

This algorithm modifies REC::Particle in place.

For each REC::Particle row:

  • selects protons (pid == 2212)
  • classifies the track as FD vs CD using the status code
  • determines the run period from RUN::config::run
  • computes (p, theta, phi) from (px, py, pz)
  • applies period- and region-dependent corrections (configured in YAML)
  • writes corrected (px, py, pz) back to the bank
Configuration Options:
YAML configuration, which includes the default option values:
clas12::rga::ProtonEnergyLossCorrection:
periods:
rga_sp18_inb:
run_ranges:
- [3031, 3087]
- [3306, 3817]
- [4003, 4325]
FD:
A_p: [0.0146275, -0.00124929, 3.64154e-05]
B_p: [-0.00743169, 0.000458648, -6.45703e-06]
C_p: [0.0175282, -0.00128554, 3.5249e-05]
A_theta: [0.0]
B_theta: [0.0]
C_theta: [0.0]
A_phi: [0.0]
B_phi: [0.0]
C_phi: [0.0]
CD:
A_p: [-0.229055, 0.00924571, -9.09927e-05]
B_p: [0.371002, -0.0146818, 0.000146548]
C_p: [-0.174565, 0.00680452, -6.9e-05]
A_theta: [0.0]
B_theta: [0.0]
C_theta: [0.0]
A_phi: [0.0]
B_phi: [0.0]
C_phi: [0.0]
rga_sp18_out:
run_ranges:
- [3103, 3293]
- [3820, 3987]
FD:
A_p: [0.00523188, -9.43614e-05]
B_p: [-0.00887291, 0.000759277]
C_p: [0.0]
A_theta: [0.0]
B_theta: [0.0]
C_theta: [0.0]
A_phi: [0.0]
B_phi: [0.0]
C_phi: [0.0]
CD:
A_p: [-0.204359, 0.00857339, -8.79867e-05]
B_p: [0.402543, -0.0168624, 0.000178539]
C_p: [-0.217865, 0.00908787, -9.77617e-05]
A_theta: [0.0]
B_theta: [0.0]
C_theta: [0.0]
A_phi: [0.0]
B_phi: [0.0]
C_phi: [0.0]
rga_fa18_inb:
run_ranges:
- [4763, 5419]
FD:
A_p: [0.0099626, -0.0002414, -2.0e-06]
B_p: [-0.01428267, 0.00042833, 1.081e-05]
C_p: [0.01197102, -0.00055673, 7.85e-06]
A_theta: [0.0683831, -0.0083821, 0.0001670]
B_theta: [-0.15834256, 0.02630760, -0.00064126]
C_theta: [0.11587509, -0.01679559, 0.00038915]
A_phi: [0.0416510, -0.0064212, 0.0000622]
B_phi: [0.28414191, -0.00047647, 0.00010357]
C_phi: [-0.25690893, 0.00886707, -0.00016081]
CD:
A_p: [-0.2383991, 0.0124992, -0.0001646]
B_p: [0.60123885, -0.03128464, 0.00041314]
C_p: [-0.44080146, 0.02209857, -0.00028224]
A_theta: [0.1000890, -0.0039222, 0.0000359]
B_theta: [-0.0130680, 0.0004545, -0.0000026]
C_theta: [0.0]
A_phi: [0.0776934, -0.0059632, 0.0000749]
B_phi: [-0.31582008, 0.01649220, -0.00018505]
C_phi: [0.10909746, -0.00530642, 0.00005627]
rga_fa18_out:
run_ranges:
- [5423, 5666]
FD:
A_p: [0.0135790, -0.0005303]
B_p: [-0.02165929, 0.00121123]
C_p: [0.0]
A_theta: [-0.3715486, 0.0272810, -0.0006278, 0.0000040]
B_theta: [2.00009939, -0.20781779, 0.00721092, -0.00008343]
C_theta: [0.0]
A_phi: [-0.9701486, 0.1213124, -0.0049215, 0.0000640]
B_phi: [2.85034691, -0.34405076, 0.01347377, -0.00016663]
C_phi: [0.0]
CD:
A_p: [-0.1927861, 0.0099546, -0.0001299]
B_p: [0.44307822, -0.02309469, 0.00030784]
C_p: [-0.32938000, 0.01648659, -0.00021181]
A_theta: [0.0581473, -0.0021818, 0.0000181]
B_theta: [0.00915748, -0.00040748, 0.00000562]
C_theta: [0.0]
A_phi: [-0.0733814, 0.0010335, -0.0000044]
B_phi: [-0.06127800, 0.00492239, -0.00005683]
C_phi: [0.02586507, -0.00160176, 0.00001642]
rga_sp19_inb:
run_ranges:
- [6616, 6783]
FD:
A_p: [0.0095205, -0.0001914, -0.0000031]
B_p: [-0.01365658, 0.00036322, 0.00001217]
C_p: [0.01175256, -0.00053407, 0.00000742]
A_theta: [0.0723069, -0.0085078, 0.0001702]
B_theta: [-0.16048057, 0.02561073, -0.00062158]
C_theta: [0.10954630, -0.01566605, 0.00036132]
A_phi: [0.0486986, -0.0067579, 0.0000638]
B_phi: [0.26803189, 0.00016245, 0.00010433]
C_phi: [-0.24522460, 0.00826646, -0.00015640]
CD:
A_p: [-0.2716918, 0.0142491, -0.0001862]
B_p: [0.65945101, -0.03431360, 0.00045036]
C_p: [-0.46602726, 0.02335623, -0.00029720]
A_theta: [0.2550377, -0.0107983, 0.0001116]
B_theta: [-0.14022533, 0.00596067, -0.00006172]
C_theta: [0.0]
A_phi: [-0.5459156, 0.0219868, -0.0002349]
B_phi: [0.74223687, -0.03037065, 0.00032761]
C_phi: [-0.29798258, 0.01246744, -0.00013525]

Definition at line 48 of file Algorithm.h.

Public Member Functions

bool Run (hipo::bank &rec, hipo::bank const &run) const
 Run Function: Process an event's hipo::bank objects
Momentum3 Transform (int const pid, int const status, int const run, vector_element_t const px, vector_element_t const py, vector_element_t const pz) const
 Action Function:
Public Member Functions inherited from iguana::Algorithm
 Algorithm (std::string_view name)
std::string GetAlgorithmDir () const
hipo::banklist::size_type GetBankIndex (hipo::banklist &banks, std::string const &bank_name) const noexcept(false)
std::unique_ptr< YAMLReader > const & GetConfig () const
hipo::bank GetCreatedBank (std::string const &bank_name="") const noexcept(false)
hipo::banklist::size_type GetCreatedBankIndex (hipo::banklist &banks) const noexcept(false)
std::string GetCreatedBankName () const noexcept(false)
std::vector< std::string > GetCreatedBankNames () const noexcept(false)
hipo::schema GetCreatedBankSchema (std::string const &bank_name="") const noexcept(false)
unsigned int GetCreatedBankVariant () const
std::string GetModelFile (std::string const &name)
YAML::Node GetOptionNode (YAMLReader::node_path_t node_path) const
template<typename OPTION_TYPE>
OPTION_TYPE GetOptionScalar (YAMLReader::node_path_t node_path={}) const
template<typename OPTION_TYPE>
std::set< OPTION_TYPE > GetOptionSet (YAMLReader::node_path_t node_path={}) const
template<typename OPTION_TYPE>
std::vector< OPTION_TYPE > GetOptionVector (YAMLReader::node_path_t node_path={}) const
std::unique_ptr< RCDBReader > & GetRCDBReader ()
virtual bool Run (hipo::banklist &banks) const final
 Run Function: Process an event's hipo::banklist
void SetConfig (std::unique_ptr< YAMLReader > &&yaml_config)
void SetConfigDirectory (std::string const &name)
void SetConfigFile (std::string const &name)
void SetName (std::string_view name)
template<typename OPTION_TYPE>
OPTION_TYPE SetOption (std::string const &key, const OPTION_TYPE val)
 Set an option specified by the user.
virtual void Start () final
 Start Function: Initialize this algorithm before any events are processed, with the intent to process either hipo::bank objects or bank rows, rather than full hipo::banklist objects
virtual void Start (hipo::banklist &banks) final
 Start Function: Initialize this algorithm before any events are processed, with the intent to process hipo::banklist objects
virtual void Stop () final
 Stop Function: Finalize this algorithm after all events are processed.
Public Member Functions inherited from iguana::Object
 Object (std::string_view name="", Logger::Level lev=Logger::DEFAULT_LEVEL)
std::unique_ptr< Logger > & GetLog ()
std::string GetName () const
std::unique_ptr< Logger > & Log ()
void SetLogLevel (Logger::Level const lev)
void SetLogLevel (std::string_view lev)
void SetName (std::string_view name)

Additional Inherited Members

Protected Member Functions inherited from iguana::Algorithm
hipo::schema CreateBank (hipo::banklist &banks, hipo::banklist::size_type &bank_idx, std::string const &bank_name) noexcept(false)
hipo::bank & GetBank (hipo::banklist &banks, hipo::banklist::size_type const idx, std::string const &expected_bank_name="") const noexcept(false)
void ShowBank (hipo::bank const &bank, std::string_view message="", Logger::Level const level=Logger::trace) const
void ShowBanks (hipo::banklist const &banks, std::string_view message="", Logger::Level const level=Logger::trace) const
void StartRCDBReader ()
 Instantiate the RCDBReader instance for this algorithm.
void ThrowSinceRenamed (std::string const &new_name, std::string const &version) const noexcept(false)
Protected Attributes inherited from iguana::Algorithm
std::string m_class_name
 Class name of this algorithm.
unsigned int m_created_bank_variant {0}
std::string m_default_config_file
 Default configuration file name.
std::mutex m_mutex
 A mutex for this algorithm.
std::unique_ptr< RCDBReaderm_rcdb
 RCDB reader.
bool m_rows_only
 If true, algorithm can only operate on bank rows; Algorithm::GetBank, and therefore Algorithm::Run, cannot be called.
std::string o_user_config_dir
std::string o_user_config_file
Protected Attributes inherited from iguana::Object
std::unique_ptr< Loggerm_log
 Logger instance for this object
std::string m_name
 The name of this object.
Inheritance diagram for iguana::clas12::rga::ProtonEnergyLossCorrection:
Inheritance graph

Member Function Documentation

◆ Run()

bool iguana::clas12::rga::ProtonEnergyLossCorrection::Run ( hipo::bank & rec,
hipo::bank const & run ) const

Run Function: Process an event's hipo::bank objects

The parameter list explains which banks are input ("in"), output ("out"), or both ("in,out").

Parameters
recREC::Particle bank (mutated in place)
runRUN::config bank (read-only; used for run number)
Returns
true, i.e., this Run function does not provide an event-level filter

◆ Transform()

Momentum3 iguana::clas12::rga::ProtonEnergyLossCorrection::Transform ( int const pid,
int const status,
int const run,
vector_element_t const px,
vector_element_t const py,
vector_element_t const pz ) const

Action Function:

Function Type
scalar transformer
Parameters
pidPDG ID (correct only protons: 2212)
statusREC::Particle status code (used to identify detector)
runrun number (selects the period and coefficients)
pxmomentum x component (GeV)
pymomentum y component (GeV)
pzmomentum z component (GeV)
Returns
corrected (px,py,pz)

The documentation for this class was generated from the following file:
  • /builds/hallb/clas12/iguana/src/iguana/algorithms/clas12/rga/ProtonEnergyLossCorrection/Algorithm.h