Geant4  10.02.p03
F01CalorimeterSD Class Reference

#include <F01CalorimeterSD.hh>

Inheritance diagram for F01CalorimeterSD:
Collaboration diagram for F01CalorimeterSD:

Public Member Functions

 F01CalorimeterSD (G4String, F01DetectorConstruction *)
 
virtual ~F01CalorimeterSD ()
 
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 ()
 
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
 

Private Attributes

F01CalorHitsCollectionfCalCollection
 
F01DetectorConstructionfDetector
 
G4intfHitID
 

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 F01CalorimeterSD.hh.

Constructor & Destructor Documentation

◆ F01CalorimeterSD()

F01CalorimeterSD::F01CalorimeterSD ( G4String  name,
F01DetectorConstruction det 
)

Definition at line 49 of file F01CalorimeterSD.cc.

51 : G4VSensitiveDetector(name),
52  fCalCollection(0),
53  fDetector(det),
54  fHitID(new G4int[500])
55 {
56  collectionName.insert("CalCollection");
57 }
F01DetectorConstruction * fDetector
int G4int
Definition: G4Types.hh:78
F01CalorHitsCollection * fCalCollection
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ ~F01CalorimeterSD()

F01CalorimeterSD::~F01CalorimeterSD ( )
virtual

Definition at line 61 of file F01CalorimeterSD.cc.

62 {
63  delete [] fHitID;
64 }

Member Function Documentation

◆ EndOfEvent()

void F01CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 112 of file F01CalorimeterSD.cc.

113 {
114  static G4int hcID = -1;
115  if (hcID<0)
118 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
F01CalorHitsCollection * fCalCollection
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ Initialize()

void F01CalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 68 of file F01CalorimeterSD.cc.

69 {
72  for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
73 }
G4THitsCollection< F01CalorHit > F01CalorHitsCollection
Definition: F01CalorHit.hh:82
int G4int
Definition: G4Types.hh:78
F01CalorHitsCollection * fCalCollection
G4CollectionNameVector collectionName

◆ ProcessHits()

G4bool F01CalorimeterSD::ProcessHits ( G4Step *  step,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 77 of file F01CalorimeterSD.cc.

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
87  = (G4TouchableHistory*)(step->GetPreStepPoint()->GetTouchable());
88 
89  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
90 
91  G4int number = 0;
92  if (fHitID[number]==-1)
93  {
94  F01CalorHit* calHit = new F01CalorHit();
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 F01: " << 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 F01: " << number << G4endl;
106  }
107  return true;
108 }
F01DetectorConstruction * fDetector
int G4int
Definition: G4Types.hh:78
Double_t edep
void AddAbs(G4double de, G4double dl)
Definition: F01CalorHit.hh:63
G4GLOB_DLL std::ostream G4cout
const G4VPhysicalVolume * GetAbsorber()
F01CalorHitsCollection * fCalCollection
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetVolume(G4int depth=0) const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ fCalCollection

F01CalorHitsCollection* F01CalorimeterSD::fCalCollection
private

Definition at line 61 of file F01CalorimeterSD.hh.

◆ fDetector

F01DetectorConstruction* F01CalorimeterSD::fDetector
private

Definition at line 62 of file F01CalorimeterSD.hh.

◆ fHitID

G4int* F01CalorimeterSD::fHitID
private

Definition at line 63 of file F01CalorimeterSD.hh.


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