CMS 3D CMS Logo

cmsPerfCommons.py
Go to the documentation of this file.
1 from builtins import range
2 import os, re
3 
4 #Sort the candles to make sure MinBias is executed before QCD_80_120, otherwise DIGI PILEUP would not find its MinBias root files
5 
6 #Define ALL the physics processes available to the Performance Suite user (for most uses only 2 or 5 of these at a time will be used):
7 Candles=["MinBias" ,
8  "HiggsZZ4LM200" ,
9  "SingleElectronE1000",
10  "SingleMuMinusPt10" ,
11  "SinglePiMinusE1000" ,
12  "TTbar" ,
13  "QCD_80_120",
14  #Example addition of a new candle:
15  "QCD_3000_3500"
16  ]
17 #List containing the root filenames hardcoded in cmsDriver.py
18 #In the future we could eliminate this dependency by forcing the filename convention in the suite since we use the --fileout cmsDriver.py option now.
19 CandFname={
20  Candles[0]:"MINBIAS_",
21  Candles[1]:"HZZLLLL_200",
22  Candles[2]:"E_1000",
23  Candles[3]:"MU-_pt10",
24  Candles[4]:"PI-_1000",
25  Candles[5]:"TTBAR_" ,
26  Candles[6]:"QCD_80_120",
27  #Example addition of a new candle:
28  Candles[7]:"QCD_3000_3500"
29  }
30 
31 #List with all the "individual" steps understood by the Performance Suite
32 Step = ["GEN,SIM",
33  "DIGI",
34  "L1",
35  "DIGI2RAW",
36  "HLT",
37  "RAW2DIGI,RECO",
38  #Add also all PILEUP steps
39  "DIGI_PILEUP",
40  "L1_PILEUP",
41  "DIGI2RAW_PILEUP",
42  "HLT_PILEUP",
43  "RAW2DIGI,RECO_PILEUP"
44  ]
45 
46 #List of Production steps (to be used by the publishing script to find reports:
47 ProductionSteps = ["GEN,SIM,DIGI,L1,DIGI2RAW,HLT",
48  "GEN,SIM,DIGI,L1,DIGI2RAW",
49  "RAW2DIGI,RECO", #This is already included in Step! So remember to eliminate duplicates if doing the union of the two!
50  #Add also all PILEUP steps
51  "GEN,SIM,DIGI,L1,DIGI2RAW,HLT_PILEUP",
52  "GEN,SIM,DIGI,L1,DIGI2RAW_PILEUP",
53  "RAW2DIGI,RECO_PILEUP", #This is already included in Step!
54  "GEN,FASTSIM", #Adding FASTSIM workflow
55  "HLT" #Adding HLT alone workflow
56  ]
57 #A dictionary with the reverse look-up for the candle given the root base filename
58 revCFname = {
59  "MINBIAS_" : Candles[0],
60  "HZZLLLL_200" : Candles[1],
61  "E_1000" : Candles[1],
62  "MU-_pt10" : Candles[2],
63  "PI-_1000" : Candles[3],
64  "TTBAR_" : Candles[4],
65  "QCD_80_120" : Candles[6],
66  #Example addition of a new candle:
67  "QCD_3000_3500": Candles[7]
68  }
69 
70 CandDesc=["Minimum Bias",
71  "Higgs -> ZZ -> 4 leptons",
72  "Electron",
73  "Muon",
74  "Pion",
75  "TTBar",
76  "QCD Jets 80-120 GeV",
77  #Example addition of a new candle:
78  "QCD Jets 3000-3500 GeV"
79  ]
80 
81 # Need a little hash to match the candle with the ROOT name used by cmsDriver.py.
82 
83 FileName = {}
84 # Hash to switch from keyword to .cfi use of cmsDriver.py:
85 KeywordToCfi = {}
86 configs = ['MinBias.cfi',
87  'H200ZZ4L.cfi',
88  'SingleElectronE1000.cfi',
89  'SingleMuPt10.cfi',
90  'SinglePiE1000.cfi',
91  'TTbar_Tauola.cfi',
92  'QCD_Pt_80_120.cfi',
93  #Example addition of a new candle:
94  'QCD_Pt_3000_3500.cfi'
95  ]
96 
97 filenames = [CandFname[Candles[0]],
98  CandFname[Candles[1]],
99  CandFname[Candles[2]],
100  CandFname[Candles[3]],
101  CandFname[Candles[4]],
102  CandFname[Candles[5]],
103  CandFname[Candles[6]],
104  #Example addition of a new candle:
105  CandFname[Candles[7]]
106  ]
107 for x in range(len(Candles)):
108 
109  KeywordToCfi[Candles[x]] = configs[x]
110  FileName[Candles[x]] = filenames[x]
111 
112 #Allowed event contents (this list is used at the moment only in cmsRelvalreportInput.py to make sure any unprofiled step uses the FEVTDEBUGHLT eventcontent. Other uses can be devised later (adding FEVTDEBUG and FEVTDEBUGHLT for example)
113 EventContents=['RAWSIM',
114  'RECOSIM'
115  ]
116 
117 #PILE-UP Settings:
118 
119 #Set here the cmsDriver.py --pileup option:
120 cmsDriverPileUpOption='LowLumiPileUp'
121 
122 #Set the customise fragments path for the various steps:
123 #Note that currently the default customise fragment for steps not defined in this dictionary is the DIGI one below.
124 #Each step could have its own, by adding it in this dictionary
125 #When cmsRelvalreport.py is invoked with --pileup in its --cmsdriver option, then the DIGI-PILEUP customise will be
126 #used for all steps.
127 CustomiseFragment = {
128  'GEN,SIM': 'Validation/Performance/TimeMemoryG4Info.py',
129  'DIGI': 'Validation/Performance/TimeMemoryInfo.py',
130  'DIGI-PILEUP':'Validation/Performance/MixingModule.py'
131  }
132 
133 def getVerFromLog(previous):
134  prevlog = os.path.join(previous,"cmsPerfSuite.log")
135  if os.path.exists(prevlog):
136  for line in open(prevlog):
137  if "Test Release based on:" in line:
138  verreg = re.compile("^.*Test Release based on: (.*)$")
139  match = verreg.search(line)
140  if match:
141  return match.groups()[0]
142 
143  return "Unknown_prev_release"
def getVerFromLog(previous)