Geant4  10.02.p03
ExN04MuonSD Class Reference

#include <ExN04MuonSD.hh>

Inheritance diagram for ExN04MuonSD:
Collaboration diagram for ExN04MuonSD:

Public Member Functions

 ExN04MuonSD (G4String name)
 
 ~ExN04MuonSD ()
 
void Initialize (G4HCofThisEvent *HCE)
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
void EndOfEvent (G4HCofThisEvent *HCE)
 
void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
 ExN04MuonSD (G4String name)
 
 ~ExN04MuonSD ()
 
void Initialize (G4HCofThisEvent *HCE)
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
void EndOfEvent (G4HCofThisEvent *HCE)
 
void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
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
 

Private Attributes

ExN04MuonHitsCollectionmuonCollection
 
G4double positionResolution
 

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

Constructor & Destructor Documentation

◆ ExN04MuonSD() [1/2]

ExN04MuonSD::ExN04MuonSD ( G4String  name)

Definition at line 42 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

43  : G4VSensitiveDetector(name)
44 {
45  G4String HCname;
46  collectionName.insert(HCname="muonCollection");
48 }
static const double cm
Definition: G4SIunits.hh:118
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ ~ExN04MuonSD() [1/2]

ExN04MuonSD::~ExN04MuonSD ( )

Definition at line 51 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

51 {;}

◆ ExN04MuonSD() [2/2]

ExN04MuonSD::ExN04MuonSD ( G4String  name)

◆ ~ExN04MuonSD() [2/2]

ExN04MuonSD::~ExN04MuonSD ( )

Member Function Documentation

◆ clear() [1/2]

void ExN04MuonSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 98 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

99 {
100 }

◆ clear() [2/2]

void ExN04MuonSD::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ DrawAll() [1/2]

void ExN04MuonSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

104 {
105 }

◆ DrawAll() [2/2]

void ExN04MuonSD::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ EndOfEvent() [1/2]

void ExN04MuonSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 93 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

94 {
95 }

◆ EndOfEvent() [2/2]

void ExN04MuonSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

◆ Initialize() [1/2]

void ExN04MuonSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 54 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

55 {
56  static int HCID = -1;
59  if(HCID<0)
60  { HCID = GetCollectionID(0); }
62 }
virtual G4int GetCollectionID(G4int i)
G4THitsCollection< ExN04MuonHit > ExN04MuonHitsCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ Initialize() [2/2]

void ExN04MuonSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

◆ PrintAll() [1/2]

void ExN04MuonSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 108 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

109 {
110 }

◆ PrintAll() [2/2]

void ExN04MuonSD::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ ProcessHits() [1/2]

G4bool ExN04MuonSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 65 of file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc.

66 {
67  G4double edep = aStep->GetTotalEnergyDeposit();
68 
69  if(edep==0.) return true;
70 
71  ExN04MuonHit* aHit;
72  int nHit = muonCollection->entries();
73  G4ThreeVector hitpos = aStep->GetPreStepPoint()->GetPosition();
74  for(int i=0;i<nHit;i++) {
75  aHit = (*muonCollection)[i];
76  G4ThreeVector pos = aHit->GetPos();
77  G4double dist2 = sqr(pos.x()-hitpos.x())
78  +sqr(pos.y()-hitpos.y())+sqr(pos.z()-hitpos.z());
79  if(dist2<=sqr(positionResolution))
80  aHit->AddEdep(edep);
81  return true;
82  }
83 
84  aHit = new ExN04MuonHit();
85  aHit->SetEdep( edep );
86  aHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
87  muonCollection->insert( aHit );
88 
89  return true;
90 }
Double_t edep
double x() const
double y() const
double z() const
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
static const G4double pos
Here is the call graph for this function:

◆ ProcessHits() [2/2]

G4bool ExN04MuonSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Member Data Documentation

◆ muonCollection

ExN04MuonHitsCollection * ExN04MuonSD::muonCollection
private

◆ positionResolution

G4double ExN04MuonSD::positionResolution
private

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