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

#include <F03CalorimeterSD.hh>

Inheritance diagram for F03CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 F03CalorimeterSD (G4String, F03DetectorConstruction *)
 
virtual ~F03CalorimeterSD ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual 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 48 of file F03CalorimeterSD.hh.

Constructor & Destructor Documentation

F03CalorimeterSD::F03CalorimeterSD ( G4String  name,
F03DetectorConstruction det 
)

Definition at line 49 of file F03CalorimeterSD.cc.

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

51 : G4VSensitiveDetector(name),
52  fCalCollection(0),
53  fDetector(det),
54  fHitID(new G4int[500])
55 {
56  collectionName.insert("CalCollection");
57 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
F03CalorimeterSD::~F03CalorimeterSD ( )
virtual

Definition at line 61 of file F03CalorimeterSD.cc.

62 {
63  delete [] fHitID;
64 }

Member Function Documentation

void F03CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 112 of file F03CalorimeterSD.cc.

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

113 {
114  static G4int hcID = -1;
115  if (hcID<0)
117  hce->AddHitsCollection(hcID,fCalCollection);
118 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
void F03CalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 68 of file F03CalorimeterSD.cc.

References G4VSensitiveDetector::collectionName, and G4VSensitiveDetector::SensitiveDetectorName.

69 {
70  fCalCollection = new F03CalorHitsCollection
72  for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
73 }
G4THitsCollection< F03CalorHit > F03CalorHitsCollection
Definition: F03CalorHit.hh:82
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
G4bool F03CalorimeterSD::ProcessHits ( G4Step step,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 77 of file F03CalorimeterSD.cc.

References F03CalorHit::AddAbs(), G4cout, G4endl, F03DetectorConstruction::GetAbsorber(), G4Step::GetPreStepPoint(), G4Step::GetStepLength(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4TouchableHistory::GetVolume(), G4THitsCollection< T >::insert(), and G4VSensitiveDetector::verboseLevel.

78 {
79  G4double edep = step->GetTotalEnergyDeposit();
80  G4double stepl = 0.;
81 
82  stepl = step->GetStepLength();
83 
84  if ((edep == 0.) && (stepl == 0.) ) return false;
85 
86  G4TouchableHistory* theTouchable
88 
89  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
90 
91  G4int number = 0;
92  if (fHitID[number]==-1)
93  {
94  F03CalorHit* calHit = new F03CalorHit();
95  if (physVol == fDetector->GetAbsorber()) calHit->AddAbs(edep,stepl);
96  fHitID[number] = fCalCollection->insert(calHit) - 1;
97  if (verboseLevel>0)
98  G4cout << " New Calorimeter Hit on F03: " << number << G4endl;
99  }
100  else
101  {
102  if (physVol == fDetector->GetAbsorber())
103  (*fCalCollection)[fHitID[number]]->AddAbs(edep,stepl);
104  if (verboseLevel>0)
105  G4cout << " Energy added to F03: " << number << G4endl;
106  }
107  return true;
108 }
void AddAbs(G4double de, G4double dl)
Definition: F03CalorHit.hh:63
G4double GetStepLength() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
const G4VPhysicalVolume * GetAbsorber()
G4double GetTotalEnergyDeposit() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

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