From 3a5e14a8b53d0e92b214b5f3ad59115468f54ce4 Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Tue, 2 Apr 2019 16:24:00 +0200 Subject: [PATCH 01/10] ggZ samples --- Nero/test/crabNero.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Nero/test/crabNero.py b/Nero/test/crabNero.py index 30f3b79..a480fe7 100644 --- a/Nero/test/crabNero.py +++ b/Nero/test/crabNero.py @@ -519,9 +519,29 @@ def submitDatasets(datasetNames): #config.Data.inputDataset = '/GluGluToHHTo2B2G_node_4_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' #submit(config) + config.General.requestName = 'GGZZ2e2mu' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2e2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ4mu' + config.Data.inputDataset = '/GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ4tau' + config.Data.inputDataset = '/GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14_ext1-v2/MINIAODSIM' + submit(config) + config.General.requestName = 'GGZZ2mu2nu' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2nu_13TeV_MCFM701_pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/MINIAODSIM' + submit(config) # Local Variables: # mode:python From be7d0ca5f938aadbde1a64c81ca9ea7c0f37200a Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Wed, 3 Apr 2019 16:12:00 +0200 Subject: [PATCH 02/10] dy105 160. first version of crab2016 --- Nero/test/crabNero.py | 5 + Nero/test/crabNero2016.py | 455 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 460 insertions(+) create mode 100644 Nero/test/crabNero2016.py diff --git a/Nero/test/crabNero.py b/Nero/test/crabNero.py index a480fe7..18732f4 100644 --- a/Nero/test/crabNero.py +++ b/Nero/test/crabNero.py @@ -483,8 +483,13 @@ def submitDatasets(datasetNames): config.General.requestName = 'DYJetsToLL2' config.Data.inputDataset = '/DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + submit(config)\ + + config.General.requestName = 'DYJetsToMuMu_105_160' + config.Data.inputDataset='/DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' submit(config) + #config.General.requestName = 'QCD-15-700-hpp' #config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' #submit(config) diff --git a/Nero/test/crabNero2016.py b/Nero/test/crabNero2016.py new file mode 100644 index 0000000..f2322a6 --- /dev/null +++ b/Nero/test/crabNero2016.py @@ -0,0 +1,455 @@ +from CRABClient.UserUtilities import config, getUsernameFromSiteDB +from subprocess import call, check_output + +import sys, os, re + +### CHECK THAT CMS env and it is correct +pwd = os.environ['PWD'] +if 'CMSSW_VERSION' not in os.environ: + print "Do cmsenv!" + exit(0) +version = os.environ['CMSSW_VERSION'] +ok = False +for dir in reversed(pwd.split('/')): + if version == dir : + ok = True + break +if not ok: + print "Do (redo) cmsenv (2) !" + exit(0) + + +config = config() + +config.General.requestName = 'Nero_request_XXX' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = False + +## JobType +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'testNero.py' +#config.JobType.psetName = 'testNero_twomu.py' +config.JobType.pyCfgParams=['isGrid=True','isData=False','nerohead='+check_output("git rev-parse HEAD",shell=True), 'nerotag='+check_output('git describe --tags',shell=True),'isRun=2016B'] + +# request shipping of the JEC V4 -- local +#config.JobType.inputFiles=['jec/Summer15_50nsV4_DATA.db','jec/Summer15_50nsV4_MC.db'] +config.JobType.inputFiles=['jec','qg','jer'] + +### DATA configuration +config.Data.inputDataset = '/HplusToTauNu-M500/amarini-amarini_PrivateMC_HPlusToTauNu_June2015-16aa19d591b8b49c55c4508e7a7c9233/USER' +#config.Data.inputDBS = 'phys03' +config.Data.inputDBS = 'global' +config.Data.ignoreLocality = False + +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 10 +config.Data.totalUnits = -1 + +tag = check_output("git describe --tags | cut -d'-' -f 1 | tr -d '\n' ",shell=True) +print "-> current tag is '"+tag + "'" +#config.Data.outLFNDirBase = '/store/user/%s/Nero/%s/' % (getUsernameFromSiteDB(), tag) +config.Data.outLFNDirBase = '/store/group/phys_higgs/cmshmm/%s/Nero/%s/2016/' % (getUsernameFromSiteDB(), tag) +config.Data.publication = False +config.Data.outputDatasetTag ='NeroNtuples' +config.Data.allowNonValidInputDataset = True + +config.Site.storageSite = 'T2_CH_CERN' +#config.Site.blacklist = [ 'T2_US_Florida','T2_US_Vanderbilt'] + + +if __name__ == '__main__': + + from CRABAPI.RawCommand import crabCommand + from CRABClient.ClientExceptions import ClientException + from httplib import HTTPException + + # We want to put all the CRAB project directories from the tasks we submit here into one common directory. + # That's why we need to set this parameter (here or above in the configuration file, it does not matter, we will not overwrite it). + config.General.workArea = 'NeroSubmissionSkim' + + def submit(config): + ### for some reason only the first dataset is submitted correctly, work around + if len(sys.argv) ==1: + ## book the command and run python + cmd = "python " + sys.argv[0] + " '" + config.General.requestName + "'" + print "calling: "+cmd + call(cmd,shell=True) + return + if len(sys.argv) > 1: + ## if it is not in the request try the next + if sys.argv[1] != config.General.requestName: return + ### + if '*' in config.Data.inputDataset: + print "-> Figuring out dataset from *" + cmd="dasgoclient -query='%s'"%config.Data.inputDataset + print "Running cmd '"+cmd+"'" + dataset=check_output(cmd,shell=True).split('\n')[0].split()[0] + config.Data.inputDataset=dataset + #config.Data.inputDataset = '/SingleMuon/Run2017B-31Mar2018-v1/MINIAOD' + if 'Run2017' in config.Data.inputDataset or 'Run2016' in config.Data.inputDataset or 'Run2018' in config.Data.inputDataset: + run=config.Data.inputDataset.split('/')[2].split('-')[0] + setrun(run) + print "--- Submitting " + "\033[01;32m" + config.Data.inputDataset.split('/')[1] + "\033[00m" + " ---" + config.Data.outputDatasetTag = config.General.requestName + print "lumi-mask is",config.Data.lumiMask + try: + crabCommand('submit', config = config) + except HTTPException as hte: + print "Failed submitting task: %s" % (hte.headers) + except ClientException as cle: + print "Failed submitting task: %s" % (cle) + + def setdata(value="True"): + if value=='True': + config.Data.splitting = 'LumiBased' + #config.Data.lumiMask=None + #url = "https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions17/13TeV/Final" + #config.Data.lumiMask = url + "/Cert_294927-306462_13TeV_PromptReco_Collisions17_JSON.txt" + url = "https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions16/13TeV/ReReco/Final/" + #config.Data.lumiMask = url + "/Cert_294927-306462_13TeV_EOY2017ReReco_Collisions17_JSON.txt" + config.Data.lumiMask = url + "Cert_271036-284044_13TeV_23Sep2016ReReco_Collisions16_JSON.txt" + else: + config.Data.lumiMask = None + config.Data.splitting = 'FileBased' + + for idx,par in enumerate(config.JobType.pyCfgParams): + if "isData" in par: + config.JobType.pyCfgParams[idx] = "isData=" + value + return + + def setrun(value='Run2017B'): + print "-> Setting run Option to:", value + for idx,par in enumerate(config.JobType.pyCfgParams): + if "isRun" in par: + config.JobType.pyCfgParams[idx] = "isRun=" + value + + def submitDatasets(datasetNames): + usedNames = {} + for datasetName in datasetNames: + basename = datasetName.split('/')[1] + datasetNum = usedNames.get(basename, 0) + config.General.requestName = '{0}_{1}'.format(basename,datasetNum) + config.Data.inputDataset = datasetName + submit(config) + usedNames[basename] = datasetNum + 1 + + ############################################################################################# + ## From now on that's what users should modify: this is the a-la-CRAB2 configuration part. ## + ############################################################################################# + + ################################################### + ######## 25ns 2017 ######## + ################################################### + setdata("True") + ################################################### + config.Data.unitsPerJob = 100 + + config.General.requestName = 'SingleMuon-Run2016B_ver1' + config.Data.inputDataset = '/SingleMuon/Run2016B-17Jul2018_ver1-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016B_ver2' + config.Data.inputDataset = '/SingleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016C' + config.Data.inputDataset = '/SingleMuon/Run2016C-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016D' + config.Data.inputDataset = '/SingleMuon/Run2016D-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016E' + config.Data.inputDataset = '/SingleMuon/Run2016E-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016F' + config.Data.inputDataset = '/SingleMuon/Run2016F-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016G' + config.Data.inputDataset = '/SingleMuon/Run2016G-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'SingleMuon-Run2016H' + config.Data.inputDataset = '/SingleMuon/Run2016H-17Jul2018-v1/MINIAOD' + submit(config) + + ######################################## DOUBLE MUON + + config.General.requestName = 'DoubleMuon-Run2016B_ver1' + config.Data.inputDataset = '/DoubleMuon/Run2016B-17Jul2018_ver1-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016B_ver2' + config.Data.inputDataset = '/DoubleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016C' + config.Data.inputDataset = '/DoubleMuon/Run2016C-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016D' + config.Data.inputDataset = '/DoubleMuon/Run2016D-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016E' + config.Data.inputDataset = '/DoubleMuon/Run2016E-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016F' + config.Data.inputDataset = '/DoubleMuon/Run2016F-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016G' + config.Data.inputDataset = '/DoubleMuon/Run2016G-17Jul2018-v1/MINIAOD' + submit(config) + + config.General.requestName = 'DoubleMuon-Run2016H' + config.Data.inputDataset = '/DoubleMuon/Run2016H-17Jul2018-v1/MINIAOD' + submit(config) + + ################################################### + + ##################################################### + ##setdata("False") + ##################################################### + + ##config.General.requestName = 'WZ-pythia8' + ##config.Data.inputDataset = '/WZ_TuneCUETP8M1_13TeV-pythia8/RunIIFall15MiniAODv2-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/MINIAODSIM' + ##submit(config) + + #################################### + ##config.Data.unitsPerJob = 10 + #################################### + + ##config.General.requestName = 'QCD-15-30' + ##config.Data.inputDataset = '/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIIFall15MiniAODv2-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/MINIAODSIM' + ##submit(config) + + ################################################### + setdata("False") + setrun("Run2016B") + ################################################### + + ################################## + config.Data.unitsPerJob = 1 + ################################## + #$dasgoclient -query='dataset=/TT*/*12Apr2018_94X*/MINIAODSIM' + #config.JobType.pyCfgParams.append('isParticleGun=True') + #config.General.requestName = 'JPsiToMuMu' + #config.Data.inputDataset = '/JPsiToMuMu_Pt20to100-pythia8-gun/RunIIFall17MiniAODv2-PU2017RECOSIMstep_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + + #### HMM + for mh in [120,125,130]: + #for mh in [120]: + config.General.requestName = 'ttH_%d'%mh + config.Data.inputDataset = '/ttHToMuMu_M%d_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'ZH_%d'%mh + config.Data.inputDataset = '/ZH_HToMuMu_ZToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'WPlusH_%d'%mh + config.Data.inputDataset='/WplusH_HToMuMu_WToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + + config.General.requestName = 'WMinusH_%d'%mh + config.Data.inputDataset="/WminusH_HToMuMu_WToAll_M%d_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM"%mh + submit(config) + + config.General.requestName = 'GluGluH_%d'%mh + config.Data.inputDataset = '/GluGluHToMuMu_M%d_TuneCP5_PSweights_13TeV_amcatnloFXFX_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + #/GluGluHToMuMu_M-125_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM + + config.General.requestName = 'VBFH_%d'%mh + config.Data.inputDataset = '/VBFHToMuMu_M%d_TuneCP5_PSweights_13TeV_amcatnlo_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM'%mh + submit(config) + #/VBFHToMuMu_M-125_TuneCP5_PSweights_13TeV_powheg_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM + + #config.Data.inputDBS = 'phys03' + #config.Data.unitsPerJob = 10 + #config.General.requestName = 'VBFH_HToMuMu_M125_13TeV_powheg_pythia8' + #config.Data.inputDataset = '/VBFH_HToMuMu_M125_13TeV_powheg_pythia8/amarini-Fall17_94X-MINIAODSIM-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.Data.unitsPerJob = 10 + #config.General.requestName = 'GluGluH_HToMuMu_M125_13TeV_powheg_pythia8' + #config.Data.inputDataset = '/GluGlu_HToMuMu_M125_13TeV_powheg_pythia8/amarini-Fall17_94X-MINIAODSIM-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + #config.Data.inputDBS = 'global' + + config.General.requestName = 'TTTo2L2Nu' + config.Data.inputDataset = '/TTTo2L2Nu_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_s-channel' + config.Data.inputDataset = '/ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_t-channel_antitop' + config.Data.inputDataset = '/ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_t-channel_top' + config.Data.inputDataset = '/ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_tW_antitop' + config.Data.inputDataset = '/ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ST_tW_top' + config.Data.inputDataset = '/ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToQQ' + config.Data.inputDataset = '/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToLL_M-1to10' + config.Data.inputDataset = '/TTZToLL_M-1to10_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTZToLLNuNu_M-10' + config.Data.inputDataset = '/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTWToQQ' + config.Data.inputDataset = '/TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'TTWToLNu' + config.Data.inputDataset = '/TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWTo1L1Nu2Q' + config.Data.inputDataset = '/WWTo1L1Nu2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWTo2L2Nu' + config.Data.inputDataset = '/WWTo2L2Nu_13TeV-powheg/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWW' + config.Data.inputDataset = '/WWW_4F_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WWZ' + config.Data.inputDataset = '/WWZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZTo2L2Q' + config.Data.inputDataset = '/WZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZTo3LNu' + config.Data.inputDataset = '/WZTo3LNu_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'WZZ' + config.Data.inputDataset = '/WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZTo2L2Q' + config.Data.inputDataset = '/ZZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZTo4L' + config.Data.inputDataset = '/ZZTo4L_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'ZZZ' + config.Data.inputDataset = '/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + + config.General.requestName = 'TTTT' + config.Data.inputDataset = '/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'DYJetsToLL' + config.Data.inputDataset = '/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM' + submit(config) + + + config.General.requestName = 'DYJetsToMuMu_105_160' + config.Data.inputDataset='/DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM' + submit(config) + + config.General.requestName = 'DYJetsToMuMu_105_160_ext' + config.Data.inputDataset = '/DYJetsToLL_M-105To160_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v1/MINIAODSIM' + submit(config) + + #config.General.requestName = 'QCD-15-700-hpp' + #config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-100-200' + #config.Data.inputDataset = '/QCD_HT100to200_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-200-300' + #config.Data.inputDataset = '/QCD_HT200to300_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-300-500' + #config.Data.inputDataset = '/QCD_HT300to500_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-500-700' + #config.Data.inputDataset = '/QCD_HT500to700_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAOD-94X_mc2017_realistic_v10-v1/MINIAODSIM' + #submit(config) + + #config.General.requestName = 'QCD-HT-700-1000' + #config.Data.inputDataset = '/QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8/RunIIFall17MiniAODv2-PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/MINIAODSIM' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.General.requestName = 'VBFHHTo2B2Mu_CV_1_C2V_1_C3_1_13TeV-madgraph' + #config.Data.inputDataset = '/VBFHHTo2B2Mu_CV_1_C2V_1_C3_1_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + #config.Data.inputDBS = 'phys03' + #config.General.requestName = 'GluGluToHHTo2B2M_node_4_13TeV-madgraph' + #config.Data.inputDataset = '/GluGluToHHTo2B2G_node_4_13TeV-madgraph/amarini-Fall17_94X_Apr2018_MINIAOD-18783c0a07109245951450a1a4f55409/USER' + #submit(config) + + config.General.requestName = 'GGZZ2e2mu' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2mu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2e2tau' + config.Data.inputDataset = '/GluGluToContinToZZTo2e2tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ4mu' + config.Data.inputDataset = '/GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ4tau' + config.Data.inputDataset = '/GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + + config.General.requestName = 'GGZZ2mu2nu' + config.Data.inputDataset = '/GluGluToContinToZZTo2mu2nu_13TeV_MCFM701_pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM' + submit(config) + +# Local Variables: +# mode:python +# indent-tabs-mode:nil +# tab-width:4 +# c-basic-offset:4 +# End: +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 From b12a55eab9dbe751f69777c6fe5116bd326e5d22 Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Wed, 3 Apr 2019 16:13:43 +0200 Subject: [PATCH 03/10] work area --- Nero/test/crabNero2016.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nero/test/crabNero2016.py b/Nero/test/crabNero2016.py index f2322a6..65e0a6e 100644 --- a/Nero/test/crabNero2016.py +++ b/Nero/test/crabNero2016.py @@ -66,7 +66,7 @@ # We want to put all the CRAB project directories from the tasks we submit here into one common directory. # That's why we need to set this parameter (here or above in the configuration file, it does not matter, we will not overwrite it). - config.General.workArea = 'NeroSubmissionSkim' + config.General.workArea = 'NeroSubmission2016' def submit(config): ### for some reason only the first dataset is submitted correctly, work around From 57f8318c874973620eebaa56ecbac031f224abeb Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Thu, 4 Apr 2019 13:43:02 +0200 Subject: [PATCH 04/10] submission 2016 --- Nero/test/crabNero2016.py | 4 ++-- Nero/test/testNero.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Nero/test/crabNero2016.py b/Nero/test/crabNero2016.py index 65e0a6e..6f927fc 100644 --- a/Nero/test/crabNero2016.py +++ b/Nero/test/crabNero2016.py @@ -49,7 +49,7 @@ tag = check_output("git describe --tags | cut -d'-' -f 1 | tr -d '\n' ",shell=True) print "-> current tag is '"+tag + "'" #config.Data.outLFNDirBase = '/store/user/%s/Nero/%s/' % (getUsernameFromSiteDB(), tag) -config.Data.outLFNDirBase = '/store/group/phys_higgs/cmshmm/%s/Nero/%s/2016/' % (getUsernameFromSiteDB(), tag) +config.Data.outLFNDirBase = '/store/group/phys_higgs/cmshmm/%s/Nero/%s/year2016/' % (getUsernameFromSiteDB(), tag) config.Data.publication = False config.Data.outputDatasetTag ='NeroNtuples' config.Data.allowNonValidInputDataset = True @@ -66,7 +66,7 @@ # We want to put all the CRAB project directories from the tasks we submit here into one common directory. # That's why we need to set this parameter (here or above in the configuration file, it does not matter, we will not overwrite it). - config.General.workArea = 'NeroSubmission2016' + config.General.workArea = 'NeroSubmission2016_v2' def submit(config): ### for some reason only the first dataset is submitted correctly, work around diff --git a/Nero/test/testNero.py b/Nero/test/testNero.py index 00be1ac..0fd3925 100644 --- a/Nero/test/testNero.py +++ b/Nero/test/testNero.py @@ -279,7 +279,7 @@ reclusterJets = True, pfCandColl=cms.InputTag("packedPFCandidates"), CHS = True, - fixEE2017 = True, + fixEE2017 = (isYear == 2017), #fixEE2017Params = {'userawPt': True, 'PtThreshold':50.0, 'MinEtaThreshold':2.65, 'MaxEtaThreshold': 3.139} , ## default have modified names postfix = "ModifiedMET" ) From 25a25d52dfcef10a249b30883f47a8c3f9daa59c Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Thu, 4 Apr 2019 19:02:13 +0200 Subject: [PATCH 05/10] maybe fixed 2016 --- Nero/test/testNero.py | 45 +++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/Nero/test/testNero.py b/Nero/test/testNero.py index 0fd3925..89ef76f 100644 --- a/Nero/test/testNero.py +++ b/Nero/test/testNero.py @@ -274,15 +274,16 @@ from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD runMetCorAndUncFromMiniAOD ( - process, - isData = isData, # false for MC - reclusterJets = True, - pfCandColl=cms.InputTag("packedPFCandidates"), - CHS = True, - fixEE2017 = (isYear == 2017), - #fixEE2017Params = {'userawPt': True, 'PtThreshold':50.0, 'MinEtaThreshold':2.65, 'MaxEtaThreshold': 3.139} , ## default have modified names - postfix = "ModifiedMET" -) + process, + isData = isData, # false for MC + reclusterJets = True, + pfCandColl=cms.InputTag("packedPFCandidates"), + CHS = True, + fixEE2017 = (isYear==2017), + #fixEE2017Params = {'userawPt': True, 'PtThreshold':50.0, 'MinEtaThreshold':2.65, 'MaxEtaThreshold': 3.139} , ## default have modified names + postfix = "ModifiedMET" if isYear==2017 else "" + ) + print "-> Ecal Bad " @@ -310,14 +311,24 @@ print "-> Updating the jets collection to run on to 'updatedPatJetsUpdatedJEC' with the new jec in the GT/or DB" process.nero.NeroJets.jets=cms.InputTag('updatedPatJetsUpdatedJEC') process.nero.NeroFatJets.chsAK8=cms.InputTag('updatedPatJetsUpdatedJECAK8') -process.nero.NeroMet.mets=cms.InputTag("slimmedMETsModifiedMET") -process.jecSequence = cms.Sequence( - #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC - process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC - * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 - * process.fullPatMetSequenceModifiedMET - * process.ecalBadCalibReducedMINIAODFilter - ) +if isYear==2017: + process.nero.NeroMet.mets=cms.InputTag("slimmedMETsModifiedMET") + process.jecSequence = cms.Sequence( + #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC + process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC + * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 + * process.fullPatMetSequenceModifiedMET + * process.ecalBadCalibReducedMINIAODFilter + ) +else: + process.nero.NeroMet.mets=cms.InputTag("slimmedMETs") + process.jecSequence = cms.Sequence( + #process.patJetCorrFactorsReapplyJEC + process.patJetsReapplyJEC + process.patJetCorrFactorsUpdatedJEC* process.updatedPatJetsUpdatedJEC + * process.patJetCorrFactorsUpdatedJECAK8* process.updatedPatJetsUpdatedJECAK8 + * process.fullPatMetSequence + * process.ecalBadCalibReducedMINIAODFilter + ) #-----------------------ELECTRON ID------------------------------- From 5fcff06eea9d7105ac145bf6a495059fe031c07a Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Wed, 10 Jul 2019 11:12:54 +0200 Subject: [PATCH 06/10] fix eg postreco --- Nero/script/duplicate_removal.py | 2 +- Nero/test/testNero.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Nero/script/duplicate_removal.py b/Nero/script/duplicate_removal.py index 4735e1a..eaefe16 100755 --- a/Nero/script/duplicate_removal.py +++ b/Nero/script/duplicate_removal.py @@ -10,7 +10,7 @@ from subprocess import call, check_output import re import math -EOS = "/afs/cern.ch/project/eos/installation/0.3.84-aquamarine/bin/eos.select" +EOS = "/usr/bin/eos" usage = ''' script to remove duplicates when running on data. The script is meant for multiple submission, diff --git a/Nero/test/testNero.py b/Nero/test/testNero.py index 89ef76f..2012b71 100644 --- a/Nero/test/testNero.py +++ b/Nero/test/testNero.py @@ -107,9 +107,15 @@ process.load('NeroProducer.Nero.Nero_cfi') from RecoEgamma.EgammaTools.EgammaPostRecoTools import setupEgammaPostRecoSeq -setupEgammaPostRecoSeq(process, - runVID=True, - era='2017-Nov17ReReco') +if isYear==2017: + setupEgammaPostRecoSeq(process, + runVID=True, + era='2017-Nov17ReReco') +if isYear==2016: + setupEgammaPostRecoSeq(process, + runVID=True, + runEnergyCorrections=False, + era='2016-Legacy') ############################### JEC ##################### #### Load from a sqlite db, if not read from the global tag From add9db3ce4d2825377433a810f0a0be65736a2df Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Fri, 19 Jul 2019 17:38:58 +0200 Subject: [PATCH 07/10] using corrected pt for fsr photons --- Nero/src/NeroLeptons.cpp | 3 ++- Nero/test/testNero.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Nero/src/NeroLeptons.cpp b/Nero/src/NeroLeptons.cpp index 664b800..36d6416 100644 --- a/Nero/src/NeroLeptons.cpp +++ b/Nero/src/NeroLeptons.cpp @@ -238,7 +238,8 @@ int NeroLeptons::analyze(const edm::Event & iEvent) if (mu.hasUserCand("cutBasedFsrPhoton")) { pat::PFParticle *pho = (pat::PFParticle *)(mu.userCand("cutBasedFsrPhoton").get()); - l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.); + //l.fsrP4.SetPtEtaPhiM(pho->pt(),pho->eta(),pho->phi(),0.); + l.fsrP4.SetPtEtaPhiM(pho->userFloat("correctedPt"),pho->eta(),pho->phi(),0.); } l.chiso = chiso; diff --git a/Nero/test/testNero.py b/Nero/test/testNero.py index 2012b71..c3846cb 100644 --- a/Nero/test/testNero.py +++ b/Nero/test/testNero.py @@ -434,6 +434,8 @@ PhotonMVA="FSRPhotonRecovery/FSRPhotons/data/PhotonMVAv5_BDTG1000TreesDY.weights.xml" PhotonMVA="FSRPhotonRecovery/FSRPhotons/data/PhotonMVAv9_BDTG800TreesDY.weights.xml" addFSRphotonSequence(process, process.nero.NeroLeptons.muons.value(), PhotonMVA) +#electrons = cms.InputTag("slimmedElectrons","","nero"), +process.FSRRecovery.patphotons= cms.InputTag("slimmedPhotons","","nero") ############################################################### From a34c4e53eb967cbbbea334183943af262671fe43 Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Mon, 2 Sep 2019 13:48:02 +0200 Subject: [PATCH 08/10] dxy and dz. --- Core/interface/BareLeptons.hpp | 5 +++++ Core/src/BareLeptons.cpp | 24 ++++++++++++++++++++++++ Nero/interface/NeroLeptons.hpp | 10 +++++++++- Nero/src/NeroLeptons.cpp | 22 ++++++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/Core/interface/BareLeptons.hpp b/Core/interface/BareLeptons.hpp index 56d3dba..0d79f14 100644 --- a/Core/interface/BareLeptons.hpp +++ b/Core/interface/BareLeptons.hpp @@ -79,6 +79,11 @@ class BareLeptons : virtual public BareP4 vector *kinfitPtErr{0}; TClonesArray *fsrP4{0}; // at most 1. + vector *dxy; + vector *dz; + + vector *dxybs; + vector *dzbs; }; diff --git a/Core/src/BareLeptons.cpp b/Core/src/BareLeptons.cpp index 4cf3e5f..c16770a 100644 --- a/Core/src/BareLeptons.cpp +++ b/Core/src/BareLeptons.cpp @@ -26,6 +26,10 @@ BareLeptons::~BareLeptons(){ BareFunctions::Delete(kinfitP4); BareFunctions::Delete(kinfitPtErr); BareFunctions::Delete(fsrP4); + BareFunctions::Delete(dxy); + BareFunctions::Delete(dz); + BareFunctions::Delete(dxybs); + BareFunctions::Delete(dzbs); } void BareLeptons::init(){ @@ -53,6 +57,11 @@ void BareLeptons::init(){ BareFunctions::New(kinfitP4); BareFunctions::New(kinfitPtErr); BareFunctions::New(fsrP4); + BareFunctions::New(dxy); + BareFunctions::New(dz); + + BareFunctions::New(dxybs); + BareFunctions::New(dzbs); } void BareLeptons::clear(){ @@ -84,6 +93,11 @@ void BareLeptons::clear(){ kinfitPtErr->clear(); fsrP4->Clear(); + dxy->clear(); + dz->clear(); + dxybs->clear(); + dzbs->clear(); + } void BareLeptons::defineBranches(TTree*t){ @@ -123,6 +137,10 @@ void BareLeptons::defineBranches(TTree*t){ t->Branch( "lepKinfitP4","TClonesArray", &kinfitP4, 128000, 0); t->Branch( "lepFsrP4","TClonesArray", &fsrP4, 128000, 0); + t->Branch("lepDxy","vector",&dxy); + t->Branch("lepDz","vector",&dz); + t->Branch("lepDxyBS","vector",&dxybs); + t->Branch("lepDzBS","vector",&dzbs); } @@ -155,6 +173,12 @@ void BareLeptons::setBranchAddresses(TTree*t){ BareFunctions::SetBranchAddress(t,"lepKinfitPtErr",&kinfitPtErr); BareFunctions::SetBranchAddress(t,"lepKinfitP4",&kinfitP4); BareFunctions::SetBranchAddress(t,"lepFsrP4",&fsrP4); + + BareFunctions::SetBranchAddress(t,"lepDxy",&dxy); + BareFunctions::SetBranchAddress(t,"lepDz",&dz); + + BareFunctions::SetBranchAddress(t,"lepDxyBS",&dxybs); + BareFunctions::SetBranchAddress(t,"lepDzBS",&dzbs); } BAREREGISTER(BareLeptons); diff --git a/Nero/interface/NeroLeptons.hpp b/Nero/interface/NeroLeptons.hpp index 1c6c7fb..a9b5a8c 100644 --- a/Nero/interface/NeroLeptons.hpp +++ b/Nero/interface/NeroLeptons.hpp @@ -9,6 +9,7 @@ // Electron corrector #include "EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h" +#include "DataFormats/BeamSpot/interface/BeamSpot.h" class NeroLeptons : virtual public NeroCollection, virtual public BareLeptons @@ -26,7 +27,7 @@ class NeroLeptons : virtual public NeroCollection, public: myLepton(){ chiso=-999; nhiso=-999; phoiso=-999; puiso=-999;mva = -999; miniiso=-999; etasc=0; sieie=0; sipip=0; sieip=0; r9=0; ecorr=1; - resolution =-999; nlayers=-999; + resolution =-999; nlayers=-999; kinfitP4.SetPxPyPzE(0,0,0,0); kinfitPtErr=-999; fsrP4.SetPxPyPzE(0,0,0,0); @@ -57,6 +58,11 @@ class NeroLeptons : virtual public NeroCollection, float resolution; int nlayers; + + float dxy{-999}; + float dz{-999}; + float dxy2{-999}; + float dz2{-999}; }; @@ -68,6 +74,7 @@ class NeroLeptons : virtual public NeroCollection, // --- Token edm::EDGetTokenT vtx_token; edm::EDGetTokenT token_pf; + edm::EDGetTokenT beamspot_token; // Token edm::EDGetTokenT mu_token; @@ -106,6 +113,7 @@ class NeroLeptons : virtual public NeroCollection, edm::Handle vtx_handle; edm::Handle handle_pf; + edm::Handle beamspot_handle; // for miniiso edm::Handle rho_handle; diff --git a/Nero/src/NeroLeptons.cpp b/Nero/src/NeroLeptons.cpp index 36d6416..3dfcbbb 100644 --- a/Nero/src/NeroLeptons.cpp +++ b/Nero/src/NeroLeptons.cpp @@ -57,6 +57,7 @@ NeroLeptons::NeroLeptons(edm::ConsumesCollector & cc,edm::ParameterSet iConfig): #endif vtx_token = cc.consumes(iConfig.getParameter("vertices")); + beamspot_token = cc.consumes(edm::InputTag("offlineBeamSpot")); token_pf = cc.consumes(iConfig.getParameter("pfCands")); ea_ . reset (new EffectiveAreas( edm::FileInPath(iConfig.getParameter("eleEA")).fullPath () ) ); mu_token = cc.consumes(iConfig.getParameter("muons")); @@ -121,6 +122,9 @@ int NeroLeptons::analyze(const edm::Event & iEvent) const reco::Vertex *pv = &vtx_handle->front(); iEvent.getByToken(token_pf, handle_pf); + iEvent.getByToken(beamspot_token, beamspot_handle); + const reco::BeamSpot *bs = &(*beamspot_handle); // recast + iEvent.getByToken(mu_token,mu_handle); iEvent.getByToken(el_token,el_handle); @@ -234,6 +238,13 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.selBits |= unsigned(LepHighPt * myid::isHighPtMuon(mu,*pv)) ; l.pfPt = mu.pfP4().pt(); + + // + l.dz = mu.innerTrack()->dz(pv->position()); + l.dxy = mu.innerTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = mu.innerTrack()->dz(bs->position()); + l.dxy2 = mu.innerTrack()->dxy(bs->position()); if (mu.hasUserCand("cutBasedFsrPhoton")) { @@ -378,6 +389,12 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.sipip = el.full5x5_sigmaIphiIphi(); l.sieip = el.full5x5_sigmaIetaIphi(); l.r9 = el.r9(); + + l.dz = el.gsfTrack()->dz(pv->position()); + l.dxy = el.gsfTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = el.gsfTrack()->dz(bs->position()); + l.dxy2 = el.gsfTrack()->dxy(bs->position()); // float chIso = el.chargedHadronIso(); // float nhIso = el.neutralHadronIso(); @@ -531,6 +548,11 @@ int NeroLeptons::analyze(const edm::Event & iEvent) resolution -> push_back(l.resolution); nLayers -> push_back(l.nlayers); + dxy -> push_back(l.dxy); + dz -> push_back(l.dz); + dxybs -> push_back(l.dxy2); + dzbs -> push_back(l.dz2); + //kinfit new ( (*kinfitP4)[kinfitP4->GetEntriesFast()]) TLorentzVector(l.kinfitP4); kinfitPtErr -> push_back(l.kinfitPtErr); From e9c7a89a17d6a13a387372dcba50592b0bc2cb6f Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Mon, 2 Sep 2019 15:48:16 +0200 Subject: [PATCH 09/10] init stuff --- Core/interface/BareLeptons.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/interface/BareLeptons.hpp b/Core/interface/BareLeptons.hpp index 0d79f14..555a2a6 100644 --- a/Core/interface/BareLeptons.hpp +++ b/Core/interface/BareLeptons.hpp @@ -79,11 +79,11 @@ class BareLeptons : virtual public BareP4 vector *kinfitPtErr{0}; TClonesArray *fsrP4{0}; // at most 1. - vector *dxy; - vector *dz; + vector *dxy{0}; + vector *dz{0}; - vector *dxybs; - vector *dzbs; + vector *dxybs{0}; + vector *dzbs{0}; }; From c4f4db7777b27aa8e786dc15680a8e44117d4b66 Mon Sep 17 00:00:00 2001 From: Andrea Carlo Marini Date: Tue, 3 Sep 2019 10:56:32 +0200 Subject: [PATCH 10/10] null protection --- Nero/src/NeroLeptons.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Nero/src/NeroLeptons.cpp b/Nero/src/NeroLeptons.cpp index 3dfcbbb..b7a154d 100644 --- a/Nero/src/NeroLeptons.cpp +++ b/Nero/src/NeroLeptons.cpp @@ -240,11 +240,14 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.pfPt = mu.pfP4().pt(); // - l.dz = mu.innerTrack()->dz(pv->position()); - l.dxy = mu.innerTrack()->dxy(pv->position()); - //offlineBeamSpot - l.dz2 = mu.innerTrack()->dz(bs->position()); - l.dxy2 = mu.innerTrack()->dxy(bs->position()); + if (not mu.innerTrack().isNull()) + { + l.dz = mu.innerTrack()->dz(pv->position()); + l.dxy = mu.innerTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = mu.innerTrack()->dz(bs->position()); + l.dxy2 = mu.innerTrack()->dxy(bs->position()); + } if (mu.hasUserCand("cutBasedFsrPhoton")) { @@ -389,12 +392,14 @@ int NeroLeptons::analyze(const edm::Event & iEvent) l.sipip = el.full5x5_sigmaIphiIphi(); l.sieip = el.full5x5_sigmaIetaIphi(); l.r9 = el.r9(); - - l.dz = el.gsfTrack()->dz(pv->position()); - l.dxy = el.gsfTrack()->dxy(pv->position()); - //offlineBeamSpot - l.dz2 = el.gsfTrack()->dz(bs->position()); - l.dxy2 = el.gsfTrack()->dxy(bs->position()); + + if ( not el.gsfTrack().isNull()){ + l.dz = el.gsfTrack()->dz(pv->position()); + l.dxy = el.gsfTrack()->dxy(pv->position()); + //offlineBeamSpot + l.dz2 = el.gsfTrack()->dz(bs->position()); + l.dxy2 = el.gsfTrack()->dxy(bs->position()); + } // float chIso = el.chargedHadronIso(); // float nhIso = el.neutralHadronIso();