CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
10 class TrackSplittingValidation(GenericValidationData_CTSR, ParallelValidation, ValidationWithPlotsSummary, ValidationForPresentation):
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 
91 class SubsectionTrackSplitting(SubsectionFromList):
92  pageidentifiers = (
93  ("hist[.]Delta_pt", "$p_T$"),
94  ("hist[.]Delta_(eta|phi)", "Angles"),
95  ("hist[.]Delta_d(xy|z)", "Vertex"),
96  )
97 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19