Previous page

Exclusive tt analysis using full run II CMS data


This page contain analysis instructions (in development)

On this page:

Usefull Links

  • Analysis twiki: ExclusiveTop
  • Exclusive ttbar talk (LHC WG on Forward Physics and Diffraction): link

Data and MC samples

Sample Xsec
/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIISummer19UL17MiniAOD-106X_mc2017_realistic_v6-v2/MINIAODSIM 832

These samples produced privately and can be found in CERN EOS

Sample Xsec [fb]
/eos/cms/store/cmst3/group/top/exclusive_top/excl_ttbar_QED/MINIAOD/excl_ttbar_WmLep_QED/ 0.064
/eos/cms/store/cmst3/group/top/exclusive_top/excl_ttbar_QED/MINIAOD/excl_ttbar_WpLep_QED/ 0.064

Configuration file can be found in the attachment . It consist of several steps:

  • Simulation with FPMC of exclusive γγ→tt events
  • Interfacing of FPMC output with MadSpin such that only one top quark decays leptonically (including taus)
  • Interfacing MadSpin output with Pythia8
  • Processing events after hadronization with full CMS detector simulation following by reconstruction
Execute script with correct arguments. The output files will be of a miniAOD.root format.

Stream Lumi
/MuonEG/Run2017F-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleMuon/Run2017B-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleMuon/Run2017C-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleMuon/Run2017D-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleMuon/Run2017E-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleMuon/Run2017F-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleElectron/Run2017B-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleElectron/Run2017C-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleElectron/Run2017D-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleElectron/Run2017E-09Aug2019_UL2017-v1/MINIAOD XXX
/SingleElectron/Run2017F-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleMuon/Run2017B-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleMuon/Run2017C-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleMuon/Run2017D-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleMuon/Run2017E-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleMuon/Run2017F-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleEG/Run2017B-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleEG/Run2017C-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleEG/Run2017D-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleEG/Run2017E-09Aug2019_UL2017-v1/MINIAOD XXX
/DoubleEG/Run2017F-09Aug2019_UL2017-v1/MINIAOD XXX
/MuonEG/Run2017B-09Aug2019_UL2017-v1/MINIAOD XXX
/MuonEG/Run2017C-09Aug2019_UL2017-v1/MINIAOD XXX
/MuonEG/Run2017D-09Aug2019_UL2017-v1/MINIAOD XXX
/MuonEG/Run2017E-09Aug2019_UL2017-v1/MINIAOD XXX

NTuple production

proton reconstruction and Ntuplizer

Production is performed using TopLJets2015 analysis package which use PPS reconstruction data. The full instruction for simulating the forward protons can be found in TaggedProtonsDirectSimulation twiki. The configuration file is attached (

scram project CMSSW CMSSW_10_6_10
cd CMSSW_10_6_10/src

git cms-init
git remote add ctpps
git fetch ctpps pps_zx_mc_10_6
git checkout -b test ctpps/pps_zx_mc_10_6
git cms-addpkg IOMC/EventVertexGenerators SimCTPPS/Generators
scram b -r -j8

# ---- Settings for TopLJets2016 ----

#EGM id
git cms-merge-topic cms-egamma:EgammaPostRecoTools
scram b -j8

#B-fragmentation analyzer
mkdir TopQuarkAnalysis 
cd TopQuarkAnalysis
git clone -b 94x
cd -
scram b -j8

#TopLJets package
git clone -b 106_protonreco
cd TopLJets2015
git remote add upstream
git checkout 106_protonreco
cd -
scram b -j8
# --------------------------
cd ../..

The following lines should be executed (CMSSW should point to your CMSSW setup as explained here): The code will run both PPS reconstruction and ntuplizer. Option of exclude PU protons from reconstruction is doPUProtons=False. To switch off event skimming (defined in you can set applyFilt=False.

cd ${CMSSW}/src
eval `scram r -sh`
cd -
cmsRun ${CMSSW_BASE}/src/TopLJets2015/TopAnalysis/test/ runOnData=False era=era2017 inputFile=file:miniAOD.root outFilename=nanoAOD.root maxEvents=-1 runProtonFastSim=120 noParticleLevel=True

NOTE: several options should be considered:

  • miniAOD w/o proton reco: The proton simulation should be executed, this is done with runProtonFastSim=120 option.
  • miniAOD with protonreco: No need to proton simulation, just define the inputs properly: RecoProtons=True
  • data: for data use: XXXXXX
  • proton simulation: if you wish not to use the PU protons you can add doPUProtons=False option

to process miniAOD, one should change the collection name to: cms.InputTag("prunedGenParticles")

Making validation plots


Helper: set up few Aliases for shorter Draw commands:


  • To plot top - anti-top invariant mass from the samples, either directly from tops or from the protons

Events->Draw("2*sqrt( (6500.-genpar.pz()[0])*(6500.+genpar.pz()[1]))")
Events->Scan("lhe.IDUP :lhe.ISTUP")

  • To plot proton pZ vs reconstructed pZ (similarly can be made for ξ):

Events->Draw("proton.pz() : genpar.pz()[0]","proton.pz() > 0")

For more variables see reco::ForwardProton or TaggedProtonsGettingStarted.


To access the output, and plot for example the mtt spectra run:
root -l  nanoAOD.root
TTree * tree = (TTree*)analysis->Get("data")
tree->Draw("sqrt(gtop_m[2]*gtop_m[2]+gtop_m[5]*gtop_m[5]+2*(Et1*Et2-gtop_pt[2]*gtop_pt[5]*cos(gtop_phi[2]-gtop_phi[5]) - Pzt1*Pzt2))")
tree->Draw("sqrt(gtop_m[2]*gtop_m[2]+gtop_m[5]*gtop_m[5]+2*(sqrt(gtop_pt[2]*gtop_pt[2]*cosh(gtop_eta[2])*cosh(gtop_eta[2])+gtop_m[2]*gtop_m[2])*sqrt(gtop_pt[5]*gtop_pt[5]*cosh(gtop_eta[5])*cosh(gtop_eta[5])+gtop_m[5]*gtop_m[5]) - gtop_pt[2]*gtop_pt[5]*cos(gtop_phi[2]-gtop_phi[5])) - gtop_pt[2]*gtop_pt[5]*(cosh(gtop_eta[2]+gtop_eta[5])-cosh(gtop_eta[2]-gtop_eta[5])))")

Making flat ntuples

To process the ntuples (nanoAODs) execute the following:

ln -s /eos/cms/store/cmst3/group/top/exclusive_top/excl_ttbar_QED/NanoAOD/excl_ttbar_WmLep_QED.root MiniEvents.root
python $CMSSW_BASE/src/TopLJets2015/TopAnalysis/scripts/ -i MiniEvents.root -o ntuple.root --njobs 1 -q local --era era2017 -m RunExclusiveTop2020 --skimtree True

PPS reconstruction (data)

Submit to grid

After the local tests are successful, one can process all the data on the grid. Run the following code:

python $CMSSW_BASE/src/TopLJets2015/TopAnalysis/scripts/ --lfn /store/group/cmst3/user/mpitt/ttbar -j samples.json -c ${CMSSW_BASE}/src/TopLJets2015/TopAnalysis/test/ --only MC --workDir grid --xangle=120
There is a public area to write the output: /eos/cms/store/group/phys_top/TTbarCentralExclProd or in private area /eos/cms/store/cmst3/user/mpitt/ttbar

samples.json is a file that contains list of MC samples to be submitted to the grid, for example:

"MC13TeV_2017_TTJets_v1"                : [832, 0,     "/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIISummer19UL17MiniAOD-106X_mc2017_realistic_v6-v2/MINIAODSIM", "t#bar{t}", 920, true, false, 1]
Inspect crab option in grid/, and submit the jobs with crab submit -c grid/

  • Inspect the submission process proceeds: crab status -d grid/crab_MC13TeV_2017_TTJets_v1
    • In case of errors, use crab status --verboseErrors for details
    • To resubmit failed jobs with extra options: crab resubmit -d grid/crab_MC13TeV_2017_TTJets_v1 --maxmemory=4000 --maxjobruntime=360 --numcores=1
    • To kill the current job: crab kill -d grid/crab_MC13TeV_2017_TTJets_v1
  • The results will appear in cat grid/ | grep config.Data.outLFNDirBase | awk '{print $3}' | sed -e 's/"\//\/eos\/cms\//g' | sed -e 's/\/group//g' | sed -e 's/"//g'



execute this and that


execute this and that

-- MichaelPitt - 2019-12-07

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatgz GEN_10_6_15_ProtonReco.tar.gz r1 manage 9.4 K 2020-08-13 - 00:12 MichaelPitt production of exclusive ttbar events with CMS
Compressed Zip archivezip r1 manage 6.6 K 2020-04-05 - 15:09 MichaelPitt proton reconstruction and ntuplizer
Edit | Attach | Watch | Print version | History: r29 < r28 < r27 < r26 < r25 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r29 - 2020-08-13 - MichaelPitt
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback