Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
RE05CalorimeterSD Class Reference

#include <RE05CalorimeterSD.hh>

Inheritance diagram for RE05CalorimeterSD:
G4VSensitiveDetector

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 ()
 
const 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 RE05CalorimeterSD.hh.

Constructor & Destructor Documentation

RE05CalorimeterSD::RE05CalorimeterSD ( G4String  name)

Definition at line 46 of file RE05CalorimeterSD.cc.

References G4VSensitiveDetector::collectionName, and G4CollectionNameVector::insert().

48  numberOfCellsInZ(20),numberOfCellsInPhi(48)
49 {
50  G4String HCname;
51  collectionName.insert(HCname="calCollection");
52 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
RE05CalorimeterSD::~RE05CalorimeterSD ( )
virtual

Definition at line 56 of file RE05CalorimeterSD.cc.

57 {;}

Member Function Documentation

void RE05CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 125 of file RE05CalorimeterSD.cc.

126 {
127 }
void RE05CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 129 of file RE05CalorimeterSD.cc.

130 {
131 }
void RE05CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 117 of file RE05CalorimeterSD.cc.

References G4HCofThisEvent::AddHitsCollection(), and G4VSensitiveDetector::GetCollectionID().

118 {
119  static G4int HCID = -1;
120  if(HCID<0)
121  { HCID = GetCollectionID(0); }
122  HCE->AddHitsCollection( HCID, CalCollection );
123 }
int G4int
Definition: G4Types.hh:78
virtual G4int GetCollectionID(G4int i)
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
void RE05CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 59 of file RE05CalorimeterSD.cc.

References G4VSensitiveDetector::collectionName, G4VSensitiveDetector::SensitiveDetectorName, and G4VSensitiveDetector::verboseLevel.

60 {
61  CalCollection = new RE05CalorimeterHitsCollection
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 }
G4THitsCollection< RE05CalorimeterHit > RE05CalorimeterHitsCollection
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
void RE05CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 133 of file RE05CalorimeterSD.cc.

134 {
135 }
G4bool RE05CalorimeterSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 73 of file RE05CalorimeterSD.cc.

References G4cout, G4endl, G4VTouchable::GetHistory(), G4VPhysicalVolume::GetLogicalVolume(), G4Step::GetPreStepPoint(), G4VTouchable::GetReplicaNumber(), G4NavigationHistory::GetTopTransform(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4VTouchable::GetVolume(), G4THitsCollection< T >::insert(), G4AffineTransform::Invert(), python.hepunit::MeV, G4AffineTransform::NetRotation(), G4AffineTransform::NetTranslation(), RE05CalorimeterHit::SetEdep(), RE05CalorimeterHit::SetPos(), RE05CalorimeterHit::SetRot(), and G4VSensitiveDetector::verboseLevel.

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 }
void SetRot(G4RotationMatrix rmat)
G4ThreeVector NetTranslation() const
virtual const G4NavigationHistory * GetHistory() const
Definition: G4VTouchable.cc:86
const G4VTouchable * GetTouchable() const
void SetEdep(G4double de)
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4AffineTransform & Invert()
G4GLOB_DLL std::ostream G4cout
void SetPos(G4ThreeVector xyz)
G4double GetTotalEnergyDeposit() const
G4RotationMatrix NetRotation() const
G4LogicalVolume * GetLogicalVolume() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
#define G4endl
Definition: G4ios.hh:61
const G4AffineTransform & GetTopTransform() const
double G4double
Definition: G4Types.hh:76

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