test
CMS 3D CMS Logo

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