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

#include <ExN02TrackerSD.hh>

Inheritance diagram for ExN02TrackerSD:
G4VSensitiveDetector

Public Member Functions

 ExN02TrackerSD (G4String)
 
 ~ExN02TrackerSD ()
 
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 ()
 
const 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

Definition at line 46 of file ExN02TrackerSD.hh.

Constructor & Destructor Documentation

ExN02TrackerSD::ExN02TrackerSD ( G4String  name)

Definition at line 44 of file ExN02TrackerSD.cc.

References G4VSensitiveDetector::collectionName, and G4CollectionNameVector::insert().

46 {
47  G4String HCname;
48  collectionName.insert(HCname="trackerCollection");
49 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
ExN02TrackerSD::~ExN02TrackerSD ( )

Definition at line 53 of file ExN02TrackerSD.cc.

53 { }

Member Function Documentation

void ExN02TrackerSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 91 of file ExN02TrackerSD.cc.

References G4THitsCollection< T >::entries(), G4cout, G4endl, and G4VSensitiveDetector::verboseLevel.

92 {
93  if (verboseLevel>0) {
94  G4int NbHits = trackerCollection->entries();
95  G4cout << "\n-------->Hits Collection: in this event they are " << NbHits
96  << " hits in the tracker chambers: " << G4endl;
97  for (G4int i=0;i<NbHits;i++) (*trackerCollection)[i]->Print();
98  }
99 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void ExN02TrackerSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 57 of file ExN02TrackerSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4SDManager::GetCollectionID(), G4SDManager::GetSDMpointer(), and G4VSensitiveDetector::SensitiveDetectorName.

58 {
59  trackerCollection = new ExN02TrackerHitsCollection
61  static G4int HCID = -1;
62  if(HCID<0)
64  HCE->AddHitsCollection( HCID, trackerCollection );
65 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4THitsCollection< ExN02TrackerHit > ExN02TrackerHitsCollection
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
G4bool ExN02TrackerSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 69 of file ExN02TrackerSD.cc.

References G4VTouchable::GetCopyNumber(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchableHandle(), G4Step::GetTrack(), G4Track::GetTrackID(), G4THitsCollection< T >::insert(), ExN02TrackerHit::SetChamberNb(), ExN02TrackerHit::SetEdep(), ExN02TrackerHit::SetPos(), and ExN02TrackerHit::SetTrackID().

70 {
71  G4double edep = aStep->GetTotalEnergyDeposit();
72 
73  if(edep==0.) return false;
74 
75  ExN02TrackerHit* newHit = new ExN02TrackerHit();
76  newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
78  ->GetCopyNumber());
79  newHit->SetEdep (edep);
80  newHit->SetPos (aStep->GetPostStepPoint()->GetPosition());
81  trackerCollection->insert( newHit );
82 
83  //newHit->Print();
84  //newHit->Draw();
85 
86  return true;
87 }
G4int GetCopyNumber(G4int depth=0) const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4int GetTrackID() const
G4double GetTotalEnergyDeposit() const
void SetPos(G4ThreeVector xyz)
void SetTrackID(G4int track)
G4StepPoint * GetPostStepPoint() const
void SetEdep(G4double de)
void SetChamberNb(G4int chamb)
double G4double
Definition: G4Types.hh:76
G4Track * GetTrack() const
const G4TouchableHandle & GetTouchableHandle() const

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