Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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

Definition at line 41 of file ExN04CalorimeterSD.hh.

Constructor & Destructor Documentation

ExN04CalorimeterSD::ExN04CalorimeterSD ( G4String  name)

Definition at line 45 of file ExN04CalorimeterSD.cc.

46  : G4VSensitiveDetector(name), fnumberOfCellsInZ(20), fnumberOfCellsInPhi(48)
47 {
48  G4String HCname;
49  collectionName.insert(HCname="calCollection");
50 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

ExN04CalorimeterSD::~ExN04CalorimeterSD ( )

Definition at line 53 of file ExN04CalorimeterSD.cc.

54 {
55 }
ExN04CalorimeterSD::ExN04CalorimeterSD ( G4String  name)
ExN04CalorimeterSD::~ExN04CalorimeterSD ( )

Member Function Documentation

void ExN04CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 124 of file ExN04CalorimeterSD.cc.

125 {
126 }
void ExN04CalorimeterSD::clear ( )
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 129 of file ExN04CalorimeterSD.cc.

130 {
131 }
void ExN04CalorimeterSD::DrawAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

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 }
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)

Here is the call graph for this function:

void ExN04CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 58 of file ExN04CalorimeterSD.cc.

59 {
60  fCalCollection = new ExN04CalorimeterHitsCollection
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
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
void ExN04CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

void ExN04CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 134 of file ExN04CalorimeterSD.cc.

135 {
136 }
void ExN04CalorimeterSD::PrintAll ( )
virtual

Reimplemented from G4VSensitiveDetector.

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

Implements G4VSensitiveDetector.

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 =
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 }
G4ThreeVector NetTranslation() const
G4int insert(T *aHit)
int G4int
Definition: G4Types.hh:78
G4AffineTransform & Invert()
G4GLOB_DLL std::ostream G4cout
G4RotationMatrix NetRotation() const
G4LogicalVolume * GetLogicalVolume() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
const G4AffineTransform & GetTopTransform() const
const G4NavigationHistory * GetHistory() const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Implements G4VSensitiveDetector.


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