cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.07k stars 4.29k forks source link

Weird-looking distribution of `Muon::isolationR03().emEt` vs muon ϕ in Phase 2 samples #43858

Open mmusich opened 8 months ago

mmusich commented 8 months ago

While studying the Phase2 TkAl ALCARECO events produced in the Phase2Fall22DRMiniAOD campaign, a peculiar feature was noticed in the ϕ distribution of the tracks from Z → µµ decays selected from alignment (see here for more details). Upon dedicated check at the level of ALCARECO sample, it was observed that the feature was already present in the tracks persisted in the input sample, but also in the muon tracks from W → μν decays. Checking on the input muons, the reason of the ϕ-dependent inefficiency was spotted in an abnormal distribution of the muon electromagnetic relative isolation distribution Muon::isolationR03().emEt as a function of the muon azimuth. This quantity is used together with the tracker and hadronic relative isolation to select the muons entering the alignment samples.

https://github.com/cms-sw/cmssw/blob/f2ffd7b3c9b926a2db457de7749d4fca2183ba53/Alignment/CommonAlignmentProducer/python/TkAlMuonSelectors_cfi.py#L16

For reference it is how the isolationR03().emEt looks like in a NO PU SingleMuon gun [*] (hence I would naively expect it to be close to zero):

Screenshot from 2024-02-03 18-56-30

And here the full relative combined isolation vs muon 𝜂-ϕ.

Screenshot from 2024-02-03 18-56-54

[*]

 /RelValSingleMuFlatPt2To100/CMSSW_14_0_0_pre2-133X_mcRun4_realistic_v1_STD_2026D98_noPU_RV229-v1/GEN-SIM-RECO 
cmsbuild commented 8 months ago

cms-bot internal usage

cmsbuild commented 8 months ago

A new Issue was created by @mmusich Marco Musich.

@makortel, @Dr15Jones, @antoniovilela, @sextonkennedy, @rappoccio, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

mmusich commented 8 months ago

type muon

slava77 commented 8 months ago

wouldn't it be more practical to use PF isolation? CaloTower-based isolation in phase-2 isn't supposed to work in the endcaps; and from this issue it seems like the barrel is not healthy either.

mmusich commented 8 months ago

wouldn't it be more practical to use PF isolation?

I was told to use tracker isolation instead.

slava77 commented 8 months ago

wouldn't it be more practical to use PF isolation?

I was told to use tracker isolation instead.

track iso should work OK

mmusich commented 8 months ago

track iso should work OK

yes, but the point of this issue is that this minefield is left in release for anyone to step into. Something should be changed to avoid returning nonsense.

makortel commented 8 months ago

assign alca, reconstruction, upgrade

makortel commented 8 months ago

@cms-sw/muon-pog-l2

cmsbuild commented 8 months ago

New categories assigned: alca,reconstruction,upgrade

@jfernan2,@mandrenguyen,@srimanob,@subirsarkar,@saumyaphor4252,@perrotta,@consuegs you have been requested to review this Pull request/Issue and eventually sign? Thanks

jfernan2 commented 7 months ago

FYI @24LopezR @rbhattacharya04

rbhattacharya04 commented 7 months ago

Since the issue is with the electromagnetic component of the isolation, it would be nice if Egamma can check whether they see a similar trend in their isolation variable.

mmusich commented 7 months ago

@cms-sw/egamma-pog-l2 FYI

swagata87 commented 6 months ago

It looks like electrons and photons don't have this issue. For example, I attach one plot for electrons in barrel. Sample used: /RelValZEE_14/CMSSW_14_0_0_pre3-140X_mcRun4_realistic_v1_STD_2026D98_noPU-v1/MINIAODSIM CMSSW version used: 14_1_X Electron collection used : pat::Electron, slimmedElectrons

ele_barrel
swagata87 commented 6 months ago

I can confirm, from my setup, the weird behaviour of muons that Marco reported; using 14_1_0 and similar relVal sample (Z to mu mu miniaod).

It seems that muon is using calotowers to compute caloIso, as I see here: RecoMuon/MuonIsolation/plugins/CaloExtractor.cc. If that's the case then note that calotower code is not well maintained anymore by anyone. I'm not saying that the issue has to come from calotowers, but its a suspect that you might want to look at. This is also a major difference with egamma, who does not use calotower to compute the EM-iso, they directly use the ECAL recHits.

srimanob commented 5 months ago

@cms-sw/muon-pog-l2 @cms-sw/egamma-pog-l2 Do you have any update on this issues? Thanks.

swagata87 commented 5 months ago

just to clarify, the issue is in muon only, not in egamma. so there is no action item for egamma.

mmusich commented 5 months ago

Since the issue is with the electromagnetic component of the isolation, it would be nice if Egamma can check whether they see a similar trend in their isolation variable.

@rbhattacharya04 have you seen https://github.com/cms-sw/cmssw/issues/43858#issuecomment-1988267651 ? Do you have any reactions about the suggestion from @swagata87 ?

JanFSchulte commented 5 months ago

Hi everyone,

on the muon side, we are working on a re-implementation of our ECAL-based isolation, ditching the no longer supported calo towers and switching to rec hits, following EGMs approach. It's a taking a bit longer than expected, but @24LopezR is working on it and will update here once a solution is implemented.

24LopezR commented 5 months ago

Hi all, So I computed the Ecal and Hcal isolation using RecHits instead of calotowers, and the weird structures seem to disappear. [1] CaloTower Ecal iso, [2] RecHit Ecal iso [3] CaloTower Hcal iso, [4] RecHit Hcal iso

[1] [2] [3] [4]

Ceirtanly, the plots look more natural now. I am currently preparing the PR with this fix.

mandrenguyen commented 4 months ago

+1 This issue seems fixed by #44797

srimanob commented 4 months ago

+Upgrade

mmusich commented 4 months ago

This issue seems fixed by https://github.com/cms-sw/cmssw/pull/44797

There is still the point at https://github.com/cms-sw/cmssw/pull/44797#issuecomment-2104224952, so I would prefer to keep this open until that's clarified.