diff --git a/r3bgen/R3BAsciiGenerator.cxx b/r3bgen/R3BAsciiGenerator.cxx index 2bae7f55a..1f804e7fc 100644 --- a/r3bgen/R3BAsciiGenerator.cxx +++ b/r3bgen/R3BAsciiGenerator.cxx @@ -30,30 +30,14 @@ R3BAsciiGenerator::R3BAsciiGenerator() , fFile() , fBuf() , fInput(&fBuf) - , fX(0.) - , fY(0.) - , fZ(0.) - , fPointVtxIsSet(false) - , fDX(0.) - , fDY(0.) - , fDZ(0.) - , fBoxVtxIsSet(false) { } -R3BAsciiGenerator::R3BAsciiGenerator(std::string fileName) +R3BAsciiGenerator::R3BAsciiGenerator(const std::string& fileName) : fFileName(std::move(fileName)) , fFile() , fBuf() , fInput(&fBuf) - , fX(0.) - , fY(0.) - , fZ(0.) - , fPointVtxIsSet(false) - , fDX(0.) - , fDY(0.) - , fDZ(0.) - , fBoxVtxIsSet(false) { RegisterIons(); } @@ -68,8 +52,6 @@ R3BAsciiGenerator::R3BAsciiGenerator(const char* fileName) { } -R3BAsciiGenerator::~R3BAsciiGenerator() {} - bool R3BAsciiGenerator::ReadEvent(FairPrimaryGenerator* primGen) { // Event variable to be read from file @@ -265,4 +247,4 @@ void R3BAsciiGenerator::OpenOrRewindFile() } } -ClassImp(R3BAsciiGenerator); +ClassImp(R3BAsciiGenerator) diff --git a/r3bgen/R3BAsciiGenerator.h b/r3bgen/R3BAsciiGenerator.h index 8c13f0e6d..648253e7c 100644 --- a/r3bgen/R3BAsciiGenerator.h +++ b/r3bgen/R3BAsciiGenerator.h @@ -32,12 +32,12 @@ class R3BAsciiGenerator : public FairGenerator /** Standard constructor. ** @param fileName The input file name **/ - explicit R3BAsciiGenerator(std::string fileName); + explicit R3BAsciiGenerator(const std::string& fileName); explicit R3BAsciiGenerator(const TString& fileName); explicit R3BAsciiGenerator(const char* fileName); // for old macros - /** Destructor. **/ - ~R3BAsciiGenerator() override; + // Destructor virtual + virtual ~R3BAsciiGenerator() = default; /** Reads on event from the input file and pushes the tracks onto ** the stack. Abstract method in base class. @@ -61,10 +61,11 @@ class R3BAsciiGenerator : public FairGenerator void OpenOrRewindFile(); - Double32_t fX, fY, fZ; // Point vertex coordinates [cm] - bool fPointVtxIsSet; // True if point vertex is set - Double32_t fDX, fDY, fDZ; // Point vertex coordinates [cm] - bool fBoxVtxIsSet; // True if point vertex is set + Double32_t fX = 0., fY = 0., fZ = 0.; // Point vertex coordinates [cm] + bool fPointVtxIsSet = false; // True if point vertex is set + Double32_t fDX = 0., fDY = 0., fDZ = 0.; // Point vertex coordinates [cm] + bool fBoxVtxIsSet = false; // True if point vertex is set - ClassDefOverride(R3BAsciiGenerator, 0); + public: + ClassDefOverride(R3BAsciiGenerator, 0); // NOLINT }; diff --git a/r3bgen/R3BCALIFATestGenerator.cxx b/r3bgen/R3BCALIFATestGenerator.cxx index 449483a25..956ab726b 100644 --- a/r3bgen/R3BCALIFATestGenerator.cxx +++ b/r3bgen/R3BCALIFATestGenerator.cxx @@ -12,54 +12,20 @@ ******************************************************************************/ #include "R3BCALIFATestGenerator.h" +#include "R3BLogger.h" -#include "FairLogger.h" -#include "FairPrimaryGenerator.h" +#include -#include "TDatabasePDG.h" -#include "TMath.h" -#include "TParticlePDG.h" -#include "TRandom.h" +#include +#include +#include +#include +#include +#include +#include R3BCALIFATestGenerator::R3BCALIFATestGenerator() - : fPDGType(0) - , fMult(0) - , fPDGMass(0) - , fPtMin(0) - , fPtMax(0) - , fPhiMin(0) - , fPhiMax(0) - , fEtaMin(0) - , fEtaMax(0) - , fYMin(0) - , fYMax(0) - , fPMin(0) - , fPMax(0) - , fThetaMin(0) - , fThetaMax(0) - , fX(0) - , fY(0) - , fZ(0) - , fX1(0) - , fY1(0) - , fZ1(0) - , fX2(0) - , fY2(0) - , fZ2(0) - , fEtaRangeIsSet(0) - , fYRangeIsSet(0) - , fThetaRangeIsSet(0) - , fCosThetaIsSet(0) - , fPtRangeIsSet(0) - , fPRangeIsSet(0) - , fPointVtxIsSet(0) - , fBoxVtxIsSet(0) - , fDebug(0) - , fGammasDefinedInNuclearDecay(0) - , fBetaOfEmittingFragment(0) - , fGammaFactor(1) - , fLorentzBoostIsSet(0) - , fNuclearDecayChainIsSet(0) + : R3BCALIFATestGenerator(22, 1) { // Default constructor } @@ -111,38 +77,33 @@ R3BCALIFATestGenerator::R3BCALIFATestGenerator(Int_t pdgid, Int_t mult) Bool_t R3BCALIFATestGenerator::Init() { // Initialize generator - - if (fPhiMax - fPhiMin > 360) - LOG(fatal) << "Init(): R3BCALIFATestGenerator: phi range is too wide: " << fPhiMin << " 360, "phi range is too wide: " << fPhiMin << " 1) - LOG(fatal) << "Init(): R3BCALIFATestGenerator: beta of fragment larger than 1!"; + R3BLOG_IF(fatal, fBetaOfEmittingFragment > 1, "beta of fragment larger than 1!"); Double32_t sumBranchingRatios = 0; for (Int_t i = 0; i < fGammasDefinedInNuclearDecay; i++) { if (fGammaBranchingRatios[i] > 1) - LOG(fatal) << "Init(): R3BCALIFATestGenerator: gamma branching ratio in position " << i - << " larger than 1!"; + { + R3BLOG(fatal, "gamma branching ratio in position " << i << " larger than 1!"); + } sumBranchingRatios += fGammaBranchingRatios[i]; } - if (sumBranchingRatios > 1) - LOG(fatal) << "Init(): R3BCALIFATestGenerator: gamma branching ratio sum larger than 1!"; + R3BLOG_IF(fatal, sumBranchingRatios > 1, "gamma branching ratio sum larger than 1!"); // Check for particle type TDatabasePDG* pdgBase = TDatabasePDG::Instance(); TParticlePDG* particle = pdgBase->GetParticle(fPDGType); - if (!particle) - LOG(fatal) << "R3BCALIFATestGenerator: PDG code " << fPDGType << " not defined."; + R3BLOG_IF(fatal, !particle, "PDG code " << fPDGType << " not defined."); fPDGMass = particle->Mass(); return kTRUE; } @@ -157,7 +118,7 @@ Bool_t R3BCALIFATestGenerator::ReadEvent(FairPrimaryGenerator* primGen) Double32_t pabs = 0, phi, pt = 0, theta = 0, eta, y, mt, px, py, pz = 0; Double32_t br = 0; - Bool_t doNotBoost = 0; + bool doNotBoost = false; // Generate particles for (Int_t k = 0; k < fMult; k++) @@ -211,8 +172,7 @@ Bool_t R3BCALIFATestGenerator::ReadEvent(FairPrimaryGenerator* primGen) if (fNuclearDecayChainIsSet) { - if (fPDGType != 22) - LOG(fatal) << "R3BCALIFATestGenerator: PDG code " << fPDGType << " is not a gamma!"; + LOG_IF(fatal, fPDGType != 22) << "PDG code " << fPDGType << " is not a gamma!"; br = gRandom->Uniform(); for (Int_t i = 0; i < fGammasDefinedInNuclearDecay; i++) { @@ -226,7 +186,7 @@ Bool_t R3BCALIFATestGenerator::ReadEvent(FairPrimaryGenerator* primGen) } } // if Sum(branchingRatios)<1, the leftover probability (up to 1) is defined as environmental noise - doNotBoost = 1; + doNotBoost = true; } /* if (fLorentzBoostIsSet && !doNotBoost){ @@ -256,24 +216,24 @@ Bool_t R3BCALIFATestGenerator::ReadEvent(FairPrimaryGenerator* primGen) } if (fDebug) - printf("CALIFATestGen: kf=%d, p=(%.2f, %.2f, %.2f) GeV, x=(%.1f, %.1f, %.1f) cm\n", - fPDGType, - px, - py, - pz, - fX, - fY, - fZ); + { + std::ostringstream oss; + oss << "CALIFATestGen: kf=" << fPDGType << ", p=(" << std::fixed << std::setprecision(2) << px << ", " << py + << ", " << pz << ") GeV" + << ", x=(" << std::setprecision(1) << fX << ", " << fY << ", " << fZ << ") cm"; + std::cout << oss.str() << std::endl; + } primGen->AddTrack(fPDGType, px, py, pz, fX, fY, fZ); } return kTRUE; } -void R3BCALIFATestGenerator::SetFragmentVelocity(Double32_t beta) +void R3BCALIFATestGenerator::SetFragmentVelocity(double beta, double dispersion) { // Sets the velocity and gamma factor of the fragment emitting the gammas - fBetaOfEmittingFragment = beta; + R3BLOG(info, "Set a beta of " << beta << " with a sigma dispersion of " << dispersion); + fBetaOfEmittingFragment = gRandom->Gaus(beta, dispersion); fGammaFactor = TMath::Sqrt(1 - fBetaOfEmittingFragment * fBetaOfEmittingFragment); } @@ -283,7 +243,9 @@ void R3BCALIFATestGenerator::SetDecayChainPoint(Double32_t gammaEnergy, Double32 // // if (fGammasDefinedInNuclearDecay > 7) - printf("CALIFATestGen: Maximum number (8) of gammas defined in the chain\n"); + { + R3BLOG(error, "Maximum number (8) of gammas defined in the chain\n"); + } else { fGammaEnergies[fGammasDefinedInNuclearDecay] = gammaEnergy; @@ -291,5 +253,4 @@ void R3BCALIFATestGenerator::SetDecayChainPoint(Double32_t gammaEnergy, Double32 fGammasDefinedInNuclearDecay++; } } - ClassImp(R3BCALIFATestGenerator) diff --git a/r3bgen/R3BCALIFATestGenerator.h b/r3bgen/R3BCALIFATestGenerator.h index 5d9b6e57b..b7fe08791 100644 --- a/r3bgen/R3BCALIFATestGenerator.h +++ b/r3bgen/R3BCALIFATestGenerator.h @@ -20,10 +20,9 @@ * Derived from FairGenerator. **/ -#ifndef FAIR_CALIFATESTGENERATOR_H -#define FAIR_CALIFATESTGENERATOR_H +#pragma once -#include "FairGenerator.h" +#include #include @@ -32,7 +31,7 @@ class FairPrimaryGenerator; class R3BCALIFATestGenerator : public FairGenerator { public: - /** Default constructor. **/ + // Default constructor R3BCALIFATestGenerator(); /** Constructor with PDG-ID, multiplicity @@ -41,10 +40,10 @@ class R3BCALIFATestGenerator : public FairGenerator **/ R3BCALIFATestGenerator(Int_t pdgid, Int_t mult = 1); - /** Destructor **/ - virtual ~R3BCALIFATestGenerator(){}; + // Destructor + virtual ~R3BCALIFATestGenerator() = default; - /** Modifiers **/ + // Modifiers void SetPDGType(Int_t pdg) { fPDGType = pdg; }; void SetMultiplicity(Int_t mult) { fMult = mult; }; @@ -83,7 +82,7 @@ class R3BCALIFATestGenerator : public FairGenerator fYRangeIsSet = kTRUE; }; - void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 90) + void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 180) { fThetaMin = thetamin; fThetaMax = thetamax; @@ -124,19 +123,19 @@ class R3BCALIFATestGenerator : public FairGenerator fLorentzBoostIsSet = kTRUE; }; - void SetFragmentVelocity(Double32_t beta = 0); + void SetFragmentVelocity(double beta = 0., double dispersion = 0.); void SetNuclearDecayChain() { fNuclearDecayChainIsSet = kTRUE; }; void SetDecayChainPoint(Double32_t gammaEnergy = 0, Double32_t branchingRatio = 0); /** Initializer **/ - virtual Bool_t Init(); + Bool_t Init() override; /** Creates an event with given type and multiplicity. - **@param primGen pointer to the FairPrimaryGenerator + **@param primGen pointer to the FairPrimaryGenerator **/ - virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen); + Bool_t ReadEvent(FairPrimaryGenerator* primGen) override; private: Int_t fPDGType; // Particle type (PDG encoding) @@ -167,13 +166,12 @@ class R3BCALIFATestGenerator : public FairGenerator Double32_t fGammaEnergies[8]; // Gamma energies for the nuclear decay chain [GeV] TEST UNITS! Double32_t fGammaBranchingRatios[8]; // Gamma branching ratios for the nuclear decay chain Int_t fGammasDefinedInNuclearDecay; // Number of gammas defined (max 8) - Double32_t fBetaOfEmittingFragment; // Velocity of the fragment emitting the gammas - Double32_t fGammaFactor; // Velocity of the fragment emitting the gammas + double fBetaOfEmittingFragment; // Velocity of the fragment emitting the gammas + double fGammaFactor; // Velocity of the fragment emitting the gammas Bool_t fLorentzBoostIsSet; // True if Lorentz Boost is set Bool_t fNuclearDecayChainIsSet; // True if a nuclear decay chain is set - ClassDef(R3BCALIFATestGenerator, 1); + public: + ClassDefOverride(R3BCALIFATestGenerator, 1); // NOLINT }; - -#endif diff --git a/r3bgen/R3BCosmicGenerator.h b/r3bgen/R3BCosmicGenerator.h index c95b69a5c..410c070c9 100644 --- a/r3bgen/R3BCosmicGenerator.h +++ b/r3bgen/R3BCosmicGenerator.h @@ -25,14 +25,13 @@ * Derived from R3BGenerator. **/ -#ifndef R3B_COSMICGENERATOR_H -#define R3B_COSMICGENERATOR_H +#pragma once #include "R3BDistribution.h" -#include "FairGenerator.h" +#include -#include "TRandom3.h" +#include #include @@ -77,7 +76,6 @@ class R3BCosmicGenerator : public FairGenerator Double_t fPDGMass; // Particle mass [GeV] - ClassDefOverride(R3BCosmicGenerator, 2) + public: + ClassDefOverride(R3BCosmicGenerator, 2); }; - -#endif diff --git a/r3bgen/R3BCryAsciiGenerator.cxx b/r3bgen/R3BCryAsciiGenerator.cxx index 3ce0a8f0d..c74bb301f 100644 --- a/r3bgen/R3BCryAsciiGenerator.cxx +++ b/r3bgen/R3BCryAsciiGenerator.cxx @@ -32,13 +32,11 @@ using namespace std; R3BCryAsciiGenerator::R3BCryAsciiGenerator() : fFileName() - , fTopDist(0.0) { } -R3BCryAsciiGenerator::R3BCryAsciiGenerator(std::string fileName) +R3BCryAsciiGenerator::R3BCryAsciiGenerator(const std::string& fileName) : fFileName(std::move(fileName)) - , fTopDist(0.0) { infile.open(fileName); if (!infile.is_open()) diff --git a/r3bgen/R3BCryAsciiGenerator.h b/r3bgen/R3BCryAsciiGenerator.h index cddbf444b..868e65d4e 100644 --- a/r3bgen/R3BCryAsciiGenerator.h +++ b/r3bgen/R3BCryAsciiGenerator.h @@ -18,11 +18,10 @@ // ----- https://nuclear.llnl.gov/simulation/ ----- // ------------------------------------------------------------------------- -#ifndef R3BCryAsciiGenerator_H -#define R3BCryAsciiGenerator_H 1 +#pragma once -#include "FairGenerator.h" -#include "TString.h" +#include +#include #include #include #include @@ -40,7 +39,7 @@ class R3BCryAsciiGenerator : public FairGenerator /** Standard constructor. ** @param fileName The input file name **/ - explicit R3BCryAsciiGenerator(std::string fileName); + explicit R3BCryAsciiGenerator(const std::string& fileName); explicit R3BCryAsciiGenerator(const TString& fileName); explicit R3BCryAsciiGenerator(const char* fileName); @@ -59,13 +58,12 @@ class R3BCryAsciiGenerator : public FairGenerator private: TString fFileName; ifstream infile; - float fTopDist; // Origin of cosmic rays in the Y-coordinate + float fTopDist = 0.; // Origin of cosmic rays in the Y-coordinate /** Private method CloseInput. Closes the input file properly. ** Called from destructor and from ReadEvent. **/ void CloseInput(); + public: ClassDefOverride(R3BCryAsciiGenerator, 0); }; - -#endif diff --git a/r3bgen/R3BINCLRootGenerator.cxx b/r3bgen/R3BINCLRootGenerator.cxx index f69865a39..e0b4dfcee 100644 --- a/r3bgen/R3BINCLRootGenerator.cxx +++ b/r3bgen/R3BINCLRootGenerator.cxx @@ -13,7 +13,6 @@ #include "R3BINCLRootGenerator.h" #include "FairIon.h" -#include "FairLogger.h" #include "FairPrimaryGenerator.h" #include "FairRunSim.h" #include "G4NistManager.hh" @@ -22,38 +21,12 @@ #include "TRandom.h" R3BINCLRootGenerator::R3BINCLRootGenerator() - : fFileName() - , fX(0.) - , fY(0.) - , fZ(0.) - , fPointVtxIsSet(kFALSE) - , fDX(0.) - , fDY(0.) - , fDZ(0.) - , fBoxVtxIsSet(kFALSE) - , fOnlySpallation(kFALSE) - , fOnlyP2pFission(kFALSE) - , fOnlyFission(kFALSE) - , fEvtRoot(0) - , fEvt(0) { + R3BLOG(fatal, "This event generator must be used with an INCL ROOT file"); } -R3BINCLRootGenerator::R3BINCLRootGenerator(std::string fileName) +R3BINCLRootGenerator::R3BINCLRootGenerator(const std::string& fileName) : fFileName(std::move(fileName)) - , fX(0.) - , fY(0.) - , fZ(0.) - , fPointVtxIsSet(kFALSE) - , fDX(0.) - , fDY(0.) - , fDZ(0.) - , fBoxVtxIsSet(kFALSE) - , fOnlySpallation(kFALSE) - , fOnlyP2pFission(kFALSE) - , fOnlyFission(kFALSE) - , fEvtRoot(0) - , fEvt(0) { RegisterIons(); } @@ -233,7 +206,7 @@ void R3BINCLRootGenerator::RegisterIons() if (ions.find(pdg) == ions.end()) { const Double_t mass = G4NistManager::Instance()->GetIsotopeMass(iZ, iA) / CLHEP::GeV; - LOG(debug) << "R3BINCLRootGenerator: New ion " << iZ << "\t" << iA << "\t" << mass; + R3BLOG(debug, "New ion " << iZ << "\t" << iA << "\t" << mass); ions[pdg] = new FairIon(TString::Format("Ion_%d_%d", iA, iZ), iZ, iA, iZ, 0., mass); } } @@ -263,4 +236,4 @@ void R3BINCLRootGenerator::SetDxDyDz(Double32_t sx, Double32_t sy, Double32_t sz fBoxVtxIsSet = kTRUE; } -ClassImp(R3BINCLRootGenerator); +ClassImp(R3BINCLRootGenerator) diff --git a/r3bgen/R3BINCLRootGenerator.h b/r3bgen/R3BINCLRootGenerator.h index 46bde4001..a8297aa4a 100644 --- a/r3bgen/R3BINCLRootGenerator.h +++ b/r3bgen/R3BINCLRootGenerator.h @@ -28,17 +28,17 @@ class FairPrimaryGenerator; class R3BINCLRootGenerator : public FairGenerator { public: - /** Default constructor without arguments should not be used. **/ + /// Default constructor without arguments should not be used R3BINCLRootGenerator(); /** Standard constructor. ** @param fileName The input file name **/ - explicit R3BINCLRootGenerator(std::string fileName); + explicit R3BINCLRootGenerator(const std::string& fileName); explicit R3BINCLRootGenerator(const TString& fileName); explicit R3BINCLRootGenerator(const char* fileName); // for old macros - /** Destructor. **/ + // Destructor ~R3BINCLRootGenerator() override; /** Reads on event from the input file and pushes the tracks onto @@ -62,24 +62,24 @@ class R3BINCLRootGenerator : public FairGenerator /** ** Method to simulate only fission events **/ - void SetOnlyFission(Bool_t Opt = true) { fOnlyFission = Opt; } + void SetOnlyFission(bool Opt = true) { fOnlyFission = Opt; } /** ** Method to simulate only spallation events **/ - void SetOnlySpallation(Bool_t Opt = true) { fOnlySpallation = Opt; } + void SetOnlySpallation(bool Opt = true) { fOnlySpallation = Opt; } /** ** Method to simulate only p2p-fission events **/ - void SetOnlyP2pFission(Bool_t Opt = true) { fOnlyP2pFission = Opt; } + void SetOnlyP2pFission(bool Opt = true) { fOnlyP2pFission = Opt; } private: TString fFileName; // Input file name TFile* fInput; - Bool_t fOnlyFission; // True if we want to simulate only fission events - Bool_t fOnlyP2pFission; // True if we want to simulate only p2p-fission events - Bool_t fOnlySpallation; // True if we want to simulate only spallation events + bool fOnlyFission = false; // True if we want to simulate only fission events + bool fOnlyP2pFission = false; // True if we want to simulate only p2p-fission events + bool fOnlySpallation = false; // True if we want to simulate only spallation events /** Private method RegisterIons. Goes through the input file and registers ** any ion needed. TODO: Should not be needed by FairRoot. **/ @@ -87,9 +87,9 @@ class R3BINCLRootGenerator : public FairGenerator inline Int_t GetIonPdgId(int z, int a) { return 1000000000 + 10000 * z + 10 * a; } - Int_t fEvt; + Int_t fEvt = 0; TTree* Tree; - Int_t fEvtRoot; + Int_t fEvtRoot = 0; Short_t fParticles; Short_t fOrigin[160]; Short_t fMass[160]; @@ -99,10 +99,11 @@ class R3BINCLRootGenerator : public FairGenerator Float_t fThetaPrime[160]; Float_t fPhi[160]; - Double32_t fX, fY, fZ; // Point vertex coordinates [cm] - Bool_t fPointVtxIsSet; // True if point vertex is set - Double32_t fDX, fDY, fDZ; // Point vertex coordinates [cm] - Bool_t fBoxVtxIsSet; // True if point vertex is set + Double32_t fX = 0., fY = 0., fZ = 0.; // Point vertex coordinates [cm] + bool fPointVtxIsSet = false; // True if point vertex is set + Double32_t fDX = 0., fDY = 0., fDZ = 0.; // Point vertex coordinates [cm] + bool fBoxVtxIsSet = false; // True if point vertex is set - ClassDefOverride(R3BINCLRootGenerator, 0); + public: + ClassDefOverride(R3BINCLRootGenerator, 0); // NOLINT }; diff --git a/r3bgen/R3Bp2pevtGenerator.cxx b/r3bgen/R3Bp2pevtGenerator.cxx index c942c1218..01940d3ef 100644 --- a/r3bgen/R3Bp2pevtGenerator.cxx +++ b/r3bgen/R3Bp2pevtGenerator.cxx @@ -81,7 +81,7 @@ void R3Bp2pevtGenerator::SetMomDistrib(double mom) return; } -void R3Bp2pevtGenerator::Print() +void R3Bp2pevtGenerator::PrintInfo() { cout << "***** Print generator values *****" << endl; cout << "Energy: \t" << ENERGY << endl; @@ -111,7 +111,7 @@ Bool_t R3Bp2pevtGenerator::ReadEvent(FairPrimaryGenerator* primGen) // gRandom->SetSeed(0);//using computer time // TRandom2 r1; // r1.SetSeed(0); - R3Bp2pevtGenerator::Print(); + R3Bp2pevtGenerator::PrintInfo(); bool evt = false; if (INVERSE) { diff --git a/r3bgen/R3Bp2pevtGenerator.h b/r3bgen/R3Bp2pevtGenerator.h index f85790d3e..bc2be8ec4 100644 --- a/r3bgen/R3Bp2pevtGenerator.h +++ b/r3bgen/R3Bp2pevtGenerator.h @@ -18,8 +18,7 @@ * Author: gu92joq */ -#ifndef R3BP2PEVTGENERATOR_H_ -#define R3BP2PEVTGENERATOR_H_ +#pragma once #include #include @@ -55,10 +54,13 @@ class R3Bp2pevtGenerator : public FairGenerator // R3Bp2pevtGenerator() : FairGenerator("R3Bp2pevtGenerator", "R3Bp2pevtGenerator") {} // R3Bp2pevtGenerator(const char *name, const char *title) : FairGenerator(name, title) {} R3Bp2pevtGenerator(); - ~R3Bp2pevtGenerator(){}; - virtual Bool_t Init(); - virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen); + // Destructor virtual + virtual ~R3Bp2pevtGenerator() = default; + + Bool_t Init() override; + Bool_t ReadEvent(FairPrimaryGenerator* primGen) override; + void SetHeavyNucleus(int A, double M_def, double M_res); // Set Mass of heavy nucleus and Mass Defect void SetInverse(bool inverse); // Set Inverse or direct kinematics void SetIsotropic(bool isotropic); // Set Isotropic or parametric cross section for proton emission @@ -66,7 +68,7 @@ class R3Bp2pevtGenerator : public FairGenerator void SetExcitation(double exe); // Set Excitation energy void SetLightNucleus(double ma, double mi); // Set Incoming outgoing particle mass void SetBeamEnergy(double E); - void Print(); + void PrintInfo(); protected: /** @@ -92,7 +94,6 @@ class R3Bp2pevtGenerator : public FairGenerator std::pair Lorentz(double, double, double, double); void SetValues(double E, int A, double MOM, double exe, bool invert, bool iso); - ClassDef(R3Bp2pevtGenerator, 1); + public: + ClassDefOverride(R3Bp2pevtGenerator, 1); // NOLINT }; - -#endif