Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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 42 of file ExN04MuonSD.hh.

Constructor & Destructor Documentation

ExN04MuonSD::ExN04MuonSD ( G4String  name)

Definition at line 42 of file ExN04MuonSD.cc.

43  : G4VSensitiveDetector(name)
44 {
45  G4String HCname;
46  collectionName.insert(HCname="muonCollection");
47  positionResolution = 5*cm;
48 }
static constexpr double cm
Definition: G4SIunits.hh:119
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

ExN04MuonSD::~ExN04MuonSD ( )

Definition at line 51 of file ExN04MuonSD.cc.

51 {;}
ExN04MuonSD::ExN04MuonSD ( G4String  name)
ExN04MuonSD::~ExN04MuonSD ( )

Member Function Documentation

void ExN04MuonSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 98 of file ExN04MuonSD.cc.

99 {
100 }
void ExN04MuonSD::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04MuonSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 103 of file ExN04MuonSD.cc.

104 {
105 }
void ExN04MuonSD::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04MuonSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 93 of file ExN04MuonSD.cc.

94 {
95 }
void ExN04MuonSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04MuonSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 54 of file ExN04MuonSD.cc.

55 {
56  static int HCID = -1;
57  muonCollection = new ExN04MuonHitsCollection
59  if(HCID<0)
60  { HCID = GetCollectionID(0); }
61  HCE->AddHitsCollection(HCID,muonCollection);
62 }
virtual G4int GetCollectionID(G4int i)
G4THitsCollection< ExN04MuonHit > ExN04MuonHitsCollection
Definition: ExN04MuonHit.hh:66
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4CollectionNameVector collectionName

Here is the call graph for this function:

void ExN04MuonSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04MuonSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 108 of file ExN04MuonSD.cc.

109 {
110 }
void ExN04MuonSD::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

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

Implements G4VSensitiveDetector.

Definition at line 65 of file 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 }
G4ThreeVector GetPos()
Definition: ExN04MuonHit.hh:58
double x() const
G4int entries() const
G4int insert(T *aHit)
double z() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4double GetTotalEnergyDeposit() const
double y() const
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76
static const G4double pos
void SetEdep(G4double de)
Definition: ExN04MuonHit.hh:54
void AddEdep(G4double de)
Definition: ExN04MuonHit.hh:55
void SetPos(G4ThreeVector xyz)
Definition: ExN04MuonHit.hh:57

Here is the call graph for this function:

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

Implements G4VSensitiveDetector.


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