Import Geant4 11.3.0 source tree
This commit is contained in:
@@ -43,7 +43,7 @@ class G4BaseFileManager
|
||||
G4BaseFileManager() = delete;
|
||||
virtual ~G4BaseFileManager() = default;
|
||||
|
||||
void SetCompressionLevel(G4int level);
|
||||
virtual void SetCompressionLevel(G4int level);
|
||||
// Set the compression level
|
||||
virtual G4bool SetFileName(const G4String& fileName);
|
||||
// Set the base file name (without extension)
|
||||
|
||||
@@ -54,12 +54,7 @@ struct G4HnDimension
|
||||
}
|
||||
|
||||
G4HnDimension(const std::vector<G4double>& edges)
|
||||
: fNBins(0),
|
||||
fMinValue(0.),
|
||||
fMaxValue(0.),
|
||||
fEdges(edges)
|
||||
{}
|
||||
|
||||
: fEdges(edges) {}
|
||||
G4HnDimension() = default;
|
||||
G4HnDimension(const G4HnDimension& rhs) = default;
|
||||
G4HnDimension& operator=(const G4HnDimension& rhs) = default;
|
||||
|
||||
@@ -359,14 +359,14 @@ G4THnMessenger<DIM, HT>::CreateSetAxisCommand(unsigned int idim)
|
||||
G4String commandName = "set" + axis + "axis";
|
||||
G4String guidance = "Set " + axis + "-axis title for the ";;
|
||||
|
||||
auto command = CreateCommand(commandName, guidance);
|
||||
auto command = CreateCommand(std::move(commandName), guidance);
|
||||
command->AvailableForStates(G4State_PreInit, G4State_Idle);
|
||||
|
||||
// Add Id parameter
|
||||
AddIdParameter(*command);
|
||||
|
||||
auto parAxis = new G4UIparameter("axis", 's', false);
|
||||
guidance = GetObjectType() + " " + axis + "-axis title";
|
||||
guidance = GetObjectType() + " " + std::move(axis) + "-axis title";
|
||||
parAxis->SetGuidance(guidance.c_str());
|
||||
command->SetParameter(parAxis);
|
||||
|
||||
@@ -497,8 +497,8 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
|
||||
if ( command == fCreateCmd.get() ) {
|
||||
auto counter = 0;
|
||||
auto name = parameters[counter++];
|
||||
auto title = parameters[counter++];
|
||||
const auto& name = parameters[counter++];
|
||||
const auto& title = parameters[counter++];
|
||||
GetData(counter, parameters, bins, info);
|
||||
fManager->Create(name, title, bins, info);
|
||||
return;
|
||||
@@ -506,7 +506,7 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
|
||||
if ( command == fSetCmd.get() ) {
|
||||
auto counter = 0;
|
||||
auto id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
const auto& id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
GetData(counter, parameters, bins, info);
|
||||
fManager->Set(id, bins, info);
|
||||
return;
|
||||
@@ -514,16 +514,16 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
|
||||
if ( command == fDeleteCmd.get() ) {
|
||||
auto counter = 0;
|
||||
auto id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
auto keepSetting = G4UIcommand::ConvertToBool(parameters[counter++]);
|
||||
const auto& id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
const auto& keepSetting = G4UIcommand::ConvertToBool(parameters[counter++]);
|
||||
fManager->Delete(id, keepSetting);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( command == fSetTitleCmd.get() ) {
|
||||
auto counter = 0;
|
||||
auto id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
auto title = parameters[counter++];
|
||||
const auto& id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
const auto& title = parameters[counter++];
|
||||
fManager->SetTitle(id, title);
|
||||
return;
|
||||
}
|
||||
@@ -553,8 +553,8 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
|
||||
if ( command == fSetTitleCmd.get() ) {
|
||||
auto counter = 0;
|
||||
auto id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
auto title = parameters[counter++];
|
||||
const auto& id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
const auto& title = parameters[counter++];
|
||||
fManager->SetTitle(id, title);
|
||||
return;
|
||||
}
|
||||
@@ -563,8 +563,8 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
for (unsigned int idim = 0; idim < maxDim; ++idim) {
|
||||
if ( command == fSetAxisCmd[idim].get() ) {
|
||||
auto counter = 0;
|
||||
auto id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
auto axisTitle = parameters[counter++];
|
||||
const auto& id = G4UIcommand::ConvertToInt(parameters[counter++]);
|
||||
const auto& axisTitle = parameters[counter++];
|
||||
fManager->SetAxisTitle(idim, id, axisTitle);
|
||||
return;
|
||||
}
|
||||
@@ -577,7 +577,7 @@ void G4THnMessenger<DIM, HT>::SetNewValue(G4UIcommand* command, G4String newValu
|
||||
}
|
||||
|
||||
if ( command == fGetTCmd.get() ) {
|
||||
auto id = G4UIcommand::ConvertToInt(newValues);
|
||||
const auto& id = G4UIcommand::ConvertToInt(newValues);
|
||||
fTValue = GetTAddress(id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class G4THnToolsManager : public G4VTBaseHnManager<DIM>,
|
||||
|
||||
public:
|
||||
G4THnToolsManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4THnToolsManager() = default;
|
||||
~G4THnToolsManager() override = default;
|
||||
|
||||
// deleted copy constructor & assignment operator
|
||||
G4THnToolsManager(const G4THnToolsManager& rhs) = delete;
|
||||
@@ -70,40 +70,42 @@ class G4THnToolsManager : public G4VTBaseHnManager<DIM>,
|
||||
const std::array<G4HnDimension, DIM>& bins,
|
||||
const std::array<G4HnDimensionInformation, DIM>& hnInfo) override;
|
||||
|
||||
virtual G4bool Scale(G4int id, G4double factor) override;
|
||||
virtual G4int GetNofHns(G4bool onlyIfExist) const override;
|
||||
G4bool Scale(G4int id, G4double factor) override;
|
||||
G4int GetNofHns(G4bool onlyIfExist) const override;
|
||||
|
||||
// Methods to fill histograms
|
||||
virtual G4bool Fill(G4int id, std::array<G4double, DIM> value, G4double weight = 1.0) override;
|
||||
G4bool Fill(G4int id, std::array<G4double, DIM> value,
|
||||
G4double weight = 1.0) override;
|
||||
|
||||
// Access methods
|
||||
virtual G4int GetId(const G4String& name, G4bool warn = true) const override;
|
||||
G4int GetId(const G4String &name, G4bool warn = true) const override;
|
||||
|
||||
// Access to bins parameters
|
||||
virtual G4int GetNbins(unsigned int idim, G4int id) const override;
|
||||
virtual G4double GetMinValue(unsigned int idim, G4int id) const override;
|
||||
virtual G4double GetMaxValue(unsigned int idim, G4int id) const override;
|
||||
virtual G4double GetWidth(unsigned int idim, G4int id) const override;
|
||||
G4int GetNbins(unsigned int idim, G4int id) const override;
|
||||
G4double GetMinValue(unsigned int idim, G4int id) const override;
|
||||
G4double GetMaxValue(unsigned int idim, G4int id) const override;
|
||||
G4double GetWidth(unsigned int idim, G4int id) const override;
|
||||
|
||||
// Setters for attributes for plotting
|
||||
virtual G4bool SetTitle(G4int id, const G4String& title) override;
|
||||
virtual G4bool SetAxisTitle(unsigned int idim, G4int id, const G4String& title) override;
|
||||
G4bool SetTitle(G4int id, const G4String &title) override;
|
||||
G4bool SetAxisTitle(unsigned int idim, G4int id,
|
||||
const G4String &title) override;
|
||||
|
||||
// Access attributes for plotting
|
||||
virtual G4String GetTitle(G4int id) const override;
|
||||
virtual G4String GetAxisTitle(unsigned int idim, G4int id) const override;
|
||||
G4String GetTitle(G4int id) const override;
|
||||
G4String GetAxisTitle(unsigned int idim, G4int id) const override;
|
||||
|
||||
// Methods to list/print histograms
|
||||
virtual G4bool WriteOnAscii(std::ofstream& output) override;
|
||||
// Function with specialization per histo type
|
||||
virtual G4bool List(std::ostream& output, G4bool onlyIfActive = true) override;
|
||||
G4bool WriteOnAscii(std::ofstream &output) override;
|
||||
// Function with specialization per histo type
|
||||
G4bool List(std::ostream &output, G4bool onlyIfActive = true) override;
|
||||
|
||||
// Methods to delete selected histograms
|
||||
virtual G4bool Delete(G4int id, G4bool keepSetting) override;
|
||||
G4bool Delete(G4int id, G4bool keepSetting) override;
|
||||
|
||||
// // Access to Hn manager
|
||||
virtual std::shared_ptr<G4HnManager> GetHnManager() override;
|
||||
virtual const std::shared_ptr<G4HnManager> GetHnManager() const override;
|
||||
std::shared_ptr<G4HnManager> GetHnManager() override;
|
||||
const std::shared_ptr<G4HnManager> GetHnManager() const override;
|
||||
|
||||
protected:
|
||||
// Functions from base class
|
||||
|
||||
@@ -83,7 +83,7 @@ class G4TNtupleDescription
|
||||
|
||||
template <typename NT, typename FT>
|
||||
void G4TNtupleDescription<NT, FT>::SetFile(std::shared_ptr<FT> file)
|
||||
{ fFile = file; }
|
||||
{ fFile = std::move(file); }
|
||||
|
||||
template <typename NT, typename FT>
|
||||
void G4TNtupleDescription<NT, FT>::SetNtuple(NT* ntuple)
|
||||
|
||||
@@ -163,7 +163,7 @@ template <typename NT>
|
||||
G4int G4TRNtupleManager<NT>::SetNtuple(
|
||||
G4TRNtupleDescription<NT>* rntupleDescription)
|
||||
{
|
||||
G4int id = G4int(fNtupleDescriptionVector.size() + fFirstId);
|
||||
auto id = G4int(fNtupleDescriptionVector.size() + fFirstId);
|
||||
|
||||
fNtupleDescriptionVector.push_back(rntupleDescription);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user