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

Hadron calorimeter sensitive detector. More...

#include <B5HadCalorimeterSD.hh>

Inheritance diagram for B5HadCalorimeterSD:
G4VSensitiveDetector

Public Member Functions

 B5HadCalorimeterSD (G4String name)
 
virtual ~B5HadCalorimeterSD ()
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
- 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
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
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

Hadron calorimeter sensitive detector.

Definition at line 44 of file B5HadCalorimeterSD.hh.

Constructor & Destructor Documentation

B5HadCalorimeterSD::B5HadCalorimeterSD ( G4String  name)

Definition at line 43 of file B5HadCalorimeterSD.cc.

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

44 : G4VSensitiveDetector(name), fHitsCollection(0), fHCID(-1)
45 {
46  collectionName.insert("HadCalorimeterColl");
47 }
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
B5HadCalorimeterSD::~B5HadCalorimeterSD ( )
virtual

Definition at line 51 of file B5HadCalorimeterSD.cc.

52 {}

Member Function Documentation

void B5HadCalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 56 of file B5HadCalorimeterSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4SDManager::GetCollectionID(), G4SDManager::GetSDMpointer(), G4THitsCollection< T >::insert(), and G4VSensitiveDetector::SensitiveDetectorName.

57 {
58  fHitsCollection
60  if (fHCID<0)
61  { fHCID = G4SDManager::GetSDMpointer()->GetCollectionID(fHitsCollection); }
62  hce->AddHitsCollection(fHCID,fHitsCollection);
63 
64  // fill calorimeter hits with zero energy deposition
65  for (G4int iColumn=0;iColumn<10;iColumn++)
66  for (G4int iRow=0;iRow<2;iRow++)
67  {
69  fHitsCollection->insert(hit);
70  }
71 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
G4THitsCollection< B5HadCalorimeterHit > B5HadCalorimeterHitsCollection
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
G4bool B5HadCalorimeterSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 75 of file B5HadCalorimeterSD.cc.

References B5HadCalorimeterHit::AddEdep(), B5HadCalorimeterHit::GetColumnID(), G4VPhysicalVolume::GetCopyNo(), G4NavigationHistory::GetDepth(), G4TouchableHistory::GetHistory(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4NavigationHistory::GetTransform(), G4TouchableHistory::GetVolume(), G4AffineTransform::Invert(), G4AffineTransform::NetRotation(), G4AffineTransform::NetTranslation(), B5HadCalorimeterHit::SetColumnID(), B5HadCalorimeterHit::SetPos(), B5HadCalorimeterHit::SetRot(), and B5HadCalorimeterHit::SetRowID().

76 {
77  G4double edep = step->GetTotalEnergyDeposit();
78  if (edep==0.) return true;
79 
80  G4TouchableHistory* touchable
81  = (G4TouchableHistory*)(step->GetPreStepPoint()->GetTouchable());
82 
83  G4VPhysicalVolume* cellPhysical = touchable->GetVolume(2);
84  G4int rowNo = cellPhysical->GetCopyNo();
85 
86  G4VPhysicalVolume* columnPhysical = touchable->GetVolume(3);
87  G4int columnNo = columnPhysical->GetCopyNo();
88 
89  G4int hitID = 2*columnNo+rowNo;
90  B5HadCalorimeterHit* hit = (*fHitsCollection)[hitID];
91 
92  // check if it is first touch
93  if (hit->GetColumnID()<0)
94  {
95  hit->SetColumnID(columnNo);
96  hit->SetRowID(rowNo);
97  G4int depth = touchable->GetHistory()->GetDepth();
98  G4AffineTransform transform
99  = touchable->GetHistory()->GetTransform(depth-2);
100  transform.Invert();
101  hit->SetRot(transform.NetRotation());
102  hit->SetPos(transform.NetTranslation());
103  }
104  // add energy deposition
105  hit->AddEdep(edep);
106 
107  return true;
108 }
G4int GetColumnID() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4int GetDepth() const
G4ThreeVector NetTranslation() const
int G4int
Definition: G4Types.hh:78
void AddEdep(G4double de)
G4AffineTransform & Invert()
void SetPos(G4ThreeVector xyz)
G4RotationMatrix NetRotation() const
void SetRot(G4RotationMatrix rmat)
const G4AffineTransform & GetTransform(G4int n) const
virtual G4int GetCopyNo() const =0
const G4NavigationHistory * GetHistory() const
double G4double
Definition: G4Types.hh:76

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