1from __future__ 
import print_function
 
    3def makeProd(prefix,DY,y=False,phiRandom=False,X=None):
 
    5  shipsoft = os.environ[
'SHIPSOFT'].replace(
'/dev',
'')
 
    7    f = shipsoft+
'/data/pythia8_Geant4_onlyMuons.root' 
    8    cmd  = 
"python $FAIRSHIP/macro/run_simScript.py --MuonBack -f " + f + 
" -Y "+str(float(DY)) 
 
   10    f = shipsoft+
'/data/pythia8_Geant4_Jpsi_onlyMuons.root' 
   11    cmd  = 
"python $FAIRSHIP/macro/run_simScript.py --MuonBack -f " + f + 
" -Y "+str(float(DY)) 
 
   13    f = shipsoft+
'/data/pythia8_Geant4_Yandex_onlyMuons.root' 
   14    cmd  = 
"python $FAIRSHIP/macro/run_simScript.py --MuonBack -f " + f + 
" -Y "+str(float(DY)) 
 
   15  if phiRandom:  cmd = cmd +
' --phiRandom' 
   17  sTree = fn.FindObjectAny(
'pythia8-Geant4')
 
   18  ntot = sTree.GetEntries()
 
   22  for i 
in range(1,ncpu+1):
 
   24   if d 
not in os.listdir(
'.'): os.system(
'mkdir '+d)
 
   25  os.chdir(
'./'+prefix+
'1')
 
   26  for i 
in range(1,ncpu+1):
 
   27   if i==ncpu: n3 = ntot - (i-1)*n3
 
   30     os.system(
'cp $FAIRSHIP/macro/run_simScript.py .')
 
   31     os.system(cmd+
" -n "+str(n3)+
" -i "+str(ns) + 
" > log &")
 
   33    os.system(
'cp $FAIRSHIP/macro/run_simScript.py .')
 
   34    os.system(cmd+
" -n "+str(n3)+
" -i "+str(ns) + 
" > log &")
 
   41   os.chdir(
'../'+prefix+str(i+1))
 
 
  217 eos = 
"/afs/cern.ch/project/eos/installation/0.3.15/bin/eos.select" 
  218 for prod 
in [610,620]:
 
  219  for run 
in range(0,10):
 
  220   prefix = 
'muon'+str(prod+run)
 
  221   if prod 
in [610,620] 
and run == 0: prefix = 
'muon'+str(int(prod/100))
 
  222   for i 
in range(1,10):
 
  224    cmd = eos+
' cp -r '+os.path.abspath(
'.')+
'/'+prefix+str(i)+
'/ /eos/experiment/ship/data/muonBackground/'+prefix+str(i)+
'/' 
 
  229 eos = 
"/afs/cern.ch/project/eos/installation/0.3.15/bin/eos.select" 
  230 for prod 
in [610,620]:
 
  231  for run 
in range(0,10):
 
  232   prefix = 
'muon'+str(prod+run)
 
  233   if prod 
in [610,620] 
and run == 0: prefix = 
'muon'+str(int(prod/100))
 
  234   for i 
in range(1,10):
 
  236    cmd = eos+
' cp -r  /eos/experiment/ship/data/muonBackground/'+prefix+str(i)+
'/ ' +os.path.abspath(
'.')+
'/'+prefix+str(i)+
'/' 
 
makeProd(prefix, DY, y=False, phiRandom=False, X=None)
 
copy2EOS()
makeProd("muon812",10,False,True) # –< 831 copied back, done 16.3.2015 makeProd("muon822",...