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

#include <XrayFluoSD.hh>

Inheritance diagram for XrayFluoSD:
G4VSensitiveDetector

Public Member Functions

 XrayFluoSD (G4String, XrayFluoDetectorConstruction *)
 
 XrayFluoSD (G4String, XrayFluoPlaneDetectorConstruction *)
 
 XrayFluoSD (G4String, XrayFluoMercuryDetectorConstruction *)
 
 ~XrayFluoSD ()
 
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 57 of file XrayFluoSD.hh.

Constructor & Destructor Documentation

XrayFluoSD::XrayFluoSD ( G4String  name,
XrayFluoDetectorConstruction det 
)

Definition at line 55 of file XrayFluoSD.cc.

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

57  :G4VSensitiveDetector(name),Detector(0),planeDetector(0),mercuryDetector(0)
58 {
59 
60  Detector = det;
61  collectionName.insert("HPGeCollection");
62  HitHPGeID = new G4int[500];
63  G4cout << "XrayFluoSD created" << G4endl;
64 
65 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector(G4String name)
#define G4endl
Definition: G4ios.hh:61
G4CollectionNameVector collectionName
XrayFluoSD::XrayFluoSD ( G4String  name,
XrayFluoPlaneDetectorConstruction det 
)

Definition at line 69 of file XrayFluoSD.cc.

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

71  :G4VSensitiveDetector(name),Detector(0),planeDetector(0),mercuryDetector(0)
72 {
73  planeDetector = det;
74  collectionName.insert("HPGeCollection");
75  HitHPGeID = new G4int[500];
76  G4cout << "XrayFluoSD created" << G4endl;
77 
78 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector(G4String name)
#define G4endl
Definition: G4ios.hh:61
G4CollectionNameVector collectionName
XrayFluoSD::XrayFluoSD ( G4String  name,
XrayFluoMercuryDetectorConstruction det 
)

Definition at line 82 of file XrayFluoSD.cc.

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

84  :G4VSensitiveDetector(name),Detector(0),planeDetector(0),mercuryDetector(0)
85 {
86  mercuryDetector = det;
87  collectionName.insert("HPGeCollection");
88  HitHPGeID = new G4int[500];
89  G4cout << "XrayFluoSD created" << G4endl;
90 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector(G4String name)
#define G4endl
Definition: G4ios.hh:61
G4CollectionNameVector collectionName
XrayFluoSD::~XrayFluoSD ( )

Definition at line 97 of file XrayFluoSD.cc.

References G4cout, and G4endl.

98 {
99 
100  delete [] HitHPGeID;
101 
102  // delete HPGeCollection;
103 
104  G4cout << "XrayFluoSD deleted" << G4endl;
105 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Member Function Documentation

void XrayFluoSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 201 of file XrayFluoSD.cc.

202 {}
void XrayFluoSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 206 of file XrayFluoSD.cc.

207 {}
void XrayFluoSD::EndOfEvent ( G4HCofThisEvent HCE)
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 191 of file XrayFluoSD.cc.

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

192 {
193  static G4int HCID = -1;
194  if(HCID<0)
196  HCE->AddHitsCollection(HCID,HPGeCollection);
197 }
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 XrayFluoSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 109 of file XrayFluoSD.cc.

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

113 {
114  HPGeCollection = new XrayFluoSensorHitsCollection
116 
117  G4int nPixel = 0;
118 
119  if (Detector) {nPixel = Detector->GetNbOfPixels();}
120  else if (planeDetector) {nPixel = planeDetector->GetNbOfPixels();}
121  else if (mercuryDetector) {nPixel = mercuryDetector->GetNbOfPixels();}
122 
123  for (G4int j=0;j<nPixel;j++)
124  {HitHPGeID [j]= -1;};
125 }
int G4int
Definition: G4Types.hh:78
G4THitsCollection< XrayFluoSensorHit > XrayFluoSensorHitsCollection
G4CollectionNameVector collectionName
void XrayFluoSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 211 of file XrayFluoSD.cc.

212 {}
G4bool XrayFluoSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
protectedvirtual

Implements G4VSensitiveDetector.

Definition at line 129 of file XrayFluoSD.cc.

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

130 {
131 
132 
133 
134  G4double edep = aStep->GetTotalEnergyDeposit();
135 
136  /*
137  G4String particleName = aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName();
138 
139  G4Track* track = aStep->GetTrack();
140  G4int trackId = track->GetTrackID();
141  //G4String processName = aStep->GetTrack()->GetCreatorProcess()->GetProcessName();
142 
143  G4double partEnergy = aStep->GetPreStepPoint()->GetKineticEnergy();
144  G4double secondEnergy = aStep->GetPostStepPoint()->GetKineticEnergy();
145  G4cout << " la particella che deposita e': " << particleName << " ha una energia di keV "
146  << partEnergy << " e deposita "<< edep << G4endl;
147  G4cout << " la particella creata ha energia cinetica: " << secondEnergy << G4endl;
148  */
149 
150  if (edep==0.) return false;
151 
152  //G4cout << " edep = " << edep << G4endl;
153 
154  G4TouchableHistory* theTouchable
156 
157 
158 
159  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
160  G4int PixelNumber = 0;
161 
162  if (Detector && Detector->GetNbOfPixels()>1) {PixelNumber= physVol->GetCopyNo();}
163  else if (planeDetector && planeDetector->GetNbOfPixels()>1) {PixelNumber= physVol->GetCopyNo();}
164  else if (mercuryDetector && mercuryDetector->GetNbOfPixels()>1) {PixelNumber= physVol->GetCopyNo();}
165 
166 
167 
168  if ( HitHPGeID[PixelNumber]==-1)
169  {
170  XrayFluoSensorHit* HPGeHit = new XrayFluoSensorHit();
171  HPGeHit->AddEnergy(edep);
172  HitHPGeID[PixelNumber] = HPGeCollection->insert(HPGeHit) - 1;
173  if (verboseLevel>0){
174  G4cout << " New Hit on pixel: " << PixelNumber << G4endl;
175  }
176  }
177  else
178  {
179  (*HPGeCollection)[HitHPGeID[PixelNumber]]->AddEnergy(edep);
180  //G4double ED =(*HPGeCollection)[HitHPGeID[PixelNumber]]->GetEdepTot();
181  if (verboseLevel>0)
182  G4cout << " Energy added to Pixel: " << PixelNumber << G4endl;
183  }
184 
185  return true;
186 }
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: