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

#include <Doxymodules_eventgenerator.h>

Inheritance diagram for ExN04CalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 ExN04CalorimeterSD (G4String name)
 
 ~ExN04CalorimeterSD ()
 
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

ExN04CalorimeterHitsCollectionfCalCollection
 
int fCellID [20][48]
 
const int fnumberOfCellsInZ
 
const int fnumberOfCellsInPhi
 

Detailed Description

Definition at line 37 of file Doxymodules_eventgenerator.h.

Constructor & Destructor Documentation

◆ ExN04CalorimeterSD()

ExN04CalorimeterSD::ExN04CalorimeterSD ( G4String  name)

Definition at line 44 of file ExN04CalorimeterSD.cc.

47{
48 G4String HCname;
49 collectionName.insert(HCname="calCollection");
50}
ExN04CalorimeterHitsCollection * fCalCollection

◆ ~ExN04CalorimeterSD()

ExN04CalorimeterSD::~ExN04CalorimeterSD ( )

Definition at line 53 of file ExN04CalorimeterSD.cc.

54{
55}

Member Function Documentation

◆ Initialize()

void ExN04CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Definition at line 58 of file ExN04CalorimeterSD.cc.

59{
61 (SensitiveDetectorName, collectionName[0]);
62
63 for ( G4int j = 0; j < fnumberOfCellsInZ; j++) {
64 for(G4int k = 0; k < fnumberOfCellsInPhi; k++) {
65 fCellID[j][k] = -1;
66 }
67 }
68
69 verboseLevel = 0;
70}
G4THitsCollection< ExN04CalorimeterHit > ExN04CalorimeterHitsCollection

◆ ProcessHits()

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

Definition at line 73 of file ExN04CalorimeterSD.cc.

74{
75 if ( !ROhist ) return false;
76 G4double edep = aStep-> GetTotalEnergyDeposit();
77 if ( verboseLevel > 1 )
78 G4cout << "Next step edep(MeV) = " << edep/MeV << G4endl;
79 if ( edep == 0. ) return false;
80
81 G4VPhysicalVolume* physVol = ROhist-> GetVolume();
82 //ROhist->MoveUpHistory();
83 //G4VPhysicalVolume* mothVol = ROhist->GetVolume(1);
84 G4int copyIDinZ = ROhist-> GetReplicaNumber();
85 G4int copyIDinPhi = ROhist-> GetReplicaNumber(1);
86
87 if ( fCellID[copyIDinZ][copyIDinPhi] == -1 ) {
88 ExN04CalorimeterHit* calHit =
89 new ExN04CalorimeterHit(physVol->GetLogicalVolume(),
90 copyIDinZ, copyIDinPhi);
91 calHit-> SetEdep(edep);
92 G4AffineTransform aTrans = ROhist->GetHistory()->GetTopTransform();
93 aTrans.Invert();
94 calHit-> SetPos(aTrans.NetTranslation());
95 calHit-> SetRot(aTrans.NetRotation());
96 G4int icell = fCalCollection->insert(calHit);
97 fCellID[copyIDinZ][copyIDinPhi] = icell - 1;
98 if(verboseLevel>0) {
99 G4cout << " New Calorimeter Hit on CellID "
100 << copyIDinZ << " " << copyIDinPhi << G4endl;
101 }
102 } else {
103 (*fCalCollection)[fCellID[copyIDinZ][copyIDinPhi]]-> AddEdep(edep);
104 if ( verboseLevel > 0 ) {
105 G4cout << " Energy added to CellID "
106 << copyIDinZ << " " << copyIDinPhi << G4endl;
107 }
108 }
109
110 return true;
111}

◆ EndOfEvent()

void ExN04CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Definition at line 114 of file ExN04CalorimeterSD.cc.

115{
116 static G4int HCID = -1;
117 if ( HCID < 0 ) {
118 HCID = GetCollectionID(0);
119 }
120 HCE-> AddHitsCollection(HCID, fCalCollection );
121}

◆ clear()

void ExN04CalorimeterSD::clear ( )
virtual

Definition at line 124 of file ExN04CalorimeterSD.cc.

125{
126}

◆ DrawAll()

void ExN04CalorimeterSD::DrawAll ( )
virtual

Definition at line 129 of file ExN04CalorimeterSD.cc.

130{
131}

◆ PrintAll()

void ExN04CalorimeterSD::PrintAll ( )
virtual

Definition at line 134 of file ExN04CalorimeterSD.cc.

135{
136}

Member Data Documentation

◆ fCalCollection

ExN04CalorimeterHitsCollection* ExN04CalorimeterSD::fCalCollection
private

Definition at line 53 of file ExN04CalorimeterSD.hh.

◆ fCellID

int ExN04CalorimeterSD::fCellID[20][48]
private

Definition at line 54 of file ExN04CalorimeterSD.hh.

◆ fnumberOfCellsInZ

const int ExN04CalorimeterSD::fnumberOfCellsInZ
private

Definition at line 55 of file ExN04CalorimeterSD.hh.

◆ fnumberOfCellsInPhi

const int ExN04CalorimeterSD::fnumberOfCellsInPhi
private

Definition at line 56 of file ExN04CalorimeterSD.hh.


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

Applications | User Support | Publications | Collaboration