SND@LHC Software
Loading...
Searching...
No Matches
makeMuonDIS Namespace Reference

Functions

 getMasssq (pid)
 
 rotate (ctheta, stheta, cphi, sphi, px, py, pz)
 

Variables

int nJob = 2
 
int nMult = 10
 
str muonIn = '$SHIPSOFT/data/muConcrete.root'
 
int nPerJob = 20000
 
 PDG = ROOT.TDatabasePDG.Instance()
 
 myPythia = ROOT.TPythia6()
 
 kc = myPythia.Pycomp(kf)
 
dict masssq = {}
 
 R = int(time.time()%900000000)
 
dict mutype = {-13:'gamma/mu+',13:'gamma/mu-'}
 
 fout = ROOT.TFile('muonDis_'+str(nJob)+'.root','recreate')
 
 dTree = ROOT.TTree('DIS','muon DIS')
 
 iMuon = ROOT.TClonesArray("TVectorD")
 
 iMuonBranch = dTree.Branch("InMuon",iMuon,32000,-1)
 
 dPart = ROOT.TClonesArray("TVectorD")
 
 dPartBranch = dTree.Branch("Particles",dPart,32000,-1)
 
 fin = ROOT.TFile(muonIn)
 
 sTree = fin.muons
 
 nTOT = sTree.GetEntries()
 
int nStart = nPerJob*nJob
 
 nEnd = min(nTOT,nStart + nPerJob)
 
int nMade = 0
 
 rc = sTree.GetEvent(k)
 
 px
 
 py
 
 pz
 
 x
 
 y
 
 z
 
 pid
 
 w
 
 p = ROOT.TMath.Sqrt(px*px+py*py+pz*pz)
 
 E = ROOT.TMath.Sqrt(getMasssq(pid)+p*p)
 
 theta = ROOT.TMath.ACos(pz/p)
 
 phi = ROOT.TMath.ATan2(py,px)
 
 ctheta
 
 stheta
 
 cphi
 
 sphi
 
 mu = array('d',[pid,px,py,pz,E,x,y,z,w])
 
 muPart = ROOT.TVectorD(9,mu)
 
 did = myPythia.GetK(itrk,2)
 
 dpx
 
 dpy
 
 dpz
 
int psq = dpx**2+dpy**2+dpz**2
 
 m = array('d',[did,dpx,dpy,dpz,E])
 
 part = ROOT.TVectorD(5,m)
 
 nPart = dPart.GetEntries()
 

Function Documentation

◆ getMasssq()

makeMuonDIS.getMasssq (   pid)

Definition at line 25 of file makeMuonDIS.py.

25def getMasssq(pid):
26 apid = abs(int(pid))
27 if not apid in masssq:
28 masssq[apid] = PDG.GetParticle(apid).Mass()**2
29 return masssq[apid]
30

◆ rotate()

makeMuonDIS.rotate (   ctheta,
  stheta,
  cphi,
  sphi,
  px,
  py,
  pz 
)

Definition at line 49 of file makeMuonDIS.py.

49def rotate(ctheta,stheta,cphi,sphi,px,py,pz):
50 #rotate around y-axis
51 px1=ctheta*px+stheta*pz
52 pzr=-stheta*px+ctheta*pz
53 #rotate around z-axis
54 pxr=cphi*px1-sphi*py
55 pyr=sphi*px1+cphi*py
56 return pxr,pyr,pzr
57

Variable Documentation

◆ cphi

makeMuonDIS.cphi

Definition at line 82 of file makeMuonDIS.py.

◆ ctheta

makeMuonDIS.ctheta

Definition at line 81 of file makeMuonDIS.py.

◆ did

makeMuonDIS.did = myPythia.GetK(itrk,2)

Definition at line 94 of file makeMuonDIS.py.

◆ dPart

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

Definition at line 42 of file makeMuonDIS.py.

◆ dPartBranch

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

Definition at line 43 of file makeMuonDIS.py.

◆ dpx

makeMuonDIS.dpx

Definition at line 95 of file makeMuonDIS.py.

◆ dpy

makeMuonDIS.dpy

Definition at line 95 of file makeMuonDIS.py.

◆ dpz

makeMuonDIS.dpz

Definition at line 95 of file makeMuonDIS.py.

◆ dTree

makeMuonDIS.dTree = ROOT.TTree('DIS','muon DIS')

Definition at line 39 of file makeMuonDIS.py.

◆ E

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

Definition at line 77 of file makeMuonDIS.py.

◆ fin

makeMuonDIS.fin = ROOT.TFile(muonIn)

Definition at line 46 of file makeMuonDIS.py.

◆ fout

makeMuonDIS.fout = ROOT.TFile('muonDis_'+str(nJob)+'.root','recreate')

Definition at line 38 of file makeMuonDIS.py.

◆ iMuon

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

Definition at line 40 of file makeMuonDIS.py.

◆ iMuonBranch

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

Definition at line 41 of file makeMuonDIS.py.

◆ kc

makeMuonDIS.kc = myPythia.Pycomp(kf)

Definition at line 20 of file makeMuonDIS.py.

◆ m

makeMuonDIS.m = array('d',[did,dpx,dpy,dpz,E])

Definition at line 98 of file makeMuonDIS.py.

◆ masssq

dict makeMuonDIS.masssq = {}

Definition at line 23 of file makeMuonDIS.py.

◆ mu

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

Definition at line 83 of file makeMuonDIS.py.

◆ muonIn

makeMuonDIS.muonIn = '$SHIPSOFT/data/muConcrete.root'

Definition at line 5 of file makeMuonDIS.py.

◆ muPart

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

Definition at line 84 of file makeMuonDIS.py.

◆ mutype

dict makeMuonDIS.mutype = {-13:'gamma/mu+',13:'gamma/mu-'}

Definition at line 33 of file makeMuonDIS.py.

◆ myPythia

makeMuonDIS.myPythia = ROOT.TPythia6()

Definition at line 16 of file makeMuonDIS.py.

◆ nEnd

makeMuonDIS.nEnd = min(nTOT,nStart + nPerJob)

Definition at line 61 of file makeMuonDIS.py.

◆ nJob

makeMuonDIS.nJob = 2

Definition at line 3 of file makeMuonDIS.py.

◆ nMade

int makeMuonDIS.nMade = 0

Definition at line 69 of file makeMuonDIS.py.

◆ nMult

makeMuonDIS.nMult = 10

Definition at line 4 of file makeMuonDIS.py.

◆ nPart

makeMuonDIS.nPart = dPart.GetEntries()

Definition at line 101 of file makeMuonDIS.py.

◆ nPerJob

makeMuonDIS.nPerJob = 20000

Definition at line 6 of file makeMuonDIS.py.

◆ nStart

int makeMuonDIS.nStart = nPerJob*nJob

Definition at line 60 of file makeMuonDIS.py.

◆ nTOT

makeMuonDIS.nTOT = sTree.GetEntries()

Definition at line 58 of file makeMuonDIS.py.

◆ p

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

Definition at line 76 of file makeMuonDIS.py.

◆ part

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

Definition at line 99 of file makeMuonDIS.py.

◆ PDG

makeMuonDIS.PDG = ROOT.TDatabasePDG.Instance()

Definition at line 15 of file makeMuonDIS.py.

◆ phi

makeMuonDIS.phi = ROOT.TMath.ATan2(py,px)

Definition at line 80 of file makeMuonDIS.py.

◆ pid

makeMuonDIS.pid

Definition at line 75 of file makeMuonDIS.py.

◆ psq

int makeMuonDIS.psq = dpx**2+dpy**2+dpz**2

Definition at line 96 of file makeMuonDIS.py.

◆ px

makeMuonDIS.px

Definition at line 73 of file makeMuonDIS.py.

◆ py

makeMuonDIS.py

Definition at line 73 of file makeMuonDIS.py.

◆ pz

makeMuonDIS.pz

Definition at line 73 of file makeMuonDIS.py.

◆ R

makeMuonDIS.R = int(time.time()%900000000)

Definition at line 31 of file makeMuonDIS.py.

◆ rc

makeMuonDIS.rc = sTree.GetEvent(k)

Definition at line 71 of file makeMuonDIS.py.

◆ sphi

makeMuonDIS.sphi

Definition at line 82 of file makeMuonDIS.py.

◆ stheta

makeMuonDIS.stheta

Definition at line 81 of file makeMuonDIS.py.

◆ sTree

makeMuonDIS.sTree = fin.muons

Definition at line 47 of file makeMuonDIS.py.

◆ theta

makeMuonDIS.theta = ROOT.TMath.ACos(pz/p)

Definition at line 79 of file makeMuonDIS.py.

◆ w

makeMuonDIS.w

Definition at line 75 of file makeMuonDIS.py.

◆ x

makeMuonDIS.x

Definition at line 74 of file makeMuonDIS.py.

◆ y

makeMuonDIS.y

Definition at line 74 of file makeMuonDIS.py.

◆ z

makeMuonDIS.z

Definition at line 74 of file makeMuonDIS.py.