Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExTGTrackerSD Class Reference

Example of Sensitive detector. More...

#include <ExTGTrackerSD.hh>

Inheritance diagram for ExTGTrackerSD:
Collaboration diagram for ExTGTrackerSD:

Public Member Functions

 ExTGTrackerSD (G4String)
 
 ~ExTGTrackerSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *)
 
- 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
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
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

Example of Sensitive detector.

Definition at line 42 of file ExTGTrackerSD.hh.

Constructor & Destructor Documentation

ExTGTrackerSD::ExTGTrackerSD ( G4String  name)

Definition at line 40 of file ExTGTrackerSD.cc.

42 {
43  G4String HCname;
44  collectionName.insert(HCname="trackerCollection");
45 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

ExTGTrackerSD::~ExTGTrackerSD ( )

Definition at line 48 of file ExTGTrackerSD.cc.

49 {
50 }

Member Function Documentation

void ExTGTrackerSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 87 of file ExTGTrackerSD.cc.

88 {
89  G4int NbHits = fTrackerCollection->entries();
90  G4cout << "\n-------->Hits Collection: in this event there are " << NbHits
91  << " hits in the tracker chambers: " << G4endl;
92  for (G4int i=0;i<NbHits;i++)
93  {
94  (*fTrackerCollection)[i]->Print();
95  }
96 }
G4int entries() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void ExTGTrackerSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 53 of file ExTGTrackerSD.cc.

54 {
55  fTrackerCollection = new ExTGTrackerHitsCollection
57  static G4int HCID = -1;
58  if ( HCID<0 )
59  {
61  }
62  HCE->AddHitsCollection( HCID, fTrackerCollection );
63 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
G4THitsCollection< ExTGTrackerHit > ExTGTrackerHitsCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName

Here is the call graph for this function:

G4bool ExTGTrackerSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 66 of file ExTGTrackerSD.cc.

67 {
68  G4double edep = aStep->GetTotalEnergyDeposit();
69 
70  if(edep==0.) { return false; }
71 
72  ExTGTrackerHit* newHit = new ExTGTrackerHit();
73  newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
75  ->GetCopyNumber());
76  newHit->SetEdep (edep);
77  newHit->SetPos (aStep->GetPostStepPoint()->GetPosition());
78  fTrackerCollection->insert( newHit );
79 
80  //newHit->Print();
81  //newHit->Draw();
82 
83  return true;
84 }
void SetPos(G4ThreeVector xyz)
G4int insert(T *aHit)
Example of hit.
G4int GetCopyNumber(G4int depth=0) const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4int GetTrackID() const
G4double GetTotalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
void SetEdep(G4double de)
void SetTrackID(G4int track)
double G4double
Definition: G4Types.hh:76
void SetChamberNb(G4int chamb)
G4Track * GetTrack() const
const G4TouchableHandle & GetTouchableHandle() const

Here is the call graph for this function:


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