SND@LHC Software
Loading...
Searching...
No Matches
g4Ex.ScoreSD Class Reference
Inheritance diagram for g4Ex.ScoreSD:
Collaboration diagram for g4Ex.ScoreSD:

Public Member Functions

 __init__ (self, Name)
 
 ProcessHits (self, step, rohist)
 

Detailed Description

Definition at line 195 of file g4Ex.py.

Constructor & Destructor Documentation

◆ __init__()

g4Ex.ScoreSD.__init__ (   self,
  Name 
)

Definition at line 198 of file g4Ex.py.

198 def __init__(self,Name):
199 G4VSensitiveDetector.__init__(self, Name)
200

Member Function Documentation

◆ ProcessHits()

g4Ex.ScoreSD.ProcessHits (   self,
  step,
  rohist 
)

Definition at line 201 of file g4Ex.py.

201 def ProcessHits(self, step, rohist):
202 preStepPoint = step.GetPreStepPoint()
203 track = step.GetTrack()
204 part = track.GetDynamicParticle()
205 pid = part.GetPDGcode()
206 if abs(pid) in leptons :
207 mom = track.GetMomentum()
208 pos = track.GetPosition()
209#
210 # primPart = part.GetPrimaryParticle()
211 w = track.GetWeight()
212 parentid = int(w)/100000-10000
213 pythiaid = int(w)%100000-10000
214 h['ntuple'].Fill(float(pid), float(mom.x/GeV),float(mom.y/GeV),float(mom.z/GeV),
215 float(pos.x/m),float(pos.y/m),float(pos.z/m),pythiaid,parentid)
216 #print 'xxx',pid, float(mom.x/GeV),float(mom.y/GeV),float(mom.z/GeV),pythiaid,parentid,float(pos.x/m),float(pos.y/m),float(pos.z/m)
217 #myPythia.EventListing()
218

The documentation for this class was generated from the following file: