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

Added extra parameters for Geant4 tracking in field #31665

Merged
merged 6 commits into from Oct 14, 2020

Conversation

civanch
Copy link
Contributor

@civanch civanch commented Oct 5, 2020

PR description:

To address problem discussed in https://indico.cern.ch/event/958339/contributions/4032381/attachments/2110000/3549315/muoncal-Sept25-2020.pdf extra parameters for Geant4 tracking in field are added. This will allow simulation of high energy tracks without reported bias in trajectories. Optimal values of new parameters require evaluation, because of that in this PR new set of parameters are not yet enabled.

Also printouts are improved.

PR validation:

private

if this PR is a backport please specify the original PR and why you need to backport that PR:

to be discussed if it should be backported to legacy for Run-2 or not.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31665/18780

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

A new Pull Request was created by @civanch (Vladimir Ivantchenko) for master.

It involves the following packages:

SimG4Core/Application
SimG4Core/MagneticField

@cmsbuild, @civanch, @mdhildreth can you please review it and eventually sign? Thanks.
@makortel, @namapane, @rovere, @fabiocos, @slomeo this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

The code-checks are being triggered in jenkins.

@civanch
Copy link
Contributor Author

civanch commented Oct 5, 2020

@bendavid , here a simple variant to suppress bias within tracker is introduced. Optimal values of new parameters should be defined, first of all, energy limit.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31665/18804

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

Pull request #31665 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again.

@civanch
Copy link
Contributor Author

civanch commented Oct 5, 2020

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2020

The tests are being triggered in jenkins.

@bendavid
Copy link
Contributor

bendavid commented Oct 5, 2020

Thanks,
Are we sure things don't need to be tightened all the way up to the muon detectors? (Maybe with a higher pt threshold in this case?)

(For 10_6_X in any case I think we prefer to do this without code changes/new release just changing the parameters.)

@bendavid
Copy link
Contributor

bendavid commented Oct 5, 2020

The results of some tests I've done changing the parameters globally.

CPU Timing:
(11_2_0_pre6 200 ttbar events on 8 cores, reporting AvgEventTime from fwkjobreport)

Nominal:
17.0 s/event

Test1:

DeltaIntersection = 1e-6

16.9 s/event

Test2

DeltaOneStep = 1e-5
DeltaIntersection = 1e-6

16.5 s/event

Test3:

DeltaOneStep = 1e-4
DeltaIntersection = 1e-6
MaximumEpsilonStep = 1e-6
MinimumEpsilonStep = 5e-7

18.6 s/event

Test4:

DeltaOneStep = 1e-5
DeltaIntersection = 1e-7
MaximumEpsilonStep = 1e-7
MinimumEpsilonStep = 5e-8

19.5 s/event

So it seems Minimum/MaximumEpsilonStep have some impact on CPU performance, but the others not really.

If I tried setting ONLY process.g4SimHits.MagneticField.ConfGlobalMFM.OCMS.StepperParam.DeltaIntersection = 1e-7 then I saw at least one error like

%MSG-w SimG4CoreApplication:  OscarMTProducer:g4SimHits  03-Oct-2020 21:21:36 CEST Run: 1 Event: 13
SimG4Exception caght! 
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : GeomNav0003
      issued by : G4MultiLevelLocator::EstimateIntersectionPoint()
Location: G4MultiLevelLocator::EstimateIntersectionPoint()- After EndIf(Intersects_AF)
       Current Position  and  Direction 
Step#       s        X(mm)      Y(mm)      Z(mm)    N_x     N_y     N_z   Delta|N|   StepLen  StartSafety   PhsStep 
Step taken was -3.28232e-08 out of PhysicalStep= -1
Final safety is: 0.0538266
Chord length = 0.0638181

Error in advancing propagation.
        Point A (start) is  (  X= 960.758119 -686.715153 -1284.83137  P= -0.0304831592 0.019051108 -0.00890712698  Pmag= 0.0370338308 Ekin= 0.00134022636 l= 0.229092711115 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
        Point B (end)   is  (  X= 960.803786 -686.759263 -1284.82492  P= 0.0196695889 0.0709860047 -0.00882731746  Pmag= 0.0741877829 Ekin= 0.00535727826 l= 0.229092678292 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
        Curve distance is -3.28232e-08

The final curve point is not further along than the original!
 Value of fEpsStep= 0.01
 Point A (Curve start) is  (  X= 960.693644 -686.698994 -1284.79831  P= -0.0486781726 -0.0539783537 -0.00869678801  Pmag= 0.0732042436 Ekin= 0.00521688528 l= 0 m0= 0.510999 (Pdir-1)= 0 t_lab= 6.03425 t_proper= 0 PolV= (0,0,0)  ) 
 Point B (Curve   end)   is  (  X= 960.803786 -686.759263 -1284.82492  P= 0.0196695889 0.0709860047 -0.00882731746  Pmag= 0.0741877829 Ekin= 0.00535727826 l= 0.229092678292 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
 Point A (Current start) is  (  X= 960.758119 -686.715153 -1284.83137  P= -0.0304831592 0.019051108 -0.00890712698  Pmag= 0.0370338308 Ekin= 0.00134022636 l= 0.229092711115 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
 Point B (Current end)   is  (  X= 960.803786 -686.759263 -1284.82492  P= 0.0196695889 0.0709860047 -0.00882731746  Pmag= 0.0741877829 Ekin= 0.00535727826 l= 0.229092678292 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
 Point S (Sub start)     is  (  X= 960.772311 -686.748124 -1284.82197  P= 0.00702793245 0.0352431179 -0.00874740342  Pmag= 0.0369862983 Ekin= 0.00133679272 l= 0.189801080643 m0= 0.510999 (Pdir-1)= -1.11022e-16 t_lab= 0 t_proper= 0 PolV= (0,0,0)  )  Point E (Trial Point)   is (960.79725948202315067,-686.75295861891402183,-1284.8258373345900054)
 Point F (Intersection)  is  (  X= 960.758119 -686.715153 -1284.83137  P= -0.0304831592 0.019051108 -0.00890712698  Pmag= 0.0370338308 Ekin= 0.00134022636 l= 0.229092711115 m0= 0.510999 (Pdir-1)= 0 t_lab= 0 t_proper= 0 PolV= (0,0,0)  ) 
 LocateIntersection parameters are : 
      Substep no (total) = 4
      Substep (depth= 04
-------- EEEE -------- G4Exception-END --------- EEEE -------

%MSG
----- Begin Fatal Exception 03-Oct-2020 21:21:36 CEST-----------------------
An exception of category 'EventCorruption' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 13 stream: 0
   [1] Running path 'RECOSIMoutput_step'
   [2] Prefetching for module PoolOutputModule/'RECOSIMoutput'
   [3] Calling method for module OscarMTProducer/'g4SimHits'
Exception Message:
SimG4CoreApplication exception in generation of event run: 1 lumi: 1 event: 13 in stream 0 

This error did NOT occur in the "Test4" configuration with other parameters tightened, so maybe it was due to the mismatch, or just "luck".

In terms of physics performance, in a "deterministic" closure test with all random processes for muons turned off, I saw ONLY DeltaIntersection making a difference, between 5.5 GeV and 150GeV in pt within the tracker volume at eta of around 2.3-2.4

Plots of the bias vs q/pT on the last TEC layer, and vs z for muons with pT=150GeV:

Nominal settings:
hpt_nom
hz_nom

DeltaIntersection = 1e-5:
hpt_1en5
hz_1en5

DeltaIntersection = 1e-6:
hpt_1en6
hz_1en6

DeltaIntersection = 1e-7:
hpt_1en7

hz_1en7

@bendavid
Copy link
Contributor

bendavid commented Oct 5, 2020

I should also add that "Test2", "Test3", and "Test4" configurations here have been tested with several million Z->mu mu events each without provoking any of the EstimateIntersectionPoint errors.

@cmsbuild
Copy link
Contributor

Pull request #31665 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again.

@civanch
Copy link
Contributor Author

civanch commented Oct 14, 2020

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 14, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+1
Tested at: d89060d
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-dd3610/9941/summary.html
CMSSW: CMSSW_11_2_X_2020-10-13-2300
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2543752
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2543729
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

@civanch
Copy link
Contributor Author

civanch commented Oct 14, 2020

+1

history change in previous version of this PR is understood.

@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 will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 242ecd0 into cms-sw:master Oct 14, 2020
@civanch civanch changed the title Added extar parameters for Geant4 tracking in field Added extra parameters for Geant4 tracking in field Nov 9, 2020
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

4 participants