Problem 23 - Digitization
Summary: Digitization
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: digits_hits (show other problems)
Version: 0.1
Hardware: PC Linux
: P2 normal
Assignee: asai
URL:
Depends on:
Blocks:
 
Reported: 1999-10-26 04:26 CEST by Carlos.Lacasta
Modified: 2018-05-02 20:27 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Carlos.Lacasta 1999-10-26 04:26:44 CEST
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
Comment 1 Makoto.Asai 1999-10-27 22:18:59 CEST
entries() method is added to G4TDigiCollection.
The crash of G4VDigitizerModule::StoreDigiCollection is still under
investigation.
Comment 2 Makoto.Asai 1999-10-29 04:07:59 CEST
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.