Giter Club home page Giter Club logo

bmm5's Introduction

Bmm5

B to mumu analysis code for data produced by the CMS experiment at CERN

The code is based on the NanoAODv12 campaign for using Run3 Prompt Reco and MC MiniAOD. The setup produces standard NanoAOD output with additional branches specific to the analysis. The samples can be used as a replacement for the standard NanoAOD samples produced by the CMS Central Production infrastructure.

Build Instructions

  • scram p CMSSW CMSSW_13_0_13
  • cd CMSSW_13_0_13/src/
  • cmsenv
  • git clone [email protected]:drkovalskyi/Bmm5.git --branch NanoAODv12-V06
  • scram b -j 8

cmsDriver Options

Here is a list required cmsDriver options to get analysis specific parts included

  • --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX
  • --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake
  • --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId

Processing examples

  • Configuration by MiniAOD campaigns
    • Monte Carlo
      • Run3Summer22MiniAODv4
        • era: Run3
        • conditions: 130X_mcRun3_2022_realistic_v5
        • Example:
          • cmsDriver.py RECO --conditions 130X_mcRun3_2022_realistic_v5 --datatier NANOAOD --era Run3 --eventcontent NANOAODSIM --filein /store/mc/Run3Summer22MiniAODv4/DstarToD0Pi_D0To2Mu_MuFilter_SoftQCDnonD_TuneCP5_13p6TeV_pythia8-evtgen/MINIAODSIM/130X_mcRun3_2022_realistic_v5-v1/30000/71ec4425-d76b-446d-9d89-a7b250c56568.root --fileout file:/tmp/dmytro/test.root --nThreads 4 -n 1000 --no_exec --python_filename test.py --scenario pp --step NANO --mc --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"
      • Run3Summer23BPixMiniAODv4 (Run3Summer23BPixNanoAODv12)
        • era: Run3_2023
        • conditions: 130X_mcRun3_2023_realistic_postBPix_v2
      • Run3Summer23MiniAODv4 (Run3Summer23NanoAODv12)
        • era: Run3_2023
        • conditions: 130X_mcRun3_2023_realistic_v14
      • MiniAODv3
        • era: Run3,run3_nanoAOD_124
        • conditions: 130X_mcRun3_2022_realistic_v5
        • Example:
          • cmsDriver.py RECO --conditions 130X_mcRun3_2022_realistic_v5 --datatier NANOAOD --era Run3,run3_nanoAOD_124 --eventcontent NANOAODSIM --filein /store/user/dmytro/tmp/store+mc+Run3Summer22EEMiniAODv3+BsToMuMu_BMuonFilter_SoftQCDnonD_TuneCP5_13p6TeV_pythia8-evtgen+MINIAODSIM+124X_mcRun3_2022_realistic_postEE_v1-v2+2820000+0096d5dd-88d3-46a0-a8cc-255a3090c71e.root --fileout file:/tmp/dmytro/BsToMuMu_BMuonFilter_NanoAODv12_test.root --nThreads 4 -n "-1" --no_exec --python_filename BsToMuMu_BMuonFilter_NanoAODv12_test.py --scenario pp --step NANO --mc --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"
      • Run-2 - RunIISummer20UL MiniAODv2
        • era: Run2_2018,run2_nanoAOD_106Xv2
        • conditions: auto:phase1_2018_realistic
        • Example:
          • cmsDriver.py RECO --conditions auto:phase1_2018_realistic --datatier NANOAOD --era Run2_2018,run2_nanoAOD_106Xv2 --eventcontent NANOAODSIM --filein /store/group/phys_muon/dmytro/tmp/store+mc+RunIISummer20UL18MiniAODv2+BsToMuMu_BMuonFilter_SoftQCDnonD_TuneCP5_13TeV-pythia8-evtgen+MINIAODSIM+106X_upgrade2018_realistic_v16_L1v1-v2+120000+B73A72CF-5947-A14A-8686-92D34790C8F7.root --fileout file:BsToMuMu.root --nThreads 16 -n "-1" --no_exec --python_filename BsToMuMu.py --scenario pp --step NANO --mc --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"
    • Data
      • Run2023
        • era: Run3
        • conditiongs: 130X_dataRun3_PromptAnalysis_v1
        • Example:
          • cmsDriver.py RECO --conditions 130X_dataRun3_PromptAnalysis_v1 --datatier NANOAOD --era Run3 --eventcontent NANOAOD --filein /store/data/Run2023D/ParkingDoubleMuonLowMass0/MINIAOD/PromptReco-v1/000/370/580/00000/a0cf8056-01ce-48f5-9b7e-570e225b5aba.root --fileout file:/tmp/dmytro/test_data.root --nThreads 4 -n 10000 --no_exec --python_filename test_data.py --scenario pp --step NANO --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"
      • Run2022
        • era: Run3,run3_nanoAOD_124
        • conditions: 130X_dataRun3_v2
        • Example:
          • cmsDriver.py RECO --conditions 130X_dataRun3_v2 --datatier NANOAOD --era Run3,run3_nanoAOD_124 --eventcontent NANOAOD --filein file:/eos/cms/store/user/dmytro/tmp/store+data+Run2022C+ParkingDoubleMuonLowMass0+MINIAOD+PromptReco-v1+000+357+271+00000+ea64a9c2-6b1f-4744-b4ea-41aa0e3c3e1b.root --fileout file:/tmp/dmytro/test_data.root --nThreads 4 -n 10000 --no_exec --python_filename test_data.py --scenario pp --step NANO --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeDileptonPlusX --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeV0ForMuonFake --customise=Bmm5/NanoAOD/nano_cff.nanoAOD_customizeBmmMuonId --customise_commands="process.add_(cms.Service('InitRootHandlers', EnableIMT = cms.untracked.bool(False)))"

Optional Filtering

If you want to add event filtering to the commands below you just need to modify the step option the following way

  • Monte Carlo: --step NANO,FILTER:Bmm5/NanoAOD/BxToMuMuFilter_cff.BxToMuMuFilterSequenceMC
  • Data: --step NANO,FILTER:Bmm5/NanoAOD/BxToMuMuFilter_cff.BxToMuMuFilterSequence

bmm5's People

Contributors

drkovalskyi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bmm5's Issues

Impelement DsToPhiPi

DsToPhiPi allows to achieve higher purity of kaon selection. Make it also work for pion fakes to complement ks control region.

Muon fake rate measurement is too slow

We are looking for K_S with a proper topology in each event unpacking all PFCandidates. It's a very time consuming operation. Need to find a way to speed it up.

Options:

  • Prescale hadronic K_S. We don't need them all. The down side can be that we may forget about the prescale in the analysis. Probably it's not an issue if we heavily prescale K_S to pipi since the effect will be obvious.
  • Use V0 computed in RECO. It may not work for pi+muon signature. Need to check what we have.

Kaon MC matching is broken in 2016

bkmm_gen_kaon_pdgId is mostly zero on BuToJpsiK_BMuonFilter_SoftQCDnonD_TuneCUEP8M1_13TeV-pythia8-evtgen+RunIISummer16MiniAODv2-PUMoond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6_ext1-v1+MINIAODSIM. When it's not zero it matches to anything but charged kaons

Add spvip branch

spvip is actively used in the analysis, but it's not available directly from the ntuples. One needs to calculate it on the fly. Let's add it to avoid any mistakes.

Use acos for alphaXY

Cosine of the point angle is very close to one for signal events and most of its discriminating power comes from very short variations in the angle, so it's better to use angle instead of its cosine as it's done for 3D alpha.

The change requires retraining of the MVA, which is time consuming.

Add sim-matched muon info

We need to be able to match muons to hadrons for the decay in flight. This information is available in recent MC reconstruction cycles. Not sure we will have it for all years. So it may help to add dR matching as well.

std::exception - PerigeeKinematicState::kinematic state passed is not valid!

http://t3serv001.mit.edu/~cmsprod/Kraken/agents/reviewd/nanoao/508/BdToKPi_BMuonFilter_SoftQCDnonD_TuneCP5_13TeV-pythia8-evtgen+RunIIAutumn18MiniAOD-102X_upgrade2018_realistic_v15-v2+MINIAODSIM/BC209D08-9205-D74B-A589-C7E4FF9F5ABB.err

Begin processing the 23016th record. Run 1, Event 34787581, LumiSection 918 on stream 0 at 21-Sep-2020 08:47:30.742 EDT
----- Begin Fatal Exception 21-Sep-2020 08:47:31 EDT-----------------------
An exception of category 'StdException' occurred while
[0] Processing Event run: 1 lumi: 918 event: 34787581 stream: 0
[1] Running path 'nanoAOD_step'
[2] Calling method for module BxToMuMuProducer/'BxToMuMuMc'
Exception Message:
A std::exception was thrown.
PerigeeKinematicState::kinematic state passed is not valid!
----- End Fatal Exception -------------------------------------------------
21-Sep-2020 08:47:31 EDT Closed file file:BC209D08-9205-D74B-A589-C7E4FF9F5ABB.root

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.