draw_many.py 3.82 KB
Newer Older
Cornelius Feier-Riesen's avatar
Cornelius Feier-Riesen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3

import os
import sys
import shutil


def main():
    
    print ("Use 'draw_all.py' instead!")

    """
    dataDir = sys.argv[1]
    geoSetup = sys.argv[2]
    plutoParticle = sys.argv[3]
    cbmrootConfigPath = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/build/config.sh"
    macroDir = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/cbmroot/macro/analysis/dielectron/"
    nofEvents = 10
    taskId = os.environ.get('SLURM_ARRAY_TASK_ID')
    jobId = os.environ.get('SLURM_ARRAY_JOB_ID')
    colEnergy = "8gev"
    colSystem = "auau"
    print("dataDir:" + dataDir)

    os.system(("source {}").format(cbmrootConfigPath))

    workDir = dataDir + "/workdir/" + jobId + "_" + taskId + "/"
    if os.path.exists(workDir):
        shutil.rmtree(workDir)
    os.makedirs(workDir)
    os.chdir(workDir)

    plutoFile = getPlutoPath(colSystem, colEnergy, plutoParticle, taskId)
    urqmdFile = "/lustre/nyx/cbm/prod/gen/urqmd/auau/"+colEnergy+"/centr/urqmd.auau.8gev.centr." + str(taskId).zfill(5) + ".root"
    mcFile = dataDir + "/mc." + taskId + ".root"
    parFile = dataDir + "/param." + taskId + ".root"
    digiFile = dataDir + "/digi." + taskId + ".root"
    recoFile = dataDir + "/reco." + taskId + ".root"
    litQaFile = dataDir + "/litqa." + taskId + ".root"
    analysisFile = dataDir + "/analysis." + taskId + ".root"
    geoSimFile = dataDir + "/geosim." + taskId + ".root"
    os.system(('root -l -b -q {}/run_sim.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
        macroDir, urqmdFile, plutoFile, mcFile, parFile, geoSimFile, geoSetup, nofEvents))
    os.system(('root -l -b -q {}/run_digi.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
        macroDir, mcFile, parFile, digiFile, nofEvents))
    os.system(('root -l -b -q {}/run_reco.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
        macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, nofEvents))
    os.system(('root -l -b -q {}/run_litqa.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
        macroDir, mcFile, parFile, digiFile, recoFile, litQaFile, geoSetup, nofEvents))
    os.system(('root -l -b -q {}/run_analysis.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
        macroDir, mcFile, parFile, digiFile, recoFile, analysisFile, plutoParticle, colSystem, colEnergy, geoSetup, nofEvents))


def getPlutoPath(colSystem, colEnergy, plutoParticle, taskId):
    if plutoParticle == "rho0":
       return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/rho0/epem/pluto.auau."+colEnergy+".rho0.epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "omegaepem":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/omega/epem/pluto.auau."+colEnergy+".omega.epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "omegadalitz":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/omega/pi0epem/pluto.auau."+colEnergy+".omega.pi0epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "phi":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/phi/epem/pluto.auau."+colEnergy+".phi.epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "pi0":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/pi0/gepem/pluto.auau."+colEnergy+".pi0.gepem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "inmed":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/"+colEnergy+"/rapp.inmed/epem/pluto.auau."+colEnergy+".rapp.inmed.epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "qgp":
        return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/"+colEnergy+"/rapp.qgp/epem/pluto.auau."+colEnergy+".rapp.qgp.epem." + str(taskId).zfill(4) + ".root"
    elif plutoParticle == "urqmd":
        return ""
"""

if __name__ == '__main__':
    main()