Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

LCDG4VXDSD Class Reference

#include <LCDG4VXDSD.hh>

Inheritance diagram for LCDG4VXDSD:

Inheritance graph
[legend]
Collaboration diagram for LCDG4VXDSD:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LCDG4VXDSD (G4String name)
 ~LCDG4VXDSD ()
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 sens)

Private Attributes

LCDG4TrackerHitsCollectionm_vxdCollection
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

Constructor & Destructor Documentation

LCDG4VXDSD::LCDG4VXDSD G4String  name  ) 
 

Definition at line 13 of file LCDG4VXDSD.cc.

00013                                     : G4VSensitiveDetector(name) {
00014   G4String HCname;
00015   collectionName.insert(HCname="vxdCollection");
00016 }

LCDG4VXDSD::~LCDG4VXDSD  ) 
 

Definition at line 21 of file LCDG4VXDSD.cc.

00021 {;}


Member Function Documentation

G4int LCDG4VXDSD::AddLogVolInfo G4LogicalVolume *  g4vxdlog,
G4int  startlayerNo,
G4int  sysNo,
G4int  be,
G4int  ns,
G4int  sens
 

Definition at line 111 of file LCDG4VXDSD.cc.

References ns.

00112                       {
00113   m_maplayer.insert(std::pair<G4LogicalVolume*,G4int>(g4vxdlog,startlayerNo));
00114   m_mapsys.insert(std::pair<G4LogicalVolume*,G4int>(g4vxdlog,sysNo));
00115   m_mapbe.insert(std::pair<G4LogicalVolume*,G4int>(g4vxdlog,be));
00116   m_mapns.insert(std::pair<G4LogicalVolume*,G4int>(g4vxdlog,ns));
00117   m_mapsens.insert(std::pair<G4LogicalVolume*,G4int>(g4vxdlog,sens));
00118   return m_maplayer.size();
00119 }

void LCDG4VXDSD::clear  ) 
 

Definition at line 92 of file LCDG4VXDSD.cc.

00092                        {
00093 }

void LCDG4VXDSD::DrawAll  ) 
 

Definition at line 98 of file LCDG4VXDSD.cc.

00098                          {
00099 }

void LCDG4VXDSD::EndOfEvent G4HCofThisEvent *  HCE  ) 
 

Definition at line 85 of file LCDG4VXDSD.cc.

00085                                                {
00086   if(HCE) ;  // make compiler happy about unused vars
00087 }

void LCDG4VXDSD::Initialize G4HCofThisEvent *  HCE  ) 
 

Definition at line 26 of file LCDG4VXDSD.cc.

References LCDG4TrackerHitsCollection, and m_vxdCollection.

00026                                                {
00027   static int HCID = -1;
00028   m_vxdCollection = new LCDG4TrackerHitsCollection(SensitiveDetectorName,collectionName[0]);
00029 
00030   if(HCID < 0) {
00031     HCID = GetCollectionID(0);
00032   }
00033   HCE->AddHitsCollection(HCID,m_vxdCollection);
00034 }

void LCDG4VXDSD::PrintAll  ) 
 

Definition at line 104 of file LCDG4VXDSD.cc.

00104                           {
00105 }

G4bool LCDG4VXDSD::ProcessHits G4Step *  aStep,
G4TouchableHistory *  ROhist
 

Definition at line 39 of file LCDG4VXDSD.cc.

References m_mapbe, m_maplayer, m_mapns, m_mapsens, m_mapsys, m_vxdCollection, ns, LCDG4TrackerHit::SetBarEnd(), LCDG4TrackerHit::SetEdep(), LCDG4TrackerHit::SetLayer(), LCDG4TrackerHit::SetNorthSouth(), LCDG4TrackerHit::SetPos(), LCDG4TrackerHit::SetSystem(), LCDG4TrackerHit::SetTdep(), and LCDG4TrackerHit::SetTrackID().

00039                                                                         {
00040 
00041   G4double edep = aStep->GetTotalEnergyDeposit();
00042   if(edep==0.) return false;
00043 
00044   const G4VPhysicalVolume* physVol
00045     = aStep->GetPreStepPoint()->GetPhysicalVolume();
00046   if( ROhist!=NULL ) {
00047     G4VPhysicalVolume* phyVol = ROhist->GetVolume();
00048     if(phyVol != physVol) G4cout<<"phy,phys="<< phyVol<<' '<<physVol <<G4endl;
00049   }
00050 
00051   G4Track* mctrk=aStep->GetTrack();
00052   G4int    trkID=mctrk->GetTrackID();
00053   G4double tdep =mctrk->GetGlobalTime();
00054   G4LogicalVolume* logVol=physVol->GetLogicalVolume();
00055   G4int    layerNo     =m_maplayer[logVol];
00056   G4int    sysNo       =m_mapsys[logVol];
00057   G4int    barend      =m_mapbe[logVol];
00058   G4int    ns          =m_mapns[logVol];
00059   G4int    sens        =m_mapsens[logVol];
00060 
00061   // gismo writes out all vxd hits with sysno=1
00062   sysNo = 1;
00063 //   G4cout << "VXDSD: sys,be,ns=" << sysNo <<' '<< barend <<' '<< ns << G4endl;
00064 
00065   if (sens) {
00066     LCDG4TrackerHit* newHit = new LCDG4TrackerHit();
00067     newHit->SetTrackID(trkID);
00068     newHit->SetLayer(layerNo);
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_vxdCollection->insert(newHit);
00077   }
00078 
00079   return true;
00080 }


Member Data Documentation

std::map<G4LogicalVolume*,G4int> LCDG4VXDSD::m_mapbe [private]
 

Definition at line 34 of file LCDG4VXDSD.hh.

Referenced by ProcessHits().

std::map<G4LogicalVolume*,G4int> LCDG4VXDSD::m_maplayer [private]
 

Definition at line 32 of file LCDG4VXDSD.hh.

Referenced by ProcessHits().

std::map<G4LogicalVolume*,G4int> LCDG4VXDSD::m_mapns [private]
 

Definition at line 35 of file LCDG4VXDSD.hh.

Referenced by ProcessHits().

std::map<G4LogicalVolume*,G4int> LCDG4VXDSD::m_mapsens [private]
 

Definition at line 36 of file LCDG4VXDSD.hh.

Referenced by ProcessHits().

std::map<G4LogicalVolume*,G4int> LCDG4VXDSD::m_mapsys [private]
 

Definition at line 33 of file LCDG4VXDSD.hh.

Referenced by ProcessHits().

LCDG4TrackerHitsCollection* LCDG4VXDSD::m_vxdCollection [private]
 

Definition at line 31 of file LCDG4VXDSD.hh.

Referenced by Initialize(), and ProcessHits().


The documentation for this class was generated from the following files:
Generated on Thu Oct 7 18:45:07 2004 for LCDG4 by doxygen 1.3.4