Geant4  10.02.p03
GammaRayTelCalorimeterSD Class Reference

#include <GammaRayTelCalorimeterSD.hh>

Inheritance diagram for GammaRayTelCalorimeterSD:
Collaboration diagram for GammaRayTelCalorimeterSD:

Public Member Functions

 GammaRayTelCalorimeterSD (G4String)
 
 ~GammaRayTelCalorimeterSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *astep, G4TouchableHistory *ROHist)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void DrawAll ()
 
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

GammaRayTelCalorimeterHitsCollectionCalorimeterCollection
 
GammaRayTelDetectorConstructionDetector
 
G4intChitXID
 
G4intChitYID
 
G4int NbOfCALLayers
 
G4int NbOfCALBars
 
G4int NbOfCALChannels
 

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 51 of file GammaRayTelCalorimeterSD.hh.

Constructor & Destructor Documentation

◆ GammaRayTelCalorimeterSD()

GammaRayTelCalorimeterSD::GammaRayTelCalorimeterSD ( G4String  name)

Definition at line 52 of file GammaRayTelCalorimeterSD.cc.

53 {
55  Detector =
57 
60 
61  //G4cout << NbOfCALBars << " bars " << G4endl;
62  //G4cout << NbOfCALLayers << " layers " << G4endl;
63 
65 
68  collectionName.insert("CalorimeterCollection");
69 }
GammaRayTelDetectorConstruction * Detector
int G4int
Definition: G4Types.hh:78
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
Here is the call graph for this function:

◆ ~GammaRayTelCalorimeterSD()

GammaRayTelCalorimeterSD::~GammaRayTelCalorimeterSD ( )

Definition at line 73 of file GammaRayTelCalorimeterSD.cc.

74 {
75  delete [] ChitXID;
76  delete [] ChitYID;
77 }

Member Function Documentation

◆ clear()

void GammaRayTelCalorimeterSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 192 of file GammaRayTelCalorimeterSD.cc.

193 {}

◆ DrawAll()

void GammaRayTelCalorimeterSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 197 of file GammaRayTelCalorimeterSD.cc.

198 {}

◆ EndOfEvent()

void GammaRayTelCalorimeterSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 172 of file GammaRayTelCalorimeterSD.cc.

173 {
174  static G4int HCID = -1;
175  if(HCID<0)
176  {
178  }
180 
181 
182  for (G4int i=0;i<NbOfCALChannels;i++)
183  {
184  ChitXID[i] = -1;
185  ChitYID[i] = -1;
186  };
187 }
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
GammaRayTelCalorimeterHitsCollection * CalorimeterCollection
G4CollectionNameVector collectionName
Here is the call graph for this function:

◆ Initialize()

void GammaRayTelCalorimeterSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 81 of file GammaRayTelCalorimeterSD.cc.

82 {
85  for (G4int i=0;i<NbOfCALChannels;i++)
86  {
87  ChitXID[i] = -1;
88  ChitYID[i] = -1;
89  };
90 }
int G4int
Definition: G4Types.hh:78
G4THitsCollection< GammaRayTelCalorimeterHit > GammaRayTelCalorimeterHitsCollection
GammaRayTelCalorimeterHitsCollection * CalorimeterCollection
G4CollectionNameVector collectionName

◆ PrintAll()

void GammaRayTelCalorimeterSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 202 of file GammaRayTelCalorimeterSD.cc.

203 {}

◆ ProcessHits()

G4bool GammaRayTelCalorimeterSD::ProcessHits ( G4Step *  astep,
G4TouchableHistory ROHist 
)
virtual

Implements G4VSensitiveDetector.

Definition at line 94 of file GammaRayTelCalorimeterSD.cc.

95 {
96 
97  G4double edep = aStep->GetTotalEnergyDeposit();
98  if ((edep/keV == 0.)) return false;
99 
100  // This TouchableHistory is used to obtain the physical volume
101  // of the hit
102  G4TouchableHistory* theTouchable
103  = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
104 
105  G4VPhysicalVolume* cal_bar = theTouchable->GetVolume();
106  G4VPhysicalVolume* cal_plane = theTouchable->GetVolume(1);
107 
108  G4int CALBarNumber=cal_bar->GetCopyNo();
109  G4String CALBarName = cal_bar->GetName();
110 
111  G4int PlaneNumber = 0;
112  PlaneNumber=cal_plane->GetCopyNo();
113  G4String PlaneName = cal_plane->GetName();
114 
115 
116  G4int NChannel = 0;
117 
118  NChannel = PlaneNumber * NbOfCALBars + CALBarNumber;
119 
120  if (PlaneName == "CALLayerX" )
121 
122  // The hit is on an X CsI plane
123 
124  {
125  // This is a new hit
126  if (ChitXID[NChannel]==-1)
127  {
129  CalorimeterHit->SetCALType(1);
130  CalorimeterHit->AddEnergy(edep);
131  CalorimeterHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
132  CalorimeterHit->SetCALPlaneNumber(PlaneNumber);
133  CalorimeterHit->SetCALBarNumber(CALBarNumber);
134  ChitXID[NChannel] =
135  CalorimeterCollection->insert(CalorimeterHit) -1;
136  }
137  else // This is not new
138  {
139  (*CalorimeterCollection)
140  [ChitXID[NChannel]]->AddEnergy(edep);
141  }
142  }
143 
144  if (PlaneName == "CALLayerY")
145  // The hit is on an Y CsI plane
146  {
147  // This is a new hit
148  if (ChitYID[NChannel]==-1)
149  {
150  GammaRayTelCalorimeterHit* CalorimeterHit
152  CalorimeterHit->SetCALType(0);
153  CalorimeterHit->AddEnergy(edep);
154  CalorimeterHit->SetPos(aStep->GetPreStepPoint()->GetPosition());
155  CalorimeterHit->SetCALPlaneNumber(PlaneNumber);
156  CalorimeterHit->SetCALBarNumber(CALBarNumber);
157  ChitYID[NChannel] =
158  CalorimeterCollection->insert(CalorimeterHit)-1;
159  }
160  else // This is not new
161  {
162  (*CalorimeterCollection)
163  [ChitYID[NChannel]]->AddEnergy(edep);
164  }
165  }
166 
167  return true;
168 }
int G4int
Definition: G4Types.hh:78
Double_t edep
const G4String & GetName() const
virtual G4int GetCopyNo() const =0
GammaRayTelCalorimeterHitsCollection * CalorimeterCollection
G4VPhysicalVolume * GetVolume(G4int depth=0) const
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ CalorimeterCollection

GammaRayTelCalorimeterHitsCollection* GammaRayTelCalorimeterSD::CalorimeterCollection
private

Definition at line 67 of file GammaRayTelCalorimeterSD.hh.

◆ ChitXID

G4int* GammaRayTelCalorimeterSD::ChitXID
private

Definition at line 70 of file GammaRayTelCalorimeterSD.hh.

◆ ChitYID

G4int* GammaRayTelCalorimeterSD::ChitYID
private

Definition at line 71 of file GammaRayTelCalorimeterSD.hh.

◆ Detector

GammaRayTelDetectorConstruction* GammaRayTelCalorimeterSD::Detector
private

Definition at line 68 of file GammaRayTelCalorimeterSD.hh.

◆ NbOfCALBars

G4int GammaRayTelCalorimeterSD::NbOfCALBars
private

Definition at line 74 of file GammaRayTelCalorimeterSD.hh.

◆ NbOfCALChannels

G4int GammaRayTelCalorimeterSD::NbOfCALChannels
private

Definition at line 75 of file GammaRayTelCalorimeterSD.hh.

◆ NbOfCALLayers

G4int GammaRayTelCalorimeterSD::NbOfCALLayers
private

Definition at line 73 of file GammaRayTelCalorimeterSD.hh.


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