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

#include <F02CalorimeterSD.hh>

Inheritance diagram for F02CalorimeterSD:
Collaboration diagram for F02CalorimeterSD:

Public Member Functions

 F02CalorimeterSD (G4String, F02DetectorConstruction *)
 
virtual ~F02CalorimeterSD ()
 
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 46 of file F02CalorimeterSD.hh.

Constructor & Destructor Documentation

F02CalorimeterSD::F02CalorimeterSD ( G4String  name,
F02DetectorConstruction det 
)

Definition at line 49 of file F02CalorimeterSD.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:

F02CalorimeterSD::~F02CalorimeterSD ( )
virtual

Definition at line 61 of file F02CalorimeterSD.cc.

62 {
63  delete [] fHitID;
64 }

Member Function Documentation

void F02CalorimeterSD::EndOfEvent ( G4HCofThisEvent hce)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 113 of file F02CalorimeterSD.cc.

114 {
115  static G4int hcID = -1;
116  if (hcID<0)
118  hce->AddHitsCollection(hcID,fCalCollection);
119 }
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 F02CalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 68 of file F02CalorimeterSD.cc.

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

Implements G4VSensitiveDetector.

Definition at line 77 of file F02CalorimeterSD.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  F02CalorHit* calHit = new F02CalorHit();
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 F02: " << 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 F02: " << number << G4endl;
106  }
107 
108  return true;
109 }
G4double GetStepLength() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
void AddAbs(G4double de, G4double dl)
Definition: F02CalorHit.hh:61
G4int insert(T *aHit)
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
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: