def SetGridLoc(self, storage=None): key = "" if self.storage.get() == "T2_UK_SGrid_RALPP": key = "RAL" elif self.storage.get() == "T2_CH_CAF": key = "CAF" elif self.storage.get() == "T2_US_Purdue": key = "PUR" elif self.storage.get() == "T3_US_UMD": key = "UMD" if key not in copySites.keys(): self.gridroot.set("") self.gridloc.set("") else: self.gridroot.set(copySites[key][0]) self.gridloc.set(copySites[key][1]) # Add other grid sites as necessary return
def SwitchSourceLocation(self): if self.sourceLocationVar.get() in copySites.keys(): temp = copySites[self.sourceLocationVar.get()] self.gridroot.set(temp[0]) self.gridloc.set(temp[1]) return
def ReadInputs(self): self.INuseLocalDBS = False self.INuseJSON = True # default should be true, not false? self.INtrigger = "2011" self.INdatatype = "RECO" self.INscheduler = "glite" self.INwhitelist = None parser = OptionParser() parser.add_option( "-l", action="store_true", default=False, dest="useLocalDBS", help="Use Local DBS (http://cmsdbsprod.cern.ch/cms_dbs_ph_analysis_02/servlet/DBSServlet)", ) parser.add_option( "-j", action="store_true", default=True, dest="useJSON", help="use JSON file to run on good LS" ) parser.add_option("-c", action="store_true", default=False, dest="useCAF", help="Use CAF") parser.add_option("-f", action="store_true", default=False, dest="useCONDOR", help="Use FNAL (condor)") parser.add_option("-g", default="glite", dest="scheduler", help="Specify scheduler (default=glite)") parser.add_option("-t", dest="triggerType", default="2011", help="Specify trigger type (default is 2011)") parser.add_option( "--2010", dest="oldTriggerType", default=False, action="store_true", help="Set trigger type to 2010" ) parser.add_option( "--2011", dest="newTriggerType", default=False, action="store_true", help="Set trigger type to 2011" ) parser.add_option("-r", dest="myreco", default="RECO", help="Specify reco type (default=RECO)") parser.add_option( "--raw", "--RAW", dest="rawtype", default=False, action="store_true", help="Set reco type to RAW+RECO" ) parser.add_option( "--reco", "--RECO", dest="recotype", default=False, action="store_true", help="Set reco type to RECO" ) parser.add_option("--mc", "--MC", dest="mctype", default=False, action="store_true", help="Set reco type to MC") parser.add_option("-w", dest="whitelist", default=None, help="Specify CE whitelist") parser.add_option( "-B", dest="BristolWhiteList", action="store_true", default=False, help="Use Bristol sites (heplnx206.pp.rl.ac.uk,heplnx207.pp.rl.ac.uk) for CE whitelist", ) parser.add_option("-E", "--era", dest="era", default=None, help="Specify Era (e.g. Run2011A_423p5_V180101)") parser.add_option( "-L", "--label", dest="label", default=None, help="Specify Label (e.g. the fill range: 2006_2040_v1" ) parser.add_option( "-D", "--dataset", dest="dataset", default=None, help="Specify dataset (ex. /MinimumBias/Run2011A-HSCPSD-PromptSkim-v6/RECO)", ) parser.add_option( "-G", "--globaltag", dest="globaltag", default=None, help="Specify globaltag (ex. GR_P_V22::All)" ) parser.add_option("--json", dest="json", default=None, help="Specify json file ") parser.add_option("--runs", dest="runs", default=None, help="Specify runlist file") parser.add_option( "--storage", dest="storage", default="T2_UK_SGrid_RALPP", help="Specify storage location (default is T2_UK_SGrid_RALPP)", ) # parser.add_option("--hltL3Tag", # dest="hltL3Tag", # default="Default", # help="Specify hltL3Tag (default is 'Default', which will use whatever is already specified in cfg file.)") # parser.add_option("--newhlttag", # dest="newhlttag", # default=False, # action="store_true", # help="Specify new hltL3Tag (hltStoppedHSCPCaloJetEnergy50)") # parser.add_option("--oldhlttag", # dest="oldhlttag", # default=False, # action="store_true", # help="Specify old hltL3Tag (hltStoppedHSCPTight1CaloJetEnergy30)") parser.add_option( "-s", "--site", default="RAL", help="Specify copysite location. Choices are: %s" % copySites.keys() ) parser.add_option( "-p", "--srmcp", default=False, action="store_true", help="Use srmcp to copy files. Default is false (lcg is used by default.)", ) parser.add_option( "-v", "--version", # default="v1", dest="version", help="Specify ntuple version/iteration, such as 'v1'", ) parser.add_option( "-n", "--ntuple", # default="V180101", dest="ntuple", help="specify Ntuple tag, such as 'V180101'", ) (options, args) = parser.parse_args() # if options.newhlttag==True and options.oldhlttag==True: # print "Cannot specify both old and new hlttags as true! Pick one!" # else: # if options.newhlttag==True: # if options.hltL3Tag=="Default": # options.hltL3Tag="hltStoppedHSCPCaloJetEnergy50" # else: # print "Cannot specify both '--newhlttag' and a separate '--hltL3Tag'!" # print "Using the hltL3tag value '%s'"%options.hltL3Tag # elif options.oldhlttag==True: # if options.hltL3Tag=="Default": # options.hltL3Tag="hltStoppedHSCPTight1CaloJetEnergy30" # else: # print "Cannot specify both '--oldhlttag' and a separate '--hltL3Tag'!" # print "Using the hltL3tag value '%s'"%options.hltL3Tag self.INuseLocalDBS = options.useLocalDBS self.INuseJSON = options.useJSON self.INscheduler = options.scheduler # self.INhltL3Tag=options.hltL3Tag self.site = options.site self.srmcp = options.srmcp if options.useCAF == True and options.useCONDOR == True: self.Print("Error! Both CAF and CONDOR cannot be set to True!") sys.exit() if options.useCAF == True: self.INscheduler = "caf" if options.useCONDOR == True: self.INscheduler = "condor" if options.oldTriggerType == True and options.newTriggerType == True: self.Print("Error! Can't specify trigger type as both 2010 and 2011!") sys.exit() elif options.oldTriggerType == True: self.INtrigger = "2010" elif options.newTriggerType == True: self.INtrigger = "2011" else: self.INtrigger = options.triggerType if options.rawtype == True: self.INdatatype = "RAWRECO" elif options.recotype == True: self.INdatatype = "RECO" elif options.mctype == True: self.INdatatype == "MC" else: self.INdatatype = options.myreco if options.BristolWhiteList == True: self.INwhitelist = "heplnx206.pp.rl.ac.uk,heplnx207.pp.rl.ac.uk" else: if options.whitelist <> None: self.INwhitelist = options.whitelist else: self.INwhitelist = "#heplnx206.pp.rl.ac.uk,heplnx207.pp.rl.ac.uk" self.INera = options.era self.INlabel = options.label self.INdataset = options.dataset self.INgtag = options.globaltag self.INjsonfile = options.json self.INruns = options.runs self.INstorage = options.storage self.outputloc = ["T2_UK_SGrid_RALPP", "T2_CH_CAF", "T2_US_Purdue", "T3_US_UMD"] if self.INstorage not in self.outputloc: self.outputloc.append(self.INstorage) else: self.outputloc.append("None") self.INntuple = options.ntuple self.INversion = options.version for a in args: # print a if self.INera == None: self.INera = a # print "era = ",a elif self.INlabel == None: self.INlabel = a # print "label = ",a elif self.INdataset == None: self.INdataset = a # print "dataset=",a elif self.INgtag == None: self.INgtag = a elif self.INuseJSON == True and self.INjsonfile == None: self.INjsonfile = a # print "jsonfile = ",a elif self.INuseJSON == False and self.INruns == None: self.INruns = a # Last argument is either jsonfile or runlist # Make them equal, but disable one based on whether useJSON is True if self.INjsonfile == None: self.INjsonfile = self.INruns if self.INruns == None: self.INruns = self.INjsonfile # Split label, era up to separate versions if self.INlabel <> None: if self.INlabel.find("_v") > -1: temp = string.split(self.INlabel, "_v") self.INlabel = temp[0] self.INversion = "v%s" % temp[1] if self.INlabel.find("_V") > -1: temp = string.split(self.INlabel, "_V") self.INlabel = temp[0] self.INversion = "v%s" % string.lower(temp[1]) if self.INera <> None: if self.INera.find("_V") > -1: temp = string.split(self.INera, "_V") self.INera = temp[0] self.INntuple = "V%s" % temp[1] if self.INera.find("_v") > -1: temp = string.split(self.INera, "_v") self.INera = temp[0] self.INntuple = "V%s" % string.upper(temp[1]) return