ME0 Simulation and Reconstruction

Status Summary

As of Nov 5 (and earlier): ME0s in full reco code (STA muon production) works in testing in 76X, porting complete, details below.

As of Sep 23 2015: PR #11398 is sent (for reco::ME0Muons)

Work to begin on testing the ME0-in-full-reco with the same customized digitizers as the reco::ME0Muon code.

As of Oct 6 2015: PR #11398 close to merging (waited for new IB, reviewed, review responded to, followup comments responded to)

Work on ME0s in full reco under way with customized digitizers and reco configs as in the reco::ME0Muon code. Runs fine, working on missing component to include ME0 hits in track trajectory.

Dedicated reco::ME0Muons

Working in 62X versions

reco::ME0Muons are dedicated objects which are matched track-ME0Segment pairs. The matching code is in later 6_2_0_SLHC releases, although the later update to make them configurable and selectable offline is still pending for 76X. To re-run the reconstruction on existing files, do this:

cmsrel CMSSW_6_2_0_SLHC25_patch1
cd CMSSW_6_2_0_SLHC25_patch1/src/
cmsenv
git cms-merge-topic dnash86:ME0GlobalReco-Selectors
scram b -j 16

Then the ME0Muons can be remade via these lines in a config:

process.load('RecoMuon.MuonIdentification.me0MuonReco_cff')
process.p = cms.Path(process.me0MuonReco)

Offline selection is done using the ME0MuonSelectors module:

#include "RecoMuon/MuonIdentification/plugins/ME0MuonSelector.cc"

And currently there are three available options, which also need the me0geometry (this reliance is removed in the pending update to 76X):

edm::ESHandle<ME0Geometry> me0Geom;
muon::isGoodMuon(me0Geom, *thisMuon, muon::Tight)
OR
muon::isGoodMuon(me0Geom, *thisMuon, muon::Loose)
OR
muon::isGoodMuon(me0Geom, *thisMuon, muon::VeryLoose)

The user could of course add further options in RecoMuon/MuonIdentification/plugins/ME0MuonSelector.cc.

ME0Muons in 76X

Work is ongoing for ME0Muons in 76X, standalone configs very tricky to produce.

Thanks to work from Piet to help create the necessary configs in RecoLocalMuon/GEMRecHit, we have a standalone configs to test ME0Muons in 76X. Working branch for ME0Muon production here:

https://github.com/dnash86/cmssw/tree/ME0Muons-In-76X_v2

To produce ME0Muons do this:

cmsrel CMSSW_7_6_0_pre4
cd CMSSW_7_6_0_pre4/src/
cmsenv
git cms-merge-topic dnash86:ME0Muons-In-76X_v2
scram b -j 16
cd RecoLocalMuon/GEMRecHit/test/
cmsRun SingleMuPt100_cfi_GEM-SIM_Extended2015MuonGEMDev_RPCGEMME0Customs_cfg.py
cmsRun SingleMuPt100_cfi_DIGI_Extended2015MuonGEMDev_RPCGEMME0Customs_cfg.py
cmsRun runTestUpgradeGEMME0Reco_cfg.py

Analyzer used for studies in 62X also available, at RecoMuon/MuonIdentification/test/testME0MuonAnalyzer_Example.py.

ME0Muons checked, look good, so PR is ready and sent: https://github.com/cms-sw/cmssw/pull/11398.

These changes are necessary to run the dedicated ME0Muon code in 76X, and are not included in PR #11398:

RecoVertex/Configuration/python/RecoVertex_cff.py

TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc

ME0 in Full Reco

Set up and testing in SLHC releases

The following tests were passed.

In CMSSW_6_2_0_SLHC21, where the packages were developed:

cmsrel CMSSW_6_2_0_SLHC21
cd CMSSW_6_2_0_SLHC21/src/
cmsenv
git cms-merge-topic dnash86:ME0-In-Full-MuonReco
scram b -j 16
runTheMatrix.py -w upgrade -l 13007

And in a later release:

cmsrel CMSSW_6_2_0_SLHC24
cd CMSSW_6_2_0_SLHC24/src/
cmsenv
git cms-merge-topic dnash86:ME0-In-Full-MuonReco
scram b -j 16
runTheMatrix.py -w upgrade -l 13007

Either set of commands can be used to check out all the necessary packages for ME0s in full reco. Note: Many dependent packages are checked out, so compilation is heavy and takes some time.

Packages that were updated for ME0s

The following packages had changes to include ME0s:

Category Package/SubPackage Comments
DQM
  DQM/DTMonitorModule Very small change to MuonDetLayerMeasurements calls to match changes
DataFormats
  DataFormats/GEMDigi ME0Digis
  DataFormats/GEMRecHit ME0RecHits, RecSegments
  DataFormats/MuonDetId ME0DetId
  DataFormats/TrackReco ME0s added to HitPattern
Geometry
  Geometry/GEMGeometry ME0EtaPartitions and ME0Chambers (needed for proper accessing of ME0s by chamberId) implemented
  Geometry/GEMGeometryBuilder ME0GeometryBuilder (must build ME0Chambers in order to access ME0-dependent objects by chamberId)
RecoMuon
  RecoMuon/DetLayers MuonME0DetLayerGeometryBuilder (builds the layer of ME0 chambers)
  RecoMuon/MeasurementDet MuonDetLayerMeasurements updated to include ME0s
  RecoMuon/CosmicMuonProducer Very small change to MuonDetLayerMeasurements calls to match changes
  RecoMuon/GlobalTrackingTools  
  RecoMuon/MuonSeedGenerator Very small change to MuonDetLayerMeasurements calls to match changes
  RecoMuon/MuonIdentification Previous ME0Muon work (dedicated ME0Muon object)
  RecoMuon/Navigation ME0s included in the Navigation
  RecoMuon/StandAloneMuonProducer  
  RecoMuon/StandAloneTrackFinder ME0s included in LogTrace
  RecoMuon/TrackingTools ME0s included in subdetectors
RecoLocalMuon
  RecoLocalMuon/GEMRecHit ME0SegmentBuilder edited to refer to ME0Chambers by the correct DetId
RecoTracker
  RecoTracker/TrackProducer ME0s included in LogTrace
SLHCUpgradeSimulations
  SLHCUpgradeSimulations/Configuration ME0 customs files
TrackingTools
  TrackingTools/TrackFitters ME0s included in LogTrace
Validation
  Validation/RecoMuon Some tools for ME0 analyzers

Porting to 75X releases

The same packages that were changed in SLHC releases to include ME0s must be ported to 75X. Changes will need to include use of "consumes" and changing "getByLabel" functionality to "getByToken".

This procedure is done for the smaller "reco::ME0Muon" functionality, and is available in this branch (Note: Still pending testing pre-PR): https://github.com/dnash86/cmssw/tree/ME0Muons-In-75X

The porting procedure for ME0s in full reconstruction is planned to proceed starting from a GEM porting working area here (thanks to Archie): https://github.com/archiesharma/cmssw/tree/Portingin75X

The branch for this porting work is here:

https://github.com/dnash86/cmssw/tree/ME0-InFullMuonReco-For75X-Port

The packages listed above will have their porting status reported below:

Category Package/SubPackage Porting status
DQM
  DQM/DTMonitorModule Yes
  DQM/./DQM/DataScouting Work in progress test/HLTvsRECOstudies/hlt_data.py, added disables
DataFormats
  DataFormats/GEMDigi Yes
  DataFormats/GEMRecHit Yes
  DataFormats/MuonDetId Yes
  DataFormats/TrackReco Yes
Geometry
  Geometry/GEMGeometry Yes
  Geometry/GEMGeometryBuilder Yes
RecoMuon
  RecoMuon/DetLayers Yes
  RecoMuon/MeasurementDet Yes
  RecoMuon/CosmicMuonProducer Yes
  RecoMuon/GlobalTrackingTools Yes
  RecoMuon/MuonSeedGenerator Yes
  RecoMuon/MuonIdentification Covered by ME0Muon PR
  RecoMuon/Navigation Yes
  RecoMuon/StandAloneMuonProducer Yes
  RecoMuon/StandAloneTrackFinder Yes
  RecoMuon/TrackingTools Yes
RecoLocalMuon
  RecoLocalMuon/GEMRecHit Yes
RecoTracker
  RecoTracker/TrackProducer Okay - LogDebug lines removed, no differences w.r.t. ME0 now
SLHCUpgradeSimulations
  SLHCUpgradeSimulations/Configuration Covered by ME0Muon PR
TrackingTools
  TrackingTools/TrackFitters Yes
Validation
  Validation/RecoMuon Covered by ME0Muon PR
Additional packages
  RecoMuon/L2MuonProducer Yes

Working on 76X, issues with ECAL preshower

Developing began in: https://github.com/dnash86/cmssw/tree/ME0-InFullMuonReco-For76X-Port

Trying tests with runTheMatrix.py -l 21.0, editing the geometry to this:

process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDevReco_cff')
process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDev_cff')
#process.load('Configuration.StandardSequences.GeometryRecoDB_cff')

and including these customs files:

from SLHCUpgradeSimulations.Configuration.me0Customs import customise 
#call to customisation function customise imported from SLHCUpgradeSimulations.Configuration.me0Customs
process = customise(process)

When trying out removing the ECAL preshower via customization, like so:

    process.load("Geometry.CaloEventSetup.CaloGeometryBuilder_cfi")
    process.CaloGeometryBuilder.SelectedCalos = cms.vstring('HCAL',
                                                            'ZDC',
                                                            'EcalBarrel',
                                                            'EcalEndcap',
                                                            #'EcalPreshower',
                                                            'TOWER')

, experiencing this error in runtime:

cmsRun: /build/cmsbuild/jenkins-workarea/workspace/build-cache/cms.week0/w/tmp/BUILDROOT/4ac4c9b2bbce774434666a6fac2d296d/opt/cmssw/slc6_amd64_gcc491/cms/cmssw/CMSSW_7_6_X_2015-08-02-1000/src/SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc:53: void ESDigitizer::setGain(int): Assertion `0 = m_detIds && 0 = m_detIds->size()' failed.

Piggy-backing off of testing changes to reco::ME0Muon code listed above, included the changes to the tracker code and testing now with this config:

https://github.com/dnash86/cmssw/blob/ME0-InFullMuonReco-For76X-Port-v2/RecoLocalMuon/GEMRecHit/test/runTestUpgradeGEMME0Reco_cfg.py

(in branch: https://github.com/dnash86/cmssw/tree/ME0-InFullMuonReco-For76X-Port-v2/RecoLocalMuon/GEMRecHit/test)

Config works and produces standalone muons, however current testing shows ME0 enabled and geometry created but not ME0 hits in the track trajectory. Looking in to changes in HitPattern (from 6_2_0_SLHCX versions), etc...

Working version of ME0 inclusion in STA muons

Working version here:

https://github.com/dnash86/cmssw/tree/ME0-InFullMuonReco-For76X-Port-v2

Some records of testing, package checkout:

cmsrel CMSSW_7_6_0_pre4
cd CMSSW_7_6_0_pre4/src
cmsenv
git cms-merge-topic dnash86:ME0-InFullMuonReco-For76X-Port-v2
scram b -j 16
cmsRun RecoLocalMuon/GEMRecHit/test/SingleMuPt100_cfi_GEM-SIM_Extended2015MuonGEMDev_RPCGEMME0Customs_cfg.py
cmsRun RecoLocalMuon/GEMRecHit/test/SingleMuPt100_cfi_DIGI_Extended2015MuonGEMDev_RPCGEMME0Customs_cfg.py
cmsRun RecoLocalMuon/GEMRecHit/test/runTestUpgradeGEMME0Reco_cfg.py

ME0 analysis strategies

Association by hits, an overview

Overall the section of the analyzer that deals with chi2/hits association is here:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L865-L1131

although portions of that are commented out. I tried to comment inside those lines what is going on, but I'll try to explain further here (broken down by set up and by use):


> Set up:
To set the associators (by chi2 or by hits) up, one must set the "consumes" up:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L267-L271

and then get them from the event:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L583-L589



> Use:
While I do loop over the associators here:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L880

I do not ever use more than one at a time.

First, one must build the collection of "simtoreco" and "recotosim" associations:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L884-L908

Those are collections of reco tracks associated to each sim track, and vice versa.

But probably you want to check for a one-to-one "best" match. So, then, for each reco track you should check for any sim tracks (gen particles) associated to it:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L973

and then you take the list of associated gen particles, picking the "best" one, and check the collection of RECO tracks associated with the gen:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L974-L983

and finally check if the "best" reco track for the gen particle is the same one you started with:

https://github.com/dnash86/cmssw/blob/ME0Muons-In-76X_v2/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L985-L989

The above walkthrough used a release for 76X development, the version in SLHC is here: https://github.com/cms-sw/cmssw/blob/CMSSW_6_2_X_SLHC/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc#L691-L886

and the version with the ME0-Selectors available: https://github.com/dnash86/cmssw/blob/ME0GlobalReco-Selectors/RecoMuon/MuonIdentification/test/ME0MuonAnalyzer.cc

(Note: the version in ME0GlobalReco-Selectors has been merged in SLHCDEV)

Association by hits, to run existing analyzer

To check out the package (other CMSSW versions should work):

cmsrel CMSSW_6_2_0_SLHC25_patch1
cd CMSSW_6_2_0_SLHC25_patch1/src/
cmsenv
git cms-merge-topic dnash86:ME0GlobalReco-Selectors
scram b -j 16

Edit RecoMuon/MuonIdentification/test/testME0MuonAnalyzer_cfg.py, replacing "OUTPUTTEMPLATE" with the output name you'd like, and "FILETEMPLATE" with the input file you that has ME0Muons that you'd like to run on. You will also need to check that the geometry and global tag is the same as the geometry and global tag used in production of the input root file.

Note: Default parameters in the config are:

  • A pT cut of 5 GeV
  • A matching window for the Delta_R matching of 0.15
  • Association by Hits turned on
    • Efficiency cut for Assoc by Hits of 0.0
    • Purity cut for Assoc by Hits of 0.0
  • Geometry: GeometryExtended2023HGCalMuonReco
  • GT: PH2_1K_FB_V6::All

Then, of course:

cmsRun RecoMuon/MuonIdentification/test/testME0MuonAnalyzer_cfg.py

Note: Many histos produced are "legacy" histos, needed once and left in the analyzer. Significant ones are:

Histo Name Description
Chi2MatchedME0Muon_Eta The "numerator" of the Chi2MuonRecoEff_Eta plot - it is actually for matching by hits if that is on, as well.
TPMuon_Eta The "denominator" of the Chi2MuonRecoEff_Eta plot- it is all tracking particles considered for association
MatchedME0Muon_Eta The "numerator" of MuonRecoEff_Eta, for matching by delta R
GenMuon_Eta The "denominator" of the MuonRecoEff_Eta plot - all gen muons considered for matching by delta R
Chi2MuonRecoEff_Eta The efficiency of the association by chi2/hits
MuonRecoEff_Eta The efficiency of the matching by delta R
Chi2UnmatchedMEMuon_Eta The tracks that failed association by chi2/hits
UnmatchedMEMuon_Cuts_Eta The tracks that failed matching by delta R

-- DavidNash - 2015-03-04

Edit | Attach | Watch | Print version | History: r34 < r33 < r32 < r31 < r30 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r34 - 2016-03-18 - ArchieSharma
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

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