#do python /scratch/sdorheim/FOPI/newDev/OUTPUT/git_scripts//Alignment/runStandaloneResCalc.py -n 0 -r $i -m 3d -alFile alinput.txt -p /nfs/mds/data/tpc/fopi/2011/reconstructed/smooth_finalCandidate3_newAlignment_newZshift/ -fb TpcFopiRecoSGE -smoothing -field -pt 0.15 -max-pt 1.5 -sectorCut 0 -fPath /nfs/mds/data/tpc/fopi/2011/fopi_reco_sverre/rev176/; done import ROOT, glob, math, sys, os, argparse print "####################################################################################################################################################################################" print sys.argv[0] + "running in this directory:" os.system("pwd") print "####################################################################################################################################################################################" parser=argparse.ArgumentParser(description="Scrip to run one Alignment step/iteraton") parser.add_argument("-n","--number-of-events", help="number of input events to be used for alignment", type=int, default=140000) parser.add_argument("-r","--run", help="run number to use if n<140k otherwhise specify run range 32XX , 34XX, 35XX", type=int, default=3280) parser.add_argument("-nr","--n-runs",help="number of runs", type=int, default=1) parser.add_argument("-m", "--method", help="residual calculator to be used, \n 2D, 3D, 3D-simple, track-track, cdc", type=str, default="3d") parser.add_argument("-d", "--dummy", help="enable dummy mode, print options but do not loop", action="store_true") parser.add_argument("-alFile", "--alignmentfile", help="specify alignment file to be used", type=str, default="alinput.txt") parser.add_argument("-p", "--path", help="Specify path to reconstructed files", type=str, default = "/scratch/other/sdorheim/DATA/unSmooth_noV0FopiTracking_RpcBarPixFits_DAF/") parser.add_argument("-fb", "--file-base", help="Specify file base of reco files. Used as follows: \n \"path + filebase+\"_run\"+runStr+\"_part\"+partStr+\"*\"+smoothingText+\".reco.root\"", type=str, default="TpcFopiRecoPersist_run") parser.add_argument("-smoothing","--smoothing", help="Flag if using smoothed data", action="store_true") parser.add_argument("-charge","--charge-filter", help="Specify filtering on charge, =0: no filtering, >0: only positive charge, <0: only negative charge", type=int, default=0) parser.add_argument("-field", "--mag-field", help="flag to turn on magnetic field", action="store_true") parser.add_argument("-pt", "--pt-limit", help="limit on Cdc track pt>limit", default=0.8, type=float) parser.add_argument("-max-pt", "--maximum-pt", help="Maximum Cdc track pt, pt0: resCalc.setMassCut(args.cdc_mass_cut) resCalc.setMinHitsCdc(args.minCdcHits) # resCalc.applyDevMap("/scratch/sdorheim/FOPI/newDev/tpc/FOPI/par/full_field_-148.62_-236.74_4s3_4.700_0.000sh0.000_65ar81_merged.txt") # resCalc.applyDevMap("/scratch/sdorheim/FOPI/newDev/tpc/FOPI/par/full_field_-148.62_-232.79_4s3_4.700_-0.000sh0.000_0.0000_65ar80__merged.txt") if args.sectorCut>0 or args.cdc_mass_cut>0: resCalc.addBranchName("CdcHitBr") resCalc.addBranchName("CdcTrackBr") resCalc.setCdcTrackBranchName("CdcTrackBr") resCalc.setCdcHitBranchName("CdcHitBr") resCalc.setCutOnNSectors(args.sectorCut) TpcSAResCalc.addFopiBranch("CdcHitBr","CdcHit") TpcSAResCalc.addFopiBranch("CdcTrackBr","CdcTrack") TpcSAResCalc.setTpcEventBranchName("TpcEventIdentifier") TpcSAResCalc.setFopiEventBranchName("FopiEventBr") # resCalc.setUseClusters(True) residualcCalculatorName="CdcTrackTpcHitResCalc" if True: resCalc.setCheckFopiTrack(False) if args.storeHistos: TpcSAResCalc.setSaveHistos(True) TpcSAResCalc.setResCalculatior(resCalc,residualcCalculatorName) TpcSAResCalc.setChargeFiltering(args.charge_filter) TpcSAResCalc.setMaxRangeXY(2); TpcSAResCalc.init() print "###################################################################################################" print "###################################################################################################" print "###################################################################################################" print "###################################################################################################" print "# " print "# " #print "# ",ROOT.TpcDigiMapper.getInstance().getGas().VDrift(0,0); print "# " print "# " print "###################################################################################################" print "###################################################################################################" print "###################################################################################################" print "###################################################################################################" timer.Stop(); rtime = timer.RealTime() ctime = timer.CpuTime() timer.Start(True) print "residual preparation took ", rtime, "and ctime: ",ctime TpcSAResCalc.execute() timer.Stop() rtime2 = timer.RealTime() ctime2 = timer.CpuTime() print "residual preparation took ", rtime, "and ctime: ",ctime print "residual calculation took ", rtime2, "and ctime: ",ctime2 if args.storeHistos: TpcSAResCalc.writeHistos() print "\n\n\n\n done \n\n\n\n " if args.storeHistos: if method.lower()=="3d" or method.lower()=="2d" or method.lower() == "cdc" and not mc: resCalc.writeHists() print "\n\n\n\n done \n\n\n\n " exit()