Tags:
,
view all tags
%TOC{depth="4"}% ---+ Monte Carlo Production ---++ Full simulation on 10_2_5 ---+++ Preparation <verbatim> $ export SCRAM_ARCH=slc6_amd64_gcc700 $ cmsrel CMSSW_10_2_5 $ cd CMSSW_10_2_5/src $ cmsenv $ mkdir -p Configuration/GenProduction/ $ git clone git@github.com:cms-sw/genproductions.git Configuration/GenProduction/ $ scram b </verbatim> ---+++ Using Pythia to generate !Randall-Sundrum Graviton ---++++ STEP 1 - Event generation (GEN) and detector simulation (SIM) <verbatim> $ cmsDriver.py \ Configuration/GenProduction/python/ThirteenTeV/RSGraviton/RSGravitonToZZ_kMpl01_M_1000_TuneCUETP8M1_13TeV_pythia8_cfi.py \ --fileout file:RSGravitonToZZ_GEN-SIM.root \ --python_filename RSGravitonToZZ_GEN-SIM_cfg.py \ --step GEN,SIM \ --datatier GEN-SIM \ --eventcontent RAWSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --mc --no_exec --number 10 $ cmsRun RSGravitonToZZ_GEN-SIM_cfg.py </verbatim> ---++++ STEP 2 - RAW from SIM <verbatim> $ cmsDriver.py RAWSIM \ --filein file:RSGravitonToZZ_GEN-SIM.root \ --fileout file:RSGravitonToZZ_GEN-SIM-RAW.root \ --python_filename RSGravitonToZZ _GEN-SIM-RAW_cfg.py \ --step DIGI,L1,DIGI2RAW,HLT \ --datatier GEN-SIM-RAW \ --eventcontent RAWSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --mc --no_exec --number -1 $ cmsRun RSGravitonToZZ _GEN-SIM-RAW_cfg.py </verbatim> ---++++ STEP 3 - AOD from RAW <verbatim> $ cmsDriver.py AODSIM \ --filein file:RSGravitonToZZ_GEN-SIM-RAW.root \ --fileout file:RSGravitonToZZ_GEN-SIM-RAW-AOD.root \ --python_filename RSGravitonToZZ_GEN-SIM-RAW-AOD_cfg.py \ --step RAW2DIGI,L1Reco,RECO \ --datatier RECO \ --eventcontent AODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun RSGravitonToZZ_GEN-SIM-RAW-AOD_cfg.py </verbatim> ---++++ STEP 4 - MINIAOD from AOD <verbatim> $ cmsDriver.py MINIAOD \ --filein file:RSGravitonToZZ_GEN-SIM-RAW-AOD.root \ --fileout file:RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD.root \ --python_filename RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD_cfg.py \ --step PAT \ --datatier MINIAODSIM \ --eventcontent MINIAODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD_cfg.py </verbatim> ---++++ STEP 5 - NANOAOD from MINIAOD <verbatim> $ cmsDriver.py NANOAOD \ --filein file:RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD.root \ --fileout file:RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD-NANOAOD.root \ --python_filename RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD-NANOAOD_cfg.py \ --step NANO \ --datatier NANOAODSIM \ --eventcontent NANOAODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun RSGravitonToZZ_GEN-SIM-RAW-AOD-MINIAOD-NANOAOD_cfg.py </verbatim> ---+++ Using !MadGraph LHE and Pythia hadronizer ---++++ Step 1 - Hadronization from Matrix Element LHE (GEN) and detector simulation (SIM) <verbatim> $ cmsDriver.py Configuration/GenProduction/python/ThirteenTeV/Hadronizer/Hadronizer_TuneCUETP8M1_13TeV_aMCatNLO_0p_LHE_pythia8_cff.py \ --filein file:MG5_pp2mumu_1000evts.lhe \ --fileout file:pp2mumu_LHE-GEN-SIM.root \ --python_filename pp2mumu_LHE-GEN-SIM_cfg.py \ --step GEN,SIM \ --eventcontent RAWSIM \ --datatier LHE-GEN-SIM \ --conditions 102X_upgrade2018_realistic_v15 \ --beamspot Realistic25ns13TeVEarly2017Collision \ --geometry DB:Extended \ --era Run2_2018 \ --mc --no_exec --number 100 $ cmsRun pp2mumu_LHE-GEN-SIM_cfg.py </verbatim> ---++++ Step 2 - RAW from SIM <verbatim> $ cmsDriver.py RAWSIM \ --filein file:pp2mumu_LHE-GEN-SIM.root \ --fileout file:pp2mumu_LHE-GEN-SIM-RAW.root \ --python_filename pp2mumu_LHE-GEN-SIM-RAW_cfg.py \ --step DIGI,L1,DIGI2RAW,HLT \ --datatier GEN-SIM-RAW \ --eventcontent RAWSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --mc --no_exec --number -1 $ cmsRun pp2mumu_LHE-GEN-SIM-RAW_cfg.py</verbatim> ---++++ Step 3 - AOD from RAW <verbatim> $ cmsDriver.py AODSIM \ --filein file:pp2mumu_LHE-GEN-SIM-RAW.root \ --fileout file:pp2mumu_LHE-GEN-SIM-RAW-AOD.root \ --python_filename pp2mumu_LHE-GEN-SIM-RAW-AOD_cfg.py \ --step RAW2DIGI,L1Reco,RECO \ --datatier RECO \ --eventcontent AODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun pp2mumu_LHE-GEN-SIM-RAW-AOD_cfg.py</verbatim> ---++++ Step 4 - MINIAOD from AOD <verbatim> $ cmsDriver.py MINIAOD \ --filein file:pp2mumu_LHE-GEN-SIM-RAW-AOD.root \ --fileout file:pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD.root \ --python_filename pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD_cfg.py \ --step PAT \ --datatier MINIAODSIM \ --eventcontent MINIAODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD_cfg.py</verbatim> ---++++ Step 5 - NANOAOD from MINIAOD <verbatim> $ cmsDriver.py NANOAOD \ --filein file:pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD.root \ --fileout file:pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD-NANOAOD.root \ --python_filename pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD-NANOAOD_cfg.py \ --step NANO \ --datatier NANOAODSIM \ --eventcontent NANOAODSIM \ --beamspot Realistic25ns13TeVEarly2017Collision \ --conditions 102X_upgrade2018_realistic_v15 \ --geometry DB:Extended \ --era Run2_2018 \ --runUnscheduled \ --number -1 --no_exec --mc $ cmsRun pp2mumu_LHE-GEN-SIM-RAW-AOD-MINIAOD-NANOAOD_cfg.py </verbatim> ---+ NANOAOD Analyzer ---++ NANOAOD Tools ---+++ Example analyzer using !NanoAODTools package ---++++ !pp2mumu_Analysis.py <verbatim> #!/usr/bin/env python import os, sys, math import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True from importlib import import_module from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection from PhysicsTools.NanoAODTools.postprocessing.framework.eventloop import Module class ExampleAnalysis(Module): def __init__(self): self.writeHistFile=True def beginJob(self,histFile=None,histDirName=None): Module.beginJob(self,histFile,histDirName) self.h_minv=ROOT.TH1F('Minv', 'Minv', 10, 80, 100) self.addObject(self.h_minv ) self.h_mumass=ROOT.TH1F('MuMass', 'MuMass', 100, 0, 0.2) self.addObject(self.h_mumass ) def analyze(self, event): muons = Collection(event, "Muon") sum = ROOT.TLorentzVector() if len(muons) == 2 : #Select events with 2 muons for iter in muons : #Loop on muons muonp = iter.p4() sum += iter.p4() self.h_mumass.Fill(math.sqrt( #Fills histogram with muon mass muonp.E()*muonp.E() - muonp.Px()*muonp.Px() - muonp.Py()*muonp.Py() - muonp.Pz()*muonp.Pz() )) self.h_minv.Fill(math.sqrt( #Fills histogram with 2 muon invariant mass sum.E()*sum.E() - sum.Px()*sum.Px() - sum.Py()*sum.Py() - sum.Pz()*sum.Pz() )) return True preselection="" files=["pp2mumu_LHE-NANOAOD.root"] p=PostProcessor( ".", files, cut=preselection, branchsel=None, modules=[ExampleAnalysis()], noOut=True, histFileName="pp2mumu_Analysis.root", histDirName="plots") p.run() </verbatim> Run it: <verbatim> $ python pp2mumu_Analysis.py </verbatim> -- %USERSIG{gregores - 2019-04-01}%
Edit
|
Attach
|
P
rint version
|
H
istory
:
r8
<
r7
<
r6
<
r5
<
r4
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r5 - 2019-04-02
-
EduardoGregores
Home
Site map
Main web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback