make MCParticles from reconstructed cosmic tracks
Definition at line 24 of file makeMCParticlesFromGCRData.py.
◆ event()
event processing
Definition at line 33 of file makeMCParticlesFromGCRData.py.
34 ''' event processing '''
38 absPDG = abs(Belle2.Const.muon.getPDGCode())
39 mass = Belle2.Const.muon.getMass()
41 extHits = track.getRelationsWith(
'ExtHits')
43 for extHit
in extHits:
44 if extHit.getDetectorID() != Belle2.Const.TOP:
46 if abs(extHit.getPdgCode()) != absPDG:
48 if extHit.getPosition().Perp() < 123.5:
50 if extHit.getPosition() * extHit.getMomentum() > 0:
52 selExtHits.append(extHit)
53 if len(selExtHits) == 0:
55 sortedExtHits = sorted(selExtHits, key=
lambda x: (x.getTOF()))
56 extHit = sortedExtHits[0]
57 pos = extHit.getPosition()
58 mom = extHit.getMomentum()
60 part = mcParticles.appendNew()
61 part.setPDG(extHit.getPdgCode())
63 part.setProductionVertex(pos)
64 part.setProductionTime(tof)
66 part.setEnergy(math.sqrt(mom.Mag2() + mass**2))
67 part.setValidVertex(
True)
68 part.setStatus(Belle2.MCParticle.c_PrimaryParticle)
69 part.addStatus(Belle2.MCParticle.c_StableInGenerator)
71 if mcParticles.getEntries() > 0:
a (simplified) python wrapper for StoreArray.
◆ initialize()
The documentation for this class was generated from the following file: