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

#include <B2TrackerSD.hh>

Inheritance diagram for B2TrackerSD:
Collaboration diagram for B2TrackerSD:

Public Member Functions

 B2TrackerSD (const G4String &name, const G4String &hitsCollectionName)
 
virtual ~B2TrackerSD ()
 
virtual void Initialize (G4HCofThisEvent *hitCollection)
 
virtual G4bool ProcessHits (G4Step *step, G4TouchableHistory *history)
 
virtual void EndOfEvent (G4HCofThisEvent *hitCollection)
 
 B2TrackerSD (const G4String &name, const G4String &hitsCollectionName)
 
virtual ~B2TrackerSD ()
 
virtual void Initialize (G4HCofThisEvent *hitCollection)
 
virtual G4bool ProcessHits (G4Step *step, G4TouchableHistory *history)
 
virtual void EndOfEvent (G4HCofThisEvent *hitCollection)
 
 B2TrackerSD (const G4String &name, const G4String &hitsCollectionName)
 
virtual ~B2TrackerSD ()
 
virtual void Initialize (G4HCofThisEvent *hitCollection)
 
virtual G4bool ProcessHits (G4Step *step, G4TouchableHistory *history)
 
virtual void EndOfEvent (G4HCofThisEvent *hitCollection)
 
- 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

B2Tracker sensitive detector class

The hits are accounted in hits in ProcessHits() function which is called by Geant4 kernel at each step. A hit is created with each step with non zero energy deposit.

Definition at line 51 of file B2TrackerSD.hh.

Constructor & Destructor Documentation

B2TrackerSD::B2TrackerSD ( const G4String name,
const G4String hitsCollectionName 
)

Definition at line 40 of file B2TrackerSD.cc.

42  : G4VSensitiveDetector(name),
43  fHitsCollection(NULL)
44 {
45  collectionName.insert(hitsCollectionName);
46 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

B2TrackerSD::~B2TrackerSD ( )
virtual

Definition at line 50 of file B2TrackerSD.cc.

51 {}
B2TrackerSD::B2TrackerSD ( const G4String name,
const G4String hitsCollectionName 
)
virtual B2TrackerSD::~B2TrackerSD ( )
virtual
B2TrackerSD::B2TrackerSD ( const G4String name,
const G4String hitsCollectionName 
)
virtual B2TrackerSD::~B2TrackerSD ( )
virtual

Member Function Documentation

void B2TrackerSD::EndOfEvent ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 96 of file B2TrackerSD.cc.

97 {
98  if ( verboseLevel>1 ) {
99  G4int nofHits = fHitsCollection->entries();
100  G4cout << G4endl
101  << "-------->Hits Collection: in this event they are " << nofHits
102  << " hits in the tracker chambers: " << G4endl;
103  for ( G4int i=0; i<nofHits; i++ ) (*fHitsCollection)[i]->Print();
104  }
105 }
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:

virtual void B2TrackerSD::EndOfEvent ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

virtual void B2TrackerSD::EndOfEvent ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

virtual void B2TrackerSD::Initialize ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

virtual void B2TrackerSD::Initialize ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

void B2TrackerSD::Initialize ( G4HCofThisEvent hitCollection)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 55 of file B2TrackerSD.cc.

56 {
57  // Create hits collection
58 
59  fHitsCollection
61 
62  // Add this collection in hce
63 
64  G4int hcID
66  hce->AddHitsCollection( hcID, fHitsCollection );
67 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
G4THitsCollection< B2TrackerHit > B2TrackerHitsCollection
Definition: B2TrackerHit.hh:86
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName

Here is the call graph for this function:

G4bool B2TrackerSD::ProcessHits ( G4Step step,
G4TouchableHistory history 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 71 of file B2TrackerSD.cc.

73 {
74  // energy deposit
75  G4double edep = aStep->GetTotalEnergyDeposit();
76 
77  if (edep==0.) return false;
78 
79  B2TrackerHit* newHit = new B2TrackerHit();
80 
81  newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
82  newHit->SetChamberNb(aStep->GetPreStepPoint()->GetTouchableHandle()
83  ->GetCopyNumber());
84  newHit->SetEdep(edep);
85  newHit->SetPos (aStep->GetPostStepPoint()->GetPosition());
86 
87  fHitsCollection->insert( newHit );
88 
89  //newHit->Print();
90 
91  return true;
92 }
void SetPos(G4ThreeVector xyz)
Definition: B2TrackerHit.hh:68
void SetEdep(G4double de)
Definition: B2TrackerHit.hh:67
G4int insert(T *aHit)
void SetChamberNb(G4int chamb)
Definition: B2TrackerHit.hh:66
double G4double
Definition: G4Types.hh:76
void SetTrackID(G4int track)
Definition: B2TrackerHit.hh:65

Here is the call graph for this function:

virtual G4bool B2TrackerSD::ProcessHits ( G4Step step,
G4TouchableHistory history 
)
virtual

Implements G4VSensitiveDetector.

virtual G4bool B2TrackerSD::ProcessHits ( G4Step step,
G4TouchableHistory history 
)
virtual

Implements G4VSensitiveDetector.


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