| Message: Re: How can I read out the position information about scintillation process? | Not Logged In (login) |
|
Hi Although the G4ScintillationProcess inherits from G4VRestDiscreteProcess (for reasons I don't quite remember now - it should maybe more properly inherit from G4VRestContinuousProcess), the scintillation photons are emitted uniformly along the step. The code documents: // This routine is called for each tracking step of a charged particle // in a scintillator. A Poisson/Gauss-distributed number of photons is // generated according to the scintillation yield formula, distributed // evenly along the track segment and uniformly into 4pi. What this means is that there is no such thing as the 'position of the scintillation process'. The origins are on a line between PreStepPoint and PostStepPoint. You can get the origin of each and every scintillation photon with code such as the one exhibited in: /examples/extended/optical/LXe/scr/LXeSteppingVerbose.cc:
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
As you can see, this assumes that the secondaries of a step are stored in the fSecondary vector such that the optical photons come last. I don't know if this should be expected in all cases. Of course, you can ask for the ParticleName first and then, if 'opticalphoton' print its origin position. Hope this helps, Peter |
| Inline Depth: | Outline Depth: | Add message: |
|
to: |