[MUONDigi] Adding a digitizer of IDEA Muon system.#24
[MUONDigi] Adding a digitizer of IDEA Muon system.#24mahmoudali2 wants to merge 14 commits intokey4hep:mainfrom
Conversation
Add missing GaudiAlgLib
BrieucF
left a comment
There was a problem hiding this comment.
Very nice Mahmoud! Here are already a few questions/comments
|
|
||
| datatypes: | ||
|
|
||
| extension::MCRecoMuonSystemDigiAssociation: |
There was a problem hiding this comment.
Why not using MCRecoTrackerAssociation https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L634 ?
There was a problem hiding this comment.
Can it be used for linking between digi and sim? I fount it relates between reco and sim..
On another hand I'd like to see if there is an association also to store the validation data (e.g: simDigipPositionDifference)
| // Detector efficiency | ||
| FloatProperty m_efficiency{this, "efficiency", 0.95, "Detector efficiency"}; | ||
|
|
||
| // Declaration of validation distribution |
There was a problem hiding this comment.
Can you add a flag, set to false by default, to produce these collections? See e.g. https://github.com/key4hep/k4RecTracker/blob/master/DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h#L78 (the branch will unfortunately still be there I am afraid)
There was a problem hiding this comment.
would a set of output histograms be enough?
| DataHandle<podio::UserDataCollection<double>> m_simDigiDifferenceZ{"simDigiDifferenceZ", Gaudi::DataHandle::Writer, this}; // mm | ||
|
|
||
| // Random Number Service | ||
| IRndmGenSvc* m_randSvc; |
There was a problem hiding this comment.
@jmcarcell let us know if a consensus was reached on which random number generator we should use
There was a problem hiding this comment.
I am not sure if this the best example, but at least it works. The generator must be defined as thread local and distributions as mutable [link].
Later, for each event, remember to reset the internal state of the pseudorandom generator(s) that you may use, in a reproducible manner using the UID service [link]
| // y resolution in mm | ||
| FloatProperty m_y_resolution{this, "yResolution", 1.0, "Spatial resolution in the y direction [mm]"}; | ||
|
|
||
| // z resolution in mm |
There was a problem hiding this comment.
I don't understand why we need 3 numbers here. Since you do the smearing in local coordinates (as it should), 2 numbers should be sufficient no? OR at least we should put ine by default to 0, otherwise we really smear in the 3 dimensions.
atolosadelgado
left a comment
There was a problem hiding this comment.
Hi @mahmoudali2
thank you for this PR. I made few comments, but we can talk offline further if you want :)
| // EDM4HEP | ||
| #include "edm4hep/SimTrackerHitCollection.h" | ||
| #include "edm4hep/TrackCollection.h" | ||
| #if __has_include("edm4hep/TrackerHit3DCollection.h") |
There was a problem hiding this comment.
maybe a version check would be enough? @jmcarcell can you help here?
| #include "edm4hep/TrackerHitCollection.h" | ||
|
|
||
| namespace edm4hep { | ||
| using TrackerHit3DCollection = edm4hep::TrackerHitCollection; |
There was a problem hiding this comment.
version check as well?
| /** @class MUONsimpleDigitizer | ||
| * | ||
| * Algorithm for creating digitized Muon system hits (still based on edm4hep::TrackerHit3D) from edm4hep::SimTrackerHit. | ||
| * You have to specify the expected resolution in z and in xy. |
There was a problem hiding this comment.
does it perform only position smearing or also detection efficiency with a russian roulette method?
| * | ||
| */ | ||
|
|
||
| class MUONsimpleDigitizer : public GaudiAlgorithm { |
There was a problem hiding this comment.
I guess the GaudiAlgorithm class will be maintained for some time, @jmcarcell do you think it is worth to move this algorithm to a Gaudi functional?
| // Detector efficiency | ||
| FloatProperty m_efficiency{this, "efficiency", 0.95, "Detector efficiency"}; | ||
|
|
||
| // Declaration of validation distribution |
There was a problem hiding this comment.
would a set of output histograms be enough?
| DataHandle<podio::UserDataCollection<double>> m_simDigiDifferenceZ{"simDigiDifferenceZ", Gaudi::DataHandle::Writer, this}; // mm | ||
|
|
||
| // Random Number Service | ||
| IRndmGenSvc* m_randSvc; |
There was a problem hiding this comment.
I am not sure if this the best example, but at least it works. The generator must be defined as thread local and distributions as mutable [link].
Later, for each event, remember to reset the internal state of the pseudorandom generator(s) that you may use, in a reproducible manner using the UID service [link]
| auto simDigiDifferenceZ = m_simDigiDifferenceZ.createAndPut(); | ||
|
|
||
| for (const auto& input_sim_hit : *input_sim_hits) { | ||
| // Apply efficiency |
There was a problem hiding this comment.
please add this efficiency feature in the doxigen description in the class
| debug() << "Digitisation of " << m_readoutName << ", cellID: " << cellID << endmsg; | ||
| // auto cellDetElement = m_volman.lookupDetElement(cellID); | ||
|
|
||
| const auto& stripsTransformMatrix = m_volman.lookupVolumePlacement(cellID).matrix(); |
There was a problem hiding this comment.
maybe using the segmentation position and cellID functions [link] give the same functionality without the overhead of the volume manager?
BEGINRELEASENOTES
Defining a first draft for the muon system digitizer, which can do the following tasks:
ENDRELEASENOTES