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

#include <XrayFluoHPGeSD.hh>

Inheritance diagram for XrayFluoHPGeSD:
G4VSensitiveDetector

Public Member Functions

 XrayFluoHPGeSD (G4String, XrayFluoDetectorConstruction *)
 
 ~XrayFluoHPGeSD ()
 
void Initialize (G4HCofThisEvent *)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void DrawAll ()
 
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
 

Protected Member Functions

G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 

Additional Inherited Members

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

Constructor & Destructor Documentation

XrayFluoHPGeSD::XrayFluoHPGeSD ( G4String  name,
XrayFluoDetectorConstruction det 
)

Definition at line 51 of file XrayFluoHPGeSD.cc.

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

53 :G4VSensitiveDetector(name),Detector(det)
54 {
55  collectionName.insert("HPGeCollection");
56  HitHPGeID = new G4int[500];
57  //G4cout << "XrayFluoHPGeSD created" << G4endl;
58 
59 }
int G4int
Definition: G4Types.hh:78
G4VSensitiveDetector(G4String name)
G4CollectionNameVector collectionName
XrayFluoHPGeSD::~XrayFluoHPGeSD ( )

Definition at line 63 of file XrayFluoHPGeSD.cc.

References G4cout, and G4endl.

64 {
65 
66  delete [] HitHPGeID;
67 
68  // delete HPGeCollection;
69 
70  G4cout << "XrayFluoHPGeSD deleted" << G4endl;
71 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Member Function Documentation

void XrayFluoHPGeSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 160 of file XrayFluoHPGeSD.cc.

161 {}
void XrayFluoHPGeSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 165 of file XrayFluoHPGeSD.cc.

166 {}
void XrayFluoHPGeSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 150 of file XrayFluoHPGeSD.cc.

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

151 {
152  static G4int HCID = -1;
153  if(HCID<0)
155  HCE->AddHitsCollection(HCID,HPGeCollection);
156 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4CollectionNameVector collectionName
void XrayFluoHPGeSD::Initialize ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 75 of file XrayFluoHPGeSD.cc.

References G4VSensitiveDetector::collectionName, XrayFluoDetectorConstruction::GetNbOfPixels(), and G4VSensitiveDetector::SensitiveDetectorName.

79 {
80  if (HCE){
81 
82  HPGeCollection = new XrayFluoSensorHitsCollection
84  for (G4int j=0;j<Detector->GetNbOfPixels();j++)
85  {HitHPGeID [j]= -1;};
86  }
87 }
int G4int
Definition: G4Types.hh:78
G4THitsCollection< XrayFluoSensorHit > XrayFluoSensorHitsCollection
G4CollectionNameVector collectionName
void XrayFluoHPGeSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 170 of file XrayFluoHPGeSD.cc.

171 {}
G4bool XrayFluoHPGeSD::ProcessHits ( G4Step aStep,
G4TouchableHistory ROhist 
)
protectedvirtual

Implements G4VSensitiveDetector.

Definition at line 90 of file XrayFluoHPGeSD.cc.

References XrayFluoSensorHit::AddEnergy(), G4cout, G4endl, G4VPhysicalVolume::GetCopyNo(), XrayFluoDetectorConstruction::GetNbOfPixels(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4TouchableHistory::GetVolume(), G4THitsCollection< T >::insert(), and G4VSensitiveDetector::verboseLevel.

91 {
92 
93  if (ROhist){
94 
95  G4double edep = aStep->GetTotalEnergyDeposit();
96  // G4String particleName = aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName();
97  // G4String processName = aStep->GetTrack()->GetCreatorProcess()->GetProcessName();
98 
99  // G4double partEnergy = aStep->GetPreStepPoint()->GetKineticEnergy();
100  // G4double secondEnergy = aStep->GetPostStepPoint()->GetKineticEnergy();
101  // G4cout << " la particella che deposita e': " << particleName << " ha una energia di keV "
102  // << partEnergy << " e deposita "<< edep << G4endl;
103  // G4cout << " la particella creata deposita: " << secondEnergy << G4endl;
104  // if (processName){
105 
106 
107 
108  // G4cout << " la particella viene da: " << processName << G4endl;
109  // }
110 
111  // else {G4cout << " il deposito proviene da: Rayleugh" << G4endl;}
112 
113  if (edep==0.) return false;
114 
115  // G4cout << " edep = " << edep << G4endl;
116 
117  G4TouchableHistory* theTouchable
119 
120  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
121  // theTouchable->MoveUpHistory();
122  G4int PixelNumber = 0;
123  if (Detector->GetNbOfPixels()>1) PixelNumber= physVol->GetCopyNo() ;
124  if ( HitHPGeID[PixelNumber]==-1)
125  {
126  XrayFluoSensorHit* HPGeHit = new XrayFluoSensorHit();
127  HPGeHit->AddEnergy(edep);
128  HitHPGeID[PixelNumber] = HPGeCollection->insert(HPGeHit) - 1;
129  if (verboseLevel>0){
130  G4cout << " New Hit on pixel: " << PixelNumber << G4endl;
131  }
132  }
133  else
134  {
135  (*HPGeCollection)[HitHPGeID[PixelNumber]]->AddEnergy(edep);
136  //G4double ED =(*HPGeCollection)[HitHPGeID[PixelNumber]]->GetEdepTot();
137  if (verboseLevel>0)
138  G4cout << " Energy added to Pixel: " << PixelNumber << G4endl;
139  }
140 
141  return true;
142  }
143  else {return false;}
144 
145 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
const G4VTouchable * GetTouchable() const
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
G4double GetTotalEnergyDeposit() const
void AddEnergy(G4double de)
virtual G4int GetCopyNo() const =0
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

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