Geant4  10.02.p03
F03CalorimeterSD Class Reference

#include <F03CalorimeterSD.hh>

Inheritance diagram for F03CalorimeterSD:
Collaboration diagram for F03CalorimeterSD:

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 ()
 
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

F03CalorHitsCollectionfCalCollection
 
F03DetectorConstructionfDetector
 
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 F03CalorimeterSD.hh.

Constructor & Destructor Documentation

◆ F03CalorimeterSD()

F03CalorimeterSD::F03CalorimeterSD ( G4String  name,
F03DetectorConstruction det 
)

Definition at line 49 of file F03CalorimeterSD.cc.

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

◆ ~F03CalorimeterSD()

F03CalorimeterSD::~F03CalorimeterSD ( )
virtual

Definition at line 61 of file F03CalorimeterSD.cc.

62 {
63  delete [] fHitID;
64 }

Member Function Documentation

◆ EndOfEvent()

void F03CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 112 of file F03CalorimeterSD.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
F03CalorHitsCollection * fCalCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ Initialize()

void F03CalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 68 of file F03CalorimeterSD.cc.

69 {
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
F03CalorHitsCollection * fCalCollection
G4CollectionNameVector collectionName

◆ ProcessHits()

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

Implements G4VSensitiveDetector.

Definition at line 77 of file F03CalorimeterSD.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  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
F03DetectorConstruction * fDetector
int G4int
Definition: G4Types.hh:78
Double_t edep
F03CalorHitsCollection * fCalCollection
G4GLOB_DLL std::ostream G4cout
const G4VPhysicalVolume * GetAbsorber()
#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

F03CalorHitsCollection* F03CalorimeterSD::fCalCollection
private

Definition at line 61 of file F03CalorimeterSD.hh.

◆ fDetector

F03DetectorConstruction* F03CalorimeterSD::fDetector
private

Definition at line 62 of file F03CalorimeterSD.hh.

◆ fHitID

G4int* F03CalorimeterSD::fHitID
private

Definition at line 63 of file F03CalorimeterSD.hh.


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