-
Notifications
You must be signed in to change notification settings - Fork 8
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
optimise cache usage and reduce class size #67
base: main
Are you sure you want to change the base?
Conversation
4681594
to
28fb415
Compare
gaudi_opts/clue_gaudi_wrapper.py
Outdated
@@ -27,11 +27,14 @@ | |||
from Configurables import PodioOutput | |||
from Configurables import ApplicationMgr | |||
|
|||
from os import environ | |||
build_path = environ["ENV_CMAKE_BINARY_DIR"] |
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.
This part is making CI fail. It should not be part of the script, at least not as it is. Setting a default name is fine but a default file with a hardcoded path won't be useful for someone else. You can pass the input file as it is being done now in the tests with --EventDataSvc.input
in https://github.com/key4hep/k4Clue/blob/main/src/k4clue/CMakeLists.txt#L45.
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 thought this would be general enough since the file is the one downloaded for the tests and the directory is the build directory, but it seems that in the CI the env variable is not set. I've commented it.
28fb415
to
61c0b0a
Compare
|
||
private: | ||
std::uint8_t m_detectorRegion{0}; | ||
std::uint64_t m_layer{}; |
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 don't know the details but this changed from 64 bits to 32 bits, I guess the layer can not be bigger than 32 bits?
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.
layer goes up to 40 right now (80 if we sum the endcap)
include/CLUENtuplizer.h
Outdated
delete m_clhits_z; | ||
delete m_clhits_energy; | ||
}; | ||
~CLUENtuplizer(){}; |
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.
~CLUENtuplizer(){}; |
If defining the destructor is not needed let's not define it since it's default one.
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'll change it
src/CLUENtuplizer.cpp
Outdated
@@ -98,6 +98,7 @@ StatusCode CLUENtuplizer::execute(const EventContext&) const { | |||
} else { | |||
throw std::runtime_error("CLUE hits collection not available"); | |||
} | |||
const auto& clue_calo_coll_vect = clue_calo_coll->vect; |
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.
This seems to be used only below when computing clusInBarrel
, then maybe move it down there to right before when it's needed so that the definition is close to where it's used?
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, sure! I probably had some code in the middle that I removed
gaudi_opts/clue_gaudi_wrapper.py
Outdated
#from os import environ | ||
#build_path = environ["ENV_CMAKE_BINARY_DIR"] | ||
|
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.
#from os import environ | |
#build_path = environ["ENV_CMAKE_BINARY_DIR"] |
Remove instead of introducing commented out code? I think this may be because you are running this steering file locally? But an argument can be passed in the command line as I mentioned above which is even faster than setting the env variable and commenting this in.
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 sure, no problem
src/CLUENtuplizer.cpp
Outdated
}); | ||
uint32_t offset = 0; | ||
if (clusInBarrel != clue_calo_coll_vect.end() && clusInBarrel->inBarrel()) | ||
offset = clusInBarrel->getClusterIndex() + 1; |
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.
This wasn't here before. Can you explain, for example in the release notes, what effect does this have or what is this used for? (Used later in m_hits_clusId
?
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.
that is a way to obtain the maximum cluster index in the barrel and add this offset to the endcap (thinking about it maybe I can do it in a better way..)
Hits from barrel and endcap are clustered in two separated steps, so we'll have clusters with indices 0, 1 .. in the barrel and 0, 1.. in the endcap. With this offset, the clusters indices will be unique.
I can add it to the release notes
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'll postpone this change to the PR where I'll also remove the if
statement that now prevents saving events where there is more than one MC Particle.
With that if
only events with one of few clusters are saved, so this fix is not really needed.
61c0b0a
to
03f9910
Compare
BEGINRELEASENOTES
operator<<
, reorder class members and do not returnconst&
for simple types inCLUECalorimeterHit
std::vector<T>
instead ofstd::vector<T>*
and add the cluster index to each hit in theCLUENtuplizer
clue_gaudi_wrapper.py
ENDRELEASENOTES