-
Notifications
You must be signed in to change notification settings - Fork 199
Adding of a function to obtain MC indices array and a parents tuples … #112
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
Open
Tristan63170
wants to merge
7
commits into
HEP-FCC:master
Choose a base branch
from
Tristan63170:MC_index
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9be6927
Adding of a function to obtain MC indices array and a parents tuples …
8a792c4
Update MCParticle.h
Tristan63170 62ead18
Update MCParticle.cc
Tristan63170 f2a931a
Update MCParticle.h
Tristan63170 62c03bb
Update MCParticle.cc
Tristan63170 9d9c3f0
Update MCParticle.cc
Tristan63170 519a363
Update MCParticle.h
Tristan63170 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,8 @@ namespace MCParticle{ | |
| bool m_chargeconjugate = true; | ||
| ROOT::VecOps::RVec<edm4hep::MCParticleData> operator() (ROOT::VecOps::RVec<edm4hep::MCParticleData> in); | ||
| }; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove 2 spaces |
||
|
|
||
|
|
||
| /// get MC history tree for a given MCParticle index | ||
| struct get_tree{ | ||
|
|
@@ -91,6 +93,8 @@ namespace MCParticle{ | |
| ROOT::VecOps::RVec<edm4hep::MCParticleData> in , | ||
| ROOT::VecOps::RVec<int> ind); | ||
|
|
||
| /// return indices of MC particles | ||
| ROOT::VecOps::RVec<int> get_index(ROOT::VecOps::RVec<edm4hep::MCParticleData> mc); | ||
|
|
||
| /// return the parent index of a given list of MC particles | ||
| ROOT::VecOps::RVec<int> get_parentid(ROOT::VecOps::RVec<int> mcind, ROOT::VecOps::RVec<edm4hep::MCParticleData> mc, ROOT::VecOps::RVec<int> parents); | ||
|
|
@@ -200,7 +204,8 @@ namespace MCParticle{ | |
| ROOT::VecOps::RVec<edm4hep::MCParticleData> in, | ||
| ROOT::VecOps::RVec<int> ind) ; | ||
|
|
||
|
|
||
| /// return a sub list of MCParticles from a given list of indices | ||
| ROOT::VecOps::RVec<edm4hep::MCParticleData> get_subMC(ROOT::VecOps::RVec<int> index, ROOT::VecOps::RVec<edm4hep::MCParticleData> in); | ||
|
|
||
|
|
||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the point of this function, it just return the list of indices of the collection. The result will always be a vector of int between 0 and size-1. Why is that needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was needed to be able to use the MCParticle::get_parentid() method directly on the MC sample (the list of indices is an input of this method).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I understand that but I think this is something that could go in the define directly, After checking with RDF experts, seems something like this should be the most efficient way:
df.Define("idxs", "RVecI v(sz); std::iota(...); return v;")There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see, interesting , it is another way to do that directly in the analysis.py script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you check it does work the same and remove the corresponding C++ code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I try to use std::iota in the analysis.py, the following error occurred:
input_line_101:2:108: error: no matching function for call to 'iota'
auto lambda21 = [](ROOT::VecOps::RVecedm4hep::MCParticleData& var0){ROOT::RVecI list_index(var0.size()); std::iota(list_index,list_index+list_index.size(),0); return list_index;
^~~~~~~~~
/cvmfs/sw.hsf.org/contrib/gcc/11.2.0/x86_64-centos7-gcc8.3.0-opt/d3epy/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_numeric.h:88:5: note: candidate template ignored: deduced conflicting types for parameter '_ForwardIterator' ('RVec' vs. 'RVec')
iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
^
python3: /tmp/gitlab-runner/spack-stage/spack-stage-root-6.26.02-oqvm2mao7vull7th2vj4tmyo3i4jqsdp/spack-src/interpreter/llvm/src/tools/clang/lib/AST/DeclCXX.cpp:1391: clang::CXXMethodDecl* clang::CXXRecordDecl::getLambdaCallOperator() const: Assertion
!Calls.empty() && "Missing lambda call operator!"' failed. *** Break *** abort ^Cinput_line_102:2:108: error: no matching function for call to 'iota' auto lambda21 = [](ROOT::VecOps::RVec<edm4hep::MCParticleData>& var0){ROOT::RVecI list_index(var0.size()); std::iota(list_index,list_index+list_index.size(),0); return list_index; ^~~~~~~~~ /cvmfs/sw.hsf.org/contrib/gcc/11.2.0/x86_64-centos7-gcc8.3.0-opt/d3epy/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/stl_numeric.h:88:5: note: candidate template ignored: deduced conflicting types for parameter '_ForwardIterator' ('RVec<int>' vs. 'RVec<unsigned long>') iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) ^ python3: /tmp/gitlab-runner/spack-stage/spack-stage-root-6.26.02-oqvm2mao7vull7th2vj4tmyo3i4jqsdp/spack-src/interpreter/llvm/src/tools/clang/lib/AST/DeclCXX.cpp:1391: clang::CXXMethodDecl* clang::CXXRecordDecl::getLambdaCallOperator() const: Assertion!Calls.empty() && "Missing lambda call operator!"' failed.*** Break *** abort
I have certainly something wrong but I don't understand what, have you any idea ?
thanks