Geant4  10.02.p03
ExN04CalorimeterSD Class Reference

#include <ExN04CalorimeterSD.hh>

Inheritance diagram for ExN04CalorimeterSD:
Collaboration diagram for ExN04CalorimeterSD:

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 ()
 
 ExN04CalorimeterSD (G4String name)
 
 ~ExN04CalorimeterSD ()
 
void Initialize (G4HCofThisEvent *HCE)
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
void EndOfEvent (G4HCofThisEvent *HCE)
 
void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Private Attributes

ExN04CalorimeterHitsCollectionfCalCollection
 
int fCellID [20][48]
 
const int fnumberOfCellsInZ
 
const int fnumberOfCellsInPhi
 
ExN04CalorimeterHitsCollectionCalCollection
 
int CellID [20][48]
 
const int numberOfCellsInZ
 
const int numberOfCellsInPhi
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Constructor & Destructor Documentation

◆ ExN04CalorimeterSD() [1/2]

ExN04CalorimeterSD::ExN04CalorimeterSD ( G4String  name)

Definition at line 45 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

Here is the call graph for this function:

◆ ~ExN04CalorimeterSD() [1/2]

ExN04CalorimeterSD::~ExN04CalorimeterSD ( )

Definition at line 53 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

54 {
55 }

◆ ExN04CalorimeterSD() [2/2]

ExN04CalorimeterSD::ExN04CalorimeterSD ( G4String  name)

◆ ~ExN04CalorimeterSD() [2/2]

ExN04CalorimeterSD::~ExN04CalorimeterSD ( )

Member Function Documentation

◆ clear() [1/2]

void ExN04CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 124 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

125 {
126 }

◆ clear() [2/2]

void ExN04CalorimeterSD::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ DrawAll() [1/2]

void ExN04CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 129 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

130 {
131 }

◆ DrawAll() [2/2]

void ExN04CalorimeterSD::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ EndOfEvent() [1/2]

void ExN04CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 114 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

115 {
116  static G4int HCID = -1;
117  if ( HCID < 0 ) {
118  HCID = GetCollectionID(0);
119  }
120  HCE-> AddHitsCollection(HCID, fCalCollection );
121 }
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)
Here is the call graph for this function:

◆ EndOfEvent() [2/2]

void ExN04CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

◆ Initialize() [1/2]

void ExN04CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 58 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

◆ Initialize() [2/2]

void ExN04CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

◆ PrintAll() [1/2]

void ExN04CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 134 of file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc.

135 {
136 }

◆ PrintAll() [2/2]

void ExN04CalorimeterSD::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

◆ ProcessHits() [1/2]

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

Implements G4VSensitiveDetector.

Definition at line 73 of file eventgenerator/HepMC/HepMCEx01/src/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 =
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 }
static const double MeV
Definition: G4SIunits.hh:211
const G4NavigationHistory * GetHistory() const
int G4int
Definition: G4Types.hh:78
Double_t edep
G4AffineTransform & Invert()
G4RotationMatrix NetRotation() const
G4GLOB_DLL std::ostream G4cout
G4ThreeVector NetTranslation() const
const G4AffineTransform & GetTopTransform() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * GetLogicalVolume() const
Here is the call graph for this function:

◆ ProcessHits() [2/2]

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

Implements G4VSensitiveDetector.

Member Data Documentation

◆ CalCollection

ExN04CalorimeterHitsCollection* ExN04CalorimeterSD::CalCollection
private

◆ CellID

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

◆ fCalCollection

ExN04CalorimeterHitsCollection* ExN04CalorimeterSD::fCalCollection
private

◆ fCellID

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

◆ fnumberOfCellsInPhi

const int ExN04CalorimeterSD::fnumberOfCellsInPhi
private

◆ fnumberOfCellsInZ

const int ExN04CalorimeterSD::fnumberOfCellsInZ
private

◆ numberOfCellsInPhi

const int ExN04CalorimeterSD::numberOfCellsInPhi
private

◆ numberOfCellsInZ

const int ExN04CalorimeterSD::numberOfCellsInZ
private

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