Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F01CalorimeterSD Class Reference

#include <F01CalorimeterSD.hh>

Inheritance diagram for F01CalorimeterSD:
Collaboration diagram for F01CalorimeterSD:

Public Member Functions

 F01CalorimeterSD (G4String, F01DetectorConstruction *)
 
virtual ~F01CalorimeterSD ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
- 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
 
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

Definition at line 48 of file F01CalorimeterSD.hh.

Constructor & Destructor Documentation

F01CalorimeterSD::F01CalorimeterSD ( G4String  name,
F01DetectorConstruction det 
)

Definition at line 49 of file F01CalorimeterSD.cc.

51 : G4VSensitiveDetector(name),
52  fCalCollection(0),
53  fDetector(det),
54  fHitID(new G4int[500])
55 {
56  collectionName.insert("CalCollection");
57 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

F01CalorimeterSD::~F01CalorimeterSD ( )
virtual

Definition at line 61 of file F01CalorimeterSD.cc.

62 {
63  delete [] fHitID;
64 }

Member Function Documentation

void F01CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 112 of file F01CalorimeterSD.cc.

113 {
114  static G4int hcID = -1;
115  if (hcID<0)
117  hce->AddHitsCollection(hcID,fCalCollection);
118 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName

Here is the call graph for this function:

void F01CalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 68 of file F01CalorimeterSD.cc.

69 {
70  fCalCollection = new F01CalorHitsCollection
72  for (G4int j=0;j<1; j++) {fHitID[j] = -1;};
73 }
G4THitsCollection< F01CalorHit > F01CalorHitsCollection
Definition: F01CalorHit.hh:82
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
G4bool F01CalorimeterSD::ProcessHits ( G4Step step,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 77 of file F01CalorimeterSD.cc.

78 {
79  G4double edep = step->GetTotalEnergyDeposit();
80  G4double stepl = 0.;
81 
82  stepl = step->GetStepLength();
83 
84  if ((edep == 0.) && (stepl == 0.) ) return false;
85 
86  G4TouchableHistory* theTouchable
88 
89  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
90 
91  G4int number = 0;
92  if (fHitID[number]==-1)
93  {
94  F01CalorHit* calHit = new F01CalorHit();
95  if (physVol == fDetector->GetAbsorber()) calHit->AddAbs(edep,stepl);
96  fHitID[number] = fCalCollection->insert(calHit) - 1;
97  if (verboseLevel>0)
98  G4cout << " New Calorimeter Hit on F01: " << number << G4endl;
99  }
100  else
101  {
102  if (physVol == fDetector->GetAbsorber())
103  (*fCalCollection)[fHitID[number]]->AddAbs(edep,stepl);
104  if (verboseLevel>0)
105  G4cout << " Energy added to F01: " << number << G4endl;
106  }
107  return true;
108 }
G4double GetStepLength() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4int insert(T *aHit)
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
void AddAbs(G4double de, G4double dl)
Definition: F01CalorHit.hh:63
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
const G4VPhysicalVolume * GetAbsorber()
G4double GetTotalEnergyDeposit() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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