12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Detector Definition and Response• in the construct() method of your concrete G4VUserDetectorConstruction class:• instantiate your Readout geometry:• build it:MyROGeom* ROgeom = new MyROGeom("ROName");ROgeom->buildROGeometry();That will invoke your build() method.• Instantiate the sensitive detector which will receive the ROGeom pointer, MySensitive, and add this sensitiveto the G4SDManager. Associate this sensitive to the volume(s) of the tracking geometry as usual.• Associate the sensitive to the Readout geometry:MySensitive->SetROgeometry(ROgeom);4.4.4. G4SDManagerG4SDManager is the singleton manager class <strong>for</strong> sensitive detectors.Activation/inactivation of sensitive detectorsThe user interface commands activate and inactivate are available to control your sensitive detectors.For example:/hits/activate detector_name/hits/inactivate detector_namewhere detector_name can be the detector name or the category name.For example, if your EM calorimeter is named/myDet/myCal/myEMcal/hits/inactivate myCalwill inactivate all detectors belonging to the myCal category.Access to the hit collectionsHit collections are accessed <strong>for</strong> various cases.• Digitization• Event filtering in G4VUserStackingAction• ``End of event'' simple analysis• Drawing / printing hitsThe following is an example of how to access the hit collection of a particular concrete type:129G4SDManager* fSDM = G4SDManager::GetSDMpointer();G4RunManager* fRM = G4RunManager::GetRunManager();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!