CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Validation/Performance/scripts/cmsPerfCommons.py

Go to the documentation of this file.
00001 import os, re
00002 
00003 #Sort the candles to make sure MinBias is executed before QCD_80_120, otherwise DIGI PILEUP would not find its MinBias root files
00004 
00005 #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):
00006 Candles=["MinBias"            ,
00007          "HiggsZZ4LM200"      ,         
00008          "SingleElectronE1000",
00009          "SingleMuMinusPt10"  ,
00010          "SinglePiMinusE1000" ,
00011          "TTbar"              ,
00012          "QCD_80_120",
00013          #Example addition of a new candle:
00014          "QCD_3000_3500"
00015          ]
00016 #List containing the root filenames hardcoded in cmsDriver.py
00017 #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.
00018 CandFname={
00019     Candles[0]:"MINBIAS_",
00020     Candles[1]:"HZZLLLL_200",    
00021     Candles[2]:"E_1000",
00022     Candles[3]:"MU-_pt10",
00023     Candles[4]:"PI-_1000",
00024     Candles[5]:"TTBAR_" ,
00025     Candles[6]:"QCD_80_120",
00026     #Example addition of a new candle:
00027     Candles[7]:"QCD_3000_3500"
00028     }
00029 
00030 #List with all the "individual" steps understood by the Performance Suite
00031 Step = ["GEN,SIM",
00032         "DIGI",
00033         "L1",              
00034         "DIGI2RAW",
00035         "HLT",
00036         "RAW2DIGI,RECO",
00037         #Add also all PILEUP steps
00038         "DIGI_PILEUP",
00039         "L1_PILEUP",
00040         "DIGI2RAW_PILEUP",
00041         "HLT_PILEUP",
00042         "RAW2DIGI,RECO_PILEUP"
00043         ]
00044 
00045 #List of Production steps (to be used by the publishing script to find reports:
00046 ProductionSteps = ["GEN,SIM,DIGI,L1,DIGI2RAW,HLT",
00047                    "GEN,SIM,DIGI,L1,DIGI2RAW",
00048                    "RAW2DIGI,RECO", #This is already included in Step! So remember to eliminate duplicates if doing the union of the two!
00049                    #Add also all PILEUP steps
00050                    "GEN,SIM,DIGI,L1,DIGI2RAW,HLT_PILEUP",
00051                    "GEN,SIM,DIGI,L1,DIGI2RAW_PILEUP",
00052                    "RAW2DIGI,RECO_PILEUP", #This is already included in Step!
00053                    "GEN,FASTSIM", #Adding FASTSIM workflow
00054                    "HLT"          #Adding HLT alone workflow
00055                    ]
00056 #A dictionary with the reverse look-up for the candle given the root base filename 
00057 revCFname = {
00058     "MINBIAS_"    : Candles[0],
00059     "HZZLLLL_200" : Candles[1],    
00060     "E_1000"      : Candles[1],
00061     "MU-_pt10"    : Candles[2],
00062     "PI-_1000"    : Candles[3],
00063     "TTBAR_"      : Candles[4], 
00064     "QCD_80_120"  : Candles[6],
00065     #Example addition of a new candle:
00066     "QCD_3000_3500": Candles[7]
00067     }
00068 
00069 CandDesc=["Minimum Bias",
00070           "Higgs -> ZZ -> 4 leptons",
00071           "Electron",
00072           "Muon",
00073           "Pion",
00074           "TTBar",
00075           "QCD Jets 80-120 GeV",
00076           #Example addition of a new candle:
00077           "QCD Jets 3000-3500 GeV"
00078           ]
00079 
00080 # Need a little hash to match the candle with the ROOT name used by cmsDriver.py.
00081 
00082 FileName = {}
00083 # Hash to switch from keyword to .cfi use of cmsDriver.py:
00084 KeywordToCfi = {}
00085 configs   = ['MinBias.cfi',               
00086              'H200ZZ4L.cfi',
00087              'SingleElectronE1000.cfi',
00088              'SingleMuPt10.cfi',
00089              'SinglePiE1000.cfi',
00090              'TTbar_Tauola.cfi',               
00091              'QCD_Pt_80_120.cfi',
00092              #Example addition of a new candle:
00093              'QCD_Pt_3000_3500.cfi'
00094              ]
00095     
00096 filenames = [CandFname[Candles[0]],        
00097              CandFname[Candles[1]],
00098              CandFname[Candles[2]],
00099              CandFname[Candles[3]],
00100              CandFname[Candles[4]],
00101              CandFname[Candles[5]],
00102              CandFname[Candles[6]],
00103              #Example addition of a new candle:
00104              CandFname[Candles[7]]
00105              ]
00106 for x in range(len(Candles)):
00107 
00108     KeywordToCfi[Candles[x]] = configs[x]
00109     FileName[Candles[x]]     = filenames[x]
00110 
00111 #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)
00112 EventContents=['RAWSIM',
00113                'RECOSIM'
00114                ]
00115 
00116 #PILE-UP Settings:
00117 
00118 #Set here the cmsDriver.py --pileup option:
00119 cmsDriverPileUpOption='LowLumiPileUp'
00120 
00121 #Set the customise fragments path for the various steps:
00122 #Note that currently the default customise fragment for steps not defined in this dictionary is the DIGI one below.
00123 #Each step could have its own, by adding it in this dictionary
00124 #When cmsRelvalreport.py is invoked with --pileup in its --cmsdriver option, then the DIGI-PILEUP customise will be
00125 #used for all steps.
00126 CustomiseFragment = {
00127          'GEN,SIM': 'Validation/Performance/TimeMemoryG4Info.py',
00128          'DIGI': 'Validation/Performance/TimeMemoryInfo.py',
00129          'DIGI-PILEUP':'Validation/Performance/MixingModule.py'
00130          }
00131 
00132 def getVerFromLog(previous):
00133     prevlog = os.path.join(previous,"cmsPerfSuite.log")
00134     if os.path.exists(prevlog):
00135         for line in open(prevlog):
00136             if "Test Release based on:" in line:
00137                 verreg = re.compile("^.*Test Release based on: (.*)$")
00138                 match = verreg.search(line)
00139                 if match:
00140                     return match.groups()[0]
00141         
00142     return "Unknown_prev_release"