Message: confused by hits, hit collections, and sensitive detectors Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None confused by hits, hit collections, and sensitive detectors 

Forum: Hits, Digitization and Pileup
Date: 29 Dec, 2006
From: Ken Teh <>

I'm struggling with ExN02's treatment of sensitive detectors, hits, and hit collections. Each on their own is clear. The confusion arises from hit collections being a data member of SensitiveDetector sub-class. In this case, ExN02TrackerSD.

I want to process the hits at the end of each event to create "raw data" which are then written out to a file. It seems to me this is best done with UserEventAction sub-class. However, the UserEventAction sub-class needs to know the name of the collection in order to access it. This would suggest the hit collections be created outside of the SensitiveDetector sub-class so information about the collection object can be passed to the UserEventAction sub-class. It seems to me that it is sufficient to pass the collection object to the SensitiveDetector sub-class so it can register the collection object with HCofThisEvent and fill hits into it during the ProcessHits().

But, in the ExN02 example, the hits collection is allocated each time inside the SensitiveDetector's Initialize() method. Is this necessary? It seems to me that what's required per event is that the hits in the collection be deleted (by HCofThisEvent, I guess) and the number of entries in the collection reset to zero. The collection itself does not have to deleted.

If the collection must be allocated and deleted per event, then it makes perfect sense for the collection to be a data member of the sensitive detector. But, how does UserEventAction know about the collection? If 2 separate classes are to know about an object, then that object needs to be promoted outside of either these 2 classes.

My apologies if I sound like I'm splitting hairs. I'm sure it is because I don't quite understand the whole picture. If someone could explain this or assure me that all will be clear in time, I'd appreciate it.

Thanks! Ken

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: confused by hits, hit collections, and sensitive detectors   (Makoto Asai - 30 Dec, 2006)
 Add Message Add Message
to: "confused by hits, hit collections, and sensitive detectors"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]