Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
H02MuonSD Class Reference

#include <H02MuonSD.hh>

Inheritance diagram for H02MuonSD:
G4VSensitiveDetector

Public Member Functions

 H02MuonSD (G4String name)
 
 ~H02MuonSD ()
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual G4bool ProcessHits (G4Step *astep, G4TouchableHistory *ROhist)
 
virtual void EndOfEvent (G4HCofThisEvent *HCE)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
const G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Definition at line 41 of file H02MuonSD.hh.

Constructor & Destructor Documentation

H02MuonSD::H02MuonSD ( G4String  name)
H02MuonSD::~H02MuonSD ( )

Definition at line 48 of file H02MuonSD.cc.

49 {
50 }

Member Function Documentation

void H02MuonSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 93 of file H02MuonSD.cc.

94 {
95 }
void H02MuonSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 98 of file H02MuonSD.cc.

99 {
100 }
void H02MuonSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 88 of file H02MuonSD.cc.

89 {
90 }
void H02MuonSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 53 of file H02MuonSD.cc.

References G4VSensitiveDetector::collectionName, G4VSensitiveDetector::GetCollectionID(), and G4VSensitiveDetector::SensitiveDetectorName.

54 {
55  static int HCID=-1;
57  collectionName[0]);
58  if(HCID<0) HCID= GetCollectionID(0);
59  HCE-> AddHitsCollection(HCID, hitCollection);
60 }
G4THitsCollection< H02MuonHit > H02MuonHitsCollection
Definition: H02MuonHit.hh:98
virtual G4int GetCollectionID(G4int i)
G4CollectionNameVector collectionName
void H02MuonSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file H02MuonSD.cc.

References G4cout, and G4endl.

104 {
105  G4int nHit= hitCollection-> entries();
106  G4cout << "------------------------------------------" << G4endl
107  << "*** Muon System Hit (#hits=" << nHit << ")" << G4endl;
108  hitCollection-> PrintAllHits();
109 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4bool H02MuonSD::ProcessHits ( G4Step astep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 63 of file H02MuonSD.cc.

References fGeomBoundary, and G4VSensitiveDetector::GetName().

64 {
65  G4ParticleDefinition* particle= astep-> GetTrack()-> GetDefinition();
66  if(particle-> GetPDGCharge() == 0.) return false;
67 
68  G4StepPoint* prestep= astep-> GetPreStepPoint();
69 
70  if(prestep-> GetStepStatus() != fGeomBoundary) return false;
71 
72  G4ThreeVector vmom= prestep-> GetMomentum();
73  G4ThreeVector vpos= prestep-> GetPosition();
74  G4double tof= prestep-> GetGlobalTime();
75 
76  G4VPhysicalVolume* volume= prestep-> GetPhysicalVolume();
77  G4int id= volume-> GetCopyNo();
78  if(volume-> GetName() == "ENDCAP_MUON_PV") id +=10;
79 
80  H02MuonHit* aHit=
81  new H02MuonHit(id, particle-> GetParticleName(), vmom, vpos, tof);
82  hitCollection-> insert(aHit);
83  return true;
84 
85 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76

The documentation for this class was generated from the following files: