Geant4  10.02.p03
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
 

Private Attributes

Par01CalorimeterHitsCollectionfCalCollection
 
int * fCellID
 
int fNumberOfCells
 
int fHCID
 

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

Definition at line 40 of file Par01CalorimeterSD.cc.

43  : G4VSensitiveDetector(name),
44  fNumberOfCells(nCells),
45  fHCID(-1)
46 {
47  G4String HCname;
48  collectionName.insert(HCname=colName);
50 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ ~Par01CalorimeterSD()

Par01CalorimeterSD::~Par01CalorimeterSD ( )

Definition at line 52 of file Par01CalorimeterSD.cc.

53 {
54  delete [] fCellID;
55 }

Member Function Documentation

◆ clear()

void Par01CalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 107 of file Par01CalorimeterSD.cc.

108 {
109 }

◆ DrawAll()

void Par01CalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 111 of file Par01CalorimeterSD.cc.

112 {
113 }

◆ EndOfEvent()

void Par01CalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 100 of file Par01CalorimeterSD.cc.

101 {
102  if(fHCID<0)
105 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
Par01CalorimeterHitsCollection * fCalCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ Initialize()

void Par01CalorimeterSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 57 of file Par01CalorimeterSD.cc.

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

◆ PrintAll()

void Par01CalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 115 of file Par01CalorimeterSD.cc.

116 {
117 }

◆ ProcessHits()

G4bool Par01CalorimeterSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory ROhist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 67 of file Par01CalorimeterSD.cc.

68 {
69  G4double edep = aStep->GetTotalEnergyDeposit();
70  if(edep<=0.) return false;
71 
72  G4TouchableHistory* hist = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
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 }
const G4NavigationHistory * GetHistory() const
void SetEdep(G4double de)
int G4int
Definition: G4Types.hh:78
Double_t edep
void SetPos(G4ThreeVector xyz)
G4AffineTransform & Invert()
G4RotationMatrix NetRotation() const
G4GLOB_DLL std::ostream G4cout
G4ThreeVector NetTranslation() const
G4int GetReplicaNumber(G4int depth=0) const
Par01CalorimeterHitsCollection * fCalCollection
TH2F * hist
const G4AffineTransform & GetTopTransform() const
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetVolume(G4int depth=0) const
void SetRot(G4RotationMatrix rmat)
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * GetLogicalVolume() const
Here is the call graph for this function:

Member Data Documentation

◆ fCalCollection

Par01CalorimeterHitsCollection* Par01CalorimeterSD::fCalCollection
private

Definition at line 53 of file Par01CalorimeterSD.hh.

◆ fCellID

int* Par01CalorimeterSD::fCellID
private

Definition at line 55 of file Par01CalorimeterSD.hh.

◆ fHCID

int Par01CalorimeterSD::fHCID
private

Definition at line 57 of file Par01CalorimeterSD.hh.

◆ fNumberOfCells

int Par01CalorimeterSD::fNumberOfCells
private

Definition at line 56 of file Par01CalorimeterSD.hh.


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