-
Notifications
You must be signed in to change notification settings - Fork 14
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
[MUONDigi] Adding a digitizer of IDEA Muon system. #24
base: master
Are you sure you want to change the base?
Conversation
Add missing GaudiAlgLib
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.
Very nice Mahmoud! Here are already a few questions/comments
|
||
datatypes: | ||
|
||
extension::MCRecoMuonSystemDigiAssociation: |
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.
Why not using MCRecoTrackerAssociation
https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L634 ?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmcarcell let us know if a consensus was reached on which random number generator we should use
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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