#ifndef FlatRandomPtAndDxyGunProducer_H
#define FlatRandomPtAndDxyGunProducer_H

/** \class FlatRandomPtAndDxyGunProducer
 *
 * Generates single particle gun in HepMC format
 * The d0 is taken by convention equal to dxy
 * v1: first version of displaced Muon Gun
 * flat in dxy(0, 50), flat in lz(-50, 50)
 * v2: bugfixed, unit in HepMC is mm, rather than cm
 * v3: check pz*vz>0, make sure muon is not flying 
 * back to beamspot, Lz is generated by Gauss distribution
 * v4: dxy is produced with sign, (-500, 500) [mm]
 * v5: check vx*px+vy*py>0, and muons inside beamline-symmetric 
 * cone is vetoed by lxy^2/c^2<=(vz-d) ^2 && vz-d>0

 * Contact Sven Dildick, Tao Huang
 ***************************************/

#include "IOMC/ParticleGuns/interface/BaseFlatGunProducer.h"

namespace edm {

  class FlatRandomPtAndDxyGunProducer : public BaseFlatGunProducer {
  public:
    FlatRandomPtAndDxyGunProducer(const ParameterSet& pset);
    ~FlatRandomPtAndDxyGunProducer() override;

    void produce(Event& e, const EventSetup& es) override;

  private:
    // data members

    double fMinPt;
    double fMaxPt;
    double dxyMin_;
    double dxyMax_;
    double lxyMax_;
    double lzMax_;
    double ConeRadius_;
    double ConeH_;
    double DistanceToAPEX_;
  };
}  // namespace edm

#endif
