CMS 3D CMS Logo

trackSplittingValidation.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 import os
3 from . import configTemplates
4 from .genericValidation import GenericValidationData_CTSR, ParallelValidation, ValidationForPresentation, ValidationWithPlotsSummary
5 from .helperFunctions import replaceByMap
6 from .presentation import SubsectionFromList, SubsectionOnePage
7 from .TkAlExceptions import AllInOneError
8 
9 
11  configBaseName = "TkAlTrackSplitting"
12  scriptBaseName = "TkAlTrackSplitting"
13  crabCfgBaseName = "TkAlTrackSplitting"
14  resultBaseName = "TrackSplitting"
15  outputBaseName = "TrackSplitting"
16  defaults = {"multiIOV":"False"}
17  mandatories = {"trackcollection"}
18  valType = "split"
19 
20  @property
21  def ValidationTemplate(self):
22  return configTemplates.TrackSplittingTemplate
23 
24  @property
25  def ValidationSequence(self):
26  return configTemplates.TrackSplittingSequence
27 
28  @property
29  def ProcessName(self):
30  return "splitter"
31 
32  def createScript(self, path):
33  return super(TrackSplittingValidation, self).createScript(path)
34 
35  def createCrabCfg(self, path):
36  return super(TrackSplittingValidation, self).createCrabCfg(path, self.crabCfgBaseName)
37 
38  def getRepMap( self, alignment = None ):
39  repMap = super(TrackSplittingValidation, self).getRepMap(alignment)
40  if repMap["subdetector"] == "none":
41  subdetselection = ""
42  else:
43  subdetselection = "process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2"
44  repMap.update({
45  "nEvents": self.general["maxevents"],
46  "TrackCollection": self.general["trackcollection"],
47  "subdetselection": subdetselection,
48  })
49  # repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
50  # if self.jobmode.split( ',' )[0] == "crab":
51  # repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
52  return repMap
53 
54  def appendToPlots(self):
55  """
56  if no argument or "" is passed a string with an instantiation is
57  returned, else the validation is appended to the list
58  """
59  repMap = self.getRepMap()
60  comparestring = self.getCompareStrings("TrackSplittingValidation")
61  return ' "{},"'.format(comparestring)
62 
63  def appendToMerge(self):
64  repMap = self.getRepMap()
65 
66  parameters = " ".join(os.path.join("root://eoscms//eos/cms", file.lstrip("/")) for file in repMap["resultFiles"])
67 
68  mergedoutputfile = os.path.join("root://eoscms//eos/cms", repMap["finalResultFile"].lstrip("/"))
69  return "hadd -f %s %s" % (mergedoutputfile, parameters)
70 
71  @classmethod
73  return "TkAlTrackSplitPlot.C"
74 
75  @classmethod
77  return configTemplates.trackSplitPlotTemplate
78 
79  @classmethod
80  def plotsdirname(cls):
81  return "TrackSplittingPlots"
82 
83  @classmethod
85  return [
86  SubsectionTrackSplitting('hist.*eps$', 'Track splitting'),
87 # Uncomment and edit to highlight one or more profiles
88 # SubsectionOnePage("profile.phi_org.Delta_phi.*.eps", "modulation"),
89  ]
90 
92  pageidentifiers = (
93  ("hist[.]Delta_pt", "$p_T$"),
94  ("hist[.]Delta_(eta|phi)", "Angles"),
95  ("hist[.]Delta_d(xy|z)", "Vertex"),
96  )
97 
trackSplittingValidation.TrackSplittingValidation.createScript
def createScript(self, path)
Definition: trackSplittingValidation.py:32
trackSplittingValidation.TrackSplittingValidation.getRepMap
def getRepMap(self, alignment=None)
Definition: trackSplittingValidation.py:38
genericValidation.ValidationWithPlotsSummary
Definition: genericValidation.py:748
trackSplittingValidation.TrackSplittingValidation.ValidationSequence
def ValidationSequence(self)
Definition: trackSplittingValidation.py:25
trackSplittingValidation.TrackSplittingValidation.plotsdirname
def plotsdirname(cls)
Definition: trackSplittingValidation.py:80
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
genericValidation.ValidationForPresentation
Definition: genericValidation.py:792
trackSplittingValidation.TrackSplittingValidation
Definition: trackSplittingValidation.py:10
genericValidation.GenericValidationData_CTSR
Definition: genericValidation.py:510
trackSplittingValidation.TrackSplittingValidation.createCrabCfg
def createCrabCfg(self, path)
Definition: trackSplittingValidation.py:35
trackSplittingValidation.SubsectionTrackSplitting
Definition: trackSplittingValidation.py:91
genericValidation.GenericValidation.general
general
Definition: genericValidation.py:58
trackSplittingValidation.TrackSplittingValidation.ProcessName
def ProcessName(self)
Definition: trackSplittingValidation.py:29
genericValidation.ParallelValidation
Definition: genericValidation.py:572
genericValidation.GenericValidation.getRepMap
def getRepMap(self, alignment=None)
Definition: genericValidation.py:137
trackSplittingValidation.TrackSplittingValidation.appendToPlots
def appendToPlots(self)
Definition: trackSplittingValidation.py:54
trackSplittingValidation.TrackSplittingValidation.presentationsubsections
def presentationsubsections(cls)
Definition: trackSplittingValidation.py:84
trackSplittingValidation.TrackSplittingValidation.crabCfgBaseName
string crabCfgBaseName
Definition: trackSplittingValidation.py:13
trackSplittingValidation.TrackSplittingValidation.appendToMerge
def appendToMerge(self)
Definition: trackSplittingValidation.py:63
format
trackSplittingValidation.TrackSplittingValidation.ValidationTemplate
def ValidationTemplate(self)
Definition: trackSplittingValidation.py:21
trackSplittingValidation.TrackSplittingValidation.plottingscripttemplate
def plottingscripttemplate(cls)
Definition: trackSplittingValidation.py:76
genericValidation.GenericValidation.getCompareStrings
def getCompareStrings(self, requestId=None, plain=False)
Definition: genericValidation.py:169
presentation.SubsectionFromList
Definition: presentation.py:115
trackSplittingValidation.TrackSplittingValidation.plottingscriptname
def plottingscriptname(cls)
Definition: trackSplittingValidation.py:72