Skip to content
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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

mahmoudali2
Copy link
Member

BEGINRELEASENOTES

Defining a first draft for the muon system digitizer, which can do the following tasks:

  • Smearing the simHits in 2 Dimensions in the local coordinates of the chamber and applying the changes to the global coordinates of the Hits.
  • Emulating the efficiency of the chamber.
  • The generated root file will have branches to validate the smearing (Differences between DigiHits and SimHits in global coordinates).

ENDRELEASENOTES

Copy link
Collaborator

@BrieucF BrieucF left a 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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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
Copy link
Collaborator

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)

Copy link
Collaborator

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;
Copy link
Collaborator

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

Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Collaborator

@atolosadelgado atolosadelgado left a 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")
Copy link
Collaborator

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;
Copy link
Collaborator

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.
Copy link
Collaborator

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 {
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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
Copy link
Collaborator

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();
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants