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

Close by gun generator #26065

Merged
merged 7 commits into from Mar 14, 2019
Merged

Close by gun generator #26065

merged 7 commits into from Mar 14, 2019

Conversation

rovere
Copy link
Contributor

@rovere rovere commented Mar 5, 2019

This PR introduces a new ParticleGunGenerator that is capable of creating several vertices located at the specified (R,Z), with Z fixed and evenly spacing along R all the requested particles.
Particles can be produced parallel to the beamline or pointing towards (0,0,0).
The vertices are assigned the time required to travel from (0,0,0) to the desired location.
An accompanying PassThrough Event Vertex Generator has been added in order to copy-paste everything w/o any additional smearing on any vertex.
This generator has been extremely useful to perform clustering studies for the HGCAL detector (See, e.g. these slides

A new particle gun has been added that supports the creation of particle
guns located in 3D space. In particular the new module will take as
input the Z location and the R radius over which the particles will be
produced (one particle at one different vertex), equally spaced by
DeltaR, again a parameter of the new module. DeltaR is, in fact, the
arc-distance between two consecutive vertices over the circle of radius
R. A corresponding PassThrough Event Vertex Generator has been added: it
basically copy-paste the HepMC Event created by the upstream Particle
Gun module, without touching the vertices created before.
@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26065/8622

  • This PR adds an extra 24KB to repository

Code check has found code style and quality issues which could be resolved by applying a patch in https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26065/8622/git-diff.patch
e.g. curl https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26065/8622/git-diff.patch | patch -p1

You can run scram build code-checks to apply code checks directly

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26065/8624

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

A new Pull Request was created by @rovere (Marco Rovere) for master.

It involves the following packages:

IOMC/EventVertexGenerators
IOMC/ParticleGuns

@efeyazgan, @perrozzi, @civanch, @mdhildreth, @cmsbuild, @alberto-sanchez, @qliphy can you please review it and eventually sign? Thanks.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@efeyazgan
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/33412/console Started: 2019/03/05 14:40

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 5, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 6, 2019

Pull request #26065 was updated. @efeyazgan, @perrozzi, @civanch, @mdhildreth, @cmsbuild, @alberto-sanchez, @qliphy can you please check and sign again.

@alberto-sanchez
Copy link
Member

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 6, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/33439/console Started: 2019/03/06 17:14

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 6, 2019

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 6, 2019

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 6, 2019

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 5 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3114826
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3114628
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

@alberto-sanchez
Copy link
Member

+1

double x=fR*cos(phi);
double y=fR*sin(phi);
constexpr double c= 2.99792458e+1; // cm/ns
double timeOffset = sqrt(x*x + y*y + fZ*fZ)/c*ns*c_light;
Copy link
Contributor

Choose a reason for hiding this comment

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

@rovere , I would expect here CMS units (cm, GeV, ns)? In that case of CLHEP (mm, MeV, ns) should not be used.
Having in one expression both your constant "c" and CLHEP "c_light" seems to be a problem.

To resolve this I would put a comment line about fX, fX, fZ unit, and select one or another.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used CMS units for the configuration parameters, namely cm, GeV and ns. Then I compute the timing in ns using CMS units and the "correct" c value and convert it back to whatever CLHEP/hepmc is expecting. Finally, I put back also x,y,fZ back to units that are digested by HepMC.
I have to admit that this mix of units is, to put it mildly, quite ugly and confusing, I agree, but it's not coming from this code but rather imposed from externals.
By the way, I think you will find the same kind of "units massaging" also in other Generators.

@civanch
Copy link
Contributor

civanch commented Mar 7, 2019

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 7, 2019

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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

}

HepMC::FourVector PassThroughEvtVtxGenerator::newVertex(CLHEP::HepRandomEngine*) const {
return HepMC::FourVector(0.,0.,0.);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you assume the implicit time=0 of the class, one could even set it explicitly to 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I could change it into

return HepMC::FourVector(0.,0.,0.,0.);

return HepMC::FourVector(0.,0.,0.);
}

void PassThroughEvtVtxGenerator::produce( Event& evt, const EventSetup& )
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the purpose of not using the base class as elsewhere? To avoid the dummy LorentzBoost with a copy-only method I understand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, not sure if that will gain anything, but that's what I did.

fDelta = pgun_params.getParameter<double>("Delta");
fPartIDs = pgun_params.getParameter< vector<int> >("PartID");
fPointing = pgun_params.getParameter<bool>("Pointing");

Copy link
Contributor

Choose a reason for hiding this comment

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

do you have an example configuration fragment usable for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have, since I already privately used it extensively. Would like me to put the snippet somewhere in this package? If so, where exactly?

This is an example:

process.generator = cms.EDProducer("CloseByParticleGunProducer",
                                   PGunParameters = cms.PSet(PartID = cms.vint32(22, 22),
                                                             En = cms.double(50.),
                                                             R = cms.double(60),
                                                             Z = cms.double(320),
                                                             Delta = cms.double(2.5),
                                                             Pointing = cms.bool(True),
                                                             MaxEta = cms.double(2.9),
                                                             MaxPhi = cms.double(3.14159265359/6.),
                                                             MinEta = cms.double(1.5),
                                                             MinPhi = cms.double(-3.14159265359/6.),
                                                             ),
                                   Verbosity = cms.untracked.int32(10),
                                   psethack = cms.string('two close by particles'),
                                   AddAntiParticle = cms.bool(False),
                                   firstRun = cms.untracked.uint32(1)
                                   )

Copy link
Contributor

Choose a reason for hiding this comment

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

We normally store these default fragments in Configuration/Generator/python , where they may be used for instance by RelVals .

@fabiocos
Copy link
Contributor

+1

a possible addition of a configuration example may be managed later

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

6 participants