Skip to content

Commit

Permalink
Take Kevin's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Mar 9, 2020
1 parent 5fb8530 commit 2f5fb2c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions IOMC/ParticleGuns/src/BeamMomentumGunProducer.cc
@@ -1,5 +1,6 @@
#include "IOMC/ParticleGuns/interface/BeamMomentumGunProducer.h"

#include "DataFormats/Math/interface/deltaPhi.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"

Expand All @@ -13,7 +14,6 @@

#include "TFile.h"
#include <cmath>
#include <ostream>

namespace CLHEP {
class HepRandomEngine;
Expand Down Expand Up @@ -125,11 +125,7 @@ namespace edm {
double newtheta = ptheta + theta;
if (newtheta > M_PI && newtheta <= 2 * M_PI)
newtheta = 2 * M_PI - newtheta;
double newphi = pphi + phi;
if (newphi > M_PI && newphi <= 2 * M_PI)
newphi = -(2 * M_PI - newphi);
else if (newphi < -M_PI && newphi >= -2 * M_PI)
newphi = 2 * M_PI + newphi;
double newphi = reco::reduceRange(pphi + phi);
double px = mom * sin(newtheta) * cos(newphi);
double py = mom * sin(newtheta) * sin(newphi);
double pz = mom * cos(newtheta);
Expand Down

0 comments on commit 2f5fb2c

Please sign in to comment.