CMS 3D CMS Logo

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