FairShip
Loading...
Searching...
No Matches
makeMuonEM Namespace Reference

Functions

def getMasssq (pid)
 

Variables

int nJob = 1
 
int nMult = 1000
 
str muonIn = "/media/Data/HNL/muVetoDIS/muDISVetoCounter.root"
 
ROOT PDG = ROOT.TDatabasePDG.Instance()
 
dict masssq = {}
 
ROOT fout = ROOT.TFile("muonEm_" + str(nJob) + ".root", "recreate")
 
ROOT dTree = ROOT.TTree("pythia8-Geant4", "muons for EM studies")
 
ROOT iMuon = ROOT.TClonesArray("TVectorD")
 
ROOT iMuonBranch = dTree.Branch("InMuon", iMuon, 32000, -1)
 
ROOT dPart = ROOT.TClonesArray("TVectorD")
 
ROOT dPartBranch = dTree.Branch("Particles", dPart, 32000, -1)
 
ROOT fin = ROOT.TFile(muonIn)
 
ROOT sTree = fin.muons
 
ROOT rc = sTree.GetEvent(k)
 
 px
 
 py
 
 pz
 
 x
 
 y
 
 z
 
 pid
 
 w
 
ROOT p = ROOT.TMath.Sqrt(px * px + py * py + pz * pz)
 
ROOT E = ROOT.TMath.Sqrt(getMasssq(pid) + p * p)
 
array mu = array("d", [pid, px, py, pz, E, x, y, z, w])
 
ROOT muPart = ROOT.TVectorD(9, mu)
 
ROOT tca_vec = iMuon.ConstructedAt(0)
 
array m = array("d", [pid, px, py, pz, E])
 
ROOT part = ROOT.TVectorD(5, m)
 
len nPart = len(dPart)
 

Function Documentation

◆ getMasssq()

def makeMuonEM.getMasssq (   pid)

Definition at line 18 of file makeMuonEM.py.

18def getMasssq(pid):
19 apid = abs(int(pid))
20 if apid not in masssq:
21 masssq[apid] = PDG.GetParticle(apid).Mass() ** 2
22 return masssq[apid]
23
24
25# prepare muon input for FairShip/Geant4 processing
26# incoming muon, id:px:py:pz:x:y:z:ox:oy:oz:pythiaid:parentid:ecut:w
27
28# just duplicate muon n times, rather stupid job
29

Variable Documentation

◆ dPart

ROOT makeMuonEM.dPart = ROOT.TClonesArray("TVectorD")

Definition at line 34 of file makeMuonEM.py.

◆ dPartBranch

ROOT makeMuonEM.dPartBranch = dTree.Branch("Particles", dPart, 32000, -1)

Definition at line 35 of file makeMuonEM.py.

◆ dTree

ROOT makeMuonEM.dTree = ROOT.TTree("pythia8-Geant4", "muons for EM studies")

Definition at line 31 of file makeMuonEM.py.

◆ E

ROOT makeMuonEM.E = ROOT.TMath.Sqrt(getMasssq(pid) + p * p)

Definition at line 48 of file makeMuonEM.py.

◆ fin

ROOT makeMuonEM.fin = ROOT.TFile(muonIn)

Definition at line 38 of file makeMuonEM.py.

◆ fout

ROOT makeMuonEM.fout = ROOT.TFile("muonEm_" + str(nJob) + ".root", "recreate")

Definition at line 30 of file makeMuonEM.py.

◆ iMuon

ROOT makeMuonEM.iMuon = ROOT.TClonesArray("TVectorD")

Definition at line 32 of file makeMuonEM.py.

◆ iMuonBranch

ROOT makeMuonEM.iMuonBranch = dTree.Branch("InMuon", iMuon, 32000, -1)

Definition at line 33 of file makeMuonEM.py.

◆ m

array makeMuonEM.m = array("d", [pid, px, py, pz, E])

Definition at line 57 of file makeMuonEM.py.

◆ masssq

dict makeMuonEM.masssq = {}

Definition at line 15 of file makeMuonEM.py.

◆ mu

array makeMuonEM.mu = array("d", [pid, px, py, pz, E, x, y, z, w])

Definition at line 49 of file makeMuonEM.py.

◆ muonIn

str makeMuonEM.muonIn = "/media/Data/HNL/muVetoDIS/muDISVetoCounter.root"

Definition at line 9 of file makeMuonEM.py.

◆ muPart

ROOT makeMuonEM.muPart = ROOT.TVectorD(9, mu)

Definition at line 50 of file makeMuonEM.py.

◆ nJob

int makeMuonEM.nJob = 1

Definition at line 7 of file makeMuonEM.py.

◆ nMult

int makeMuonEM.nMult = 1000

Definition at line 8 of file makeMuonEM.py.

◆ nPart

len makeMuonEM.nPart = len(dPart)

Definition at line 60 of file makeMuonEM.py.

◆ p

ROOT makeMuonEM.p = ROOT.TMath.Sqrt(px * px + py * py + pz * pz)

Definition at line 47 of file makeMuonEM.py.

◆ part

ROOT makeMuonEM.part = ROOT.TVectorD(5, m)

Definition at line 58 of file makeMuonEM.py.

◆ PDG

ROOT makeMuonEM.PDG = ROOT.TDatabasePDG.Instance()

Definition at line 14 of file makeMuonEM.py.

◆ pid

makeMuonEM.pid

Definition at line 46 of file makeMuonEM.py.

◆ px

makeMuonEM.px

Definition at line 44 of file makeMuonEM.py.

◆ py

makeMuonEM.py

Definition at line 44 of file makeMuonEM.py.

◆ pz

makeMuonEM.pz

Definition at line 44 of file makeMuonEM.py.

◆ rc

ROOT makeMuonEM.rc = sTree.GetEvent(k)

Definition at line 42 of file makeMuonEM.py.

◆ sTree

ROOT makeMuonEM.sTree = fin.muons

Definition at line 39 of file makeMuonEM.py.

◆ tca_vec

ROOT makeMuonEM.tca_vec = iMuon.ConstructedAt(0)

Definition at line 54 of file makeMuonEM.py.

◆ w

makeMuonEM.w

Definition at line 46 of file makeMuonEM.py.

◆ x

makeMuonEM.x

Definition at line 45 of file makeMuonEM.py.

◆ y

makeMuonEM.y

Definition at line 45 of file makeMuonEM.py.

◆ z

makeMuonEM.z

Definition at line 45 of file makeMuonEM.py.