I hope it is there where I have to send this mail. I am trying to play with geant4 and I found a bit "unexplained" how to build digits out of hits. Would it be possible to get a simple example on how to do it ? I tried to follow the same steps as with the hits, that is, derive a class from G4VDigi for my digits, another one from G4VDigitizerModule and register it in my detector construction through the DigiManager: G4DigiManager *fDM = G4DigiManager::GetDMpointer(); PlaneDigitizer *mDig = new PlaneDigitizer("PlaneDigitizer"); fDM->AddNewModule(mDig); Then in my EndOfEventAction I call the Digitize method of my digitizer module whre I fill my collection of digits. My first question is: should I assume that I have to maintain myself the collection of hits ? That is, should I clear it from one event to the other and how to do it ? At this respect I found that in G4TDigiCollection there is no entries() method and therefore no way to know how many digits are there. I added it, but the next problem is how to associate the digits to G4DCofThisEvent. Looking hereand there in the source I found G4VDigitizerModule::StoreDigiCollection. I used it, but that makes the program crash persistenly. Many thanks in advance, Carlos
entries() method is added to G4TDigiCollection. The crash of G4VDigitizerModule::StoreDigiCollection is still under investigation.
1. "entries()" method is added to G4TDigiCollection.hh. This modification is included to the next release. 2. A bug was found in the user's code, which caused a crash. But this bug was derived from the quite poor documentation and absolutely no example on digitization. More documents and new examples must be supplied.