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

#include <Par01CalorimeterSD.hh>

Inheritance diagram for Par01CalorimeterSD:
G4VSensitiveDetector

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 ()
 
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 38 of file Par01CalorimeterSD.hh.

Constructor & Destructor Documentation

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

Definition at line 40 of file Par01CalorimeterSD.cc.

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

43  : G4VSensitiveDetector(name),
44  fNumberOfCells(nCells),
45  fHCID(-1)
46 {
47  G4String HCname;
48  collectionName.insert(HCname=colName);
49  fCellID = new G4int[fNumberOfCells];
50 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
Par01CalorimeterSD::~Par01CalorimeterSD ( )

Definition at line 52 of file Par01CalorimeterSD.cc.

53 {
54  delete [] fCellID;
55 }

Member Function Documentation

void Par01CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 107 of file Par01CalorimeterSD.cc.

108 {
109 }
void Par01CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 111 of file Par01CalorimeterSD.cc.

112 {
113 }
void Par01CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 100 of file Par01CalorimeterSD.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VSensitiveDetector::collectionName, G4SDManager::GetCollectionID(), and G4SDManager::GetSDMpointer().

101 {
102  if(fHCID<0)
104  HCE->AddHitsCollection( fHCID, fCalCollection );
105 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
void Par01CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 57 of file Par01CalorimeterSD.cc.

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

58 {
59  fCalCollection = new Par01CalorimeterHitsCollection
61  for(G4int j=0;j<fNumberOfCells;j++)
62  {
63  fCellID[j] = -1;
64  }
65 }
G4THitsCollection< Par01CalorimeterHit > Par01CalorimeterHitsCollection
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
void Par01CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file Par01CalorimeterSD.cc.

116 {
117 }
G4bool Par01CalorimeterSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 67 of file Par01CalorimeterSD.cc.

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

68 {
69  G4double edep = aStep->GetTotalEnergyDeposit();
70  if(edep<=0.) return false;
71 
73  const G4VPhysicalVolume* physVol = hist->GetVolume();
74  G4int copyID = hist->GetReplicaNumber();
75 
76  if(fCellID[copyID]==-1)
77  {
78  Par01CalorimeterHit* calHit =
79  new Par01CalorimeterHit(physVol->GetLogicalVolume());
80  calHit->SetEdep( edep );
81  G4AffineTransform aTrans = hist->GetHistory()->GetTopTransform();
82  aTrans.Invert();
83  calHit->SetPos(aTrans.NetTranslation());
84  calHit->SetRot(aTrans.NetRotation());
85  G4int icell = fCalCollection->insert( calHit );
86  fCellID[copyID] = icell - 1;
87  if(verboseLevel>0)
88  { G4cout << " New Calorimeter Hit on CellID " << copyID << G4endl; }
89  }
90  else
91  {
92  (*fCalCollection)[fCellID[copyID]]->AddEdep( edep );
93  if(verboseLevel>0)
94  { G4cout << " Energy added to CellID " << copyID << G4endl; }
95  }
96 
97  return true;
98 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
void SetEdep(G4double de)
G4ThreeVector NetTranslation() const
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

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