#include <LCDG4TrackerSD.hh>
Inheritance diagram for LCDG4TrackerSD:
Public Member Functions | |
| LCDG4TrackerSD (G4String name) | |
| ~LCDG4TrackerSD () | |
| void | Initialize (G4HCofThisEvent *HCE) |
| G4bool | ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist) |
| void | EndOfEvent (G4HCofThisEvent *HCE) |
| void | clear () |
| void | DrawAll () |
| void | PrintAll () |
| G4int | AddLogVolInfo (G4LogicalVolume *g4trackerlog, G4int startlayerNo, G4int sysNo, G4int be, G4int ns, G4int sens) |
Private Attributes | |
| LCDG4TrackerHitsCollection * | m_trackerCollection |
| std::map< G4LogicalVolume *, G4int > | m_maplayer |
| std::map< G4LogicalVolume *, G4int > | m_mapsys |
| std::map< G4LogicalVolume *, G4int > | m_mapbe |
| std::map< G4LogicalVolume *, G4int > | m_mapns |
| std::map< G4LogicalVolume *, G4int > | m_mapsens |
|
|
Definition at line 15 of file LCDG4TrackerSD.cc.
00016 :G4VSensitiveDetector(name) { 00017 G4String HCname; 00018 collectionName.insert(HCname="trackerCollection"); 00019 } |
|
|
Definition at line 24 of file LCDG4TrackerSD.cc.
00024 {;}
|
|
||||||||||||||||||||||||||||
|
Definition at line 111 of file LCDG4TrackerSD.cc. References ns.
00112 {
00113 m_maplayer.insert(std::pair<G4LogicalVolume*,G4int>
00114 (g4trackerlog,startlayerNo));
00115 m_mapsys.insert(std::pair<G4LogicalVolume*,G4int>(g4trackerlog,sysNo));
00116 m_mapbe.insert(std::pair<G4LogicalVolume*,G4int>(g4trackerlog,be));
00117 m_mapns.insert(std::pair<G4LogicalVolume*,G4int>(g4trackerlog,ns));
00118 m_mapsens.insert(std::pair<G4LogicalVolume*,G4int>(g4trackerlog,sens));
00119 return m_maplayer.size();
00120 }
|
|
|
Definition at line 92 of file LCDG4TrackerSD.cc.
00092 {
00093 }
|
|
|
Definition at line 98 of file LCDG4TrackerSD.cc.
00098 {
00099 }
|
|
|
Definition at line 85 of file LCDG4TrackerSD.cc.
00085 {
00086 if(HCE) ; // make compiler happy about unused vars
00087 }
|
|
|
Definition at line 29 of file LCDG4TrackerSD.cc. References LCDG4TrackerHitsCollection, and m_trackerCollection.
00029 {
00030 static int HCID = -1;
00031 m_trackerCollection = new LCDG4TrackerHitsCollection
00032 (SensitiveDetectorName,collectionName[0]);
00033 if(HCID < 0) {
00034 HCID = GetCollectionID(0);
00035 }
00036 HCE->AddHitsCollection(HCID,m_trackerCollection);
00037 }
|
|
|
Definition at line 104 of file LCDG4TrackerSD.cc.
00104 {
00105 }
|
|
||||||||||||
|
Definition at line 42 of file LCDG4TrackerSD.cc. References m_mapbe, m_maplayer, m_mapns, m_mapsens, m_mapsys, m_trackerCollection, ns, LCDG4TrackerHit::SetBarEnd(), LCDG4TrackerHit::SetEdep(), LCDG4TrackerHit::SetLayer(), LCDG4TrackerHit::SetNorthSouth(), LCDG4TrackerHit::SetPos(), LCDG4TrackerHit::SetSystem(), LCDG4TrackerHit::SetTdep(), and LCDG4TrackerHit::SetTrackID().
00042 {
00043 // printf("Here is LCDG4TrackerSD::ProcessHits\n");
00044 G4double edep = aStep->GetTotalEnergyDeposit();
00045 if(edep==0.) return false;
00046
00047 const G4VPhysicalVolume* physVol
00048 = aStep->GetPreStepPoint()->GetPhysicalVolume();
00049 const G4int copyID = physVol->GetCopyNo();
00050 if( ROhist!=NULL ) {
00051 G4VPhysicalVolume* phyVol = ROhist->GetVolume();
00052 if(phyVol != physVol) G4cout<<"phy,phys="<< phyVol<<' '<<physVol <<G4endl;
00053 }
00054
00055 G4Track* mctrk=aStep->GetTrack();
00056 G4int trkID=mctrk->GetTrackID();
00057 G4double tdep =mctrk->GetGlobalTime();
00058 G4LogicalVolume* logVol=physVol->GetLogicalVolume();
00059 G4int startlayerNo=m_maplayer[logVol];
00060 G4int sysNo =m_mapsys[logVol];
00061 G4int barend =m_mapbe[logVol];
00062 G4int ns =m_mapns[logVol];
00063 G4int sens =m_mapsens[logVol];
00064
00065 if (sens) {
00066 LCDG4TrackerHit* newHit = new LCDG4TrackerHit();
00067 newHit->SetTrackID(trkID);
00068 newHit->SetLayer(copyID+startlayerNo);
00069 newHit->SetSystem(sysNo);
00070 newHit->SetBarEnd(barend);
00071 newHit->SetNorthSouth(ns);
00072 newHit->SetEdep(edep);
00073 newHit->SetTdep(tdep);
00074 newHit->SetPos(0.5*(aStep->GetPreStepPoint()->GetPosition() +
00075 aStep->GetPostStepPoint()->GetPosition() ));
00076 m_trackerCollection->insert(newHit);
00077 }
00078
00079 return true;
00080 }
|
|
|
Definition at line 40 of file LCDG4TrackerSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 38 of file LCDG4TrackerSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 41 of file LCDG4TrackerSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 42 of file LCDG4TrackerSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 39 of file LCDG4TrackerSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 37 of file LCDG4TrackerSD.hh. Referenced by Initialize(), and ProcessHits(). |
1.3.4