Skip to content

Commit

Permalink
Added time info to the displaced vertexes for muon guns
Browse files Browse the repository at this point in the history
  • Loading branch information
cericeci committed Apr 9, 2021
1 parent b128d10 commit 0795992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions IOMC/ParticleGuns/src/FlatRandomPtAndDxyGunProducer.cc
Expand Up @@ -109,7 +109,9 @@ void FlatRandomPtAndDxyGunProducer::produce(Event& e, const EventSetup& es) {
break;
}

HepMC::GenVertex* Vtx1 = new HepMC::GenVertex(HepMC::FourVector(vx, vy, vz));
float time = sqrt(vx * vx + vy * vy + vz * vz);

HepMC::GenVertex* Vtx1 = new HepMC::GenVertex(HepMC::FourVector(vx, vy, vz, time));

int PartID = fPartIDs[ip];
const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID(abs(PartID)));
Expand All @@ -124,7 +126,7 @@ void FlatRandomPtAndDxyGunProducer::produce(Event& e, const EventSetup& es) {
fEvt->add_vertex(Vtx1);

if (fAddAntiParticle) {
HepMC::GenVertex* Vtx2 = new HepMC::GenVertex(HepMC::FourVector(-vx, -vy, -vz));
HepMC::GenVertex* Vtx2 = new HepMC::GenVertex(HepMC::FourVector(-vx, -vy, -vz, time));
HepMC::FourVector ap(-px, -py, -pz, energy);
int APartID = -PartID;
if (PartID == 22 || PartID == 23) {
Expand Down

0 comments on commit 0795992

Please sign in to comment.