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

Public Member Functions

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

Detailed Description

Definition at line 374 of file g4Ex_gap.py.

Constructor & Destructor Documentation

◆ __init__()

g4Ex_gap.ScoreSD.__init__ (   self,
  Name 
)

Definition at line 377 of file g4Ex_gap.py.

377 def __init__(self,Name):
378 G4VSensitiveDetector.__init__(self, Name)
379

Member Function Documentation

◆ ProcessHits()

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

Definition at line 380 of file g4Ex_gap.py.

380 def ProcessHits(self, step, rohist):
381 preStepPoint = step.GetPreStepPoint()
382 track = step.GetTrack()
383 part = track.GetDynamicParticle()
384 pid = part.GetPDGcode()
385 vx = track.GetVertexPosition()
386 pvx = track.GetVertexMomentumDirection()
387 ekinvx = track.GetVertexKineticEnergy()
388 M = part.GetMass()
389 Pvx = ROOT.TMath.Sqrt( ekinvx*(ekinvx+2*M) )
390 mom = track.GetMomentum()
391 ekin = track.GetKineticEnergy()/GeV
392 pos = track.GetPosition()
393#
394 # primPart = part.GetPrimaryParticle()
395 w = track.GetWeight()
396 parentid = int(w)/100000-10000
397 pythiaid = int(w)%100000-10000
398 h['ntuple'].Fill(float(pid), float(mom.x/GeV),float(mom.y/GeV),float(mom.z/GeV),\
399 float(pos.x/m),float(pos.y/m),float(pos.z/m),\
400 float(Pvx*pvx.x/GeV),float(Pvx*pvx.y/GeV),float(Pvx*pvx.z/GeV),\
401 float(vx.x/m),float(vx.y/m),float(vx.z/m),pythiaid,parentid)
402 if debug:
403 print('xxx',pid, float(mom.x/GeV),float(mom.y/GeV),float(mom.z/GeV),\
404 float(pos.x/m),float(pos.y/m),float(pos.z/m),\
405 float(Pvx*pvx.x/GeV),float(Pvx*pvx.y/GeV),float(Pvx*pvx.z/GeV),\
406 float(vx.x/m),float(vx.y/m),float(vx.z/m),pythiaid,parentid)
407

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