Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEM and ME0 realistic digitizer updates #18660

Merged
merged 31 commits into from Jun 15, 2017
Merged

GEM and ME0 realistic digitizer updates #18660

merged 31 commits into from Jun 15, 2017

Conversation

dildick
Copy link
Contributor

@dildick dildick commented May 10, 2017

This pull request includes updates for the ME0 digtizer

Below is a list of things I changed:

  1. I put the ME0 and GEM simlinks definition in the same package, SimDataFormats/GEMDigiSimLinks.
  2. I added the ME0 realistic digitizer from Roumyana Mileva (with associated python configurations)
  3. I renamed the ME0 digi sequences to be clear and consistent.
    real digis (ME0Digi) --> now simMuonME0Digis
    real pad digis (ME0PadDigi) --> now simMuonME0PadDigis
    fake digis (ME0DigiPreReco) --> now simMuonME0PseudoDigis
    fake re-digis (ME0DigiPreReco) --> now simMuonME0PseudoReDigis
    new ME0 digi sequence: simMuonME0Digis + simMuonME0PadDigis + simMuonME0PseudoDigis + simMuonME0PseudoReDigis
  4. The new names were propagated all the way to L1, RECO and Validation.
  5. I merged all customizations from customizeGEMDigi,customizeME0Digi and customizeRPCDigi in different packages to a single python file customizeMuonDigi.py. IMO there was way too much code-duplication in those customizations. I believe I merged all background customizations correctly.
  6. Background numbers for the legacy GEM and ME0 digitizers were updated.
  7. The ME0PadDigiProducer was updated to use the ME0DigiCollection instead of ME0DigiPreRecoCollection

Supporting information for the GEM and ME0 digitizers is being added here: https://twiki.cern.ch/twiki/bin/view/CMS/GEMDigitizationRoadMap

@calabria @mileva

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @dildick (Sven Dildick) for master.

It involves the following packages:

IOMC/RandomEngine
RecoLocalMuon/GEMRecHit
RecoLocalMuon/GEMSegment
SimDataFormats/GEMDigiSimLink
SimMuon/Configuration
SimMuon/GEMDigitizer
SimMuon/RPCDigitizer
Validation/MuonME0Validation

@perrotta, @smuzaffar, @civanch, @Dr15Jones, @mdhildreth, @dmitrijus, @cmsbuild, @kpedro88, @slava77, @vanbesien, @davidlange6 can you please review it and eventually sign? Thanks.
@calderona, @abbiendi, @jhgoh, @bellan, @HuguesBrun, @wddgit, @battibass, @trocino this is something you requested to watch as well.
@davidlange6 you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented May 10, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 10, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19719/console Started: 2017/05/10 15:42

@@ -3,5 +3,5 @@
me0RecHits = cms.EDProducer("ME0RecHitProducer",
recAlgoConfig = cms.PSet(),
recAlgo = cms.string('ME0RecHitStandardAlgo'),
me0DigiLabel = cms.InputTag("simMuonME0ReDigis"),
me0DigiLabel = cms.InputTag("simMuonME0PseudoReDigis"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we settle on some common naming so that (local) reco configs do not get perturbed frequently just because of some internal DIGI-step reorganization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slava77 After this PR no more name changes are foreseen. The naming that is proposed is similar to the other muon digitizers simMuonME0Digis vs simMuonRPCDigis or simMuonGEMDigis,simMuonCSCDigis and simMuonDTDigis for realistic digis. simMuonME0PadDigis vs simMuonGEMPadDigis for pads. Pseudo digis now have the string Pseudo in them to distinguish them from real digis. Re-digitized pseudo digis for Muon TDR studies are called simMuonME0PseudoReDigis. This naming convention was agreed upon with other GEM/ME0 developers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my education, could you briefly summarize "pseudo" and "re"? (pseudo means smeared, and "re" means?) -perhaps the word "sim" needs to be dropped at some point along this chain

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pseudo means that the digis are of type ME0DigiPreReco. Real digis are of type ME0Digi. The pseudo digitization sequence for ME0 was introduced for performance studies (deciding layers, eta partitions, strips) for the Muon Upgrade TDR. This sequence will be taken out of the main digi step in the future. The real ME0 digi sequence is what will be used to build ME0 triggers and for continued ME0 performance studies.

@cmsbuild
Copy link
Contributor

Comparison job queued.

@slava77
Copy link
Contributor

slava77 commented May 10, 2017 via email

@dildick
Copy link
Contributor Author

dildick commented May 10, 2017

We can put together some slides as a reference.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18660/19719/summary.html

Comparison Summary:

  • You potentially added 19 lines to the logs
  • Reco comparison results: 1706 differences found in the comparisons
  • DQMHistoTests: Total files compared: 24
  • DQMHistoTests: Total histograms compared: 1829141
  • DQMHistoTests: Total failures: 55722
  • DQMHistoTests: Total nulls: 204
  • DQMHistoTests: Total successes: 1773035
  • DQMHistoTests: Total skipped: 180
  • DQMHistoTests: Total Missing objects: 0
  • Checked 98 log files, 14 edm output root files, 24 DQM output files

#ifndef ME0OBJECTS_ME0DIGISIMLINK_H
#define ME0OBJECTS_ME0DIGISIMLINK_H

#include <map>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only need #include <utility> (not map) for pair

import FWCore.ParameterSet.Config as cms

# PSet of mixObjects that only keeps muon collections (and SimTracks with SimVertices)
mixObjects_dt_csc_rpc = cms.PSet(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than duplicating this entire structure, I think it would be better to import/copy the regular mixObjects and just clear out the parts you don't want. This has the advantage of picking up any Era modifications in SimGeneral/MixingModule/python/mixObjects_cfi.py.



# Add simMuonGEMDigis to the list of modules served by RandomNumberGeneratorService
def customize_random_GEMDigi(process):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These random number initializations are already done by Eras in IOMC/RandomEngine/python/IOMC_cff.py. They should not be duplicated here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kpedro88 If I use the construct

# Add simMuonGEMDigis to the list of modules served by RandomNumberGeneratorService                                                                                                
def customize_random_GEMDigi(process):
    from IOMC.RandomEngine.IOMC_cff import RandomNumberGeneratorService as rndsv
    process.RandomNumberGeneratorService.simMuonGEMDigis = rndsv.simMuonGEMDigis
    return process

in a driver command

cmsDriver.py SingleMuPt100_pythia8_cfi \
--conditions auto:phase2_realistic -n 10 \
--era Phase2C2_timing \
--eventcontent FEVTDEBUG  \
-s GEN,SIM,DIGI:pdigi_valid \
--datatier GEN-SIM-DIGI \
--beamspot HLLHC \
--geometry Extended2023D4 \
--customise SimMuon/Configuration/customizeMuonDigi.customize_digi_addGEM_addME0_muon_only \
--python SingleMuPt100_2023tilted_GenSimFull.py \
--no_exec --fileout file:step1.root

then the driver crashes with

...
    process = customize_random_GEMDigi(process)
  File "/afs/cern.ch/work/d/dildick/public/GEM/ME0DigiIntegration/CMSSW_9_2_X_2017-05-08-2300/python/SimMuon/Configuration/customizeMuonDigi.py", line 65, in customize_random_GEMDigi
    process.RandomNumberGeneratorService.simMuonGEMDigis = rndsv.simMuonGEMDigis
AttributeError: 'Service' object has no attribute 'simMuonGEMDigis'

How do I load the Phase2 RandomNumberGeneratorService before calling the customization?

Copy link
Contributor Author

@dildick dildick May 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I simply throw away the random number initialization and assume the initialization will be done by the --era command?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you should assume the initialization will be done by the Era.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.



# customize the full digitization sequence pdigi by adding GEMs
def customize_digi_addGEM_addGEM(process):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be called ..._addGEM_addME0?

b=a+'output'
if hasattr(process,b):
getattr(process,b).outputCommands.append('keep *_g4SimHits_Muon*_*')
getattr(process,b).outputCommands.append('keep *_*Muon*_*_*')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can combine these two lines into one extend

for (ME0DigiCollection::const_iterator digiIt = range.first; digiIt!=range.second; ++digiIt)
{
/*
for(int i = 0; i < id.roll(); i++){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete commented-out code

std::cout << "roll 8 numbers = " << countRoll8 << "\tndigi = " << ndigi8 << std::endl;

/*
for (edm::DetSetVector<StripDigiSimLink>::const_iterator itlink = thelinkDigis->begin(); itlink != thelinkDigis->end(); itlink++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete commented-out code

, me0DigiSimLinkToken_(consumes < edm::DetSetVector<ME0DigiSimLink> > (pset.getParameter < edm::InputTag > ("me0DigiSimLinkToken")))
, debug_(pset.getParameter<bool>("debugFlag"))
{
edm::Service < TFileService > fs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to have usesResource("TFileService"); here


if (MuCluster.size() != 0)
{
for (std::map<int, int>::iterator it = MuCluster.begin(); it != MuCluster.end(); ++it)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use range-based loop (also below)

if (abs(particletype) == 13)
{
tof_mu_bx0->Fill(partTof);
MuCluster.insert(std::pair<int, int>(strip, particletype));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use emplace() (also below)

@kpedro88
Copy link
Contributor

@dildick please only reply to my review comments on GitHub if you have a question or objection

@dildick
Copy link
Contributor Author

dildick commented May 11, 2017

@kpedro88 ok.

@mileva could you please address the issues pertaining to the ME0 digi model? I'll take care of the muon digi customizations.

@mileva
Copy link
Contributor

mileva commented May 11, 2017

@kpedro88 Thank you for the comments!
@dildick Ok, I will take care about the digi model and readers in the test directory, but can do this at the earliest on Saturday.

process.rpcRecHits,
cms.Sequence(process.simMuonRPCReDigis+process.rpcRecHits)
)
return process
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you removing this file? by accident?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not by accident. It is now included in SimMuon/Configuration/python/customizeMuonDigi.py which will contain all expert customizations for muon digi studies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I understand.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 9, 2017

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18660/20457/summary.html

Comparison Summary:

  • You potentially added 5 lines to the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 1872323
  • DQMHistoTests: Total failures: 34634
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1837516
  • DQMHistoTests: Total skipped: 173
  • DQMHistoTests: Total Missing objects: 0
  • Checked 94 log files, 14 edm output root files, 23 DQM output files

@slava77
Copy link
Contributor

slava77 commented Jun 10, 2017

+1

for #18660 7098ea7

@kpedro88
Copy link
Contributor

+1

@dmitrijus
Copy link
Contributor

+1

@dildick
Copy link
Contributor Author

dildick commented Jun 13, 2017

@davidlange6 Do you have any more comments on this PR?

@kpedro88
Copy link
Contributor

@Dr15Jones @civanch @mdhildreth please sign again

@Dr15Jones
Copy link
Contributor

+1
Just random number

@mdhildreth
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@dildick
Copy link
Contributor Author

dildick commented Jun 15, 2017

Can this pull request be signed please?

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 35ad0e0 into cms-sw:master Jun 15, 2017
@dildick dildick deleted the from-CMSSW_9_2_X_2017-05-08-2300-ME0-realistic-digi-updates branch June 26, 2017 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet