Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:23

0001 from __future__ import print_function
0002 import os
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 
0007 
0008 
0009 
0010 ##
0011 ## Setup command line options
0012 ##
0013 import FWCore.ParameterSet.VarParsing as VarParsing
0014 import sys
0015 options = VarParsing.VarParsing ('standard')
0016 options.register('sample', 'wlnu', VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "wlnu")
0017 options.register('isTest', True, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, "Test run")
0018 
0019 # get and parse the command line arguments
0020 if( hasattr(sys, "argv") ):
0021     for args in sys.argv :
0022         arg = args.split(',')
0023         for val in arg:
0024             val = val.split('=')
0025             if(len(val)==2):
0026                 setattr(options,val[0], val[1])
0027 
0028 print("Input sample: ", options.sample)
0029 print("Test run: ", options.isTest)
0030 
0031 
0032 
0033 ##
0034 ## Process definition
0035 ##
0036 process = cms.Process("ApeEstimatorSummary")
0037 
0038 
0039 
0040 ##
0041 ## Message Logger
0042 ##
0043 process.load("FWCore.MessageService.MessageLogger_cfi")
0044 process.MessageLogger.CalculateAPE=dict()
0045 #process.MessageLogger.ApeEstimatorSummary=dict()
0046 process.MessageLogger.cerr.INFO.limit = 0
0047 process.MessageLogger.cerr.default.limit = -1
0048 process.MessageLogger.cerr.CalculateAPE = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0049 #process.MessageLogger.cerr.ApeEstimatorSummary = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0050 
0051 #process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
0052 #    reportEvery = cms.untracked.int32(100),  # every 100th only
0053 #    limit = cms.untracked.int32(10),         # or limit to 10 printouts...
0054 #))
0055 process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ## really show only every 1000th
0056 
0057 
0058 
0059 ##
0060 ## Process options
0061 ##
0062 process.options = cms.untracked.PSet(
0063     wantSummary = cms.untracked.bool(True),
0064 )
0065 
0066 
0067 
0068 ##
0069 ## Input sample definition
0070 ##
0071 isData1 = isData2 = False
0072 isData = False
0073 isQcd = isWlnu = isZmumu = isZtautau = isZmumu10 = isZmumu20 = False
0074 isMc = False
0075 if options.sample == 'data1':
0076     isData1 = True
0077     isData = True
0078 elif options.sample == 'data2':
0079     isData2 = True
0080     isData = True
0081 elif options.sample == 'qcd':
0082     isQcd = True
0083     isMc = True
0084 elif options.sample == 'wlnu':
0085     isWlnu = True
0086     isMc = True
0087 elif options.sample == 'zmumu':
0088     isZmumu = True
0089     isMc = True
0090 elif options.sample == 'ztautau':
0091     isZtautau = True
0092     isMc = True
0093 elif options.sample == 'zmumu10':
0094     isZmumu10 = True
0095     isMc = True
0096 elif options.sample == 'zmumu20':
0097     isZmumu20 = True
0098     isMc = True
0099 else:
0100     print('ERROR --- incorrect data sammple: ', options.sample)
0101     exit(8888)
0102 
0103 
0104 
0105 ##
0106 ## Input Files
0107 ##
0108 process.source = cms.Source("EmptySource")
0109 
0110 
0111 
0112 ##
0113 ## Number of Events
0114 ##
0115 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0116 
0117 
0118 
0119 ##
0120 ## ApeEstimatorSummary
0121 ##
0122 from Alignment.APEEstimation.ApeEstimatorSummary_cff import *
0123 process.ApeEstimatorSummary1 = ApeEstimatorSummaryBaseline.clone(
0124     InputFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '.root',
0125     ResultsFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_resultsFile1.root',
0126     BaselineFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_baselineApe.root',
0127 )
0128 process.ApeEstimatorSummary2 = ApeEstimatorSummaryIter.clone(
0129     correctionScaling = 0.6,
0130     InputFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '.root',
0131     ResultsFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_resultsFile2.root',
0132     BaselineFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_baselineApe.root',
0133     IterationFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_iterationApe2.root',
0134     ApeOutputFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_apeOutput2.txt',
0135 )
0136 process.ApeEstimatorSummary3 = ApeEstimatorSummaryIter.clone(
0137     correctionScaling = 0.6,
0138     InputFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '.root',
0139     ResultsFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_resultsFile3.root',
0140     BaselineFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_baselineApe.root',
0141     IterationFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_iterationApe3.root',
0142     ApeOutputFile = os.environ['CMSSW_BASE'] + '/src/Alignment/APEEstimation/hists/test_' + options.sample + '_apeOutput3.txt',
0143 )
0144 
0145 
0146 
0147 process.p = cms.Path(
0148     process.ApeEstimatorSummary1*
0149     process.ApeEstimatorSummary2
0150     #~ *process.ApeEstimatorSummary3
0151 )
0152 
0153 
0154