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

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par01CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 Par01CalorimeterSD (G4String name, G4int nCells, G4String colName)
 
 ~Par01CalorimeterSD ()
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
virtual void EndOfEvent (G4HCofThisEvent *HCE)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 

Private Attributes

Par01CalorimeterHitsCollectionfCalCollection
 
int * fCellID
 
int fNumberOfCells
 
int fHCID
 

Detailed Description

Definition at line 19 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par01CalorimeterSD()

Par01CalorimeterSD::Par01CalorimeterSD ( G4String  name,
G4int  nCells,
G4String  colName 
)

Definition at line 44 of file Par01CalorimeterSD.cc.

48 fNumberOfCells(nCells),
49 fHCID(-1)
50{
51 G4String HCname;
52 collectionName.insert(HCname=colName);
53 fCellID = new G4int[fNumberOfCells];
54}

◆ ~Par01CalorimeterSD()

Par01CalorimeterSD::~Par01CalorimeterSD ( )

Definition at line 58 of file Par01CalorimeterSD.cc.

59{
60 delete [] fCellID;
61}

Member Function Documentation

◆ Initialize()

void Par01CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Definition at line 65 of file Par01CalorimeterSD.cc.

66{
68 (SensitiveDetectorName,collectionName[0]);
69 for(G4int j=0;j<fNumberOfCells;j++)
70 {
71 fCellID[j] = -1;
72 }
73}
G4THitsCollection< Par01CalorimeterHit > Par01CalorimeterHitsCollection
Par01CalorimeterHitsCollection * fCalCollection

◆ ProcessHits()

G4bool Par01CalorimeterSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
virtual

Definition at line 77 of file Par01CalorimeterSD.cc.

78{
79 G4double edep = aStep->GetTotalEnergyDeposit();
80 if(edep<=0.) return false;
81
82 auto hist = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
83 const G4VPhysicalVolume* physVol = hist->GetVolume();
84 G4int copyID = hist->GetReplicaNumber();
85
86 if(fCellID[copyID]==-1)
87 {
88 Par01CalorimeterHit* calHit =
89 new Par01CalorimeterHit(physVol->GetLogicalVolume());
90 calHit->SetEdep( edep );
91 G4AffineTransform aTrans = hist->GetHistory()->GetTopTransform();
92 aTrans.Invert();
93 calHit->SetPos(aTrans.NetTranslation());
94 calHit->SetRot(aTrans.NetRotation());
95 G4int icell = fCalCollection->insert( calHit );
96 fCellID[copyID] = icell - 1;
97 if(verboseLevel>0)
98 { G4cout << " New Calorimeter Hit on CellID " << copyID << G4endl; }
99 }
100 else
101 {
102 (*fCalCollection)[fCellID[copyID]]->AddEdep( edep );
103 if(verboseLevel>0)
104 { G4cout << " Energy added to CellID " << copyID << G4endl; }
105 }
106
107 return true;
108}
void SetEdep(G4double de)
void SetRot(G4RotationMatrix rmat)
void SetPos(G4ThreeVector xyz)

◆ EndOfEvent()

void Par01CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Definition at line 112 of file Par01CalorimeterSD.cc.

113{
114 if(fHCID<0)
115 { fHCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
116 HCE->AddHitsCollection( fHCID, fCalCollection );
117}

◆ clear()

void Par01CalorimeterSD::clear ( )
virtual

Definition at line 121 of file Par01CalorimeterSD.cc.

122{
123}

◆ DrawAll()

void Par01CalorimeterSD::DrawAll ( )
virtual

Definition at line 127 of file Par01CalorimeterSD.cc.

128{
129}

◆ PrintAll()

void Par01CalorimeterSD::PrintAll ( )
virtual

Definition at line 133 of file Par01CalorimeterSD.cc.

134{
135}

Member Data Documentation

◆ fCalCollection

Par01CalorimeterHitsCollection* Par01CalorimeterSD::fCalCollection
private

Definition at line 55 of file Par01CalorimeterSD.hh.

◆ fCellID

int* Par01CalorimeterSD::fCellID
private

Definition at line 57 of file Par01CalorimeterSD.hh.

◆ fNumberOfCells

int Par01CalorimeterSD::fNumberOfCells
private

Definition at line 58 of file Par01CalorimeterSD.hh.

◆ fHCID

int Par01CalorimeterSD::fHCID
private

Definition at line 59 of file Par01CalorimeterSD.hh.


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

Applications | User Support | Publications | Collaboration