Esempio n. 1
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents":
         self.general["maxevents"],
         "outputFile":
         replaceByMap((".oO[workdir]Oo./AlignmentValidation_" + self.name +
                       "_.oO[name]Oo..root"), repMap),
         "resultFile":
         replaceByMap((".oO[datadir]Oo./AlignmentValidation_" + self.name +
                       "_.oO[name]Oo..root"), repMap),
         "TrackSelectionTemplate":
         configTemplates.TrackSelectionTemplate,
         "LorentzAngleTemplate":
         configTemplates.LorentzAngleTemplate,
         "offlineValidationMode":
         "Standalone",
         "offlineValidationFileOutput":
         configTemplates.offlineStandaloneFileOutputTemplate,
         "TrackCollection":
         self.general["trackcollection"]
     })
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["outputFile"] = os.path.abspath(repMap["outputFile"])
     repMap["resultFile"] = os.path.expandvars(repMap["resultFile"])
     repMap["resultFile"] = os.path.abspath(repMap["resultFile"])
     if self.jobmode.split(',')[0] == "crab":
         repMap["outputFile"] = os.path.basename(repMap["outputFile"])
         repMap["resultFile"] = os.path.basename(repMap["resultFile"])
     return repMap
Esempio n. 2
0
 def createScript(self, path, scriptBaseName="TkAlOfflineValidation"):
     # A separate script is created for each parallel jobs.
     # Since only one cfg is saved a bit ugly solution is needed in the loop.
     returnValue = []
     numJobs = int(self.general["parallelJobs"])
     for index in range(numJobs):
         scriptName = "%s.%s.%s_%s.sh" % (scriptBaseName, self.name,
                                          self.alignmentToValidate.name,
                                          str(index))
         repMap = GenericValidationData.getRepMap(self)
         repMap["nIndex"] = ""
         repMap["nIndex"] = str(index)
         repMap["CommandLine"] = ""
         for cfg in self.configFiles:
             # The ugly solution here is to change the name for each parallel job
             cfgtemp = cfg.replace(
                 str(numJobs - 1) + "_cfg.py",
                 str(index) + "_cfg.py")
             repMap["CommandLine"] += repMap["CommandLineTemplate"] % {
                 "cfgFile": cfgtemp,
                 "postProcess": ""
             }
             scripts = {
                 scriptName:
                 replaceByMap(configTemplates.parallelScriptTemplate,
                              repMap)
             }
             returnValue.extend(
                 GenericValidationData.createScript(self, scripts, path))
     return returnValue
Esempio n. 3
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents":
         self.general["maxevents"],
         "outputFile":
         replaceByMap(
             ("AlignmentValidation_" + self.name + "_.oO[name]Oo..root"),
             repMap),
         "resultFile":
         replaceByMap(
             ("/store/caf/user/$USER/.oO[eosdir]Oo."
              "/AlignmentValidation_" + self.name + "_.oO[name]Oo..root"),
             repMap),
         "TrackSelectionTemplate":
         configTemplates.TrackSelectionTemplate,
         "LorentzAngleTemplate":
         configTemplates.LorentzAngleTemplate,
         "offlineValidationMode":
         "Standalone",
         "offlineValidationFileOutput":
         configTemplates.offlineStandaloneFileOutputTemplate,
         "TrackCollection":
         self.general["trackcollection"]
     })
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["resultFile"] = os.path.expandvars(repMap["resultFile"])
     return repMap
Esempio n. 4
0
 def getRepMap(self, alignment = None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents": self.general["maxevents"],
         "outputFile": replaceByMap( (".oO[workdir]Oo./AlignmentValidation_"
                                      + self.name +
                                      "_.oO[name]Oo..root"), repMap ),
         "resultFile": replaceByMap( (".oO[datadir]Oo./AlignmentValidation_"
                                      + self.name +
                                      "_.oO[name]Oo..root"), repMap ),
         "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
         "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
         "offlineValidationMode": "Standalone",
         "offlineValidationFileOutput":
         configTemplates.offlineStandaloneFileOutputTemplate,
         "TrackCollection": self.general["trackcollection"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
     repMap["resultFile"] = os.path.abspath( repMap["resultFile"] )
     if self.jobmode.split( ',' )[0] == "crab":
         repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
         repMap["resultFile"] = os.path.basename( repMap["resultFile"] )
     return repMap
Esempio n. 5
0
 def createScript(self, path, scriptBaseName = "TkAlOfflineValidation"):
     # A separate script is created for each parallel jobs.
     # Since only one cfg is saved a bit ugly solution is needed in the loop.
     returnValue = []
     numJobs = int( self.general["parallelJobs"] )
     for index in range(numJobs):
         scriptName = "%s.%s.%s_%s.sh"%(scriptBaseName, self.name, 
                                        self.alignmentToValidate.name,
                                        str(index))
         repMap = GenericValidationData.getRepMap(self)
         repMap["nIndex"]=""
         repMap["nIndex"]=str(index)
         repMap["CommandLine"]=""
         for cfg in self.configFiles:
             # The ugly solution here is to change the name for each parallel job 
             cfgtemp = cfg.replace(str(numJobs-1)+"_cfg.py",
                                   str(index)+"_cfg.py")
             repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfgtemp,
                                                                    "postProcess":""
                                                                    }
             scripts = {scriptName: replaceByMap(configTemplates.parallelScriptTemplate,
                                                 repMap ) }
             returnValue.extend(GenericValidationData.createScript(self,
                                                                   scripts,
                                                                   path) )
     return returnValue
Esempio n. 6
0
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents": self.general["maxevents"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
     return repMap
Esempio n. 7
0
    def getRepMap(self, alignment = None):
        repMap = GenericValidationData.getRepMap(self, alignment) 
        repMap.update({
            "nEvents": self.general["maxevents"],
#             "outputFile": "zmumuHisto.root"
            "outputFile": ("0_zmumuHisto.root"
                           ",genSimRecoPlots.root"
                           ",FitParameters.txt")
                })
        return repMap
Esempio n. 8
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self)
     repMap.update({
         "nEvents": self.general["maxevents"],
         "TrackCollection": self.general["trackcollection"]
     })
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self)
     repMap.update({ 
         "nEvents": self.general["maxevents"],
         "TrackCollection": self.general["trackcollection"]
         })
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 10
0
 def createScript(self, path, scriptBaseName = "TkAlOfflineValidation"):
     scriptName = "%s.%s.%s.sh"%( scriptBaseName, self.name,
                                  self.alignmentToValidate.name )
     repMap = GenericValidationData.getRepMap(self)
     repMap["CommandLine"]=""
     for cfg in self.configFiles:
         repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
                                               "postProcess":""
                                               }
     scripts = {scriptName: replaceByMap( configTemplates.scriptTemplate,
                                          repMap ) }
     return GenericValidationData.createScript(self, scripts, path)
Esempio n. 11
0
    def getRepMap(self, alignment = None):
        repMap = GenericValidationData.getRepMap(self, alignment)
        repMap.update({
            "nEvents": self.general["maxevents"],
            "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
            "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
            "offlineValidationMode": "Standalone",
            "offlineValidationFileOutput": configTemplates.offlineFileOutputTemplate,
            "TrackCollection": self.general["trackcollection"],
            })

        return repMap
Esempio n. 12
0
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "outputFile": replaceByMap((".oO[workdir]Oo./McValidation_"
                                     + self.name +
                                     "_.oO[name]Oo..root"), repMap ),
         "nEvents": self.general["maxevents"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     if self.jobmode.split( ',' )[0] == "crab":
         repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 13
0
 def getRepMap(self, alignment = None):
     if alignment == None:
         alignment = self.alignmentToValidate
     repMap = GenericValidationData.getRepMap(self, alignment) 
     repMap.update({
         "nEvents": self.general["maxevents"],
         "outputFile": ("0_zmumuHisto.root"
                        ",genSimRecoPlots.root"
                        ",FitParameters.txt"),
         "eosdir": os.path.join(self.general["eosdir"], "%s/%s/%s" % (self.outputBaseName, self.name, alignment.name)),
         "workingdir": ".oO[datadir]Oo./%s/%s/%s" % (self.outputBaseName, self.name, alignment.name),
         "plotsdir": ".oO[datadir]Oo./%s/%s/%s/plots" % (self.outputBaseName, self.name, alignment.name),
             })
     return repMap
Esempio n. 14
0
 def createScript(self, path, scriptBaseName="TkAlOfflineValidation"):
     scriptName = "%s.%s.%s.sh" % (scriptBaseName, self.name,
                                   self.alignmentToValidate.name)
     repMap = GenericValidationData.getRepMap(self)
     repMap["CommandLine"] = ""
     for cfg in self.configFiles:
         repMap["CommandLine"] += repMap["CommandLineTemplate"] % {
             "cfgFile": cfg,
             "postProcess": ""
         }
     scripts = {
         scriptName: replaceByMap(configTemplates.scriptTemplate, repMap)
     }
     return GenericValidationData.createScript(self, scripts, path)
Esempio n. 15
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "outputFile":
         replaceByMap((".oO[workdir]Oo./McValidation_" + self.name +
                       "_.oO[name]Oo..root"), repMap),
         "nEvents":
         self.general["maxevents"]
     })
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["outputFile"] = os.path.abspath(repMap["outputFile"])
     if self.jobmode.split(',')[0] == "crab":
         repMap["outputFile"] = os.path.basename(repMap["outputFile"])
     return repMap
Esempio n. 16
0
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "resultFile": replaceByMap(("/store/caf/user/$USER/.oO[eosdir]Oo."
                                     "/McValidation_"
                                     + self.name +
                                     "_.oO[name]Oo..root"), repMap ),
         "outputFile": replaceByMap(("McValidation_"
                                     + self.name +
                                     "_.oO[name]Oo..root"), repMap ),
         "nEvents": self.general["maxevents"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
     return repMap
Esempio n. 17
0
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self)
     if repMap["subdetector"] == "none":
         subdetselection = ""
     else:
         subdetselection = "process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2"
     repMap.update({ 
         "nEvents": self.general["maxevents"],
         "TrackCollection": self.general["trackcollection"],
         "subdetselection": subdetselection,
     })
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 18
0
    def getRepMap(self, alignment = None):
        if alignment == None:
            alignment = self.alignmentToValidate
        repMap = GenericValidationData.getRepMap(self, alignment) 
        repMap.update({
            "nEvents": self.general["maxevents"],
            "TrackCollection": self.general["trackcollection"],
            "VertexCollection": self.general["vertexcollection"],
            "eosdir": os.path.join(self.general["eosdir"]), 
            #"eosdir": os.path.join(self.general["eosdir"], "%s/%s/%s" % (self.outputBaseName, self.name, alignment.name)),
            "workingdir": ".oO[datadir]Oo./%s/%s/%s" % (self.outputBaseName, self.name, alignment.name),
            "plotsdir": ".oO[datadir]Oo./%s/%s/%s/plots" % (self.outputBaseName, self.name, alignment.name),
            })

        return repMap
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self)
     if repMap["subdetector"] == "none":
         subdetselection = ""
     else:
         subdetselection = "process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2"
     repMap.update({
         "nEvents": self.general["maxevents"],
         "TrackCollection": self.general["trackcollection"],
         "subdetselection": subdetselection,
     })
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 20
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "resultFile":
         replaceByMap(("/store/caf/user/$USER/.oO[eosdir]Oo."
                       "/McValidation_" + self.name + "_.oO[name]Oo..root"),
                      repMap),
         "outputFile":
         replaceByMap(("McValidation_" + self.name + "_.oO[name]Oo..root"),
                      repMap),
         "nEvents":
         self.general["maxevents"]
     })
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["resultFile"] = os.path.expandvars(repMap["resultFile"])
     return repMap
Esempio n. 21
0
 def getRepMap(self, alignment = None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents": self.general["maxevents"],
         "outputFile": replaceByMap( ("AlignmentValidation_"
                                      + self.name +
                                      "_.oO[name]Oo..root"), repMap ),
         "resultFile": replaceByMap( ("/store/caf/user/$USER/.oO[eosdir]Oo."
                                      "/AlignmentValidation_"
                                      + self.name +
                                      "_.oO[name]Oo..root"), repMap ),
         "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
         "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
         "offlineValidationMode": "Standalone",
         "offlineValidationFileOutput":
         configTemplates.offlineStandaloneFileOutputTemplate,
         "TrackCollection": self.general["trackcollection"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
     return repMap
 def getRepMap( self, alignment = None ):
     repMap = GenericValidationData.getRepMap(self)
     repMap.update({ 
         "resultFile": replaceByMap( ("/store/caf/user/$USER/.oO[eosdir]Oo."
                                      "/TrackSplitting_"
                                      + self.name +
                                      "_.oO[name]Oo..root"),
                                     repMap ),
         "outputFile": replaceByMap( ("TrackSplitting_"
                                      + self.name +
                                      "_.oO[name]Oo..root"),
                                     repMap ),
         "nEvents": self.general["maxevents"],
         "TrackCollection": self.general["trackcollection"]
         })
     repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
     repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 23
0
 def getRepMap(self, alignment=None):
     if alignment == None:
         alignment = self.alignmentToValidate
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({
         "nEvents":
         self.general["maxevents"],
         "outputFile": ("0_zmumuHisto.root"
                        ",genSimRecoPlots.root"
                        ",FitParameters.txt"),
         "eosdir":
         os.path.join(
             self.general["eosdir"],
             "%s/%s/%s" % (self.outputBaseName, self.name, alignment.name)),
         "workingdir":
         ".oO[datadir]Oo./%s/%s/%s" %
         (self.outputBaseName, self.name, alignment.name),
         "plotsdir":
         ".oO[datadir]Oo./%s/%s/%s/plots" %
         (self.outputBaseName, self.name, alignment.name),
     })
     return repMap
Esempio n. 24
0
    def getRepMap(self, alignment=None):
        if alignment == None:
            alignment = self.alignmentToValidate
        repMap = GenericValidationData.getRepMap(self, alignment)
        repMap.update({
            "nEvents":
            self.general["maxevents"],
            "TrackCollection":
            self.general["trackcollection"],
            "VertexCollection":
            self.general["vertexcollection"],
            "eosdir":
            os.path.join(self.general["eosdir"]),
            #"eosdir": os.path.join(self.general["eosdir"], "%s/%s/%s" % (self.outputBaseName, self.name, alignment.name)),
            "workingdir":
            ".oO[datadir]Oo./%s/%s/%s" %
            (self.outputBaseName, self.name, alignment.name),
            "plotsdir":
            ".oO[datadir]Oo./%s/%s/%s/plots" %
            (self.outputBaseName, self.name, alignment.name),
        })

        return repMap
Esempio n. 25
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self)
     repMap.update({
         "resultFile":
         replaceByMap(
             ("/store/caf/user/$USER/.oO[eosdir]Oo."
              "/TrackSplitting_" + self.name + "_.oO[name]Oo..root"),
             repMap),
         "outputFile":
         replaceByMap(
             ("TrackSplitting_" + self.name + "_.oO[name]Oo..root"),
             repMap),
         "nEvents":
         self.general["maxevents"],
         "TrackCollection":
         self.general["trackcollection"]
     })
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["resultFile"] = os.path.expandvars(repMap["resultFile"])
     # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
     # if self.jobmode.split( ',' )[0] == "crab":
     #     repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
     return repMap
Esempio n. 26
0
 def getRepMap(self, alignment=None):
     repMap = GenericValidationData.getRepMap(self, alignment)
     repMap.update({"nEvents": self.general["maxevents"]})
     repMap["outputFile"] = os.path.expandvars(repMap["outputFile"])
     repMap["resultFile"] = os.path.expandvars(repMap["resultFile"])
     return repMap