Upstream muon collider calo digis.#253
Conversation
tmadlener
left a comment
There was a problem hiding this comment.
I don't have enough permissions here to actually launch workflows and I also didn't yet have time to actually look into the code in a lot of detail. I am very happy that this pulls over the RealisticCalo{Digi,Reco} family of processors though.
Having said that, we had quite some discussion in the Key4hep meeting on March 31 and one of the key outcomes was that we should try to avoid algorithm names like realistic or detailed but rather go for more descriptive algorithm names. I don't have an immediate idea for this family of algorithms, unfortunately.
|
Question (most likely to @samf25): Are these direct translations of the one from https://github.com/iLCSoft/MarlinReco/tree/master/CaloDigi/Realistic, or have there been MuonCollider specific changes applied to these? |
|
I'm pretty sure these are 1:1 translations |
tmadlener
left a comment
There was a problem hiding this comment.
Thanks a lot for starting this (and apologies up-front for once again being a bit pedantic and requesting quite a few changes).
CI is failing due to a sign comparison warning at the moment. Additionally, after #237 this will likely need some clang-format formatting to comply again.
There are a few general themes in the comments, but in general this looks pretty good to me already. The one thing that we will need to fix is the naming. Still no really good idea, as a basis for discussion:
RealisticCaloDigi(base class) ->ElectronicsSignalDigi(maybe include aBasesuffix as well?)RealisticCaloReco(base class) ->ElectronicsSignalReco
(and then similar for the others). This is all up for discussion, these are just some initial proposals, maybe others have better ideas.
Finally, there is quite some documentation about this here: https://github.com/iLCSoft/MarlinReco/tree/master/CaloDigi/Realistic/doc After all my proposed changes that is probably no longer accurate (or even less accurate than it is now), so my suggestion would be to bring that over in a separate PR, because it's also not entirely clear to me where that should go.
|
|
||
| #include <iostream> | ||
|
|
||
| /** Helper class for decoding/encoding lcio::CalorimeterHit types for the ILD |
There was a problem hiding this comment.
@jmcarcell we already have this in k4GaudiPandora, right? Can we somehow make this available to both without having to copy things?
On a bigger picture, this looks like something that we should potentially revisit (also @BrieucF) as it is very much geared towards CALICE like detectors, resp. ILC / CLIC conventions and might fall apart with other CellID encoding strings.
Hence, also connected to key4hep/k4geo#568
| struct FilterDoubleLayerHits : public k4FWCore::Transformer<edm4hep::TrackerHitPlaneCollection( | ||
| const edm4hep::TrackerHitPlaneCollection &)> { |
There was a problem hiding this comment.
This looks like it is more tracking related (and then should probably go to https://github.com/key4hep/k4RecTracker).
Without having looked into any details about its usage yet, why is it in this PR?
| /** Called after data processing for clean up. | ||
| */ | ||
| StatusCode finalize(); |
There was a problem hiding this comment.
| /** Called after data processing for clean up. | |
| */ | |
| StatusCode finalize(); |
This doesn't seem to do anything (in the implementation file).
| using integr_function = std::function<integr_res_opt(const edm4hep::SimCalorimeterHit*)>; | ||
|
|
||
| virtual float EnergyDigi(float energy, float event_correl_miscalib) const; | ||
| virtual integr_res_opt Integrate( const edm4hep::SimCalorimeterHit * hit ) const; | ||
|
|
||
| integr_res_opt StandardIntegration( const edm4hep::SimCalorimeterHit * hit ) const ; | ||
| integr_res_opt ROCIntegration( const edm4hep::SimCalorimeterHit * hit ) const ; |
There was a problem hiding this comment.
All of these functions can just take the edm4hep::SimCalorimeterHit by value or const reference. There is no need to turn it into a pointer (which was probably done because in LCIO you only get pointers).
Additionally (also due to where this comes from likely), these functions should probably be camel cased to follow our usual conventions.
| using integr_res_opt = std::optional<integr_res>; | ||
| using integr_function = std::function<integr_res_opt(const edm4hep::SimCalorimeterHit*)>; | ||
|
|
||
| virtual float EnergyDigi(float energy, float event_correl_miscalib) const; |
There was a problem hiding this comment.
I don't think this is used in a way that requires it to be virtual. All inheriting classes implement the virtual functions below.
| virtual float EnergyDigi(float energy, float event_correl_miscalib) const; | |
| float EnergyDigi(float energy, float event_correl_miscalib) const; |
| std::string initString; | ||
| initString = m_geoSvc->constantAsString(m_encodingStringVariable.value()); | ||
| dd4hep::DDSegmentation::BitFieldCoder bitFieldCoder(initString); // check! |
There was a problem hiding this comment.
Can also go to a member variable and then be populated once in initialize.
| RecCaloDigi | ||
| Gaudi::GaudiKernel | ||
| EDM4HEP::edm4hep | ||
| k4FWCore::k4FWCore | ||
| k4FWCore::k4Interface | ||
| DD4hep::DDCore | ||
| DD4hep::DDRec | ||
| ROOT::Core | ||
| ROOT::Hist | ||
| CLHEP::Random |
There was a problem hiding this comment.
In principle many of these dependencies are transitively pulled in via RecCaloDigi, but I have nothing against being explicit here.
| } else if (m_threshold_unit.value().compare("px") == 0){ | ||
| m_threshold_iunit=NPE; | ||
| } else { | ||
| error() << "could not identify threshold unit. Please use \"GeV\", \"MIP\" or \"px\"! Aborting." << endmsg; |
There was a problem hiding this comment.
This does not abort yet. It would have to return a StatusCode::FAILURE for that.
| error() << "Could not guess timing calculation method!" << endmsg; | ||
| error() << "Available are: Standard, ROC. Provided: " << m_integration_method << endmsg; | ||
| error() << "Aborting..." << endmsg; |
| error() << "Fast/slow shaper parameter(s) not set. Required for ROC integration!" << endmsg; | ||
| error() << "Aborting..." << endmsg; |
There was a problem hiding this comment.
and once more, not aborting.
Personally I'm not 100% clear on why the second step is referred to as reco. I overall find it a bit misleading, since all this algorithm does is converting an absolute MIP scale into a particle level energy calibration. Perhaps one could refer these two as:
|
This is the second of some amount smaller PRs, designed to split up PR key4hep/k4Reco#50 into more manageable pieces. This PR includes changes to calorimeter digis used by the muon collider project in k4Reco, but being redirected here (see: key4hep/k4Reco#51 (comment)). The original work was done by @samf25. I have renamed
CaloDigitoRecCaloDigito try and fit what I guess is the naming theme here, but I am entirely flexible on this point. The CMake file was added by me (although written by Claude, my CMake is still rudimentary at best) based on what seems to be the CMake architecture of this repository, with each distinct directory having it's own file. This CMake file works for me and compiles completely on lxplus using the latest nightly release.As before, this is largely being opened for discussion to start the process of muon collider forks, if the ultimate PR requires a selected subset of these changes, that is something that can be discussed. This PR is being opened in draft because this is not strictly a key4hep repository, and I am not sure that this is a dependency the muon collider would like to add.
@tmadlener @madbaron @samf25, FYI
BEGINRELEASENOTES
ENDRELEASENOTES