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