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

#include <Doxymodules_field.h>

Inheritance diagram for F02CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 F02CalorimeterSD (G4String, F02DetectorConstruction *)
 
 ~F02CalorimeterSD () override
 
void Initialize (G4HCofThisEvent *) override
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
void EndOfEvent (G4HCofThisEvent *) override
 

Private Attributes

F02CalorHitsCollectionfCalCollection = nullptr
 
F02DetectorConstructionfDetector = nullptr
 
G4int * fHitID = nullptr
 

Detailed Description

Definition at line 56 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F02CalorimeterSD()

F02CalorimeterSD::F02CalorimeterSD ( G4String  name,
F02DetectorConstruction det 
)

Definition at line 48 of file F02CalorimeterSD.cc.

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

◆ ~F02CalorimeterSD()

F02CalorimeterSD::~F02CalorimeterSD ( )
override

Definition at line 59 of file F02CalorimeterSD.cc.

60{
61 delete [] fHitID;
62}

Member Function Documentation

◆ Initialize()

void F02CalorimeterSD::Initialize ( G4HCofThisEvent )
override

Definition at line 66 of file F02CalorimeterSD.cc.

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

◆ ProcessHits()

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

Definition at line 75 of file F02CalorimeterSD.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 F02CalorHit();
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 F02: " << 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 F02: " << number << G4endl;
104 }
105
106 return true;
107}
const G4VPhysicalVolume * GetAbsorber()

◆ EndOfEvent()

void F02CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
override

Definition at line 111 of file F02CalorimeterSD.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

F02CalorHitsCollection* F02CalorimeterSD::fCalCollection = nullptr
private

Definition at line 58 of file F02CalorimeterSD.hh.

◆ fDetector

F02DetectorConstruction* F02CalorimeterSD::fDetector = nullptr
private

Definition at line 59 of file F02CalorimeterSD.hh.

◆ fHitID

G4int* F02CalorimeterSD::fHitID = nullptr
private

Definition at line 60 of file F02CalorimeterSD.hh.


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

Applications | User Support | Publications | Collaboration