Skip to content

Displaced Particle Gun#51006

Open
bfonta wants to merge 3 commits into
cms-sw:masterfrom
bfonta:feature/displaced_gun
Open

Displaced Particle Gun#51006
bfonta wants to merge 3 commits into
cms-sw:masterfrom
bfonta:feature/displaced_gun

Conversation

@bfonta
Copy link
Copy Markdown
Contributor

@bfonta bfonta commented May 21, 2026

PR description:

This PR introduces a displaced particle gun producer, and adds corresponding workflows.
The producer is useful for studies considering displaced topologies.

The producer selects a vertex position by randomly generating a set of $R>0$, $\phi_{\text{Vtx}} \in [0;2\pi[$, and $z>0$ coordinates. The momentum of the particle is then randomly generated using $p_{\text{T}}$, $\theta \in [0, \pi[$ and $\phi \in [-\pi; \pi[$ coordinates. The vertex displacement $R$ can be generated uniformly along $R$, or uniformly along the area of an annulus of radius $R_{\text{max}}-R_{\text{min}}$.

The gun can be forced to only generate particles reaching the surface of HGCAL via the PointingToHGCAL flag. In this case, $\theta$ and $\phi$ are generated multiple times until a configuration enables the particle to lie within RminFrontSurfaceHGCAL and RmaxFrontSurfaceHGCAL. Note that, given a displaced vertex, setting only a $\theta$ range is not sufficient to guarantee that a particle is produced in the right direction. By default, RminFrontSurfaceHGCAL and RmaxFrontSurfaceHGCAL delimit the inner third of HGCAL's front surface, ensuring virtually all showers produced up to $R=200\text{cm}$ traverse the entirety of the CE-E. The PointingToHGCAL flag cannot be used with charged particles, since their curved trajectories under the magnetic field breaks the implemented logic.

PR validation

Inspecting the output of step2 with cmsShow shows photons produced at the right $R$ values, and always pointing towards the positive endcap.

Running the workflows produces the intended commands:

$ runTheMatrix.py -l 34554.0 -w upgrade 
...
Preparing to run 34554.0 DisplacedPGun+Run4D121                                                                                                                                                                    
                                                                                                                                                                                                                   
# in: /cms-hlt-nfs/user/bfontana/DisplacedSamples/src going to execute cd 34554.0_DisplacedPGun+Run4D121                                                                                                           
 cmsDriver.py DisplacedParticleGun_cfi  -s GEN,SIM -n 10 --conditions auto:phase2_realistic_T35_13TeV --beamspot DBrealisticHLLHC --datatier GEN-SIM --eventcontent FEVTDEBUG --geometry ExtendedRun4D121 --era Pha
se2C22I13M9 --relval 9000,100 --fileout file:step1.root  > step1_DisplacedPGun+Run4D121.log  2>&1                                                                                                                  
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
# in: /cms-hlt-nfs/user/bfontana/DisplacedSamples/src going to execute cd 34554.0_DisplacedPGun+Run4D121                                                                                                           
 cmsDriver.py step2  -s DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:@relvalRun4 --conditions auto:phase2_realistic_T35 --datatier GEN-SIM-DIGI-RAW -n 10 --eventcontent FEVTDEBUGHLT --geometry Extended
Run4D121 --era Phase2C22I13M9 --filein  file:step1.root  --fileout file:step2.root  > step2_DisplacedPGun+Run4D121.log  2>&1                                                                                       
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
# in: /cms-hlt-nfs/user/bfontana/DisplacedSamples/src going to execute cd 34554.0_DisplacedPGun+Run4D121                                                                                                           
 cmsDriver.py step3  -s RAW2DIGI,RECO,RECOSIM,PAT,VALIDATION:@phase2Validation+@miniAODValidation,DQM:@phase2+@miniAODDQM --conditions auto:phase2_realistic_T35 --datatier GEN-SIM-RECO,MINIAODSIM,DQMIO -n 10 --e
ventcontent FEVTDEBUGHLT,MINIAODSIM,DQM --geometry ExtendedRun4D121 --era Phase2C22I13M9 --filein  file:step2.root  --fileout file:step3.root  > step3_DisplacedPGun+Run4D121.log  2>&1                            
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
# in: /cms-hlt-nfs/user/bfontana/DisplacedSamples/src going to execute cd 34554.0_DisplacedPGun+Run4D121                                                                                                           
 cmsDriver.py step4  -s HARVESTING:@phase2Validation+@phase2+@miniAODValidation+@miniAODDQM --conditions auto:phase2_realistic_T35 --mc  --geometry ExtendedRun4D121 --scenario pp --filetype DQM --era Phase2C22I1
3M9 -n 100  --filein file:step3_inDQM.root --fileout file:step4.root  > step4_DisplacedPGun+Run4D121.log  2>&1                                                                                                     
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
# in: /cms-hlt-nfs/user/bfontana/DisplacedSamples/src going to execute cd 34554.0_DisplacedPGun+Run4D121                                                                                                           
 cmsDriver.py step5  -s ALCA:SiPixelCalSingleMuonLoose+SiPixelCalSingleMuonTight+TkAlMuonIsolated+TkAlMinBias+MuAlOverlaps+EcalESAlign+TkAlZMuMu+TkAlDiMuonAndVertex+HcalCalHBHEMuonProducerFilter+TkAlUpsilonMuMu+
TkAlJpsiMuMu --conditions auto:phase2_realistic_T35 --datatier ALCARECO -n 10 --eventcontent ALCARECO --geometry ExtendedRun4D121 --era Phase2C22I13M9 --filein file:step3.root --fileout file:step5.root  > step5_
DisplacedPGun+Run4D121.log  2>&1                                                                                                                                                                                   
                                                                                                                                                                                                                   
34554.0_DisplacedPGun+Run4D121 Step0-PASSED Step1-PASSED Step2-PASSED Step3-PASSED Step4-PASSED  - time date Thu May 21 01:14:13 2026-date Thu May 21 01:07:37 2026; exit: 0 0 0 0 0                               
1 1 1 1 1 tests passed, 0 0 0 0 0 failed 

@bfonta
Copy link
Copy Markdown
Contributor Author

bfonta commented May 21, 2026

type ngt

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented May 21, 2026

cms-bot internal usage

@cmsbuild
Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51006/49427

@cmsbuild
Copy link
Copy Markdown
Contributor

A new Pull Request was created by @bfonta for master.

It involves the following packages:

  • Configuration/Generator (generators)
  • Configuration/PyReleaseValidation (pdmv)
  • IOMC/ParticleGuns (generators)

@AdrianoDee, @DickyChant, @antoniovagnerini, @cmsbuild, @kfjack, @lviliani, @miquork, @mkirsano, @sensrcn, @sroychow, @theofil can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @fabiocos, @grzanka, @makortel, @slomeo this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented May 21, 2026

test parameters:

  • relval_opts = -w upgrade
  • workflows = 34554.0

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented May 21, 2026

@cmsbuild, please test

Copy link
Copy Markdown
Contributor

@mmusich mmusich left a comment

Choose a reason for hiding this comment

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

from a first cursory review.

Comment thread IOMC/ParticleGuns/src/DisplacedParticleGunProducer.cc Outdated
Comment thread IOMC/ParticleGuns/src/DisplacedParticleGunProducer.cc Outdated
Comment thread IOMC/ParticleGuns/src/DisplacedParticleGunProducer.cc Outdated
Comment thread IOMC/ParticleGuns/src/DisplacedParticleGunProducer.cc
@cmsbuild
Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 116KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-444934/53402/summary.html
COMMIT: b76569b
CMSSW: CMSSW_17_0_X_2026-05-20-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51006/53402/install.sh to create a dev area with all the needed externals and cmssw changes.

DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4198477
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4198451
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 52 files compared)
  • Checked 227 log files, 197 edm output root files, 53 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51006/49429

@cmsbuild
Copy link
Copy Markdown
Contributor

Pull request #51006 was updated. @AdrianoDee, @DickyChant, @antoniovagnerini, @cmsbuild, @kfjack, @lviliani, @miquork, @mkirsano, @sensrcn, @sroychow, @theofil can you please check and sign again.

@mmusich
Copy link
Copy Markdown
Contributor

mmusich commented May 21, 2026

@cmsbuild, please test

@cmsbuild
Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 116KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-444934/53408/summary.html
COMMIT: 92b205b
CMSSW: CMSSW_17_0_X_2026-05-20-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51006/53408/install.sh to create a dev area with all the needed externals and cmssw changes.

DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • You potentially removed 2 lines from the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4198477
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4198454
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 52 files compared)
  • Checked 227 log files, 197 edm output root files, 53 DQM output files
  • TriggerResults: no differences found

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.

3 participants