#include <LCDG4MuonSD.hh>
Inheritance diagram for LCDG4MuonSD:


Public Member Functions | |
| LCDG4MuonSD (G4String name) | |
| ~LCDG4MuonSD () | |
| void | Initialize (G4HCofThisEvent *HCE) |
| G4bool | ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist) |
| void | EndOfEvent (G4HCofThisEvent *HCE) |
| void | clear () |
| void | DrawAll () |
| void | PrintAll () |
| G4int | AddLogVolInfo (G4LogicalVolume *g4vxdlog, G4int startlayerNo, G4int sysNo, G4int be, G4int ns, G4int fsens) |
| void | SetSegmentation (G4int phiseg, G4int thetaseg, G4int barend) |
Private Attributes | |
| LCDG4CalHitsCollection * | m_muonCollection |
| 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 |
| std::map< G4int, LCDG4CalHit * > | m_cellhitb |
| std::map< G4int, LCDG4CalHit * > | m_cellhite |
| G4int | m_phiseg [2] |
| G4int | m_thetaseg [2] |
|
|
Definition at line 14 of file LCDG4MuonSD.cc. References m_cellhitb, m_cellhite, m_phiseg, and m_thetaseg.
00014 :G4VSensitiveDetector(name) { 00015 G4String HCname; 00016 collectionName.insert(HCname="muonCollection"); 00017 m_cellhitb.clear(); 00018 m_cellhite.clear(); 00019 m_phiseg [0]=1; m_phiseg [1]=1; 00020 m_thetaseg[0]=1; m_thetaseg[1]=1; 00021 } |
|
|
Definition at line 27 of file LCDG4MuonSD.cc.
00027 {
00028 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 156 of file LCDG4MuonSD.cc. References ns.
00157 {
00158 m_maplayer.insert(std::pair<G4LogicalVolume*,G4int>(g4muonlog,startlayerNo));
00159 m_mapsys.insert(std::pair<G4LogicalVolume*,G4int>(g4muonlog,sysNo));
00160 m_mapbe.insert(std::pair<G4LogicalVolume*,G4int>(g4muonlog,be));
00161 m_mapns.insert(std::pair<G4LogicalVolume*,G4int>(g4muonlog,ns));
00162 m_mapsens.insert(std::pair<G4LogicalVolume*,G4int>(g4muonlog,sens));
00163 return m_maplayer.size();
00164 }
|
|
|
Definition at line 134 of file LCDG4MuonSD.cc.
00134 {
00135 }
|
|
|
Definition at line 141 of file LCDG4MuonSD.cc.
00141 {
00142 }
|
|
|
Definition at line 124 of file LCDG4MuonSD.cc. References m_cellhitb, and m_cellhite.
00124 {
00125 if(HCE) ; // make compiler happy about unused vars
00126 m_cellhitb.clear();
00127 m_cellhite.clear();
00128 }
|
|
|
Definition at line 33 of file LCDG4MuonSD.cc. References LCDG4CalHitsCollection, and m_muonCollection.
00033 {
00034 static int HCID = -1;
00035 m_muonCollection = new LCDG4CalHitsCollection
00036 (SensitiveDetectorName,collectionName[0]);
00037 if(HCID < 0) {
00038 HCID = GetCollectionID(0);
00039 }
00040 HCE->AddHitsCollection(HCID,m_muonCollection);
00041 }
|
|
|
Definition at line 148 of file LCDG4MuonSD.cc.
00148 {
00149 }
|
|
||||||||||||
|
Definition at line 47 of file LCDG4MuonSD.cc. References LCDG4CalHit::AddMcPart(), LCDG4CalHit::AddMcPartAbs(), m_cellhitb, m_cellhite, m_mapbe, m_maplayer, m_mapsens, m_mapsys, m_muonCollection, m_phiseg, m_thetaseg, LCDG4CalHit::SetBarEnd(), LCDG4CalHit::SetLayer(), LCDG4CalHit::SetPhi(), LCDG4CalHit::SetPos(), LCDG4CalHit::SetSystem(), and LCDG4CalHit::SetTheta().
00047 {
00048
00049 G4double edep = aStep->GetTotalEnergyDeposit();
00050
00051 if(edep==0.) return false;
00052
00053 const G4VPhysicalVolume* physVol
00054 = aStep->GetPreStepPoint()->GetPhysicalVolume();
00055 if( ROhist!=NULL ) {
00056 G4VPhysicalVolume* phyVol = ROhist->GetVolume();
00057 if(phyVol != physVol) G4cout<<"phy,phys="<< phyVol <<' '<< physVol<<G4endl;
00058 }
00059
00060 G4LogicalVolume* logVol=physVol->GetLogicalVolume();
00061
00062 G4Track* mcmuon = aStep->GetTrack();
00063 G4int trkID = mcmuon->GetTrackID();
00064 G4double tdep = mcmuon->GetGlobalTime();
00065 G4int layno = m_maplayer[logVol];
00066 G4int sysNo = m_mapsys[logVol];
00067 G4int barend = m_mapbe[logVol];
00068
00069 G4ThreeVector pos = 0.5*(aStep->GetPreStepPoint()->GetPosition() +
00070 aStep->GetPostStepPoint()->GetPosition() );
00071 G4double dphi = 360.0*degree/m_phiseg[barend];
00072 G4double dtheta = 180.0*degree/m_thetaseg[barend];
00073 G4double trkphi = pos.phi();
00074 if (trkphi < 0.0) {
00075 trkphi += 360.0*degree;
00076 }
00077
00078 G4double trkthe = pos.theta();
00079 G4int sphi = int(trkphi/dphi);
00080 G4int sthe = int(trkthe/dtheta);
00081 G4int icell = sthe + m_thetaseg[barend]*sphi
00082 + m_thetaseg[barend]*m_phiseg[barend]*layno;
00083
00084 std::map<G4int,LCDG4CalHit*>* pcellhit=0;
00085 if (barend == 0) {
00086 pcellhit=&m_cellhitb;
00087 } else {
00088 pcellhit=&m_cellhite;
00089 }
00090
00091 LCDG4CalHit *hit=(*pcellhit)[icell];
00092
00093 if(hit == 0) {
00094 G4double r = pos.mag();
00095 G4ThreeVector hpos(r*sin((sthe+0.5)*dtheta)*cos((sphi+0.5)*dphi),
00096 r*sin((sthe+0.5)*dtheta)*sin((sphi+0.5)*dphi),
00097 r*cos((sthe+0.5)*dtheta));
00098
00099 (*pcellhit).erase(icell);
00100 hit = new LCDG4CalHit();
00101 hit->SetLayer(layno);
00102 hit->SetSystem(sysNo);
00103 hit->SetBarEnd(barend);
00104 hit->SetPhi(sphi);
00105 hit->SetTheta(sthe);
00106 hit->SetPos(hpos);
00107 m_muonCollection->insert(hit);
00108 pcellhit->insert(std::pair<G4int,LCDG4CalHit*>(icell,hit));
00109 }
00110
00111 if (m_mapsens[logVol]) {
00112 hit->AddMcPart(trkID,edep,tdep);
00113 } else {
00114 hit->AddMcPartAbs(edep);
00115 }
00116
00117 return true;
00118 }
|
|
||||||||||||||||
|
Definition at line 35 of file LCDG4MuonSD.hh. References m_phiseg, and m_thetaseg.
00036 { m_phiseg[barend] = phiseg; m_thetaseg[barend] = thetaseg; }
|
|
|
Definition at line 45 of file LCDG4MuonSD.hh. Referenced by EndOfEvent(), LCDG4MuonSD(), and ProcessHits(). |
|
|
Definition at line 46 of file LCDG4MuonSD.hh. Referenced by EndOfEvent(), LCDG4MuonSD(), and ProcessHits(). |
|
|
Definition at line 42 of file LCDG4MuonSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 40 of file LCDG4MuonSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 43 of file LCDG4MuonSD.hh. |
|
|
Definition at line 44 of file LCDG4MuonSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 41 of file LCDG4MuonSD.hh. Referenced by ProcessHits(). |
|
|
Definition at line 39 of file LCDG4MuonSD.hh. Referenced by Initialize(), and ProcessHits(). |
|
|
Definition at line 47 of file LCDG4MuonSD.hh. Referenced by LCDG4MuonSD(), ProcessHits(), and SetSegmentation(). |
|
|
Definition at line 48 of file LCDG4MuonSD.hh. Referenced by LCDG4MuonSD(), ProcessHits(), and SetSegmentation(). |
1.3.4