import ROOT, os #ROOT.gROOT.ProcessLine(".x rootlogon.C") if "VMCWORKDIR" in os.environ.keys() : ROOT.gROOT.ProcessLine(".x ${VMCWORKDIR}/gconfig/rootlogon.C") else : print "VMCWORKDIR not set. config.sh called?" exit() fRun = ROOT.FairRunAna() #fRun.SetGeomFile("geometry/FOPI_TPC.root") fRun.SetGeomFile("/home/mberger/fopiroot/dst2root/src/fopi2root/fopigeometry/FopiGeom_s339-20.0.root"); magField = ROOT.FOPIField(0.616) magField.SetTargetOffset(-61.) fRun.SetField(magField) #fRun.SetInputFile('outfiles_e12/MC/sphere/drift_86.0/new_error/Cosmics_FopiMC_86ar85_1_scaled_smallCorr2_recl.reco.root') fRun.SetInputFile('outfiles_e12/Data/Cosmics/run_3888/run_3888_86_ArCO2_85_stdErr.reco.root') #fRun.SetInputFile('outfiles/MC/sphere/drift_86.0/new_error/Cosmics_FopiMC_86ar85_1_recl.reco.root') fRun.SetOutputFile("meh.root") rtdb = fRun.GetRuntimeDb() parInput1 = ROOT.FairParAsciiFileIo() thisrun = 3888 #if args.run != None : # thisrun = args.run parFile = "tpc/FOPI/par/tpc.run%d.par"%thisrun print parFile if not os.path.isfile(parFile): print "no parfile found" exit() #parFile = os.environ["VMCWORKDIR"]+"/tpc/FOPI/par/tpc.86ar85MC.par" parInput1.open(parFile,"in") #parInput1 = ROOT.FairParRootFileIo() #parInput1.open('outfiles_e12/MC/sphere/drift_86.0/Cosmics_FopiMC_86ar85_1.param.root') rtdb.setFirstInput(parInput1) fRun.Init() ROOT.GFFieldManager.getInstance().init(ROOT.PndFieldAdaptor(fRun.GetField())) ROOT.GFMaterialEffects.getInstance().init(ROOT.GFTGeoMaterialInterface())