Message: Confusing with ExN02TrackerSD::Initialize() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Confusing with ExN02TrackerSD::Initialize() 

Forum: Documentation and Examples
Date: 10 Nov, 2010
From: Gu W.Q. <Gu W.Q.>

ExN02TrackerSD::ExN02TrackerSD(G4String name)
  :G4VSensitiveDetector(name)
  {
    G4String HCname;
    collectionName.insert(HCname="trackerCollection");
  }

void ExN02TrackerSD::Initialize(G4HCofThisEvent* HCE)                           
 {     
    trackerCollection = new ExN02TrackerHitsCollection                            
                            (SensitiveDetectorName,collectionName[0]);            
    static G4int HCID = -1;
    if(HCID<0) 
    { HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }  
    HCE->AddHitsCollection HCID, trackerCollection );         
  }

I know that ExN02TrackerSD::Initialize() is invoked at the beginning of each event. But what does " collectionName[0] " mean? Why can we use it to get a CollectionID, while not collectionName[1]?

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Confusing with ExN02TrackerSD::Initialize()   (Michael H. Kelsey - 10 Nov, 2010)
(_ None: Re: Confusing with ExN02TrackerSD::Initialize()   (Gu W.Q. - 13 Nov, 2010)
 Add Message Add Message
to: "Confusing with ExN02TrackerSD::Initialize()"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]