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

#include <Par01CalorimeterSD.hh>

Inheritance diagram for Par01CalorimeterSD:
Collaboration diagram for Par01CalorimeterSD:

Public Member Functions

 Par01CalorimeterSD (G4String name, G4int nCells, G4String colName)
 
 ~Par01CalorimeterSD ()
 
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
 

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 Par01CalorimeterSD.hh.

Constructor & Destructor Documentation

Par01CalorimeterSD::Par01CalorimeterSD ( G4String  name,
G4int  nCells,
G4String  colName 
)

Definition at line 45 of file Par01CalorimeterSD.cc.

48  : G4VSensitiveDetector(name),
49  fNumberOfCells(nCells),
50  fHCID(-1)
51 {
52  G4String HCname;
53  collectionName.insert(HCname=colName);
54  fCellID = new G4int[fNumberOfCells];
55 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName

Here is the call graph for this function:

Par01CalorimeterSD::~Par01CalorimeterSD ( )

Definition at line 59 of file Par01CalorimeterSD.cc.

60 {
61  delete [] fCellID;
62 }

Member Function Documentation

void Par01CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 122 of file Par01CalorimeterSD.cc.

123 {
124 }
void Par01CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 128 of file Par01CalorimeterSD.cc.

129 {
130 }
void Par01CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 113 of file Par01CalorimeterSD.cc.

114 {
115  if(fHCID<0)
117  HCE->AddHitsCollection( fHCID, fCalCollection );
118 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName

Here is the call graph for this function:

void Par01CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 66 of file Par01CalorimeterSD.cc.

67 {
68  fCalCollection = new Par01CalorimeterHitsCollection
70  for(G4int j=0;j<fNumberOfCells;j++)
71  {
72  fCellID[j] = -1;
73  }
74 }
G4THitsCollection< Par01CalorimeterHit > Par01CalorimeterHitsCollection
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
void Par01CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 134 of file Par01CalorimeterSD.cc.

135 {
136 }
G4bool Par01CalorimeterSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 78 of file Par01CalorimeterSD.cc.

79 {
80  G4double edep = aStep->GetTotalEnergyDeposit();
81  if(edep<=0.) return false;
82 
84  const G4VPhysicalVolume* physVol = hist->GetVolume();
85  G4int copyID = hist->GetReplicaNumber();
86 
87  if(fCellID[copyID]==-1)
88  {
89  Par01CalorimeterHit* calHit =
90  new Par01CalorimeterHit(physVol->GetLogicalVolume());
91  calHit->SetEdep( edep );
92  G4AffineTransform aTrans = hist->GetHistory()->GetTopTransform();
93  aTrans.Invert();
94  calHit->SetPos(aTrans.NetTranslation());
95  calHit->SetRot(aTrans.NetRotation());
96  G4int icell = fCalCollection->insert( calHit );
97  fCellID[copyID] = icell - 1;
98  if(verboseLevel>0)
99  { G4cout << " New Calorimeter Hit on CellID " << copyID << G4endl; }
100  }
101  else
102  {
103  (*fCalCollection)[fCellID[copyID]]->AddEdep( edep );
104  if(verboseLevel>0)
105  { G4cout << " Energy added to CellID " << copyID << G4endl; }
106  }
107 
108  return true;
109 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
void SetEdep(G4double de)
G4ThreeVector NetTranslation() const
G4int insert(T *aHit)
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
void SetPos(G4ThreeVector xyz)
G4AffineTransform & Invert()
G4GLOB_DLL std::ostream G4cout
G4int GetReplicaNumber(G4int depth=0) const
G4double GetTotalEnergyDeposit() const
G4RotationMatrix NetRotation() const
G4LogicalVolume * GetLogicalVolume() const
#define G4endl
Definition: G4ios.hh:61
const G4AffineTransform & GetTopTransform() const
const G4NavigationHistory * GetHistory() const
void SetRot(G4RotationMatrix rmat)
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: