//In the header file "PrimaryGeneratorAction.hh": #include "PrimaryGeneratorActionMessenger.hh" private: PrimaryGeneratorActionMessenger* fMessenger; G4int fMyVAR; public: void SetMethod(G4int ival) {fMyVAR = ival;}; //In the constructor of the src file "PrimaryGeneratorAction.cc": fMessenger = new PrimaryGeneratorActionMessenger(this); /gun/setGPS true