#ifndef COMPTONSPECTRUM
#define COMPTONSPECTRUM

#include "TH1F.h"

class spectrum
{
public:
  spectrum(double initialEnergy = 0, double resolution = 0);
  void setNumberOfEvents(const int events);
  virtual TH1F* getHisto();
  virtual void generateEvents();
protected:
  double fInitialEnergy = 0;
  double fResolution = 0;
  int fEvents = 0;
  std::vector<double> fSimEvents;
};

#endif //COMPTONSPECTRUM
#ifndef COMPTONSPECTRUM
#define COMPTONSPECTRUM

#include "TH1F.h"

class spectrum
{
public:
  spectrum(double initialEnergy, double resolution);
  void setNumberOfEvents(const int events);
  virtual TH1F* getHisto();
  virtual void generateEvents();
protected:
  double fInitialEnergy;
  double fResolution;
  int fEvents;
  std::vector<double> fSimEvents;
};

#endif //COMPTONSPECTRUM
--- 
+++ 
@@ -6,14 +6,14 @@
 class spectrum
 {
 public:
-  spectrum(double initialEnergy, double resolution);
+  spectrum(double initialEnergy = 0, double resolution = 0);
   void setNumberOfEvents(const int events);
   virtual TH1F* getHisto();
   virtual void generateEvents();
 protected:
-  double fInitialEnergy;
-  double fResolution;
-  int fEvents;
+  double fInitialEnergy = 0;
+  double fResolution = 0;
+  int fEvents = 0;
   std::vector<double> fSimEvents;
 };
 
Add default values of variables
