Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
F03CalorimeterSD Class Reference

#include <Doxymodules_field.h>

Inheritance diagram for F03CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 F03CalorimeterSD (G4String, F03DetectorConstruction *)
 
 ~F03CalorimeterSD () override
 
void Initialize (G4HCofThisEvent *) override
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
void EndOfEvent (G4HCofThisEvent *) override
 

Private Attributes

F03CalorHitsCollectionfCalCollection
 
F03DetectorConstructionfDetector
 
G4int * fHitID
 

Detailed Description

Definition at line 78 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F03CalorimeterSD()

F03CalorimeterSD::F03CalorimeterSD ( G4String  name,
F03DetectorConstruction det 
)

Definition at line 48 of file F03CalorimeterSD.cc.

51 fCalCollection(nullptr),
52 fDetector(det),
53 fHitID(new G4int[500])
54{
55 collectionName.insert("CalCollection");
56}
F03CalorHitsCollection * fCalCollection
F03DetectorConstruction * fDetector

◆ ~F03CalorimeterSD()

F03CalorimeterSD::~F03CalorimeterSD ( )
override

Definition at line 60 of file F03CalorimeterSD.cc.

61{
62 delete [] fHitID;
63}

Member Function Documentation

◆ Initialize()

void F03CalorimeterSD::Initialize ( G4HCofThisEvent )
override

Definition at line 67 of file F03CalorimeterSD.cc.

68{
70 (SensitiveDetectorName,collectionName[0]);
71 for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
72}
G4THitsCollection< F03CalorHit > F03CalorHitsCollection

◆ ProcessHits()

G4bool F03CalorimeterSD::ProcessHits ( G4Step step,
G4TouchableHistory  
)
override

Definition at line 76 of file F03CalorimeterSD.cc.

77{
78 G4double edep = step->GetTotalEnergyDeposit();
79 G4double stepl = 0.;
80
81 stepl = step->GetStepLength();
82
83 if ((edep == 0.) && (stepl == 0.) ) return false;
84
85 auto theTouchable
86 = (G4TouchableHistory*)(step->GetPreStepPoint()->GetTouchable());
87
88 G4VPhysicalVolume* physVol = theTouchable->GetVolume();
89
90 G4int number = 0;
91 if (fHitID[number]==-1)
92 {
93 auto calHit = new F03CalorHit();
94 if (physVol == fDetector->GetAbsorber()) calHit->AddAbs(edep,stepl);
95 fHitID[number] = fCalCollection->insert(calHit) - 1;
96 if (verboseLevel>0)
97 G4cout << " New Calorimeter Hit on F03: " << number << G4endl;
98 }
99 else
100 {
101 if (physVol == fDetector->GetAbsorber())
102 (*fCalCollection)[fHitID[number]]->AddAbs(edep,stepl);
103 if (verboseLevel>0)
104 G4cout << " Energy added to F03: " << number << G4endl;
105 }
106 return true;
107}
const G4VPhysicalVolume * GetAbsorber()

◆ EndOfEvent()

void F03CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
override

Definition at line 111 of file F03CalorimeterSD.cc.

112{
113 static G4int hcID = -1;
114 if (hcID<0)
115 { hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
116 hce->AddHitsCollection(hcID,fCalCollection);
117}

Member Data Documentation

◆ fCalCollection

F03CalorHitsCollection* F03CalorimeterSD::fCalCollection
private

Definition at line 60 of file F03CalorimeterSD.hh.

◆ fDetector

F03DetectorConstruction* F03CalorimeterSD::fDetector
private

Definition at line 61 of file F03CalorimeterSD.hh.

◆ fHitID

G4int* F03CalorimeterSD::fHitID
private

Definition at line 62 of file F03CalorimeterSD.hh.


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

Applications | User Support | Publications | Collaboration