Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeptonID #232

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

LeptonID #232

wants to merge 24 commits into from

Conversation

MarianaT27
Copy link
Collaborator

No description provided.

src/iguana/algorithms/clas12/LeptonIDFilter/Algorithm.cc Outdated Show resolved Hide resolved
Comment on lines 9 to 18
double P;
double Theta;
double Phi;
double SFpcal;
double SFecin;
double SFecout;
double m2pcal;
double m2ecin;
double m2ecout;
double score;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either each one of these members needs to be documented, or you can use @doxygen_off and @doxygen_on to avoid having to write documentation here.

Comment on lines 21 to 45
///
/// @brief_algo This is a template algorithm, used as an example showing how to write an algorithm.
///
/// Provide a more detailed description of your algorithm here.
///
/// @begin_doc_algo{clas12::LeptonIDFilter | Filter}
/// @input_banks{REC::Particle}
/// @output_banks{REC::Particle}
/// @end_doc
///
/// @begin_doc_config
/// @config_param{exampleInt | int | an example `integer` configuration parameter}
/// @config_param{exampleDouble | double | an example `double` configuration parameter}
/// @end_doc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to document this algorithm; see other algorithms for examples.

Comment on lines 81 to 115
//Create TMVA reader
TMVA::Reader *readerTMVA = new TMVA::Reader();

///Set of variables for the reader
///Momentum
Float_t P;
///Theta angle
Float_t Theta;
///Phi angle
Float_t Phi;
///Sampling fraction on the PCAL
Float_t PCAL;
///Sampling fraction on the ECIN
Float_t ECIN;
///Sampling fraction on the ECOUT
Float_t ECOUT;
///Second-momenta of PCAL
Float_t m2PCAL;
///Second-momenta of ECIN
Float_t m2ECIN;
///Second-momenta of ECOUT
Float_t m2ECOUT;

/// @brief Add variables to the readerTMVA
readerTMVA->AddVariable( "P",&P );
readerTMVA->AddVariable( "Theta",&Theta);
readerTMVA->AddVariable( "Phi",&Phi);
readerTMVA->AddVariable( "SFPCAL",&PCAL);
readerTMVA->AddVariable( "SFECIN",&ECIN);
readerTMVA->AddVariable( "SFECOUT",&ECOUT );
readerTMVA->AddVariable( "m2PCAL",&m2PCAL);
readerTMVA->AddVariable( "m2ECIN",&m2ECIN);
readerTMVA->AddVariable( "m2ECOUT",&m2ECOUT);

readerTMVA->BookMVA( "BDT", o_weightfile_fullpath );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header should only declare the variables, not define them; the definitions could go in the Start() method in Algorithm.cc.

@c-dilks
Copy link
Member

c-dilks commented Jan 29, 2025

Hi @MarianaT27, I got this up-to-date with respect to the main branch. The tests for this algorithm are still crashing, however:

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x0000745461910887 in wait4 () from /usr/lib/libc.so.6
#1  0x00007454618609fb in ?? () from /usr/lib/libc.so.6
#2  0x000074546137bc48 in TUnixSystem::StackTrace() () from /home/dilks/builds/root/lib/libCore.so
#3  0x000074546137b584 in TUnixSystem::DispatchSignals(ESignals) () from /home/dilks/builds/root/lib/libCore.so
#4  <signal handler called>
#5  0x0000745460c6d958 in TMVA::Reader::EvaluateMVA(TString const&, double) () from /home/dilks/builds/root/lib/libTMVA.so
#6  0x0000745462a95450 in iguana::clas12::LeptonIDFilter::CalculateScore (this=0x5cf4b8a4a770, lepton_vars=...) at ../src/iguana/algorithms/clas12/LeptonIDFilter/Algorithm.cc:148
#7  0x0000745462a948b4 in operator()<hipo::bank, int> (__closure=0x5cf4b8a4be80, bank=<incomplete type>, row=0) at ../src/iguana/algorithms/clas12/LeptonIDFilter/Algorithm.cc:55
#8  0x0000745462a958ff in std::__invoke_impl<bool, iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)>&, hipo::bank&, int>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/14.2.1/bits/invoke.h:61
#9  0x0000745462a95780 in std::__invoke_r<bool, iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)>&, hipo::bank&, int>(struct {...} &) (__fn=...) at /usr/include/c++/14.2.1/bits/invoke.h:114
#10 0x0000745462a95637 in std::_Function_handler<bool(hipo::bank&, int), iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)> >::_M_invoke(const std::_Any_data &, hipo::bank &, int &&) (__functor=..., __args#0=..., __args#1=
0x7ffe051ea014: 0) at /usr/include/c++/14.2.1/bits/std_function.h:290
#11 0x00007454632fd94f in hipo::bank::rowlist::filter(std::function<bool (hipo::bank&, int)>) () from /home/dilks/j/install/lib/pkgconfig/../../lib/libhipo4.so
#12 0x0000745462a94aa9 in iguana::clas12::LeptonIDFilter::Run (this=0x5cf4b8a4a770, banks=warning: Type size unknown, assuming 1. Try casting to a known type, or void *.
#13 0x0000745462a38555 in iguana::AlgorithmSequence::Run (this=0x7ffe051ea240, banks=warning: Type size unknown, assuming 1. Try casting to a known type, or void *.
#14 0x00005cf47e7a7eda in TestAlgorithm (command="algorithm", algo_name="clas12::LeptonIDFilter", prerequisite_algos=std::vector of length 0, capacity 0, bank_names=std::vector of length 2, capacity 2 = {...}, data_file="/home/dilks/j/iguana/data.hipo", num_events=10, verbose=true) at ../src/iguana/tests/include/TestAlgorithm.h:55
#15 0x00005cf47e7a0985 in main (argc=12, argv=0x7ffe051eb1a0) at ../src/iguana/tests/iguana_test.cc:225
===========================================================


The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x0000745460c6d958 in TMVA::Reader::EvaluateMVA(TString const&, double) () from /home/dilks/builds/root/lib/libTMVA.so
#6  0x0000745462a95450 in iguana::clas12::LeptonIDFilter::CalculateScore (this=0x5cf4b8a4a770, lepton_vars=...) at ../src/iguana/algorithms/clas12/LeptonIDFilter/Algorithm.cc:148
#7  0x0000745462a948b4 in operator()<hipo::bank, int> (__closure=0x5cf4b8a4be80, bank=<incomplete type>, row=0) at ../src/iguana/algorithms/clas12/LeptonIDFilter/Algorithm.cc:55
#8  0x0000745462a958ff in std::__invoke_impl<bool, iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)>&, hipo::bank&, int>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/14.2.1/bits/invoke.h:61
#9  0x0000745462a95780 in std::__invoke_r<bool, iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)>&, hipo::bank&, int>(struct {...} &) (__fn=...) at /usr/include/c++/14.2.1/bits/invoke.h:114
#10 0x0000745462a95637 in std::_Function_handler<bool(hipo::bank&, int), iguana::clas12::LeptonIDFilter::Run(hipo::banklist&) const::<lambda(auto:28, auto:29)> >::_M_invoke(const std::_Any_data &, hipo::bank &, int &&) (__functor=..., __args#0=..., __args#1=
0x7ffe051ea014: 0) at /usr/include/c++/14.2.1/bits/std_function.h:290
#11 0x00007454632fd94f in hipo::bank::rowlist::filter(std::function<bool (hipo::bank&, int)>) () from /home/dilks/j/install/lib/pkgconfig/../../lib/libhipo4.so
#12 0x0000745462a94aa9 in iguana::clas12::LeptonIDFilter::Run (this=0x5cf4b8a4a770, banks=warning: Type size unknown, assuming 1. Try casting to a known type, or void *.
#13 0x0000745462a38555 in iguana::AlgorithmSequence::Run (this=0x7ffe051ea240, banks=warning: Type size unknown, assuming 1. Try casting to a known type, or void *.
#14 0x00005cf47e7a7eda in TestAlgorithm (command="algorithm", algo_name="clas12::LeptonIDFilter", prerequisite_algos=std::vector of length 0, capacity 0, bank_names=std::vector of length 2, capacity 2 = {...}, data_file="/home/dilks/j/iguana/data.hipo", num_events=10, verbose=true) at ../src/iguana/tests/include/TestAlgorithm.h:55
#15 0x00005cf47e7a0985 in main (argc=12, argv=0x7ffe051eb1a0) at ../src/iguana/tests/iguana_test.cc:225
===========================================================

This was produced by running the following command from the build directory:

src/iguana/tests/iguana_test algorithm -n 10 -a clas12::LeptonIDFilter -f [HIPO_FILE] -b REC::Particle -b REC::Calorimeter -v

where [HIPO_FILE] should be replaced by some test HIPO file. (this test also runs on the CI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Unsorted
Development

Successfully merging this pull request may close these issues.

2 participants