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

#include <Doxymodules_field.h>

Inheritance diagram for F01CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 F01CalorimeterSD (G4String, F01DetectorConstruction *)
 
 ~F01CalorimeterSD () override
 
void Initialize (G4HCofThisEvent *) override
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
void EndOfEvent (G4HCofThisEvent *) override
 

Private Attributes

F01CalorHitsCollectionfCalCollection = nullptr
 
F01DetectorConstructionfDetector = nullptr
 
G4int * fHitID = nullptr
 

Detailed Description

Definition at line 34 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F01CalorimeterSD()

F01CalorimeterSD::F01CalorimeterSD ( G4String  name,
F01DetectorConstruction det 
)

Definition at line 48 of file F01CalorimeterSD.cc.

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

◆ ~F01CalorimeterSD()

F01CalorimeterSD::~F01CalorimeterSD ( )
override

Definition at line 59 of file F01CalorimeterSD.cc.

60{
61 delete [] fHitID;
62}

Member Function Documentation

◆ Initialize()

void F01CalorimeterSD::Initialize ( G4HCofThisEvent )
override

Definition at line 66 of file F01CalorimeterSD.cc.

67{
69 (SensitiveDetectorName,collectionName[0]);
70 for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
71}
G4THitsCollection< F01CalorHit > F01CalorHitsCollection
F01CalorHitsCollection * fCalCollection

◆ ProcessHits()

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

Definition at line 75 of file F01CalorimeterSD.cc.

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

◆ EndOfEvent()

void F01CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
override

Definition at line 110 of file F01CalorimeterSD.cc.

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

Member Data Documentation

◆ fCalCollection

F01CalorHitsCollection* F01CalorimeterSD::fCalCollection = nullptr
private

Definition at line 60 of file F01CalorimeterSD.hh.

◆ fDetector

F01DetectorConstruction* F01CalorimeterSD::fDetector = nullptr
private

Definition at line 61 of file F01CalorimeterSD.hh.

◆ fHitID

G4int* F01CalorimeterSD::fHitID = nullptr
private

Definition at line 62 of file F01CalorimeterSD.hh.


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

Applications | User Support | Publications | Collaboration