Geant4  10.02.p03
RE05CalorimeterSD Class Reference

#include <RE05CalorimeterSD.hh>

Inheritance diagram for RE05CalorimeterSD:
Collaboration diagram for RE05CalorimeterSD:

Public Member Functions

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

RE05CalorimeterHitsCollectionCalCollection
 
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

Definition at line 41 of file RE05CalorimeterSD.hh.

Constructor & Destructor Documentation

◆ RE05CalorimeterSD()

RE05CalorimeterSD::RE05CalorimeterSD ( G4String  name)

Definition at line 46 of file RE05CalorimeterSD.cc.

49 {
50  G4String HCname;
51  collectionName.insert(HCname="calCollection");
52 }
const int numberOfCellsInPhi
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ ~RE05CalorimeterSD()

RE05CalorimeterSD::~RE05CalorimeterSD ( )
virtual

Definition at line 56 of file RE05CalorimeterSD.cc.

57 {;}

Member Function Documentation

◆ clear()

void RE05CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 125 of file RE05CalorimeterSD.cc.

126 {
127 }

◆ DrawAll()

void RE05CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 129 of file RE05CalorimeterSD.cc.

130 {
131 }

◆ EndOfEvent()

void RE05CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 117 of file RE05CalorimeterSD.cc.

118 {
119  static G4int HCID = -1;
120  if(HCID<0)
121  { HCID = GetCollectionID(0); }
122  HCE->AddHitsCollection( HCID, CalCollection );
123 }
RE05CalorimeterHitsCollection * CalCollection
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
Here is the call graph for this function:

◆ Initialize()

void RE05CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 59 of file RE05CalorimeterSD.cc.

60 {
63  for(G4int j=0;j<numberOfCellsInZ;j++)
64  for(G4int k=0;k<numberOfCellsInPhi;k++)
65  {
66  CellID[j][k] = -1;
67  }
68  verboseLevel = 0;
69 }
RE05CalorimeterHitsCollection * CalCollection
G4THitsCollection< RE05CalorimeterHit > RE05CalorimeterHitsCollection
int G4int
Definition: G4Types.hh:78
const int numberOfCellsInPhi
G4CollectionNameVector collectionName

◆ PrintAll()

void RE05CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 133 of file RE05CalorimeterSD.cc.

134 {
135 }

◆ ProcessHits()

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

Implements G4VSensitiveDetector.

Definition at line 73 of file RE05CalorimeterSD.cc.

74 {
75 //***** RE05CalorimeterSD has been migrated to Geant4 version 10 that does not
76 //***** support Readout Geometry in multi-threaded mode. Now RE05CalorimeterSD
77 //***** is assigned to a dedicaed parallel world. The pointer "aStep" points to
78 //***** a G4Step object for the parallel world.
79 
80  G4double edep = aStep->GetTotalEnergyDeposit();
81  if(verboseLevel>1) G4cout << "Next step edep(MeV) = " << edep/MeV << G4endl;
82  if(edep==0.) return false;
83 
84  const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
85  G4int copyIDinZ = touchable->GetReplicaNumber(0);
86  G4int copyIDinPhi = touchable->GetReplicaNumber(1);
87 
88  if(CellID[copyIDinZ][copyIDinPhi]==-1)
89  {
90  RE05CalorimeterHit* calHit
91  = new RE05CalorimeterHit
92  (touchable->GetVolume()->GetLogicalVolume(),copyIDinZ,copyIDinPhi);
93  calHit->SetEdep( edep );
94  G4AffineTransform aTrans = touchable->GetHistory()->GetTopTransform();
95  aTrans.Invert();
96  calHit->SetPos(aTrans.NetTranslation());
97  calHit->SetRot(aTrans.NetRotation());
98  G4int icell = CalCollection->insert( calHit );
99  CellID[copyIDinZ][copyIDinPhi] = icell - 1;
100  if(verboseLevel>0)
101  { G4cout << " New Calorimeter Hit on CellID "
102  << copyIDinZ << " " << copyIDinPhi << G4endl; }
103  }
104  else
105  {
106  (*CalCollection)[CellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
107  if(verboseLevel>0)
108  { G4cout << " Energy added to CellID "
109  << copyIDinZ << " " << copyIDinPhi << G4endl; }
110  }
111 
112  return true;
113 }
static const double MeV
Definition: G4SIunits.hh:211
void SetRot(G4RotationMatrix rmat)
RE05CalorimeterHitsCollection * CalCollection
void SetEdep(G4double de)
int G4int
Definition: G4Types.hh:78
Double_t edep
G4AffineTransform & Invert()
G4RotationMatrix NetRotation() const
G4GLOB_DLL std::ostream G4cout
G4ThreeVector NetTranslation() const
void SetPos(G4ThreeVector xyz)
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
virtual const G4NavigationHistory * GetHistory() const
Definition: G4VTouchable.cc:86
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
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:

Member Data Documentation

◆ CalCollection

RE05CalorimeterHitsCollection* RE05CalorimeterSD::CalCollection
private

Definition at line 56 of file RE05CalorimeterSD.hh.

◆ CellID

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

Definition at line 57 of file RE05CalorimeterSD.hh.

◆ numberOfCellsInPhi

const int RE05CalorimeterSD::numberOfCellsInPhi
private

Definition at line 59 of file RE05CalorimeterSD.hh.

◆ numberOfCellsInZ

const int RE05CalorimeterSD::numberOfCellsInZ
private

Definition at line 58 of file RE05CalorimeterSD.hh.


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