AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
47 stars 91 forks source link

SimHits versus RecHits #1031

Closed saraheno closed 10 months ago

saraheno commented 1 year ago
    @saraheno I am not sure about the program timing. I think there is nothing wrong with the code as well, but

there is simply a lack of understanding what the various parameters really mean and what their value should be when they enter Geant4 -- for some I even had to guess the units for the conversion from TGeo to Geant4. If the parameters entering the game are far from what G4 expects, anything could go wrong.

For rechits or user defined hits, see examples/DDG4_MySensDet Have a look how the dictionary for the MyTrackerhits is build. This should be all you need to e.g. save a vector<MyTrackerHits(*)> to a root tree. There is also the possibility to add a data structure to the Geant4Hit structure. This structure of course when it comes to persistency must be embedded in a user-defined structure, but at least then this string dependency is localized.

Originally posted by @MarkusFrankATcernch in https://github.com/AIDASoft/DD4hep/issues/1027#issuecomment-1343011956

saraheno commented 1 year ago

@MarkusFrankATcernch

The example you point me to there is what I think of as "simHits". That I already have, for example: https://github.com/saraheno/SingleDualCrystal/tree/main/src

You can see there I define a special simhit for the dual readout information and an SDAction to collect the information from the GEANT4 record.

But now I want to simulate the electronics etc and make an item that would go to reconstruction code. I think dd4hep has structure for this as well?

MarkusFrankATcernch commented 1 year ago

Hmmm. In principle this is what DDDigi is supposed to target. This however is work in progress where I only the last 6-8 weeks had considerable time to look into. Since I am not really an expert of the needs for the simulation of electronics and the data structures needed to enter the reconstruction.

The basic idea however is that at the end the results are captured in edm4hep structures, which looks like becoming some standard.

saraheno commented 1 year ago

so right now all the ILC/CLIC/CEPC simulations that use dd4hep do their reconstruction right off the simhits?

MarkusFrankATcernch commented 1 year ago

ILC/CLIC/FCC use LCIO or edm4hep output to start the reconstruction which for them also includes the digitization. DDDigi was meant to separate digitization from reconstruction and therefore also allow e.g.

saraheno commented 1 year ago

ah okay. Is there an example I can look at for going from the dd4hep simhit to LCIO/edm4hep? Especially I aim to put my detector eventually into a version of the IDEA simulation. Which format do they use?

MarkusFrankATcernch commented 1 year ago

There is an example from dd4hep::sim::Geant4XXXXHit to edm4hep in: https://github.com/AIDASoft/DD4hep/blob/master/DDG4/edm4hep/Geant4Output2EDM4hep.cpp For LCIO as well: https://github.com/AIDASoft/DD4hep/blob/master/DDG4/lcio/Geant4Output2LCIO.cpp

I do not know what IDEA uses...

andresailer commented 10 months ago

Closing for lack of activity in this issue.