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

allow LHEPrimaryGenerator to shift vertex away from the origin #1417

Open
tomeichlersmith opened this issue Aug 28, 2024 · 0 comments
Open
Labels
simcore SimCore and Geant4 simulation module

Comments

@tomeichlersmith
Copy link
Member

Is your feature request related to a problem? Please describe.
Some folks want to have their LHE events start somewhere besides the origin and they do not want to go through the hassle of rewriting their LHE files with our custom #vertex... syntax within each <event> block.

Describe the solution you'd like
Update the configuration to accept a 3- or 4-component position vector as the event vertex.

class lhe(simcfg.PrimaryGenerator) :
"""New LHE file primary generator
Parameters
----------
name : str
name of new primary generator
filePath : str
path to LHE file containing the primary vertices
"""
def __init__(self,name,filePath):
super().__init__(name,'simcore::generators::LHEPrimaryGenerator')
self.filePath = filePath

Apply this vertex as the new "origin" for the LHE events, applying the #vertex ... syntax relative to this value.

G4PrimaryVertex* vertex = new G4PrimaryVertex();
vertex->SetPosition(lheEvent->getVertex()[0], lheEvent->getVertex()[1],
lheEvent->getVertex()[2]);

While mucking about with the LHE generator, one could also look at resolving #1311 or even #1316 if you want to get really technical.

Describe alternatives you've considered
The main alternative is to develop a pre-processor that adds the #vertex ... into the <event> blocks. This could be done in Python and then included in a config, but I find that error prone and not "clean".

Additional context
Needed for studying ALPs @sophiemiddleton

@tomeichlersmith tomeichlersmith added the simcore SimCore and Geant4 simulation module label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simcore SimCore and Geant4 simulation module
Projects
None yet
Development

No branches or pull requests

1 participant