From c7ff439015a2066315fb631138a35ee34093951b Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Tue, 12 Jul 2022 21:31:55 -0700 Subject: [PATCH 001/192] CHG: Some bug fixes / optimizations related to COSI calibrations --- .../base/src/MCalibrateEnergyFindLines.cxx | 3 +- src/fretalon/base/src/MCalibrationModel.cxx | 47 ++++++++++++++----- .../melinator/src/MGUIMainMelinator.cxx | 5 +- src/fretalon/melinator/src/MMelinator.cxx | 4 +- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx b/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx index 82b4a4c90..2e94f07bf 100644 --- a/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx +++ b/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx @@ -676,6 +676,7 @@ bool MCalibrateEnergyFindLines::CheckPeaks() } } + /* if (FWHMes.size() >= 3) { // Calculate outliers via the modified thomson tau method MMath M; @@ -699,7 +700,7 @@ bool MCalibrateEnergyFindLines::CheckPeaks() } else { if (g_Verbosity >= c_Info) cout<<"Not enough FWHMes found for FWHM sanity check!"< Points) // Prepare the array for ROOT m_ROOTParameters.resize(NPar(), 0); - // SEt up the fitter + // Set up the fitter ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(20000); - ROOT::Fit::BinData TheData; - TheData.Initialize(Points.size(), 1, ROOT::Fit::BinData::kValueError); + // Locally store the data - we need it later + vector X; + vector Y; + vector dY; for (unsigned int p = 0; p < Points.size(); ++p) { double FWHM = Points[p].GetEnergyFWHM(); // If we do not yet have a FWHM use a dummy linear calibration through zero - if (FWHM == 0.0) { + if (FWHM < 1E-10) { FWHM = Points[p].GetFWHM() * Points[p].GetEnergy() / Points[p].GetPeak(); } if (m_Type == MCalibrationModelType::c_LineWidth) { if (fabs(Points[p].GetEnergy() - 511) < 0.1) continue; // Always exclude any 511 line, since it is larger than usual (positron range) - TheData.Add(Points[p].GetEnergy(), FWHM, 0.1*FWHM); // Arbitrary width... + X.push_back(Points[p].GetEnergy()); + Y.push_back(FWHM); + dY.push_back(0.1*FWHM); // Arbitrary width... } else { - TheData.Add(Points[p].GetPeak(), Points[p].GetEnergy(), FWHM/2.35); + X.push_back(Points[p].GetPeak()); + Y.push_back(Points[p].GetEnergy()); + dY.push_back(FWHM/2.35); } } + // Fill the fitting data set + ROOT::Fit::BinData TheData; + TheData.Initialize(Points.size(), 1, ROOT::Fit::BinData::kValueError); + for (unsigned int d = 0; d < X.size(); ++d) { + TheData.Add(X[d], Y[d], dY[d]); + } + + ROOT::Fit::Fitter TheFitter; TheFitter.Config().SetMinimizer("Minuit2", "Migrad"); if (g_Verbosity >= c_Info) TheFitter.Config().MinimizerOptions().SetPrintLevel(2); @@ -175,7 +189,7 @@ double MCalibrationModel::Fit(const vector Points) InitializeFitParameters(TheFitter); // Fit - if (g_Verbosity >= c_Info) cout<<"Round 1 of line fitting started"<= c_Info) cout<(TheFitter.Result()); @@ -202,7 +216,7 @@ double MCalibrationModel::Fit(const vector Points) if (ReturnCode == false) { // Try a different fitting approach - if (g_Verbosity >= c_Info) cout<<"Round 2 of line fitting started"<= c_Info) cout<= c_Info) TheFitter2.Config().MinimizerOptions().SetPrintLevel(2); @@ -226,7 +240,7 @@ double MCalibrationModel::Fit(const vector Points) } if (ReturnCode == true) { TheFitResult = const_cast(TheFitter2.Result()); - if (g_Verbosity >= c_Info) cout<<"Successfully fit line model in round 2."<= c_Info) cout<<"Successfully fit line model in round 2 (chisquare: "<= c_Info) cout<<"Unable to fit calibration model in round 2."< Points) if (ReturnCode == false) { // Try a different fitting approach - if (g_Verbosity >= c_Info) cout<<"Round 3 of line fitting started"<= c_Info) cout<= c_Info) TheFitter3.Config().MinimizerOptions().SetPrintLevel(2); @@ -284,17 +298,24 @@ double MCalibrationModel::Fit(const vector Points) m_Fit = new TF1("", this, 0, 1.1*Points.back().GetPeak(), NPar()); TThread::UnLock(); - m_Fit->SetChisquare(TheFitResult.Chi2()); - m_Fit->SetNDF(TheFitResult.Ndf()); m_Fit->SetNumberFitPoints(TheData.Size()); - m_Fit->SetParameters( &(TheFitResult.Parameters().front()) ); if (int(TheFitResult.Errors().size()) >= m_Fit->GetNpar()) { m_Fit->SetParErrors( &(TheFitResult.Errors().front()) ); } + // Let's do our own chi-square calculation, since it needs to be uniform over all fit approaches and independent of fit errors + double Chisquare = 0; + for (unsigned int d = 0; d < X.size(); ++d) { + Chisquare += (m_Fit->Eval(X[d]) - Y[d])*(m_Fit->Eval(X[d]) - Y[d]) / (dY[d]*dY[d]); + } + m_Fit->SetChisquare(Chisquare); + m_Fit->SetNDF(TheFitResult.Ndf()); + + if (m_Fit->GetNDF() > 0) { m_FitQuality = m_Fit->GetChisquare()/m_Fit->GetNDF(); // Used to determine the quality of fit, thus critically important + //if (g_Verbosity >= c_Info) cout<<"Fit quality: "<GetChisquare()<<", NDF: "<GetNDF()<<")"< IsOutlier = M.ModifiedThomsonTauTest(FitQualities, 0.01, KnownOutliers); + vector IsOutlier = KnownOutliers; + if (FitQualities.size() >= 3) { + IsOutlier = M.ModifiedThomsonTauTest(FitQualities, 0.01, KnownOutliers); + } unsigned int GoodEntries = 0; double RMS = 0; diff --git a/src/fretalon/melinator/src/MMelinator.cxx b/src/fretalon/melinator/src/MMelinator.cxx index 3d8f2330b..6bcd37cd6 100644 --- a/src/fretalon/melinator/src/MMelinator.cxx +++ b/src/fretalon/melinator/src/MMelinator.cxx @@ -673,7 +673,7 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned Names += ", "; } } - Legend->AddEntry(m_Histograms[h], Names); + Legend->AddEntry(m_Histograms[h], Names, "l"); } Legend->Draw("SAME"); @@ -850,7 +850,7 @@ void MMelinator::DrawLineFit(TCanvas& Canvas, unsigned int Collection, unsigned Spectrum->GetXaxis()->SetTitleOffset(0.9); Spectrum->GetXaxis()->CenterTitle(true); Spectrum->GetXaxis()->SetMoreLogLabels(true); - Spectrum->GetXaxis()->SetNdivisions(509, true); + Spectrum->GetXaxis()->SetNdivisions(506, true); //Spectrum->GetYaxis()->SetLabelOffset(0.001); Spectrum->GetYaxis()->SetLabelSize(0.05); From d3b29b627760eb098ee7719dd24f2366f2785015 Mon Sep 17 00:00:00 2001 From: GallegoSav Date: Thu, 16 Feb 2023 10:22:53 +0100 Subject: [PATCH 002/192] update for geant4.11 --- config/AllowedGeant4Versions.txt | 1 + config/AllowedROOTVersions.txt | 3 +- config/Makefile.linuxgcc | 6 +-- config/env.sh | Bin 7289 -> 7422 bytes src/cosima/inc/MCSteppingAction.hh | 3 +- src/cosima/src/MCActivator.cc | 75 ++++++++++++++++---------- src/cosima/src/MCGeometryConverter.cc | 2 +- src/cosima/src/MCPhysicsList.cc | 14 ++--- src/cosima/src/MCSteppingAction.cc | 33 ++++++++---- 9 files changed, 84 insertions(+), 53 deletions(-) diff --git a/config/AllowedGeant4Versions.txt b/config/AllowedGeant4Versions.txt index 257e56326..8339415de 100644 --- a/config/AllowedGeant4Versions.txt +++ b/config/AllowedGeant4Versions.txt @@ -1 +1,2 @@ 102 +111 diff --git a/config/AllowedROOTVersions.txt b/config/AllowedROOTVersions.txt index 212eb6fb8..8339415de 100644 --- a/config/AllowedROOTVersions.txt +++ b/config/AllowedROOTVersions.txt @@ -1 +1,2 @@ -618 624 +102 +111 diff --git a/config/Makefile.linuxgcc b/config/Makefile.linuxgcc index a0a10661c..691725b40 100644 --- a/config/Makefile.linuxgcc +++ b/config/Makefile.linuxgcc @@ -9,7 +9,7 @@ #---------------------------------------------------------------- -CMODE = "Linux with gcc and support for C++11" +CMODE = "Linux with gcc and support for C++17" DLL = so # Basic flags generated by ROOT @@ -19,7 +19,7 @@ ROOTGLIBS = $(shell root-config --glibs) # Compiler & linker options: CXX = g++ -CXXFLAGS = $(OPT) -std=c++11 -Wall -Wno-deprecated -fPIC -D_REENTRANT -I$(IN) -I$(CT) -I. $(ROOTCFLAGS) -D___LINUX___ -D___CLING___ +CXXFLAGS = $(OPT) -std=c++17 -Wall -Wno-deprecated -fPIC -D_REENTRANT -I$(IN) -I$(CT) -I. $(ROOTCFLAGS) -D___LINUX___ -D___CLING___ DEFINES = -UHARDWARE LD = g++ LDFLAGS = $(OPT) -D___LINUX___ @@ -33,7 +33,7 @@ LINK = ln -s -f # HEASoft HEACFLAGS = HEALIBS = -ifneq ("$(wildcard $(LHEASOFT)/include/fitsio.h)", "") +ifneq ("$(wildcard $(LHEASOFT)/include/cfitsio.h)", "") HEACFLAGS += -I$(LHEASOFT)/include HEALIBS += -L$(LHEASOFT)/lib else ifeq ("$(shell pkg-config --exists cfitsio 1>&2 2> /dev/null; echo $$?)", "0") diff --git a/config/env.sh b/config/env.sh index e364447aae7a72135db20049aba608daba73a5f2..be9c4f4b149cfa67f9f0d85a05a88537f8508f3d 100755 GIT binary patch delta 103 ucmexq@y~KYIya;82DU%ueOne3^ThfHMQdfC~U+u?-Xe delta 20 ccmexo`O{)UI``z8+y;|pa64|6;#nvF0Aw2oGXMYp diff --git a/src/cosima/inc/MCSteppingAction.hh b/src/cosima/inc/MCSteppingAction.hh index 7c0677cba..098d4b0b3 100644 --- a/src/cosima/inc/MCSteppingAction.hh +++ b/src/cosima/inc/MCSteppingAction.hh @@ -87,7 +87,8 @@ public: static const int c_ProcessIDIonization; static const int c_ProcessIDTransportation; static const int c_ProcessIDUncovered; - + static const int c_ProcessIDNoProcess; //added in g4.11 : New class G4NoProcess, representing an empty process not assigned to any particle, and used only in G4SteppingManager::InvokeAtRestDoItProcs() for stable ions at rest, in order to avoid that radioactive decay appears as process defining their last step. Note that the method IsApplicable(), retunrs false, as this process should not be set to any particle. (see release note) + // protected methods: protected: diff --git a/src/cosima/src/MCActivator.cc b/src/cosima/src/MCActivator.cc index ad54f053e..1c54f81f3 100644 --- a/src/cosima/src/MCActivator.cc +++ b/src/cosima/src/MCActivator.cc @@ -36,11 +36,18 @@ #include "G4DecayTable.hh" #include "G4VDecayChannel.hh" #include "G4ParticleTable.hh" -#include "G4RIsotopeTable.hh" -#include "G4IsotopeProperty.hh" -#include "G4NuclearLevelManager.hh" -#include "G4NuclearLevel.hh" -#include "G4NuclearLevelStore.hh" +//#include "G4RIsotopeTable.hh" +// from g4 v10.2 release note : G4RIsotopeTable: added object name in constructor; removed +//G4RIsotopeTable (now redundant) and all associated pointers from G4RadioactiveDecay + +#include "G4IsotopeProperty.hh" +//#include "G4NuclearLevelManager.hh" //not found anymore in v11.1 +//#include "G4NuclearLevel.hh" //same +//#include "G4NuclearLevelSI woultore.hh" //same +#include "G4NuclearLevelData.hh" //replace libs upper ? see release note 10.2 +#include "G4LevelManager.hh" +#include "G4NucLevel.hh" + #include "G4IonTable.hh" // Standard lib: @@ -163,7 +170,7 @@ bool MCActivator::LoadCountsFiles() Counts.Load(m_CountsFiles[i]); if (Counts.GetTime() == 0) { - merr<<"Isotope file does not contain a time for rates calculation!"<(Tree[b].back().GetDefinition()); bool LevelsOK = true; - G4NuclearLevelManager* M = G4NuclearLevelStore::GetInstance()->GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); - if (M->IsValid() == true) { + //G4NucLearLevelManager* M = G4NucLevelStore::GetInstance()->GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + + //if (M->IsValid() == true) { + bool IsValid = true; // IsValid() Method no longer exist for G4LevelManager, is all level are registered now ? + if (IsValid == true) { + //M->PrintAll(); - const G4NuclearLevel* NuclearLevel = M->NearestLevel(Nucleus->GetExcitationEnergy()); - cout<<"Nearest level: "<Energy()/keV<<" vs. "<GetExcitationEnergy()/keV<NearestLevel(Nucleus->GetExcitationEnergy()); + cout<<"Nearest level: "<NearestLevelEnergy(Nucleus->GetExcitationEnergy())/keV<<" vs. "<GetExcitationEnergy()/keV<NumberOfGammas()<NumberOfGammas(); ++h) { + cout<<"Number of gammas: "<NumberOfTransitions()<NumberOfTransitions()); ++h) { vector ABranch = Tree[b]; - cout<<"Gamma energy: "<GammaEnergies()[h]/keV<LevelEnergy(NuclearLevel->FinalExcitationIndex(h))/keV<Energy() - NuclearLevel->GammaEnergies()[h]) > 1*keV && /* NuclearLevel->GammaEnergies()[h] > 1*keV && */ - NuclearLevel->Energy() != M->HighestLevel()->Energy()) { // table has some significant uncertainties... + if (fabs(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))) > 1*keV && /* NuclearLevel->GammaEnergies()[h] > 1*keV && */ + M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) != M->MaxLevelEnergy()) { // table has some significant uncertainties... // Make sure we know the exact energy of the new level: - const G4NuclearLevel* NewNuclearLevel = M->NearestLevel(NuclearLevel->Energy() - NuclearLevel->GammaEnergies()[h]); + const G4NucLevel* NewNuclearLevel = M->NearestLevel(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); if (NewNuclearLevel != 0) { - NewLevelEnergy = NewNuclearLevel->Energy(); - if (NewNuclearLevel->HalfLife() > m_HalfLifeCutOff) { - NewHalfLife = NewNuclearLevel->HalfLife(); + NewLevelEnergy = M->NearestLevelEnergy(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); + if (NewNuclearLevel->GetTimeGamma () > m_HalfLifeCutOff) { + NewHalfLife = NewNuclearLevel->GetTimeGamma (); } else { NewHalfLife = 0.0; } } else { - mout<<"Error: No nearest level found for: "<GetParticleName()<<" Excitation: "<Energy() - NuclearLevel->GammaEnergies()[h]<GetParticleName()<<" Excitation: "<NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))<GetParticleName()), NewLevelEnergy); - NewParticle.SetBranchingRatio(Tree[b].back().GetBranchingRatio()*NuclearLevel->GammaProbabilities()[h]); - NewParticle.SetProductionRate(Tree[b].back().GetProductionRate()*NuclearLevel->GammaProbabilities()[h]); + NewParticle.SetBranchingRatio(Tree[b].back().GetBranchingRatio()*NuclearLevel->GammaProbability(h)); + NewParticle.SetProductionRate(Tree[b].back().GetProductionRate()*NuclearLevel->GammaProbability(h)); // The PDGLifeTime is not always ok for excited states, thus we have to get it this way: if (NewLevelEnergy > 0.0) { NewParticle.SetHalfLife(NewHalfLife); @@ -503,7 +515,7 @@ bool MCActivator::CalculateEquilibriumRates() cout<<"Adding entry with energy: "<NumberOfGammas() > 0 && LevelsOK == true) { + if (NuclearLevel->NumberOfTransitions() > 0 && LevelsOK == true) { Tree[b].clear(); // mark for removal TreeChanged = true; cout<<"Original tree cleared"<GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + //G4NucLevelManager* M = G4NucLevelStore::GetInstance()->GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + //M->PrintAll(); - if (M->IsValid() == true) { - const G4NuclearLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); + bool IsValid = true; // IsValid() Method no longer exist for G4LevelManager, is all level are registered now ? + if (IsValid == true) { + //const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); + const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); + //Level->PrintAll(); if (Level != 0) { - if (Level->HalfLife() > m_HalfLifeCutOff || IgnoreCutOff == true) { + if (Level->GetTimeGamma() > m_HalfLifeCutOff || IgnoreCutOff == true) { //cout<<"Half life: "<HalfLife()<HalfLife(); + HalfLife = Level->GetTimeGamma (); } else { //cout<<"Half life: "<HalfLife()<<" ---> Declared as immdiate decay!"<Energy(); + ExcitationEnergy = M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()); } else { mout<<"Error: No nearest level found for: "<GetParticleName()<GetEntityType() == "G4Sphere") { G4Sphere* Sphere = (G4Sphere*) S; fout<GetInsideRadius()/cm<<" " + <GetInnerRadius()/cm<<" " <GetOuterRadius()/cm<<" " <GetStartThetaAngle()/deg<<" " <GetStartThetaAngle()/deg + Sphere->GetDeltaThetaAngle()/deg<<" " diff --git a/src/cosima/src/MCPhysicsList.cc b/src/cosima/src/MCPhysicsList.cc index 986688ee8..ba19afc23 100644 --- a/src/cosima/src/MCPhysicsList.cc +++ b/src/cosima/src/MCPhysicsList.cc @@ -46,7 +46,7 @@ #include "G4VEnergyLossProcess.hh" #include "G4ProcessVector.hh" #include "G4ProcessManager.hh" -#include "G4LivermorePolarizedPhotoElectricModel.hh" +//#include "G4LivermorePolarizedPhotoElectricModel.hh" removed in g4 v11 #include "G4LivermorePhotoElectricModel.hh" #include "G4PenelopePhotoElectricModel.hh" #include "G4LivermoreIonisationModel.hh" @@ -196,21 +196,21 @@ void MCPhysicsList::ConstructProcess() G4VModularPhysicsList::ConstructProcess(); // Do some additional modifications to the default lists: - theParticleIterator->reset(); - while ((*theParticleIterator)() == true) { - G4ParticleDefinition* particle = theParticleIterator->value(); + GetParticleIterator()->reset(); + while ((*GetParticleIterator())() == true) { + G4ParticleDefinition* particle = GetParticleIterator()->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); G4ProcessVector* pvector = pmanager->GetProcessList(); //cout<GetParticleName()<size()<size(); ++p) { + for (G4int p = 0; p < int(pvector->size()); ++p) { G4VProcess* P = (*pvector)[p]; //cout<GetProcessName()<(P) != 0) { G4RadioactiveDecay* RadioactiveDecay = dynamic_cast(P); - RadioactiveDecay->SetICM(true); // Internal Conversion + //RadioactiveDecay->SetICM(true); // Internal Conversion -> removed from PhysicList in v10.2 see release note RadioactiveDecay->SetARM(true); // Atomic Rearrangement, i.e. filling of shell vacancies - RadioactiveDecay->SetHLThreshold(1.0E-9*second); // Half life cut-off of isomeruic states + //RadioactiveDecay->SetHLThreshold(1.0E-9*second); // Half life cut-off of isomeric states | no longer exist in g4 v11 , no track of that on the release notes } } } diff --git a/src/cosima/src/MCSteppingAction.cc b/src/cosima/src/MCSteppingAction.cc index d9f582acf..9370b6b9b 100644 --- a/src/cosima/src/MCSteppingAction.cc +++ b/src/cosima/src/MCSteppingAction.cc @@ -36,9 +36,13 @@ #include "G4ParticleDefinition.hh" #include "G4ParticleTypes.hh" #include "G4EventManager.hh" -#include "G4NuclearLevel.hh" -#include "G4NuclearLevelManager.hh" -#include "G4NuclearLevelStore.hh" +//#include "G4NuclearLevel.hh" //no longer exist in g4 v11 +//#include "G4NuclearLevelManager.hh" // same +//#include "G4NuclearLevelStore.hh" // same +#include "G4NuclearLevelData.hh" //replace libs upper ? see release note 10.2 +#include "G4LevelManager.hh" +#include "G4NucLevel.hh" + #include "G4Ions.hh" #include "G4IonTable.hh" @@ -73,6 +77,7 @@ const int MCSteppingAction::c_ProcessIDDecay = 11; const int MCSteppingAction::c_ProcessIDRadioactiveDecay = 12; const int MCSteppingAction::c_ProcessIDIonization = 13; const int MCSteppingAction::c_ProcessIDTransportation = 14; +const int MCSteppingAction::c_ProcessIDNoProcess = 15; /****************************************************************************** @@ -118,6 +123,8 @@ MCSteppingAction::MCSteppingAction(MCParameterFile& RunParameters) : m_KnownProcess.push_back("LowEnConversion"); m_KnownProcessID.push_back(c_ProcessIDPair); m_KnownProcess.push_back("LowEnPolarizConversion"); m_KnownProcessID.push_back(c_ProcessIDPair); m_KnownProcess.push_back("muPairProd"); m_KnownProcessID.push_back(c_ProcessIDPair); + m_KnownProcess.push_back("ePairProd"); m_KnownProcessID.push_back(c_ProcessIDPair); + m_KnownProcess.push_back("annihil"); m_KnownProcessID.push_back(c_ProcessIDAnnihilation); m_KnownProcess.push_back("PenAnnih"); m_KnownProcessID.push_back(c_ProcessIDAnnihilation); @@ -154,6 +161,7 @@ MCSteppingAction::MCSteppingAction(MCParameterFile& RunParameters) : m_KnownProcess.push_back("KaonPlusInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("KaonMinusInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("LambdaInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); + m_KnownProcess.push_back("anti_lambdaInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("AntiLambdaInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("SigmaMinusInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("SigmaPlusInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); @@ -207,6 +215,8 @@ MCSteppingAction::MCSteppingAction(MCParameterFile& RunParameters) : m_KnownProcess.push_back("CoulombScat"); m_KnownProcessID.push_back(c_ProcessIDIonization); m_KnownProcess.push_back("Transportation"); m_KnownProcessID.push_back(c_ProcessIDTransportation); + m_KnownProcess.push_back("NoProcess"); m_KnownProcessID.push_back(c_ProcessIDNoProcess); + // To lower all processes: for (unsigned int i = 0; i < m_KnownProcess.size(); ++i) m_KnownProcessFrequency.push_back(0); @@ -910,12 +920,13 @@ void MCSteppingAction::UserSteppingAction(const G4Step* Step) //cout<<"Storing: "<GetParticleName()<GetExcitationEnergy() > 1*keV) { //cout<<"Alignment > 1 keV"<GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); - if (M->IsValid() == true) { - const G4NuclearLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); + const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); + bool IsValid =true ;// IsValid() method no longer available for G4LevelManager, always true for now , need to check + if (IsValid == true) { + const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); if (Level != 0) { G4IonTable* Table = G4IonTable::GetIonTable(); - Nucleus = dynamic_cast(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), Level->Energy())); + Nucleus = dynamic_cast(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()))); } } } else { @@ -991,8 +1002,8 @@ void MCSteppingAction::UserSteppingAction(const G4Step* Step) //cout<GetDefinition()->GetParticleName()<<" --> "<GetPostStepPoint()->GetGlobalTime()/second<<" sec "<GetPreStepPoint()->GetGlobalTime()/second<<" sec"<GetPreStepPoint()->GetTouchable()); G4LogicalVolume* V = Hist->GetVolume(0)->GetLogicalVolume(); - G4String Name = V->GetName(); - Name.remove(Name.size()-3, 3); + G4String Name = V->GetName(); + Name.erase(Name.size()-3, 3); MCRunManager::GetMCRunManager()->GetCurrentRun().SkipOneEvent(Track->GetDefinition(), Name); } @@ -1003,7 +1014,7 @@ void MCSteppingAction::UserSteppingAction(const G4Step* Step) G4TouchableHistory* Hist = (G4TouchableHistory*) (Step->GetPreStepPoint()->GetTouchable()); G4LogicalVolume* V = Hist->GetVolume(0)->GetLogicalVolume(); G4String Name = V->GetName(); - Name.remove(Name.size()-3, 3); + Name.erase(Name.size()-3, 3); double GlobalTime = Step->GetPostStepPoint()->GetGlobalTime(); // if (Track->GetDefinition()->GetParticleName() == "Ge73[66.7]") { @@ -1409,7 +1420,7 @@ int MCSteppingAction::GetProcessId(const G4String& Name) return m_KnownProcessID[i]; } } - + //cout< Date: Thu, 16 Feb 2023 10:58:55 +0100 Subject: [PATCH 003/192] Update AllowedROOTVersions.txt --- config/AllowedROOTVersions.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/AllowedROOTVersions.txt b/config/AllowedROOTVersions.txt index 8339415de..212eb6fb8 100644 --- a/config/AllowedROOTVersions.txt +++ b/config/AllowedROOTVersions.txt @@ -1,2 +1 @@ -102 -111 +618 624 From e51a2663d2c9af649473900ffc63bbe889e22eef Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 16 Feb 2023 14:49:47 -0800 Subject: [PATCH 004/192] CHG: Fixed automatic compilation --- config/AllowedROOTVersions.txt | 2 +- config/build-geant4.sh | 50 ++++++++++++++++++++-------------- config/build-root.sh | 2 +- config/check-geant4version.sh | 4 +-- 4 files changed, 33 insertions(+), 25 deletions(-) diff --git a/config/AllowedROOTVersions.txt b/config/AllowedROOTVersions.txt index 212eb6fb8..a0595b546 100644 --- a/config/AllowedROOTVersions.txt +++ b/config/AllowedROOTVersions.txt @@ -1 +1 @@ -618 624 +618 626 diff --git a/config/build-geant4.sh b/config/build-geant4.sh index 58f342f1d..302e024b1 100755 --- a/config/build-geant4.sh +++ b/config/build-geant4.sh @@ -7,9 +7,8 @@ if [ $? -eq 0 ]; then # echo "g++ compiler found - using it as default!"; CONFIGUREOPTIONS="-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++" fi -CONFIGUREOPTIONS="${CONFIGUREOPTIONS} -DCMAKE_INSTALL_PREFIX=.. -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=OFF -DGEANT4_INSTALL_DATA_TIMEOUT=14400 -DGEANT4_USE_SYSTEM_EXPAT=OFF -DGEANT4_BUILD_CXXSTD=c++11" -# For compilation with ROOT 6.06 -#CONFIGUREOPTIONS="${CONFIGUREOPTIONS} -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0" +CONFIGUREOPTIONS="${CONFIGUREOPTIONS} -DCMAKE_INSTALL_PREFIX=.. -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=OFF -DGEANT4_INSTALL_DATA_TIMEOUT=14400 -DGEANT4_USE_SYSTEM_EXPAT=OFF -DCMAKE_CXX_STANDARD=17" + # Reduce the warning messages: WARNINGS="-Wno-shadow -Wno-implicit-fallthrough -Wno-overloaded-virtual -Wno-deprecated-copy -Wno-unused-result -Wno-format-overflow=" @@ -291,23 +290,32 @@ else echo "Looking for Geant4 version ${WANTEDVERSION} with latest patch on the Geant4 website --- sometimes this takes a few minutes..." # Now check Geant4 repository for the given version: - TESTTARBALL="geant4.${WANTEDVERSION}.tar.gz" - echo "Trying to find ${TESTTARBALL}..." - EXISTS=`curl -s --head ${WEBSITE}/${TESTTARBALL} | grep gzip` - if [ "${EXISTS}" == "" ]; then - echo "ERROR: Unable to find suitable Geant4 tar ball at the Geant4 website" - exit 1 - fi - TARBALL=${TESTTARBALL} - for s in `seq -w 01 10`; do - TESTTARBALL="geant4.${WANTEDVERSION}.p${s}.tar.gz" + #TESTTARBALL="geant4_v${WANTEDVERSION}.tar.gz" + #echo "Trying to find ${TESTTARBALL}..." + #EXISTS=`curl -s --head ${WEBSITE}/${TESTTARBALL} | grep gzip` + #if [ "${EXISTS}" == "" ]; then + # echo "ERROR: Unable to find suitable Geant4 tar ball at the Geant4 website" + # exit 1 + #fi + TARBALL="" + MAX_TRIALS=3 + for s in `seq 0 100`; do + TESTTARBALL="geant4-v${WANTEDVERSION}.${s}.tar.gz" echo "Trying to find ${TESTTARBALL}..." EXISTS=`curl -s --head ${WEBSITE}/${TESTTARBALL} | grep gzip` - if [ "${EXISTS}" == "" ]; then - break + if [[ ${EXISTS} == "" ]]; then # sometimes version 00 does not exist... + MAX_TRIALS=$(( MAX_TRIALS - 1 )) + if [[ ${MAX_TRIALS} -eq 0 ]]; then + break + fi + else + TARBALL=${TESTTARBALL} fi - TARBALL=${TESTTARBALL} done + if [ "${TARBALL}" == "" ]; then + echo "ERROR: Unable to find suitable Geant4 tar ball at the Geant4 website" + exit 1 + fi echo "Using Geant4 tar ball ${TARBALL}" # Check if it already exists locally @@ -350,10 +358,10 @@ fi -GEANT4CORE=geant4_v${VER} -GEANT4DIR=geant4_v${VER}${DEBUGSTRING} -GEANT4SOURCEDIR=geant4_v${VER}-source # Attention: the cleanup checks this name pattern before removing it -GEANT4BUILDDIR=geant4_v${VER}-build # Attention: the cleanup checks this name pattern before removing it +GEANT4CORE=geant4_${VER} +GEANT4DIR=geant4_${VER}${DEBUGSTRING} +GEANT4SOURCEDIR=geant4_${VER}-source # Attention: the cleanup checks this name pattern before removing it +GEANT4BUILDDIR=geant4_${VER}-build # Attention: the cleanup checks this name pattern before removing it echo "Checking for old installation..." if [ -d ${GEANT4DIR} ]; then @@ -437,7 +445,7 @@ if [ "$?" != "0" ]; then fi mkdir ${GEANT4DIR} cd ${GEANT4DIR} -mv ../geant4.${VER} ${GEANT4SOURCEDIR} +mv ../geant4-${VER} ${GEANT4SOURCEDIR} mkdir ${GEANT4BUILDDIR} diff --git a/config/build-root.sh b/config/build-root.sh index 102090152..4caef8570 100755 --- a/config/build-root.sh +++ b/config/build-root.sh @@ -16,7 +16,7 @@ if [[ $? -eq 0 ]]; then CONFIGUREOPTIONS+=" -DCMAKE_IGNORE_PATH=${PORTPATH};${PORTPATH}/bin;${PORTPATH}/include;${PORTPATH}/include/libxml2;${PORTPATH}/include/unicode" fi # Until ROOT 6.24: C++ 11 -CONFIGUREOPTIONS+=" -DCMAKE_CXX_STANDARD=11" +CONFIGUREOPTIONS+=" -DCMAKE_CXX_STANDARD=17" # To compile ROOT 6.06 with gcc 5.x --- no longer needed for ROOT 6.08 and higher #CONFIGUREOPTIONS+=" -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0" # We want a minimal system and enable what we really need: diff --git a/config/check-geant4version.sh b/config/check-geant4version.sh index 779a29ea1..b9aefe6a9 100755 --- a/config/check-geant4version.sh +++ b/config/check-geant4version.sh @@ -99,13 +99,13 @@ Geant4VersionMin=`echo ${VERSIONS} | awk -F" " '{ print $1 }'` Geant4VersionMax=`echo ${VERSIONS} | awk -F" " '{ print $NF }'` Sep=$((${#Geant4VersionMin}-1)) -if [ ${Geant4VersionMin:0:${Sep}} -ge 10 ]; then +if [ ${Geant4VersionMin:0:${Sep}} -eq 10 ]; then Geant4VersionMinString="${Geant4VersionMin:0:${Sep}}.0${Geant4VersionMin:${Sep}:1}" else Geant4VersionMinString="${Geant4VersionMin:0:${Sep}}.${Geant4VersionMin:${Sep}:1}" fi Sep=$((${#Geant4VersionMax}-1)) -if [ ${Geant4VersionMax:0:${Sep}} -ge 10 ]; then +if [ ${Geant4VersionMax:0:${Sep}} -eq 10 ]; then Geant4VersionMaxString="${Geant4VersionMax:0:${Sep}}.0${Geant4VersionMax:${Sep}:1}" else Geant4VersionMaxString="${Geant4VersionMax:0:${Sep}}.${Geant4VersionMax:${Sep}:1}" From 56833c13f2e78b0ee1628178d681c42b8a90e25f Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Tue, 21 Feb 2023 14:55:27 -0800 Subject: [PATCH 005/192] CHG: More compile compatibilty - but still not running --- config/AllowedGeant4Versions.txt | 2 +- config/build-geant4.sh | 5 +++-- config/env.sh | Bin 7422 -> 7461 bytes 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/AllowedGeant4Versions.txt b/config/AllowedGeant4Versions.txt index 8339415de..fc1db2732 100644 --- a/config/AllowedGeant4Versions.txt +++ b/config/AllowedGeant4Versions.txt @@ -1,2 +1,2 @@ -102 +110 111 diff --git a/config/build-geant4.sh b/config/build-geant4.sh index 302e024b1..530267132 100755 --- a/config/build-geant4.sh +++ b/config/build-geant4.sh @@ -261,7 +261,8 @@ if [ "${TARBALL}" != "" ]; then # Check if it has the correct version: VER=`echo ${TARBALL} | awk -Fgeant4. '{ print $2 }' | awk -F.t '{ print $1 }'`; - SHORTVER=`echo ${TARBALL} | awk -Fgeant4. '{ print $2 }' | awk -F.t '{ print $1 }' | awk -F.p '{ print $1 }'`; + CHECKVER=`echo ${TARBALL} | awk -Fgeant4-v '{ print $2 }' | awk -F.t '{ print $1 }'`; + SHORTVER=`echo ${TARBALL} | awk -Fgeant4-v '{ print $2 }' | awk -F.t '{ print $1 }' | awk -F.p '{ print $1 }'`; echo "Version of Geant4 is: ${VER}" if [[ ${WANTEDVERSION} != "" ]]; then @@ -270,7 +271,7 @@ if [ "${TARBALL}" != "" ]; then exit 1 fi else - bash ${MEGALIB}/config/check-geant4version.sh --good-version=${VER} + bash ${MEGALIB}/config/check-geant4version.sh --good-version=${CHECKVER} if [ "$?" != "0" ]; then echo "ERROR: The Geant4 tarball you supplied does not contain an acceptable Geant4 version!" exit 1 diff --git a/config/env.sh b/config/env.sh index be9c4f4b149cfa67f9f0d85a05a88537f8508f3d..42f92f19f2146b5b78b6e150f9fa4d0d9042cf75 100755 GIT binary patch delta 23 fcmexoxzuWd2oH;bvWmv!jojjlnwvR!z6t;US@s6k delta 12 TcmZ2#_0MvH2+w9~o>u|@BKic| From 182bd39c212a6afe9690acd27115a1f34b1bfb8c Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Tue, 21 Feb 2023 15:23:20 -0800 Subject: [PATCH 006/192] CHG: Hack to fix random number seed issue --- src/cosima/src/MCMain.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cosima/src/MCMain.cc b/src/cosima/src/MCMain.cc index 4ab1d4e0a..9dfbfd607 100644 --- a/src/cosima/src/MCMain.cc +++ b/src/cosima/src/MCMain.cc @@ -394,8 +394,12 @@ unsigned int MCMain::ParseCommandLine(int argc, char** argv) } // Set the initial seed - Geant4 & ROOT ! - CLHEP::HepRandom::setTheSeed(m_Seed); + //CLHEP::HepRandom::setTheSeed(m_Seed); + //G4Random::setTheSeed(m_Seed); gRandom->SetSeed(m_Seed); + /// FIXME + cout<Sleep(1000); return 0; } From c672257898ad2d672eced3b512ddc6b92806a8ca Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Wed, 22 Feb 2023 10:29:30 +0100 Subject: [PATCH 007/192] Update MCSteppingAction.cc --- src/cosima/src/MCSteppingAction.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cosima/src/MCSteppingAction.cc b/src/cosima/src/MCSteppingAction.cc index 9370b6b9b..0d7672907 100644 --- a/src/cosima/src/MCSteppingAction.cc +++ b/src/cosima/src/MCSteppingAction.cc @@ -144,7 +144,8 @@ MCSteppingAction::MCSteppingAction(MCParameterFile& RunParameters) : m_KnownProcess.push_back("phot"); m_KnownProcessID.push_back(c_ProcessIDPhoto); m_KnownProcess.push_back("hadElastic"); m_KnownProcessID.push_back(c_ProcessIDElasticScattering); - + m_KnownProcess.push_back("ionElastic"); m_KnownProcessID.push_back(c_ProcessIDElasticScattering); + m_KnownProcess.push_back("nFission"); m_KnownProcessID.push_back(c_ProcessIDFission); m_KnownProcess.push_back("PhotonInelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); @@ -192,6 +193,8 @@ MCSteppingAction::MCSteppingAction(MCParameterFile& RunParameters) : m_KnownProcess.push_back("xi-Inelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("xi+Inelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); m_KnownProcess.push_back("xi0Inelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); + m_KnownProcess.push_back("anti_xi-Inelastic"); m_KnownProcessID.push_back(c_ProcessIDInelasticScattering); + m_KnownProcess.push_back("HadronCapture"); m_KnownProcessID.push_back(c_ProcessIDCapture); m_KnownProcess.push_back("nCapture"); m_KnownProcessID.push_back(c_ProcessIDCapture); From b807efce629d5a2b03654b2d4978f04152e4449e Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:31:03 +0100 Subject: [PATCH 008/192] ADD : EM parameters updated `SetDeexcitationIgnoreCut` was set to true for version 11 instead of false for version 10.02. Put it explicitly false on the physic list solved the issue of the factor 10 for the computation time. Some comments about this option : In Geant4 version 11, the `SetDeexcitationIgnoreCut` method is used to control the behavior of the `G4RadioactiveDecay`process during the simulation. This method sets a flag to ignore the cut imposed by the user on the production of secondary particles by radioactive decays. By default, when a radioactive decay occurs and produces one or more secondary particles (e.g. electrons, positrons, photons), these particles are subject to the same range cut and production thresholds as any other particle in the simulation. This means that if the range of a secondary particle is smaller than the range cut or the production threshold, it may be discarded by the simulation. However, in some cases it may be desirable to ignore these cuts for secondary particles produced by radioactive decays. This can be achieved by calling the `SetDeexcitationIgnoreCut` method with a value of true. This will cause the range cut and production thresholds to be ignored for all secondary particles produced by the `G4RadioactiveDecay` process. It should be noted that ignoring the range cut and production thresholds can lead to longer simulation times and may affect the accuracy of the simulation. Therefore, this feature should be used with caution and only when it is necessary to model the specific physics of the problem being studied. --- src/cosima/src/MCPhysicsList.cc | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/cosima/src/MCPhysicsList.cc b/src/cosima/src/MCPhysicsList.cc index ba19afc23..2ca9708fe 100644 --- a/src/cosima/src/MCPhysicsList.cc +++ b/src/cosima/src/MCPhysicsList.cc @@ -58,6 +58,8 @@ #include "G4LossTableManager.hh" #include "G4NuclideTable.hh" +#include "G4EmParameters.hh" + // MEGAlib: #include "MStreams.h" @@ -208,12 +210,20 @@ void MCPhysicsList::ConstructProcess() //cout<GetProcessName()<(P) != 0) { G4RadioactiveDecay* RadioactiveDecay = dynamic_cast(P); - //RadioactiveDecay->SetICM(true); // Internal Conversion -> removed from PhysicList in v10.2 see release note + //RadioactiveDecay->SetICMode(true); // Internal Conversion geant4 11 removed SetICM() method, as deprecated for some time and no longer used. ICM now set exclusively in G4PhotonEvaporation. Added printout of the flag of atomic relaxation. RadioactiveDecay->SetARM(true); // Atomic Rearrangement, i.e. filling of shell vacancies //RadioactiveDecay->SetHLThreshold(1.0E-9*second); // Half life cut-off of isomeric states | no longer exist in g4 v11 , no track of that on the release notes } - } - } + + // if (dynamic_cast(P) != 0) { + // cout<< "compton here !"<(P); + // ComptonScat->SetMinKinEnergy(1*GeV); + // } + + } //end for loop + }//end while loop G4VAtomDeexcitation* D = G4LossTableManager::Instance()->AtomDeexcitation(); D->SetFluo(true); @@ -223,8 +233,19 @@ void MCPhysicsList::ConstructProcess() G4NuclideTable::GetInstance()->SetLevelTolerance(100*eV); G4NuclideTable::GetInstance()->SetThresholdOfHalfLife(0.0001*ns); - + // for geant4 v11 in order to have same EM parameters as v10.02 + G4EmParameters* emParameters = G4EmParameters::Instance(); + emParameters->SetFluo(true); + emParameters->SetPixe(true); + emParameters->SetAuger(true); + emParameters->SetDeexcitationIgnoreCut(false); + //remove the comments below if you want exactly the same paramameters as v10.02 + //Not sure of the result if you do that + //emParameters->SetMuHadLateralDisplacement(false); + //emParameters->SetMscRangeFactor(0.04); + //emParameters->SetMscSkin(1); + //emParameters->SetAugerCascade(false); /* unnecessary as of Geant4 9.6 // Do some additional modifications to the default lists: From 469b90818bf0d4721bc58a0fb4f5f7ac0243afc1 Mon Sep 17 00:00:00 2001 From: GallegoSav Date: Tue, 23 May 2023 15:30:59 +0200 Subject: [PATCH 009/192] update for geant11 activation part --- src/cosima/src/MCActivator.cc | 124 +++++++++++++----- src/cosima/src/MCActivatorParticle.cc | 41 +++++- src/cosima/src/MCIsotopeStore.cc | 39 +++++- src/cosima/src/MCMain.cc | 6 +- src/cosima/src/MCPhysicsList.cc | 4 + src/cosima/src/MCRunManager.cc | 4 +- src/cosima/src/MCSteppingAction.cc | 174 ++++++++++++++++++++++++-- src/cosima/src/MCVHit.cc | 9 +- 8 files changed, 353 insertions(+), 48 deletions(-) diff --git a/src/cosima/src/MCActivator.cc b/src/cosima/src/MCActivator.cc index 1c54f81f3..d8e8570e3 100644 --- a/src/cosima/src/MCActivator.cc +++ b/src/cosima/src/MCActivator.cc @@ -32,6 +32,8 @@ // Geant4: #include "G4SystemOfUnits.hh" #include "G4RadioactiveDecay.hh" +#include "G4Radioactivation.hh" + #include "G4ParticleDefinition.hh" #include "G4DecayTable.hh" #include "G4VDecayChannel.hh" @@ -164,6 +166,9 @@ bool MCActivator::LoadCountsFiles() m_Rates.Reset(); + + + for (unsigned int i = 0; i < m_CountsFiles.size(); ++i) { mout<<"Loading and merging isotopes file "<(IonTable->GetIon(Z, A, 0)); - if (Ion == 0) continue; - //Ion->DumpTable(); + /*G4IonTable* IonTable = G4IonTable::GetIonTable(); + + int Z = 70; + for (int A = 157; A <= 157; ++A) { + G4Ions* Ion = dynamic_cast(IonTable->GetIon(Z, A, 0.5293,G4Ions::G4FloatLevelBase::no_Float)); + if (Ion == 0) {cout<<"ion not found !"<DumpTable(); + + + + cout<<"Life time :"<GetLifeTime(Z, A, 0,G4Ions::G4FloatLevelBase::plus_Y)<GetIon(Z, A, 0,G4Ions::G4FloatLevelBase::plus_Y); + cout<<"Life time from PDG def:"<GetPDGLifeTime()/s<LoadDecayTable(*Ion); if (DecayTable == 0) continue; if (DecayTable->entries() == 0) continue; DecayTable->DumpInfo(); + + //G4Radioactivation* Decay_bis = new G4Radioactivation(); + //G4DecayTable* DecayTable_bis = Decay_bis->LoadDecayTable(*Ion); + //if (DecayTable_bis == 0) continue; + //if (DecayTable_bis->entries() == 0) continue; + //DecayTable_bis->DumpInfo(); + + + const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Z, A); + const G4NucLevel* NuclearLevel = M->NearestLevel(Ion->GetExcitationEnergy()); + cout<<"Number of gammas: "<NumberOfTransitions()<NumberOfTransitions()<NumberOfTransitions()); ++h) { + cout<<"final excitation index : "<< NuclearLevel->FinalExcitationIndex(h)<NearestLevelEnergy(Ion->GetExcitationEnergy(),NuclearLevel->FinalExcitationIndex(h))/keV<LevelDensity(Ion->GetExcitationEnergy())<NearestLevelEnergy(M->NearestLevelEnergy(Ion->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); + cout<< "new level energy : " <NearestLevel(M->NearestLevelEnergy(Ion->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); + + + if (NewNuclearLevel!=0){ cout<< "new Half life : "<< NewNuclearLevel->GetTimeGamma()<GetParticleName()<<" Excitation: "<NearestLevelEnergy(Ion->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))< Tc90[0.000X] with HL = 0 which lead to a bug when trying to get this isotope + // and then goes to Tc90[0.000Y] with HL 8.7s which lead to geant4 loop + // hope it will be corrected in the next patch (here v11.01) + + if (m_Rates.GetID(v, i) == 44090 || m_Rates.GetID(v, i) == 73192 ) + { cout<<"Warning: This element sends Geant4 in an infinite loop -- skipping!"<GetParticleName()), ExcitationEnergy); + //NewParticle.GetDefinition()->DumpTable(); + // have to compute get the Halflife with the good def (ex Tb145[0.000Y] and not Tb145 ) #g4v11.01 bug + DetermineHalfLife(NewParticle.GetDefinition(), HalfLife, ExcitationEnergy, false); + //cout<< "Name :" <GetParticleName()<GetPDGLifeTime()*log(2.0)/s<<" sec"<GetPDGLifeTime()*log(2.0)/s<<" sec"<GetBR() > 1.01) { mout<<"Error (DecayLoop): Branching ratio of "<GetBR()<GetParticleName()<<" -> BR="<GetBR()<GetBR()); NewParticle.SetHalfLife(HalfLife); + //cout<<"HALFLIFE after SetHalfLife = "<GetParticleName())<<":"<GetExcitationEnergy()< m_HalfLifeCutOff && ImmidiateDecayRound == true) { continue; } - G4Ions* Nucleus = dynamic_cast(Tree[b].back().GetDefinition()); - + + bool LevelsOK = true; //G4NucLearLevelManager* M = G4NucLevelStore::GetInstance()->GetManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); - + + //if (M->IsValid() == true) { - bool IsValid = true; // IsValid() Method no longer exist for G4LevelManager, is all level are registered now ? - if (IsValid == true) { + if (M != nullptr) { + const G4NucLevel* NuclearLevel = M->NearestLevel(Nucleus->GetExcitationEnergy()); //M->PrintAll(); - const G4NucLevel* NuclearLevel = M->NearestLevel(Nucleus->GetExcitationEnergy()); cout<<"Nearest level: "<NearestLevelEnergy(Nucleus->GetExcitationEnergy())/keV<<" vs. "<GetExcitationEnergy()/keV<NumberOfTransitions()<NumberOfTransitions()); ++h) { vector ABranch = Tree[b]; - cout<<"Gamma energy: "<LevelEnergy(NuclearLevel->FinalExcitationIndex(h))/keV<LevelEnergy(NuclearLevel->FinalExcitationIndex(h))/keV<NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))) > 1*keV && /* NuclearLevel->GammaEnergies()[h] > 1*keV && */ + if (/*fabs(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))) > 1*keV &&*/ /* NuclearLevel->GammaEnergies()[h] > 1*keV && */ M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) != M->MaxLevelEnergy()) { // table has some significant uncertainties... // Make sure we know the exact energy of the new level: - const G4NucLevel* NewNuclearLevel = M->NearestLevel(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); + const G4NucLevel* NewNuclearLevel = M->GetLevel(NuclearLevel->FinalExcitationIndex(h)); if (NewNuclearLevel != 0) { - NewLevelEnergy = M->NearestLevelEnergy(M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))); - if (NewNuclearLevel->GetTimeGamma () > m_HalfLifeCutOff) { - NewHalfLife = NewNuclearLevel->GetTimeGamma (); + NewLevelEnergy = M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h)); + if (NewNuclearLevel->GetTimeGamma() > m_HalfLifeCutOff) { + NewHalfLife = NewNuclearLevel->GetTimeGamma(); } else { NewHalfLife = 0.0; } } else { - mout<<"Error: No nearest level found for: "<GetParticleName()<<" Excitation: "<NearestLevelEnergy(Nucleus->GetExcitationEnergy()) - M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))<GetParticleName()<<" Excitation: "<< M->LevelEnergy(NuclearLevel->FinalExcitationIndex(h))<NumberOfTransitions() > 0 && LevelsOK == true) { Tree[b].clear(); // mark for removal TreeChanged = true; @@ -1284,10 +1352,10 @@ bool MCActivator::DetermineHalfLife(G4ParticleDefinition* ParticleDef, double& H const G4LevelManager* M = G4NuclearLevelData::GetInstance()->GetLevelManager(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass()); //M->PrintAll(); - bool IsValid = true; // IsValid() Method no longer exist for G4LevelManager, is all level are registered now ? - if (IsValid == true) { + if (M!=nullptr) { + const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); + //const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); - const G4NucLevel* Level = M->NearestLevel(Nucleus->GetExcitationEnergy()); //Level->PrintAll(); if (Level != 0) { diff --git a/src/cosima/src/MCActivatorParticle.cc b/src/cosima/src/MCActivatorParticle.cc index ec9473ea9..eab14baff 100644 --- a/src/cosima/src/MCActivatorParticle.cc +++ b/src/cosima/src/MCActivatorParticle.cc @@ -129,7 +129,46 @@ void MCActivatorParticle::SetIDAndExcitation(unsigned int ID, double Excitation) G4IonTable* Table = G4IonTable::GetIonTable(); int AtomicNumber = int(m_ID/1000); int AtomicMass = m_ID - int(m_ID/1000)*1000; - m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation); + //m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation); + + + if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::no_Float)!= -1001) + {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::no_Float);} + + //if the level state of the isotope is a floating level , loop over the levels until we Get + //the isotope in order to not get 0s lifetime . Will be probably fixed in the next patch + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_X)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_X);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Y)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Y);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Z)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Z);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_U)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_U);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_V)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_V);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_W)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_W);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_R)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_R);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_S)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_S);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_A)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_A);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_B)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_B);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_C)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_C);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_D)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_D);} + + else if (Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_E)!= -1001) {m_Definition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_E);} + + + else if(m_Definition==0){cout<<"Half Life time below the SetThresholdOfHalfLife or no isotope found with this excitation energy -> create a isotope with 0s of half-time ! Z = "<" + <<"Z = "<Sleep(1000); return 0; } diff --git a/src/cosima/src/MCPhysicsList.cc b/src/cosima/src/MCPhysicsList.cc index 2ca9708fe..ff44a6504 100644 --- a/src/cosima/src/MCPhysicsList.cc +++ b/src/cosima/src/MCPhysicsList.cc @@ -41,6 +41,7 @@ #include "G4EmPenelopePhysics.hh" #include "G4EmStandardPhysics.hh" #include "G4RadioactiveDecayPhysics.hh" + #include "G4VProcess.hh" #include "G4VEmProcess.hh" #include "G4VEnergyLossProcess.hh" @@ -178,6 +179,9 @@ void MCPhysicsList::Register() // We always register all sorts of decays: RegisterPhysics(new G4RadioactiveDecayPhysics()); + + + // Check what we got: cout<<"Chosen physics: "<NearestLevel(Nucleus->GetExcitationEnergy()); if (Level != 0) { G4IonTable* Table = G4IonTable::GetIonTable(); - Nucleus = dynamic_cast(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()))); + + if(Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::no_Float)!=-1001){ + Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::no_Float));} + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_X)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_X)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_Y)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_Y)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_Z)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_Z)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_U)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_U)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_V)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_V)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_W)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_W)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_R)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_R)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_S)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_S)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_T)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_T)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_A)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_A)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_B)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_B)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_C)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_C)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_D)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_D)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_E)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()),G4Ions::G4FloatLevelBase::plus_E)); } + + else { cout<<"Isotope not found from MCSteppingAction"<GetAtomicNumber() << Nucleus->GetAtomicMass()<< M->NearestLevelEnergy(Nucleus->GetExcitationEnergy())<(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), M->NearestLevelEnergy(Nucleus->GetExcitationEnergy()))); } } } else { //cout<<"Alignment < 1 keV"<(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0)); + //Nucleus = dynamic_cast(Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0)); + + + if(Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::no_Float)!=-1001){ + Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::no_Float));} + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_X)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_X)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_Y)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_Y)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_Z)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_Z)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_U)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_U)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_V)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_V)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_W)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_W)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_R)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_R)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_S)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_S)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_T)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_T)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_A)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_A)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_B)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_B)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_C)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_C)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_D)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_D)); } + + else if( Table->GetLifeTime(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_E)!=-1001) + { Nucleus = dynamic_cast( Table->GetIon(Nucleus->GetAtomicNumber(), Nucleus->GetAtomicMass(), 0.0,G4Ions::G4FloatLevelBase::plus_E)); } + + else { cout<<"Isotope not found from MCSteppingAction"<GetAtomicNumber()<< "A :"<< Nucleus->GetAtomicMass()<<"E : " <<0.0<GetExcitationEnergy()/keV<<"keV"< 1000) { - G4ParticleDefinition* Ion = 0; + G4IonTable* Table = G4IonTable::GetIonTable(); int AtomicNumber = int(ID/1000); int AtomicMass = ID - int(ID/1000)*1000; - Ion = Table->GetIon(AtomicNumber, AtomicMass, Excitation); - if (Ion == 0) { + + + if(Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::no_Float)!=-1001){ + ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::no_Float);} + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_X)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_X); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Y)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Y); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Z)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_Z); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_U)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_U); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_V)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_V); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_W)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_W); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_R)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_R); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_S)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_S); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_T); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_A)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_A); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_B)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_B); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_C)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_C); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_D)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_D); } + + else if( Table->GetLifeTime(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_E)!=-1001) + { ParticleDefinition = Table->GetIon(AtomicNumber, AtomicMass, Excitation,G4Ions::G4FloatLevelBase::plus_E); } + + + else { merr<<"Particle type not yet implemented!"<& Origins) +void MCVHit::AddOrigins(const set& Origins) { - set::const_iterator Iter; + set::const_iterator Iter; for (Iter = Origins.begin(); Iter != Origins.end(); ++Iter) { AddOrigin(*Iter); } @@ -97,6 +97,7 @@ MSimHT* MCVHit::GetCalibrated() { MSimHT* HT = new MSimHT(); HT->Set(m_DetectorType, MVector(m_Position.getX()/cm, m_Position.getY()/cm, m_Position.getZ()/cm), m_Energy/keV, m_Time/s, m_Origins, false); + return HT; } From d46c65972ed6cc77325dbef3fe43d850f5d3eab7 Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Tue, 23 May 2023 15:38:29 +0200 Subject: [PATCH 010/192] Update MCMain.cc --- src/cosima/src/MCMain.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cosima/src/MCMain.cc b/src/cosima/src/MCMain.cc index 4ab1d4e0a..9dfbfd607 100644 --- a/src/cosima/src/MCMain.cc +++ b/src/cosima/src/MCMain.cc @@ -394,8 +394,12 @@ unsigned int MCMain::ParseCommandLine(int argc, char** argv) } // Set the initial seed - Geant4 & ROOT ! - CLHEP::HepRandom::setTheSeed(m_Seed); + //CLHEP::HepRandom::setTheSeed(m_Seed); + //G4Random::setTheSeed(m_Seed); gRandom->SetSeed(m_Seed); + /// FIXME + cout<Sleep(1000); return 0; } From 49f2c094faba6979a9cf72957ccda24ef4d0ff2b Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Tue, 23 May 2023 15:39:51 +0200 Subject: [PATCH 011/192] Update MCVHit.cc --- src/cosima/src/MCVHit.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cosima/src/MCVHit.cc b/src/cosima/src/MCVHit.cc index e9b626599..70dec9f63 100644 --- a/src/cosima/src/MCVHit.cc +++ b/src/cosima/src/MCVHit.cc @@ -45,7 +45,7 @@ MCVHit::MCVHit() m_Name = "Unknown"; m_DetectorType = MDDetector::c_NoDetectorType; - m_LastAddedOrigin = g_UnsignedIntNotDefined; + m_LastAddedOrigin = -1; } @@ -61,7 +61,7 @@ MCVHit::~MCVHit() /****************************************************************************** * Add a track ID as origin to this hit */ -void MCVHit::AddOrigin(unsigned int TrackId) +void MCVHit::AddOrigin(int TrackId) { // Since m_origin is a set, the origin is not added if it already exists! @@ -72,9 +72,9 @@ void MCVHit::AddOrigin(unsigned int TrackId) /****************************************************************************** * Add several origins to the list */ -void MCVHit::AddOrigins(const set& Origins) +void MCVHit::AddOrigins(const set& Origins) { - set::const_iterator Iter; + set::const_iterator Iter; for (Iter = Origins.begin(); Iter != Origins.end(); ++Iter) { AddOrigin(*Iter); } @@ -97,7 +97,6 @@ MSimHT* MCVHit::GetCalibrated() { MSimHT* HT = new MSimHT(); HT->Set(m_DetectorType, MVector(m_Position.getX()/cm, m_Position.getY()/cm, m_Position.getZ()/cm), m_Energy/keV, m_Time/s, m_Origins, false); - return HT; } From 00f94b4d314272d9118493a8484b10a703915826 Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:48:55 +0200 Subject: [PATCH 012/192] Update MCCrossSections.cc I had to modified this file because the folder `rayl,pair,phot` are no more present. The cross sections are loaded differently but the results are the same with the version 10.2 --- src/cosima/src/MCCrossSections.cc | 56 ++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/src/cosima/src/MCCrossSections.cc b/src/cosima/src/MCCrossSections.cc index 508ca0105..4e1e69d3b 100644 --- a/src/cosima/src/MCCrossSections.cc +++ b/src/cosima/src/MCCrossSections.cc @@ -31,6 +31,12 @@ #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4Version.hh" +#include "G4LivermorePhotoElectricModel.hh" +#include "G4LivermoreRayleighModel.hh" +#include "G4LivermoreGammaConversionModel.hh" +#include "G4ParticleTable.hh" +#include "G4ParticleDefinition.hh" +#include "G4DataVector.hh" // ROOT: #include "TSystem.h" @@ -70,21 +76,37 @@ bool MCCrossSections::CreateCrossSectionFiles(MString Path) // Make sure the path exists gSystem->mkdir(Path, true); - G4CrossSectionHandler* CrossSectionHandlerPhoto = new G4CrossSectionHandler; - CrossSectionHandlerPhoto->Clear(); - CrossSectionHandlerPhoto->LoadData("phot/pe-cs-"); - - G4CrossSectionHandler* CrossSectionHandlerRayleigh = new G4CrossSectionHandler; - CrossSectionHandlerRayleigh->Clear(); - CrossSectionHandlerRayleigh->LoadData("rayl/re-cs-"); + + // Get the G4ParticleTable + G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); + // Get the G4ParticleDefinition for a photon + G4ParticleDefinition* gamma = particleTable->FindParticle("gamma"); + G4CrossSectionHandler* CrossSectionHandlerCompton = new G4CrossSectionHandler; CrossSectionHandlerCompton->Clear(); CrossSectionHandlerCompton->LoadData("comp/ce-cs-"); - G4CrossSectionHandler* CrossSectionHandlerPair = new G4CrossSectionHandler; - CrossSectionHandlerPair->Clear(); - CrossSectionHandlerPair->LoadData("pair/pp-cs-"); + G4LivermorePhotoElectricModel* CrossSectionHandlerPhoto = new G4LivermorePhotoElectricModel; + G4DataVector Data; + CrossSectionHandlerPhoto->Initialise(gamma,Data); + + + //G4CrossSectionHandler* CrossSectionHandlerPhoto = new G4CrossSectionHandler; + //CrossSectionHandlerPhoto->Clear(); + //CrossSectionHandlerPhoto->LoadData("phot/pe-cs-"); + + G4LivermoreRayleighModel* CrossSectionHandlerRayleigh = new G4LivermoreRayleighModel; + //G4CrossSectionHandler* CrossSectionHandlerRayleigh = new G4CrossSectionHandler; + //CrossSectionHandlerRayleigh->Clear(); + //CrossSectionHandlerRayleigh->LoadData("rayl/re-cs-"); + + G4LivermoreGammaConversionModel* CrossSectionHandlerPair = new G4LivermoreGammaConversionModel; + //G4CrossSectionHandler* CrossSectionHandlerPair = new G4CrossSectionHandler; + //CrossSectionHandlerPair->Clear(); + //CrossSectionHandlerPair->LoadData("pair/pp-cs-"); + + cout<<"Cross-section Data loaded !"<size(); ++mat) { //const G4Material* M = Table->GetMaterialCutsCouple(mat)->GetMaterial(); const G4Material* M = Table->at(mat); @@ -127,7 +151,7 @@ bool MCCrossSections::CreateCrossSectionFiles(MString Path) for (int e = 0; e <= eBins; ++e) { out<<"R1 " <ValueForMaterial(M, exp(eMin+e*eDist))/(1/cm)<CrossSectionPerVolume(M, gamma,exp(eMin+e*eDist))/(1/cm)<ValueForMaterial(M, exp(eMin+e*eDist))/(1/cm)<CrossSectionPerVolume(M,gamma, exp(eMin+e*eDist))/(1/cm)<ValueForMaterial(M, exp(eMin+e*eDist))/(1/cm)<CrossSectionPerVolume(M, gamma,exp(eMin+e*eDist))/(1/cm)<ValueForMaterial(M, exp(eMin+e*eDist)) + - CrossSectionHandlerRayleigh->ValueForMaterial(M, exp(eMin+e*eDist)) + + <CrossSectionPerVolume(M, gamma,exp(eMin+e*eDist)) + + CrossSectionHandlerRayleigh->CrossSectionPerVolume(M,gamma ,exp(eMin+e*eDist)) + CrossSectionHandlerCompton->ValueForMaterial(M, exp(eMin+e*eDist)) + - CrossSectionHandlerPair->ValueForMaterial(M, exp(eMin+e*eDist)))/(1/cm)<CrossSectionPerVolume(M, gamma,exp(eMin+e*eDist)))/(1/cm)< Date: Thu, 6 Jul 2023 12:10:04 -0700 Subject: [PATCH 013/192] ADD: Flag to really exclude excluded lines --- src/global/misc/inc/MIsotope.h | 2 +- src/global/misc/inc/MIsotopeStore.h | 2 +- src/global/misc/src/MIsotope.cxx | 16 +++++++++------- src/global/misc/src/MIsotopeStore.cxx | 6 +++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/global/misc/inc/MIsotope.h b/src/global/misc/inc/MIsotope.h index 9bbe5f869..8fc56f57f 100644 --- a/src/global/misc/inc/MIsotope.h +++ b/src/global/misc/inc/MIsotope.h @@ -58,7 +58,7 @@ class MIsotope unsigned int GetNucleons() const { return m_Nucleons; } //! Add line parameters: - virtual void AddLine(double Energy, double BranchingRatio, const MString& Flags); + virtual void AddLine(double Energy, double BranchingRatio, const MString& Flags, bool ExcludeExcludedLines = false); //! Return the number of lines unsigned GetNLines() const { return m_LineEnergies.size(); } //! Return the line energy diff --git a/src/global/misc/inc/MIsotopeStore.h b/src/global/misc/inc/MIsotopeStore.h index b7bc6bfbf..9018c99b8 100644 --- a/src/global/misc/inc/MIsotopeStore.h +++ b/src/global/misc/inc/MIsotopeStore.h @@ -41,7 +41,7 @@ class MIsotopeStore virtual ~MIsotopeStore(); //! Load all isotopes form a standard MEGAlib isotope file - bool Load(MString FileName); + bool Load(MString FileName, bool ExcludeExcludedLines = false); //! Return the number of isotopes unsigned int GetNumberOfIsotopes() const { return m_Isotopes.size(); } diff --git a/src/global/misc/src/MIsotope.cxx b/src/global/misc/src/MIsotope.cxx index 100aed932..67aef9c4f 100644 --- a/src/global/misc/src/MIsotope.cxx +++ b/src/global/misc/src/MIsotope.cxx @@ -111,14 +111,16 @@ MString MIsotope::GetName() const //! Add line parameters: -void MIsotope::AddLine(double Energy, double BranchingRatio, const MString& Flags) +void MIsotope::AddLine(double Energy, double BranchingRatio, const MString& Flags, bool ExcludeExcludedLines) { - m_LineEnergies.push_back(Energy); - m_LineBranchingRatios.push_back(BranchingRatio); - m_LineExcludeFlags.push_back(false); - m_LineDefaultFlags.push_back(false); - if (Flags.Contains("E") == true) m_LineExcludeFlags.back() = true; - if (Flags.Contains("D") == true) m_LineDefaultFlags.back() = true; + if (ExcludeExcludedLines == false || (ExcludeExcludedLines == true && Flags.Contains("E") == false)) { + m_LineEnergies.push_back(Energy); + m_LineBranchingRatios.push_back(BranchingRatio); + m_LineExcludeFlags.push_back(false); + m_LineDefaultFlags.push_back(false); + if (Flags.Contains("E") == true) m_LineExcludeFlags.back() = true; + if (Flags.Contains("D") == true) m_LineDefaultFlags.back() = true; + } } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/global/misc/src/MIsotopeStore.cxx b/src/global/misc/src/MIsotopeStore.cxx index c5c094ed1..2e695f9d8 100644 --- a/src/global/misc/src/MIsotopeStore.cxx +++ b/src/global/misc/src/MIsotopeStore.cxx @@ -59,7 +59,7 @@ MIsotopeStore::~MIsotopeStore() //! Load all isotopes form a standard MEGAlib isotope file -bool MIsotopeStore::Load(MString FileName) +bool MIsotopeStore::Load(MString FileName, bool ExcludeExcludedLines) { MFile::ExpandFileName(FileName); if (MFile::Exists(FileName) == false) return false; @@ -85,7 +85,7 @@ bool MIsotopeStore::Load(MString FileName) if (m_Isotopes[s].GetElement() == Name && m_Isotopes[s].GetNucleons() == Nucleons) { m_Isotopes[s].AddLine(iParser.GetTokenizerAt(i)->GetTokenAtAsDouble(2), iParser.GetTokenizerAt(i)->GetTokenAtAsDouble(3), - Flags); + Flags, ExcludeExcludedLines); Found = true; break; } @@ -96,7 +96,7 @@ bool MIsotopeStore::Load(MString FileName) Isotope.SetNucleons(Nucleons); Isotope.AddLine(iParser.GetTokenizerAt(i)->GetTokenAtAsDouble(2), iParser.GetTokenizerAt(i)->GetTokenAtAsDouble(3), - Flags); + Flags, ExcludeExcludedLines); m_Isotopes.push_back(Isotope); } } From 250f752fbb2e860f452a299e18cb52a8f5202237 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 6 Jul 2023 12:10:30 -0700 Subject: [PATCH 014/192] CHG: Minimum bin ID is now 25 --- src/fretalon/base/src/MCalibrateEnergyFindLines.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx b/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx index 2e94f07bf..b057e7f56 100644 --- a/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx +++ b/src/fretalon/base/src/MCalibrateEnergyFindLines.cxx @@ -111,7 +111,7 @@ bool MCalibrateEnergyFindLines::FindPeaks(unsigned int ROGID) int Prior = 8; - int FirstPeakMinimumBinID = 3; + int FirstPeakMinimumBinID = 25; double FirstPeakMinimumPeakCounts = 300; double MinimumPeakCounts = 100; From 4ef81d8be98f2a3edc519c634ae559f03d527f53 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 6 Jul 2023 12:10:45 -0700 Subject: [PATCH 015/192] CHG: Exclude excluded lines --- src/fretalon/melinator/src/MGUIMainMelinator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fretalon/melinator/src/MGUIMainMelinator.cxx b/src/fretalon/melinator/src/MGUIMainMelinator.cxx index b0809a785..c2927eb5b 100644 --- a/src/fretalon/melinator/src/MGUIMainMelinator.cxx +++ b/src/fretalon/melinator/src/MGUIMainMelinator.cxx @@ -1279,7 +1279,7 @@ bool MGUIMainMelinator::OnLoadLast() vector AllGroupIDs; MIsotopeStore Store; - if (Store.Load("$(MEGALIB)/resource/libraries/Calibration.isotopes") == false) { + if (Store.Load("$(MEGALIB)/resource/libraries/Calibration.isotopes", true) == false) { merr<<"Unable to load calibration isotopes..."< Date: Wed, 19 Jul 2023 12:51:28 -0700 Subject: [PATCH 016/192] ADD: Command line option to select on a specific side --- src/fretalon/base/inc/MFileReadOuts.h | 9 +++++++-- src/fretalon/base/src/MFileReadOuts.cxx | 14 +++++++------ src/fretalon/melinator/inc/MMelinator.h | 10 ++++++++-- .../melinator/inc/MSettingsMelinator.h | 13 +++++++++--- .../melinator/src/MGUIMainMelinator.cxx | 1 + .../melinator/src/MInterfaceMelinator.cxx | 20 ++++++++++++------- src/fretalon/melinator/src/MMelinator.cxx | 7 ++++--- .../melinator/src/MSettingsMelinator.cxx | 11 ++++++++-- 8 files changed, 60 insertions(+), 25 deletions(-) diff --git a/src/fretalon/base/inc/MFileReadOuts.h b/src/fretalon/base/inc/MFileReadOuts.h index bfc5b7d0c..04a563ff5 100644 --- a/src/fretalon/base/inc/MFileReadOuts.h +++ b/src/fretalon/base/inc/MFileReadOuts.h @@ -48,8 +48,13 @@ class MFileReadOuts : public MFileEvents virtual bool Open(MString FileName, unsigned int Way = MFile::c_Read); //! Return the next event - //! If SelectedDetectorID >= 0 then restrict yourself to SelectedDetectorID - bool ReadNext(MReadOutSequence& Sequence, int SelectedDetectorID = -1); + //! If SelectedDetectorID is non-negative then restrict yourself to SelectedDetectorID + //! SelectedDetectorSide: + //! < 0: all + //! 0: negative side + //! 1: positive side + //! >=2: all + bool ReadNext(MReadOutSequence& Sequence, int SelectedDetectorID = -1, int SelectedDetectorSide = -1); // protected methods: diff --git a/src/fretalon/base/src/MFileReadOuts.cxx b/src/fretalon/base/src/MFileReadOuts.cxx index 755e4d7bb..43eb067c0 100644 --- a/src/fretalon/base/src/MFileReadOuts.cxx +++ b/src/fretalon/base/src/MFileReadOuts.cxx @@ -248,7 +248,7 @@ bool MFileReadOuts::ParseFooter(const MString& Line) //////////////////////////////////////////////////////////////////////////////// -bool MFileReadOuts::ReadNext(MReadOutSequence& ROS, int SelectedDetectorID) +bool MFileReadOuts::ReadNext(MReadOutSequence& ROS, int SelectedDetectorID, int SelectedDetectorSide) { // Return next single event from file... or 0 if there are no more. @@ -267,7 +267,7 @@ bool MFileReadOuts::ReadNext(MReadOutSequence& ROS, int SelectedDetectorID) // If we have an include file, we get the event from it! if (m_IncludeFileUsed == true) { - bool Return = dynamic_cast(m_IncludeFile)->ReadNext(ROS, SelectedDetectorID); + bool Return = dynamic_cast(m_IncludeFile)->ReadNext(ROS, SelectedDetectorID, SelectedDetectorSide); if (ROS.GetNumberOfReadOuts() == 0 || Return == false) { m_IncludeFile->Close(); m_IncludeFileUsed = false; @@ -313,7 +313,7 @@ bool MFileReadOuts::ReadNext(MReadOutSequence& ROS, int SelectedDetectorID) if (OpenIncludeFile(Line) == true) { //mout<<"Switched to new include file: "<GetFileName()<(m_IncludeFile)->ReadNext(ROS, SelectedDetectorID); + bool Return = dynamic_cast(m_IncludeFile)->ReadNext(ROS, SelectedDetectorID, SelectedDetectorSide); if (ROS.GetNumberOfReadOuts() == 0 || Return == false) { //mout<<"Closing: "<GetFileName()<Close(); @@ -340,9 +340,11 @@ bool MFileReadOuts::ReadNext(MReadOutSequence& ROS, int SelectedDetectorID) // cout<<"Combined: "<ToString()<<" vs. "<GetCombinedType()<= 0 && (int) m_ROE->GetDetectorID() == SelectedDetectorID)) { - MReadOut RO(*m_ROE, *m_ROD); - ROS.AddReadOut(RO); - //cout<<"Added: "<= 2 || (dynamic_cast(m_ROE) != nullptr && (int) dynamic_cast(m_ROE)->IsPositiveStrip() == SelectedDetectorSide)) { + MReadOut RO(*m_ROE, *m_ROD); + ROS.AddReadOut(RO); + //cout<<"Added: "<=2: all) + void SetSelectedDetectorSide(int SelectedDetectorSide) { m_SelectedDetectorSide = SelectedDetectorSide; } + //! Load the calibration data containing the given isotopes and eventually merge files with identical data groups //! Return false if an error occurred //! This function performs parallel loading of all given files @@ -199,7 +202,10 @@ class MMelinator double m_SelectedTemperatureMin; //! The selected temperature window maximum double m_SelectedTemperatureMax; - + + //! The selected detector side (< 0: all, 0: negative side, 1: positive side, >=2: all) + int m_SelectedDetectorSide; + //! The group IDs vector m_GroupIDs; //! The calibration file names diff --git a/src/fretalon/melinator/inc/MSettingsMelinator.h b/src/fretalon/melinator/inc/MSettingsMelinator.h index cc030a42c..ddebda59e 100644 --- a/src/fretalon/melinator/inc/MSettingsMelinator.h +++ b/src/fretalon/melinator/inc/MSettingsMelinator.h @@ -133,12 +133,17 @@ class MSettingsMelinator : public MSettings void SetSaveAsFileName(const MString& SaveAsFileName) { m_SaveAsFileName = SaveAsFileName; } //! Get the save-as file name MString GetSaveAsFileName() const { return m_SaveAsFileName; } - + //! Set the single detector to use (negative means use all) void SetSelectedDetectorID(int ID) { m_SelectedDetectorID = ID; } //! Get the single detector to use (negative means use all) int GetSelectedDetectorID() const { return m_SelectedDetectorID; } - + + //! Set the detector side to use (< 0: all, 0: negative side, 1: positive side, >=2: all) + void SetSelectedDetectorSide(int Side) { m_SelectedDetectorSide = Side; } + //! Get the detector side to use (< 0: all, 0: negative side, 1: positive side, >=2: all) + int GetSelectedDetectorSide() const { return m_SelectedDetectorSide; } + //! Set the minimum allowed detector temperature void SetMinimumTemperature(double MinimumTemperature) { m_MinimumTemperature = MinimumTemperature; } //! Get the minimum allowed detector temperate @@ -206,7 +211,9 @@ class MSettingsMelinator : public MSettings //! Set the single detector to use (negative means use all) int m_SelectedDetectorID; - + //! Set the detector side to use (< 0: all, 0: negative side, 1: positive side, >=2: all) + int m_SelectedDetectorSide; + //! Set the minimum allowed detector temperature double m_MinimumTemperature; //! Set the maximum allowed detector temperature diff --git a/src/fretalon/melinator/src/MGUIMainMelinator.cxx b/src/fretalon/melinator/src/MGUIMainMelinator.cxx index c2927eb5b..db3babc7c 100644 --- a/src/fretalon/melinator/src/MGUIMainMelinator.cxx +++ b/src/fretalon/melinator/src/MGUIMainMelinator.cxx @@ -1267,6 +1267,7 @@ bool MGUIMainMelinator::OnLoadLast() m_Melinator.Clear(); m_Melinator.SetSelectedDetectorID(m_Settings->GetSelectedDetectorID()); + m_Melinator.SetSelectedDetectorSide(m_Settings->GetSelectedDetectorSide()); m_Melinator.SetSelectedTemperatureWindow(m_Settings->GetMinimumTemperature(), m_Settings->GetMaximumTemperature()); MString FileName; diff --git a/src/fretalon/melinator/src/MInterfaceMelinator.cxx b/src/fretalon/melinator/src/MInterfaceMelinator.cxx index 0c39c6db2..dcbea0910 100644 --- a/src/fretalon/melinator/src/MInterfaceMelinator.cxx +++ b/src/fretalon/melinator/src/MInterfaceMelinator.cxx @@ -95,16 +95,18 @@ bool MInterfaceMelinator::ParseCommandLine(int argc, char** argv) Usage<"<.ecal:"<.ecal:"<:"<:"< :"<:"< i+1) && argv[i+1][0] != '-')){ @@ -164,12 +167,15 @@ bool MInterfaceMelinator::ParseCommandLine(int argc, char** argv) // Now parse all low level options for (int i = 1; i < argc; i++) { Option = argv[i]; - if (Option == "--save" || Option == "-s") { + if (Option == "--ecal" || Option == "-e") { m_Data->SetSaveAsFileName(argv[++i]); cout<<"Command-line parser: Use save as file name "<GetSaveAsFileName()<SetSelectedDetectorID(atoi(argv[++i])); cout<<"Command-line parser: Use only this detector: "<GetSelectedDetectorID()<SetSelectedDetectorSide(atoi(argv[++i])); + cout<<"Command-line parser: Use only this detector side (0: neg, 1: pos, else: all): "<GetSelectedDetectorSide()<SetMinimumTemperature(atof(argv[++i])); m_Data->SetMaximumTemperature(atof(argv[++i])); diff --git a/src/fretalon/melinator/src/MMelinator.cxx b/src/fretalon/melinator/src/MMelinator.cxx index 6bcd37cd6..544026941 100644 --- a/src/fretalon/melinator/src/MMelinator.cxx +++ b/src/fretalon/melinator/src/MMelinator.cxx @@ -126,10 +126,11 @@ void MMelinator::Clear() m_Isotopes.clear(); m_SelectedDetectorID = -1; - + m_SelectedDetectorSide = -1; + m_SelectedTemperatureMin = -numeric_limits::max(); m_SelectedTemperatureMax = +numeric_limits::max(); - + m_HistogramChanged = true; m_HistogramCollection = -1; for (auto H: m_Histograms) delete H; @@ -420,7 +421,7 @@ bool MMelinator::LoadParallel(unsigned int ThreadID) MReadOutSequence Sequence; long Counter = 0; long NewCounter = 0; - while (Reader.ReadNext(Sequence, m_SelectedDetectorID) == true) { + while (Reader.ReadNext(Sequence, m_SelectedDetectorID, m_SelectedDetectorSide) == true) { // Since we do energy calibration, exclude everything with more than the number of good hits //if (Sequence.HasIdenticalReadOutElementTypes() == true) { // if (Sequence.GetNumberOfReadOuts() > 0 && diff --git a/src/fretalon/melinator/src/MSettingsMelinator.cxx b/src/fretalon/melinator/src/MSettingsMelinator.cxx index 710f1bf65..8b438fe1b 100644 --- a/src/fretalon/melinator/src/MSettingsMelinator.cxx +++ b/src/fretalon/melinator/src/MSettingsMelinator.cxx @@ -77,6 +77,7 @@ MSettingsMelinator::MSettingsMelinator(bool AutoLoad) : MSettings("MelinatorConf m_SaveAsFileName = "Out.ecal"; m_SelectedDetectorID = -1; + m_SelectedDetectorSide = -1; m_MinimumTemperature = -numeric_limits::max(); m_MaximumTemperature = +numeric_limits::max(); @@ -169,8 +170,10 @@ bool MSettingsMelinator::WriteXml(MXmlNode* Node) new MXmlNode(Node, "SaveAsFileName", m_SaveAsFileName); - //new MXmlNode(Node, "SelectedDetectorID", m_SelectedDetectorID); - + // Not stored, since command line options: + // new MXmlNode(Node, "SelectedDetectorID", m_SelectedDetectorID); + // new MXmlNode(Node, "SelectedDetectorSide", m_SelectedDetectorSide); + return true; } @@ -279,9 +282,13 @@ bool MSettingsMelinator::ReadXml(MXmlNode* Node) } /* + // Not stored since command line options if ((aNode = Node->GetNode("SelectedDetectorID")) != 0) { m_SelectedDetectorID = aNode->GetValueAsInt(); } + if ((aNode = Node->GetNode("SelectedDetectorSide")) != 0) { + m_SelectedDetectorSide = aNode->GetValueAsInt(); + } */ return true; From a93fe4fa29aa52dff87a135998d0cf895dc1560d Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Wed, 19 Jul 2023 18:38:22 -0700 Subject: [PATCH 017/192] CHG: Disallow cfg loading in the UI --- src/fretalon/melinator/src/MGUIMainMelinator.cxx | 9 +++++++-- src/fretalon/melinator/src/MInterfaceMelinator.cxx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fretalon/melinator/src/MGUIMainMelinator.cxx b/src/fretalon/melinator/src/MGUIMainMelinator.cxx index db3babc7c..492f46959 100644 --- a/src/fretalon/melinator/src/MGUIMainMelinator.cxx +++ b/src/fretalon/melinator/src/MGUIMainMelinator.cxx @@ -168,7 +168,8 @@ void MGUIMainMelinator::Create() MenuFiles->AddEntry("Save", c_Save); MenuFiles->AddSeparator(); MenuFiles->AddLabel("Configuration file"); - MenuFiles->AddEntry("Open", c_LoadConfig); + //MenuFiles->AddEntry("Open", c_LoadConfig); + MenuFiles->AddEntry("Open -> use command line at launch", c_LoadConfig); MenuFiles->AddEntry("Save As", c_SaveConfig); MenuFiles->AddSeparator(); MenuFiles->AddLabel("Geometry file"); @@ -1864,6 +1865,9 @@ bool MGUIMainMelinator::OnFitAll() //! Load a configuration file from disk bool MGUIMainMelinator::OnLoadConfiguration() { + //! Loading can leave the app in an inconsistent state, thus not do it now + + /* const char** Types = new const char*[4]; Types[0] = "Configuration file"; Types[1] = "*.cfg"; @@ -1880,7 +1884,8 @@ bool MGUIMainMelinator::OnLoadConfiguration() // Get the filename ... if ((char *) Info.fFilename != 0) { m_Interface->LoadConfiguration(MString(Info.fFilename)); - } + } + */ return true; } diff --git a/src/fretalon/melinator/src/MInterfaceMelinator.cxx b/src/fretalon/melinator/src/MInterfaceMelinator.cxx index dcbea0910..b21d2cd5f 100644 --- a/src/fretalon/melinator/src/MInterfaceMelinator.cxx +++ b/src/fretalon/melinator/src/MInterfaceMelinator.cxx @@ -260,7 +260,7 @@ bool MInterfaceMelinator::LoadConfiguration(MString FileName) { // Load the configuration file - if (m_Data == 0) { + if (m_Data == nullptr) { m_Data = new MSettingsMelinator(); m_BasicGuiData = dynamic_cast(m_Data); //m_Gui->SetConfiguration(m_Data); From c012e63a9eb875d24272c2ece967b282c5507dc8 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Fri, 8 Sep 2023 15:25:06 -0700 Subject: [PATCH 018/192] CHG: Switch from n/p side to high and low voltage side --- .../base/inc/MReadOutElementDoubleStrip.h | 16 +++++++++++----- .../base/src/MReadOutElementDoubleStrip.cxx | 18 +++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/fretalon/base/inc/MReadOutElementDoubleStrip.h b/src/fretalon/base/inc/MReadOutElementDoubleStrip.h index c39fed83d..569b44395 100644 --- a/src/fretalon/base/inc/MReadOutElementDoubleStrip.h +++ b/src/fretalon/base/inc/MReadOutElementDoubleStrip.h @@ -64,10 +64,16 @@ class MReadOutElementDoubleStrip : public MReadOutElementStrip //! I.e. for a double strip it is two (n and p side), otherwise it is usually 1 virtual unsigned int GetMinimumNumberOfReadOutsForGoodInteraction() const { return 2; } - //! Set the strip type (x/y) - void IsPositiveStrip(bool IsPositiveStrip) { m_IsPositiveStrip = IsPositiveStrip; } - //! Return the strip type (x/y) - bool IsPositiveStrip() const { return m_IsPositiveStrip; } + //! Set the strip type (positive equals the lowest voltage value side of the detector) + void IsPositiveStrip(bool IsPositiveStrip) { m_IsLowVoltageStrip = IsPositiveStrip; } + //! Return the strip type (positive equals the lowest voltage value side of the detector) + bool IsPositiveStrip() const { return m_IsLowVoltageStrip; } + + //! Is this the low voltage strip (= negative in ols nomenclature) + void IsLowVoltageStrip(bool IsLowVoltageStrip) { m_IsLowVoltageStrip = IsLowVoltageStrip; } + //! Return true if this is a high-volatge strip + bool IsLowVoltageStrip() const { return m_IsLowVoltageStrip; } + //! Return the number of parsable elements virtual unsigned int GetNumberOfParsableElements() const; @@ -91,7 +97,7 @@ class MReadOutElementDoubleStrip : public MReadOutElementStrip // protected members: protected: //! The side of double sided strip detector - bool m_IsPositiveStrip; + bool m_IsLowVoltageStrip; // private members: private: diff --git a/src/fretalon/base/src/MReadOutElementDoubleStrip.cxx b/src/fretalon/base/src/MReadOutElementDoubleStrip.cxx index 3570a8f40..f97bacd38 100644 --- a/src/fretalon/base/src/MReadOutElementDoubleStrip.cxx +++ b/src/fretalon/base/src/MReadOutElementDoubleStrip.cxx @@ -46,7 +46,7 @@ ClassImp(MReadOutElementDoubleStrip) //! Default constructor -MReadOutElementDoubleStrip::MReadOutElementDoubleStrip(): MReadOutElementStrip(), m_IsPositiveStrip(true) +MReadOutElementDoubleStrip::MReadOutElementDoubleStrip(): MReadOutElementStrip(), m_IsLowVoltageStrip(true) { } @@ -55,7 +55,7 @@ MReadOutElementDoubleStrip::MReadOutElementDoubleStrip(): MReadOutElementStrip() //! Read out element of a DOUBLE-SIDED strip detector -MReadOutElementDoubleStrip::MReadOutElementDoubleStrip(unsigned int DetectorID, unsigned int StripID, bool IsPositiveStrip) : MReadOutElementStrip(DetectorID, StripID), m_IsPositiveStrip(IsPositiveStrip) +MReadOutElementDoubleStrip::MReadOutElementDoubleStrip(unsigned int DetectorID, unsigned int StripID, bool IsLowVoltageStrip) : MReadOutElementStrip(DetectorID, StripID), m_IsLowVoltageStrip(IsLowVoltageStrip) { } @@ -75,7 +75,7 @@ MReadOutElementDoubleStrip::~MReadOutElementDoubleStrip() //! Clone this read-out element - the returned element must be deleted! MReadOutElementDoubleStrip* MReadOutElementDoubleStrip::Clone() const { - MReadOutElementDoubleStrip* R = new MReadOutElementDoubleStrip(m_DetectorID, m_StripID, m_IsPositiveStrip); + MReadOutElementDoubleStrip* R = new MReadOutElementDoubleStrip(m_DetectorID, m_StripID, m_IsLowVoltageStrip); return R; } @@ -87,7 +87,7 @@ MReadOutElementDoubleStrip* MReadOutElementDoubleStrip::Clone() const void MReadOutElementDoubleStrip::Clear() { MReadOutElementStrip::Clear(); - m_IsPositiveStrip = true; + m_IsLowVoltageStrip = true; } @@ -124,7 +124,7 @@ bool MReadOutElementDoubleStrip::operator==(const MReadOutElement& R) const if (m_StripID != S->m_StripID) return false; if (m_DetectorID != S->m_DetectorID) return false; - if (m_IsPositiveStrip != S->m_IsPositiveStrip) return false; + if (m_IsLowVoltageStrip != S->m_IsLowVoltageStrip) return false; return true; } @@ -143,7 +143,7 @@ bool MReadOutElementDoubleStrip::operator<(const MReadOutElement& R) const if (m_DetectorID == S->m_DetectorID) { if (m_StripID < S->m_StripID) return true; if (m_StripID == S->m_StripID) { - if (m_IsPositiveStrip == false && S->m_IsPositiveStrip == true) return true; + if (m_IsLowVoltageStrip == false && S->m_IsLowVoltageStrip == true) return true; } } @@ -174,7 +174,7 @@ bool MReadOutElementDoubleStrip::Parse(const MTokenizer& T, unsigned int StartEl m_DetectorID = T.GetTokenAtAsUnsignedIntFast(StartElement); m_StripID = T.GetTokenAtAsUnsignedIntFast(StartElement+1); - m_IsPositiveStrip = (T.GetTokenAt(StartElement+2) == "p") ? true : false; + m_IsLowVoltageStrip = (T.GetTokenAt(StartElement+2) == "l" || T.GetTokenAt(StartElement+2) == "p") ? true : false; return true; } @@ -194,7 +194,7 @@ MString MReadOutElementDoubleStrip::ToParsableString(bool WithDescriptor) const Return += " "; Return += m_StripID; Return += " "; - Return += (m_IsPositiveStrip ? "p" : "n"); + Return += (m_IsLowVoltageStrip ? "l" : "h"); return Return; } @@ -207,7 +207,7 @@ MString MReadOutElementDoubleStrip::ToParsableString(bool WithDescriptor) const MString MReadOutElementDoubleStrip::ToString() const { ostringstream os; - os<<"Detector: "< Date: Tue, 12 Sep 2023 00:53:14 -0700 Subject: [PATCH 019/192] CHG: More switching from neg/pos to LV/HV --- src/fretalon/base/inc/MReadOutElementDoubleStrip.h | 4 ++-- src/fretalon/melinator/src/MInterfaceMelinator.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fretalon/base/inc/MReadOutElementDoubleStrip.h b/src/fretalon/base/inc/MReadOutElementDoubleStrip.h index 569b44395..f37d327f5 100644 --- a/src/fretalon/base/inc/MReadOutElementDoubleStrip.h +++ b/src/fretalon/base/inc/MReadOutElementDoubleStrip.h @@ -69,9 +69,9 @@ class MReadOutElementDoubleStrip : public MReadOutElementStrip //! Return the strip type (positive equals the lowest voltage value side of the detector) bool IsPositiveStrip() const { return m_IsLowVoltageStrip; } - //! Is this the low voltage strip (= negative in ols nomenclature) + //! Is this the-low voltage strip (= negative in old nomenclature) void IsLowVoltageStrip(bool IsLowVoltageStrip) { m_IsLowVoltageStrip = IsLowVoltageStrip; } - //! Return true if this is a high-volatge strip + //! Return true if this is a low-voltage strip bool IsLowVoltageStrip() const { return m_IsLowVoltageStrip; } diff --git a/src/fretalon/melinator/src/MInterfaceMelinator.cxx b/src/fretalon/melinator/src/MInterfaceMelinator.cxx index b21d2cd5f..7e91587e2 100644 --- a/src/fretalon/melinator/src/MInterfaceMelinator.cxx +++ b/src/fretalon/melinator/src/MInterfaceMelinator.cxx @@ -106,7 +106,7 @@ bool MInterfaceMelinator::ParseCommandLine(int argc, char** argv) Usage<<" -d --detector :"<:"< :"<:"<GetSelectedDetectorID()<SetSelectedDetectorSide(atoi(argv[++i])); - cout<<"Command-line parser: Use only this detector side (0: neg, 1: pos, else: all): "<GetSelectedDetectorSide()<GetSelectedDetectorSide()<SetMinimumTemperature(atof(argv[++i])); m_Data->SetMaximumTemperature(atof(argv[++i])); From 772f8c37100acc0b43fd93252654e6bb20a187d8 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Wed, 13 Sep 2023 00:06:36 -0700 Subject: [PATCH 020/192] CHG: Added peak finding options to UI, scrollbar for options, include errors for peak fitting, minor canvas chnages --- .../base/inc/MCalibrateEnergyFindLines.h | 21 +- .../src/MCalibrateEnergyAssignEnergies.cxx | 4 +- .../base/src/MCalibrateEnergyFindLines.cxx | 35 ++-- .../base/src/MCalibrationFitGaussian.cxx | 2 +- .../melinator/inc/MGUIMainMelinator.h | 12 +- src/fretalon/melinator/inc/MMelinator.h | 17 +- .../melinator/inc/MSettingsMelinator.h | 27 ++- .../melinator/src/MGUIEReadOutElementView.cxx | 2 +- .../melinator/src/MGUIMainMelinator.cxx | 197 ++++++++++++------ src/fretalon/melinator/src/MMelinator.cxx | 21 +- .../melinator/src/MSettingsMelinator.cxx | 20 +- src/global/misc/src/MBinner.cxx | 12 +- 12 files changed, 267 insertions(+), 103 deletions(-) diff --git a/src/fretalon/base/inc/MCalibrateEnergyFindLines.h b/src/fretalon/base/inc/MCalibrateEnergyFindLines.h index f780235a0..28fbc6c6a 100644 --- a/src/fretalon/base/inc/MCalibrateEnergyFindLines.h +++ b/src/fretalon/base/inc/MCalibrateEnergyFindLines.h @@ -60,6 +60,16 @@ class MCalibrateEnergyFindLines : public MCalibrateEnergy //! Set the selected temperature window void SetTemperatureWindow(double Min, double Max) { m_TemperatureMin = Min; m_TemperatureMax = Max; } + //! Set the prior + void SetBayesianBlockPrior(unsigned int Prior) { m_Prior = Prior; } + + //! Set the number of bins which are excluded from peak finding at low energies + //! to avoid noise peaks + void SetNumberOfExcludedBinsAtLowEnergies(unsigned int Bins) { m_ExcludeFirstNumberOfBins = Bins; } + + //! Set the minimum number of counts in accepted peaks + void SetMinimumNumberOfPeakCounts(unsigned int Counts) { m_MinimumPeakCounts = Counts; } + //! Perform the calibration virtual bool Calibrate(); @@ -108,7 +118,16 @@ class MCalibrateEnergyFindLines : public MCalibrateEnergy //! The selected temperature window maximum double m_TemperatureMax; - + // User adjustable flags + + //! The prior for the Bayesian block binning + unsigned int m_Prior; + //! Ignore peaks found in the first X number of bins + unsigned int m_ExcludeFirstNumberOfBins; + //! Minimum number of counts in accepted peak + unsigned int m_MinimumPeakCounts; + + #ifdef ___CLING___ public: ClassDef(MCalibrateEnergyFindLines, 0) // no description diff --git a/src/fretalon/base/src/MCalibrateEnergyAssignEnergies.cxx b/src/fretalon/base/src/MCalibrateEnergyAssignEnergies.cxx index 360ce37da..bb077d8d4 100644 --- a/src/fretalon/base/src/MCalibrateEnergyAssignEnergies.cxx +++ b/src/fretalon/base/src/MCalibrateEnergyAssignEnergies.cxx @@ -316,9 +316,9 @@ bool MCalibrateEnergyAssignEnergies::CalibrateLinear() } if (AllIncreasing == true) { NewSetsOfMatches.push_back(NewSet); - //cout<<"Increasing: "<::max(); m_TemperatureMax = +numeric_limits::max(); + + m_Prior = 8; + m_ExcludeFirstNumberOfBins = 25; + m_MinimumPeakCounts = 100; } @@ -109,12 +113,9 @@ bool MCalibrateEnergyFindLines::FindPeaks(unsigned int ROGID) { if (g_Verbosity >= c_Info) cout<GetName()<<")"<GetNumberOfReadOutDatas(); ++d) { MReadOutDataTemperature* T = dynamic_cast(m_ROGs[ROGID]->GetReadOutData(d).Get(MReadOutDataTemperature::m_TypeID)); if (T != nullptr) { @@ -259,11 +260,11 @@ bool MCalibrateEnergyFindLines::FindPeaks(unsigned int ROGID) if (g_Verbosity >= c_Chatty) cout<GetBinLowEdge(b+1)<<": Height etc. : "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Rejected: Not enough counts per bin: "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Rejected: Not enough counts per bin: "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Passed: Enough counts per bin: "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Passed: Enough counts per bin: "<= c_Chatty) cout<<"Peak bin: "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Rejected: First peak must be at least "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Rejected: First peak must be at least "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Passed: First peak is at least "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Passed: First peak is at least "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Passed: Enough peak counts for a first peak: "<= c_Info) cout<GetBinLowEdge(b+1)<<" - Rejected: Not enough peak counts: "< 3.0 && Fit.Evaluate(P.GetPeak())/Fit.Evaluate(P.GetHighEdge()) < 10) { if (g_Verbosity >= c_Info) cout<= c_Info) cout< m_Histograms; - + + //! Peak finding: Bayesian block prior + unsigned int m_PeakFindingPrior; + //! Peak finding: the number of bins excluded at lower energies + unsigned int m_PeakFindingExcludeFirstNumberOfBins; + //! Peak finding: the minimum number of counts in a peak + unsigned int m_PeakFindingMinimumPeakCounts; + //! The peak parametrization method in during calibration of the lines unsigned int m_PeakParametrizationMethod; diff --git a/src/fretalon/melinator/inc/MSettingsMelinator.h b/src/fretalon/melinator/inc/MSettingsMelinator.h index ddebda59e..aec6cc4d7 100644 --- a/src/fretalon/melinator/inc/MSettingsMelinator.h +++ b/src/fretalon/melinator/inc/MSettingsMelinator.h @@ -79,7 +79,25 @@ class MSettingsMelinator : public MSettings bool GetHistogramLogY() const { return m_HistogramLogY; } //! Set a flag indicating the y-axis is displayed logarithmic void SetHistogramLogY(bool HistogramLogY) { m_HistogramLogY = HistogramLogY; } - + + + + //! Get the peak finding Bayesian block prior + unsigned int GetPeakFindingPrior() const { return m_PeakFindingPrior; } + //! Set the peak finding Bayesian block prior + void SetPeakFindingPrior(unsigned int PeakFindingPrior) { m_PeakFindingPrior = PeakFindingPrior; } + + //! Get the peak finding number of bins excluded at lower energies + unsigned int GetPeakFindingExcludeFirstNumberOfBins() const { return m_PeakFindingExcludeFirstNumberOfBins; } + //! Set the peak finding number of bins excluded at lower energies + void SetPeakFindingExcludeFirstNumberOfBins(unsigned int PeakFindingExcludeFirstNumberOfBins) { m_PeakFindingExcludeFirstNumberOfBins = PeakFindingExcludeFirstNumberOfBins; } + + //! Get the peak finding minimum number of counts in a peak + unsigned int GetPeakFindingMinimumPeakCounts() const { return m_PeakFindingMinimumPeakCounts; } + //! Set the peak finding minimum number of counts in a peak + void SetPeakFindingMinimumPeakCounts(unsigned int PeakFindingMinimumPeakCounts) { m_PeakFindingMinimumPeakCounts = PeakFindingMinimumPeakCounts; } + + //! Get the peak binning mode: 0: fixed number of bins, 1: fixed cts per bin, 2: Bayesian block unsigned int GetPeakHistogramBinningMode() const { return m_PeakHistogramBinningMode; } @@ -183,6 +201,13 @@ class MSettingsMelinator : public MSettings //! Flag indicating that the y-axis is displayed logarithmic bool m_HistogramLogY; + //! Peak finding: Bayesian block prior + unsigned int m_PeakFindingPrior; + //! Peak finding: the number of bins excluded at lower energies + unsigned int m_PeakFindingExcludeFirstNumberOfBins; + //! Peak finding: the minimum number of counts in a peak + unsigned int m_PeakFindingMinimumPeakCounts; + //! The binning mode for the peak histogram: fixed number of bins, fixed cts per bin, Bayesian block unsigned int m_PeakHistogramBinningMode; //! Depending on the binning mode, either bins, cts/bin, or prior diff --git a/src/fretalon/melinator/src/MGUIEReadOutElementView.cxx b/src/fretalon/melinator/src/MGUIEReadOutElementView.cxx index 6b4b26125..70a099ad1 100644 --- a/src/fretalon/melinator/src/MGUIEReadOutElementView.cxx +++ b/src/fretalon/melinator/src/MGUIEReadOutElementView.cxx @@ -47,7 +47,7 @@ MGUIEReadOutElementView::MGUIEReadOutElementView(const TGWindow* Parent) : m_Parent = (TGWindow *) Parent; // Since we do not create the element in the constructor, - // we have initialze some pointers: + // we have to initialize some pointers: m_Container = new TGCompositeFrame(GetViewPort(), 50, 50); SetContainer(m_Container); diff --git a/src/fretalon/melinator/src/MGUIMainMelinator.cxx b/src/fretalon/melinator/src/MGUIMainMelinator.cxx index 492f46959..4d2d95bf5 100644 --- a/src/fretalon/melinator/src/MGUIMainMelinator.cxx +++ b/src/fretalon/melinator/src/MGUIMainMelinator.cxx @@ -107,6 +107,9 @@ void MGUIMainMelinator::Create() double FontScaler = MGUIDefaults::GetInstance()->GetFontScaler(); + int ScrollBarWidth = 50; + int ControlColumnWidth = 225 + ScrollBarWidth; + // Give it a default size Resize(FontScaler*1200, 250 + FontScaler*600); @@ -125,10 +128,14 @@ void MGUIMainMelinator::Create() TGLayoutHints* TopLeftTextLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, FontScaler*3, 0); TGLayoutHints* TopRightLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsRight, FontScaler*10, 0, 0, 0); TGLayoutHints* ButtonLayout = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, FontScaler*3, 3); + + TGLayoutHints* CenterYLeftLayout = new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 0, 0, 0); + TGLayoutHints* CenterYRightEntryLayout = new TGLayoutHints(kLHintsCenterY | kLHintsRight, 0, 0, 0, 0); + //TGLayoutHints* TopRightLayout = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 3); - TGLayoutHints* GroupLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 5, 5); + TGLayoutHints* GroupLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2 + ScrollBarWidth, 5, 5); // We have three main columns - the control column on the left, data column in the center, and selection on the right @@ -140,9 +147,7 @@ void MGUIMainMelinator::Create() // Left column: control column - - int ControlColumnWidth = 225; - + TGLayoutHints* ControlColumnLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 5, 0, 0, 0); TGVerticalFrame* ControlColumn = new TGVerticalFrame(Columns, ControlColumnWidth, ControlColumnWidth); //, kRaisedFrame); Columns->AddFrame(ControlColumn, ControlColumnLayout); @@ -218,9 +223,22 @@ void MGUIMainMelinator::Create() ControlColumn->AddFrame(SubTitle, SubTitleLayout); + + // Options section + + TGLayoutHints* OptionsLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 5, 0, 0, 0); + TGCanvas* OptionsCanvas = new TGCanvas(Columns, ControlColumnWidth, ControlColumnWidth, 0); + + TGVerticalFrame* OptionsFrame = new TGVerticalFrame(OptionsCanvas->GetViewPort(), ControlColumnWidth, ControlColumnWidth, 0); + OptionsCanvas->SetContainer(OptionsFrame); + OptionsCanvas->SetScrolling(TGCanvas::kCanvasScrollVertical); + + ControlColumn->AddFrame(OptionsCanvas, OptionsLayout); + + // Section: Main spectrum - TGGroupFrame* HistogramGroup = new TGGroupFrame(ControlColumn, "Options for Main Spectrum", kVerticalFrame); - ControlColumn->AddFrame(HistogramGroup, GroupLayout); + TGGroupFrame* HistogramGroup = new TGGroupFrame(OptionsFrame, "Display of spectrum", kVerticalFrame); + OptionsFrame->AddFrame(HistogramGroup, GroupLayout); TGHorizontalFrame* ADCFrame = new TGHorizontalFrame(HistogramGroup); @@ -306,11 +324,57 @@ void MGUIMainMelinator::Create() HistogramGroup->AddFrame(m_UpdateHistogramButton, TopExpandXLayout); + + + // Section: Peak finding + TGGroupFrame* PeakFindingGroup = new TGGroupFrame(OptionsFrame, "Peak finding options", kVerticalFrame); + OptionsFrame->AddFrame(PeakFindingGroup, GroupLayout); + + TGHorizontalFrame* PeakFindingPriorFrame = new TGHorizontalFrame(PeakFindingGroup); + PeakFindingGroup->AddFrame(PeakFindingPriorFrame, TopLeftLayout); + + TGLabel* PeakFindingPriorLabel = new TGLabel(PeakFindingPriorFrame, "Bayesian block prior: "); + PeakFindingPriorLabel->SetWrapLength(FontScaler*150); + PeakFindingPriorFrame->AddFrame(PeakFindingPriorLabel, CenterYLeftLayout); + + m_PeakFindingPrior = new TGNumberEntry(PeakFindingPriorFrame, m_Settings->GetPeakFindingPrior()); + m_PeakFindingPrior->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 1000000); + m_PeakFindingPrior->SetWidth(FontScaler*70); + PeakFindingPriorFrame->AddFrame(m_PeakFindingPrior, CenterYRightEntryLayout); + + + TGHorizontalFrame* PeakFindingExcludeFirstNumberOfBinsFrame = new TGHorizontalFrame(PeakFindingGroup); + PeakFindingGroup->AddFrame(PeakFindingExcludeFirstNumberOfBinsFrame, TopLeftLayout); + + TGLabel* PeakFindingExcludeFirstNumberOfBinsLabel = new TGLabel(PeakFindingExcludeFirstNumberOfBinsFrame, "Number of low-energy bins to exclude: "); + PeakFindingExcludeFirstNumberOfBinsLabel->SetWrapLength(FontScaler*150); + PeakFindingExcludeFirstNumberOfBinsFrame->AddFrame(PeakFindingExcludeFirstNumberOfBinsLabel, CenterYLeftLayout); + + m_PeakFindingExcludeFirstNumberOfBins = new TGNumberEntry(PeakFindingExcludeFirstNumberOfBinsFrame, m_Settings->GetPeakFindingExcludeFirstNumberOfBins()); + m_PeakFindingExcludeFirstNumberOfBins->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 1000000); + m_PeakFindingExcludeFirstNumberOfBins->SetWidth(FontScaler*70); + PeakFindingExcludeFirstNumberOfBinsFrame->AddFrame(m_PeakFindingExcludeFirstNumberOfBins, CenterYRightEntryLayout); + + + TGHorizontalFrame* PeakFindingMinimumPeakCountsFrame = new TGHorizontalFrame(PeakFindingGroup); + PeakFindingGroup->AddFrame(PeakFindingMinimumPeakCountsFrame, TopLeftLayout); + + TGLabel* PeakFindingMinimumPeakCountsLabel = new TGLabel(PeakFindingMinimumPeakCountsFrame, "Minimum counts in peak: "); + PeakFindingMinimumPeakCountsLabel->SetWrapLength(FontScaler*150); + PeakFindingMinimumPeakCountsFrame->AddFrame(PeakFindingMinimumPeakCountsLabel, CenterYLeftLayout); + + m_PeakFindingMinimumPeakCounts = new TGNumberEntry(PeakFindingMinimumPeakCountsFrame, m_Settings->GetPeakFindingMinimumPeakCounts()); + m_PeakFindingMinimumPeakCounts->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 1000000); + m_PeakFindingMinimumPeakCounts->SetWidth(FontScaler*70); + PeakFindingMinimumPeakCountsFrame->AddFrame(m_PeakFindingMinimumPeakCounts, CenterYRightEntryLayout); + + + + // Section: Secondary spectrum - TGGroupFrame* PeakGroup = new TGGroupFrame(ControlColumn, "Options for Peak Spectrum", kVerticalFrame); - ControlColumn->AddFrame(PeakGroup, GroupLayout); - + TGGroupFrame* PeakGroup = new TGGroupFrame(OptionsFrame, "Display of peak spectrum", kVerticalFrame); + OptionsFrame->AddFrame(PeakGroup, GroupLayout); TGHorizontalFrame* PeakBinningModeFrame = new TGHorizontalFrame(PeakGroup); PeakGroup->AddFrame(PeakBinningModeFrame, TopLeftLayout); @@ -374,8 +438,8 @@ void MGUIMainMelinator::Create() // Peak parametrization section - TGGroupFrame* FitGroup = new TGGroupFrame(ControlColumn, "Peak parametrization options", kVerticalFrame); - ControlColumn->AddFrame(FitGroup, GroupLayout); + TGGroupFrame* FitGroup = new TGGroupFrame(OptionsFrame, "Peak parametrization options", kVerticalFrame); + OptionsFrame->AddFrame(FitGroup, GroupLayout); TGHorizontalFrame* PeakParametrizationMethodFrame = new TGHorizontalFrame(FitGroup); FitGroup->AddFrame(PeakParametrizationMethodFrame, TopLeftLayout); @@ -404,8 +468,8 @@ void MGUIMainMelinator::Create() // Calibration model determination section - TGGroupFrame* CalibrationModel = new TGGroupFrame(ControlColumn, "Calibration model options", kVerticalFrame); - ControlColumn->AddFrame(CalibrationModel, GroupLayout); + TGGroupFrame* CalibrationModel = new TGGroupFrame(OptionsFrame, "Calibration model options", kVerticalFrame); + OptionsFrame->AddFrame(CalibrationModel, GroupLayout); m_CalibrationModelZeroCrossing = new TGCheckButton(CalibrationModel, "Energy assignment only: Assume the energy calibration crosses (0/0)", c_CalibrationModelZeroCrossing); m_CalibrationModelZeroCrossing->Associate(this); @@ -500,9 +564,7 @@ void MGUIMainMelinator::Create() m_SpectrumCanvas = new MGUIEReadOutUnitsCanvas(this, "SpectrumCanvas", MainDataView); MainDataView->AddFrame(m_SpectrumCanvas, CanvasLayout); - - - + // The calibration view: TGHorizontalFrame* CalibrationView = new TGHorizontalFrame(DataColumn, 100, 100); //, kRaisedFrame); @@ -902,7 +964,7 @@ void MGUIMainMelinator::CloseWindow() //! Update the setting with the GUI data -bool MGUIMainMelinator::Update() +bool MGUIMainMelinator::UpdateSettings() { m_Settings->SetHistogramMin(m_HistogramRangeMin->GetNumber()); m_Settings->SetHistogramMax(m_HistogramRangeMax->GetNumber()); @@ -921,6 +983,10 @@ bool MGUIMainMelinator::Update() m_Settings->SetPeakHistogramBinningMode(m_PeakHistogramBinningMode->GetSelected()); m_Settings->SetPeakHistogramBinningModeValue(m_PeakHistogramBinningModeValue->GetNumber()); + m_Settings->SetPeakFindingPrior(m_PeakFindingPrior->GetNumber()); + m_Settings->SetPeakFindingExcludeFirstNumberOfBins(m_PeakFindingExcludeFirstNumberOfBins->GetNumber()); + m_Settings->SetPeakFindingMinimumPeakCounts(m_PeakFindingMinimumPeakCounts->GetNumber()); + m_Settings->SetPeakParametrizationMethod(m_PeakParametrizationMethod->GetSelected()); if (m_PeakParametrizationMethod->GetSelected() == MCalibrateEnergyFindLines::c_PeakParametrizationMethodFittedPeak) { m_Settings->SetPeakParametrizationMethodFittingBackgroundModel(m_PeakParametrizationMethodFittingBackgroundModel->GetSelected()); @@ -948,7 +1014,7 @@ bool MGUIMainMelinator::Update() //! Close the applictaion bool MGUIMainMelinator::OnExit() { - Update(); + UpdateSettings(); m_Settings->Write(); // Update alreday writes, but it is logical that we write here too so keep it //m_Interface->Exit(); @@ -1270,6 +1336,10 @@ bool MGUIMainMelinator::OnLoadLast() m_Melinator.SetSelectedDetectorID(m_Settings->GetSelectedDetectorID()); m_Melinator.SetSelectedDetectorSide(m_Settings->GetSelectedDetectorSide()); m_Melinator.SetSelectedTemperatureWindow(m_Settings->GetMinimumTemperature(), m_Settings->GetMaximumTemperature()); + m_Melinator.SetPeakFindingPrior(m_Settings->GetPeakFindingPrior()); + m_Melinator.SetPeakFindingExcludeFirstNumberOfBins(m_Settings->GetPeakFindingExcludeFirstNumberOfBins()); + m_Melinator.SetPeakFindingMinimumPeakCounts(m_Settings->GetPeakFindingMinimumPeakCounts()); + MString FileName; MString IsotopeName; @@ -1527,6 +1597,37 @@ bool MGUIMainMelinator::OnToggleResults() //////////////////////////////////////////////////////////////////////////////// +//! Update all graphs +void MGUIMainMelinator::UpdateMelinator() +{ + UpdateSettings(); + + m_Melinator.SetPeakFindingPrior(m_Settings->GetPeakFindingPrior()); + m_Melinator.SetPeakFindingExcludeFirstNumberOfBins(m_Settings->GetPeakFindingExcludeFirstNumberOfBins()); + m_Melinator.SetPeakFindingMinimumPeakCounts(m_Settings->GetPeakFindingMinimumPeakCounts()); + + if (m_Melinator.GetNumberOfCollections() > 0) { + m_Melinator.SetPeakParametrizationMethod(m_PeakParametrizationMethod->GetSelected()); + if (m_PeakParametrizationMethod->GetSelected() == MCalibrateEnergyFindLines::c_PeakParametrizationMethodFittedPeak) { + m_Melinator.SetPeakParametrizationMethodFittedPeakOptions(m_PeakParametrizationMethodFittingBackgroundModel->GetSelected(), m_PeakParametrizationMethodFittingEnergyLossModel->GetSelected(), m_PeakParametrizationMethodFittingPeakShapeModel->GetSelected()); + } + + if (m_CalibrationModelZeroCrossing->GetState() == kButtonDown) { + m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_LinearZeroCrossing); + } else { + m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_Linear); + } + m_Melinator.SetCalibrationModelDeterminationMethod(m_CalibrationModelDeterminationMethod->GetSelected()); + if (m_CalibrationModelDeterminationMethod->GetSelected() == MCalibrateEnergyDetermineModel::c_CalibrationModelFit) { + m_Melinator.SetCalibrationModelDeterminationMethodFittingEnergyOptions(m_CalibrationModelDeterminationMethodFittingEnergyModel->GetSelected()); + m_Melinator.SetCalibrationModelDeterminationMethodFittingFWHMOptions(m_CalibrationModelDeterminationMethodFittingFWHMModel->GetSelected()); + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + + //! Update all graphs bool MGUIMainMelinator::UpdateDisplay(unsigned int Collection, unsigned int Line, bool ActiveResultIsEnergy) { @@ -1544,7 +1645,7 @@ bool MGUIMainMelinator::UpdateDisplay(unsigned int Collection, unsigned int Line //! Set the active collection and put it to the screen void MGUIMainMelinator::UpdateCollection(unsigned int Collection, unsigned int Line) { - Update(); + UpdateSettings(); if (Collection < m_Melinator.GetNumberOfCollections()) { m_ActiveCollection = Collection; @@ -1566,7 +1667,7 @@ void MGUIMainMelinator::UpdateCollection(unsigned int Collection, unsigned int L m_Melinator.SetHistogramProperties(m_Settings->GetHistogramMin(), m_Settings->GetHistogramMax(), m_Settings->GetHistogramBinningMode(), m_Settings->GetHistogramBinningModeValue()); m_Melinator.DrawSpectrum(*(m_SpectrumCanvas->GetCanvas()), m_ActiveCollection, Line); - + OnXAxis(m_Settings->GetHistogramLogX()); OnYAxis(m_Settings->GetHistogramLogY()); @@ -1772,23 +1873,9 @@ void MGUIMainMelinator::SwitchToLine(double X) //! Fit the current histogram bool MGUIMainMelinator::OnFit() { - if (m_ActiveCollection < m_Melinator.GetNumberOfCollections()) { - m_Melinator.SetPeakParametrizationMethod(m_PeakParametrizationMethod->GetSelected()); - if (m_PeakParametrizationMethod->GetSelected() == MCalibrateEnergyFindLines::c_PeakParametrizationMethodFittedPeak) { - m_Melinator.SetPeakParametrizationMethodFittedPeakOptions(m_PeakParametrizationMethodFittingBackgroundModel->GetSelected(), m_PeakParametrizationMethodFittingEnergyLossModel->GetSelected(), m_PeakParametrizationMethodFittingPeakShapeModel->GetSelected()); - } - - if (m_CalibrationModelZeroCrossing->GetState() == kButtonDown) { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_LinearZeroCrossing); - } else { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_Linear); - } - m_Melinator.SetCalibrationModelDeterminationMethod(m_CalibrationModelDeterminationMethod->GetSelected()); - if (m_CalibrationModelDeterminationMethod->GetSelected() == MCalibrateEnergyDetermineModel::c_CalibrationModelFit) { - m_Melinator.SetCalibrationModelDeterminationMethodFittingEnergyOptions(m_CalibrationModelDeterminationMethodFittingEnergyModel->GetSelected()); - m_Melinator.SetCalibrationModelDeterminationMethodFittingFWHMOptions(m_CalibrationModelDeterminationMethodFittingFWHMModel->GetSelected()); - } + UpdateMelinator(); + if (m_ActiveCollection < m_Melinator.GetNumberOfCollections()) { m_Melinator.Calibrate(m_ActiveCollection, false); OnUpdateHistogram(); } @@ -1803,23 +1890,9 @@ bool MGUIMainMelinator::OnFit() //! Fit the current histogram bool MGUIMainMelinator::OnFitWithDiagnostics() { - if (m_ActiveCollection < m_Melinator.GetNumberOfCollections()) { - m_Melinator.SetPeakParametrizationMethod(m_PeakParametrizationMethod->GetSelected()); - if (m_PeakParametrizationMethod->GetSelected() == MCalibrateEnergyFindLines::c_PeakParametrizationMethodFittedPeak) { - m_Melinator.SetPeakParametrizationMethodFittedPeakOptions(m_PeakParametrizationMethodFittingBackgroundModel->GetSelected(), m_PeakParametrizationMethodFittingEnergyLossModel->GetSelected(), m_PeakParametrizationMethodFittingPeakShapeModel->GetSelected()); - } + UpdateMelinator(); - if (m_CalibrationModelZeroCrossing->GetState() == kButtonDown) { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_LinearZeroCrossing); - } else { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_Linear); - } - m_Melinator.SetCalibrationModelDeterminationMethod(m_CalibrationModelDeterminationMethod->GetSelected()); - if (m_CalibrationModelDeterminationMethod->GetSelected() == MCalibrateEnergyDetermineModel::c_CalibrationModelFit) { - m_Melinator.SetCalibrationModelDeterminationMethodFittingEnergyOptions(m_CalibrationModelDeterminationMethodFittingEnergyModel->GetSelected()); - m_Melinator.SetCalibrationModelDeterminationMethodFittingFWHMOptions(m_CalibrationModelDeterminationMethodFittingFWHMModel->GetSelected()); - } - + if (m_ActiveCollection < m_Melinator.GetNumberOfCollections()) { m_Melinator.Calibrate(m_ActiveCollection, true); OnUpdateHistogram(); } @@ -1834,23 +1907,9 @@ bool MGUIMainMelinator::OnFitWithDiagnostics() //! Fit the current histogram bool MGUIMainMelinator::OnFitAll() { - if (m_Melinator.GetNumberOfCollections() > 0) { - m_Melinator.SetPeakParametrizationMethod(m_PeakParametrizationMethod->GetSelected()); - if (m_PeakParametrizationMethod->GetSelected() == MCalibrateEnergyFindLines::c_PeakParametrizationMethodFittedPeak) { - m_Melinator.SetPeakParametrizationMethodFittedPeakOptions(m_PeakParametrizationMethodFittingBackgroundModel->GetSelected(), m_PeakParametrizationMethodFittingEnergyLossModel->GetSelected(), m_PeakParametrizationMethodFittingPeakShapeModel->GetSelected()); - } + UpdateMelinator(); - if (m_CalibrationModelZeroCrossing->GetState() == kButtonDown) { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_LinearZeroCrossing); - } else { - m_Melinator.SetCalibrationModelEnergyAssignmentMethod(MCalibrateEnergyAssignEnergyModes::e_Linear); - } - m_Melinator.SetCalibrationModelDeterminationMethod(m_CalibrationModelDeterminationMethod->GetSelected()); - if (m_CalibrationModelDeterminationMethod->GetSelected() == MCalibrateEnergyDetermineModel::c_CalibrationModelFit) { - m_Melinator.SetCalibrationModelDeterminationMethodFittingEnergyOptions(m_CalibrationModelDeterminationMethodFittingEnergyModel->GetSelected()); - m_Melinator.SetCalibrationModelDeterminationMethodFittingFWHMOptions(m_CalibrationModelDeterminationMethodFittingFWHMModel->GetSelected()); - } - + if (m_Melinator.GetNumberOfCollections() > 0) { m_Melinator.Calibrate(false); OnUpdateHistogram(); } @@ -1912,7 +1971,7 @@ bool MGUIMainMelinator::OnSaveConfiguration() // Get the filename and store all the data in the settings... if ((char *) Info.fFilename != 0) { - Update(); + UpdateSettings(); m_Interface->SaveConfiguration(MString(Info.fFilename)); } diff --git a/src/fretalon/melinator/src/MMelinator.cxx b/src/fretalon/melinator/src/MMelinator.cxx index 544026941..fa6074177 100644 --- a/src/fretalon/melinator/src/MMelinator.cxx +++ b/src/fretalon/melinator/src/MMelinator.cxx @@ -90,6 +90,10 @@ MMelinator::MMelinator() m_HistogramChanged = true; m_HistogramCollection = -1; + m_PeakFindingPrior = 8; + m_PeakFindingExcludeFirstNumberOfBins = 25; + m_PeakFindingMinimumPeakCounts = 100; + m_PeakParametrizationMethod = MCalibrateEnergyFindLines::c_PeakParametrizationMethodBayesianBlockPeak; m_PeakParametrizationMethodFittedPeakBackgroundModel = MCalibrationFit::c_BackgroundModelLinear; m_PeakParametrizationMethodFittedPeakEnergyLossModel = MCalibrationFit::c_EnergyLossModelNone; @@ -543,10 +547,10 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned Canvas.SetGridy(); //Canvas.SetLogy(); - Canvas.SetLeftMargin(0.08); + Canvas.SetLeftMargin(0.1); Canvas.SetRightMargin(0.05); Canvas.SetTopMargin(0.05); - Canvas.SetBottomMargin(0.12); + Canvas.SetBottomMargin(0.14); @@ -595,14 +599,14 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned //m_Histograms[h]->GetXaxis()->SetLabelOffset(0.0); m_Histograms[h]->GetXaxis()->SetLabelSize(0.05); m_Histograms[h]->GetXaxis()->SetTitleSize(0.06); - m_Histograms[h]->GetXaxis()->SetTitleOffset(0.9); + m_Histograms[h]->GetXaxis()->SetTitleOffset(1.1); m_Histograms[h]->GetXaxis()->CenterTitle(true); m_Histograms[h]->GetXaxis()->SetMoreLogLabels(true); //m_Histograms[h]->GetYaxis()->SetLabelOffset(0.001); m_Histograms[h]->GetYaxis()->SetLabelSize(0.05); m_Histograms[h]->GetYaxis()->SetTitleSize(0.06); - m_Histograms[h]->GetYaxis()->SetTitleOffset(0.6); + m_Histograms[h]->GetYaxis()->SetTitleOffset(0.8); m_Histograms[h]->GetYaxis()->CenterTitle(true); } } @@ -611,9 +615,9 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned if (m_Histograms[h] == 0) continue; if (h == 0) { - m_Histograms[h]->DrawCopy(); + m_Histograms[h]->DrawCopy("HIST"); } else { - m_Histograms[h]->DrawCopy("SAME"); + m_Histograms[h]->DrawCopy("HIST SAME"); } } @@ -964,7 +968,7 @@ void MMelinator::DrawCalibration(TCanvas& Canvas, unsigned int Collection, bool Graph->GetXaxis()->CenterTitle(true); Graph->GetXaxis()->SetMoreLogLabels(true); Graph->GetXaxis()->SetLimits(0.0, 1.1*MaximumX); - Graph->GetXaxis()->SetNdivisions(509, true); + Graph->GetXaxis()->SetNdivisions(505, true); if (UseEnergy == true) { Graph->GetYaxis()->SetTitle("energy [keV]"); @@ -1263,6 +1267,9 @@ bool MMelinator::Calibrate(unsigned int Collection, bool ShowDiagnostics) FindLines.SetDiagnosticsMode(ShowDiagnostics); FindLines.SetRange(m_HistogramMin, m_HistogramMax); FindLines.SetTemperatureWindow(m_SelectedTemperatureMin, m_SelectedTemperatureMax); + FindLines.SetBayesianBlockPrior(m_PeakFindingPrior); + FindLines.SetNumberOfExcludedBinsAtLowEnergies(m_PeakFindingExcludeFirstNumberOfBins); + FindLines.SetMinimumNumberOfPeakCounts(m_PeakFindingMinimumPeakCounts); //cout<<"T1: "<GetNode("HistogramLogY")) != 0) { m_HistogramLogY = aNode->GetValueAsBoolean(); } - + + if ((aNode = Node->GetNode("PeakFindingPrior")) != 0) { + m_PeakFindingPrior = aNode->GetValueAsUnsignedInt(); + } + if ((aNode = Node->GetNode("PeakFindingExcludeFirstNumberOfBins")) != 0) { + m_PeakFindingExcludeFirstNumberOfBins = aNode->GetValueAsUnsignedInt(); + } + if ((aNode = Node->GetNode("PeakFindingMinimumPeakCounts")) != 0) { + m_PeakFindingMinimumPeakCounts = aNode->GetValueAsUnsignedInt(); + } + if ((aNode = Node->GetNode("PeakHistogramBinningMode")) != 0) { m_PeakHistogramBinningMode = aNode->GetValueAsUnsignedInt(); } diff --git a/src/global/misc/src/MBinner.cxx b/src/global/misc/src/MBinner.cxx index 3b6e6b396..96d5c375d 100644 --- a/src/global/misc/src/MBinner.cxx +++ b/src/global/misc/src/MBinner.cxx @@ -129,6 +129,11 @@ TH1D* MBinner::GetHistogram(const MString& Title, const MString& xTitle, const M for (unsigned int i = 0; i < m_BinnedData.size(); ++i) { Hist->SetBinContent(i+1, m_BinnedData[i]); + if (m_BinnedData[i] > 0) { + Hist->SetBinError(i+1, sqrt(m_BinnedData[i])); + } else { + Hist->SetBinError(i+1, 1); + } } return Hist; @@ -143,9 +148,14 @@ TH1D* MBinner::GetNormalizedHistogram(const MString& Title, const MString& xTitl { TH1D* Hist = GetHistogram(Title, xTitle, yTitle); - for (int b = 0; b <= Hist->GetNbinsX(); ++b) { + for (int b = 1; b <= Hist->GetNbinsX(); ++b) { if (Hist->GetBinWidth(b) > 0) { Hist->SetBinContent(b, Hist->GetBinContent(b)/Hist->GetBinWidth(b)); + if (Hist->GetBinContent(b) > 0) { + Hist->SetBinError(b, sqrt(Hist->GetBinContent(b))/Hist->GetBinWidth(b)); + } else { + Hist->SetBinError(b, 1/Hist->GetBinWidth(b)); + } } } From 86b5459ca2eb7492d3a431b22f0cae742a9ab976 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Wed, 13 Sep 2023 11:49:29 -0700 Subject: [PATCH 021/192] CHG: Parallelize spectrum creation --- src/fretalon/melinator/inc/MMelinator.h | 18 +- .../melinator/src/MGUIMainMelinator.cxx | 15 +- src/fretalon/melinator/src/MMelinator.cxx | 157 +++++++++++++++--- 3 files changed, 160 insertions(+), 30 deletions(-) diff --git a/src/fretalon/melinator/inc/MMelinator.h b/src/fretalon/melinator/inc/MMelinator.h index b0234da87..86685900d 100644 --- a/src/fretalon/melinator/inc/MMelinator.h +++ b/src/fretalon/melinator/inc/MMelinator.h @@ -178,6 +178,8 @@ class MMelinator bool CalibrateParallel(unsigned int ThreadID); //! This function is executed by the parallel loading threads bool LoadParallel(unsigned int ThreadID); + //! The function is executed by the parallel spectrum creation threads + bool CreateSpectrumParallel(unsigned int ThreadID, unsigned int CollectionID, unsigned int DataGroupID); // protected methods: @@ -308,21 +310,32 @@ class MMelinatorThreadCaller { public: //! Standard constructor - MMelinatorThreadCaller(MMelinator* M, unsigned int ThreadID) { + //! ID1 and ID2 can be any ID/index we need to pass on + MMelinatorThreadCaller(MMelinator* M, unsigned int ThreadID, unsigned int ID1 = 0, unsigned int ID2 = 0) { m_Melinator = M; m_ThreadID = ThreadID; + m_ID1 = ID1; + m_ID2 = ID2; } //! Return the calling class MMelinator* GetThreadCaller() { return m_Melinator; } //! Return the thread ID unsigned int GetThreadID() { return m_ThreadID; } + //! Return ID1 + unsigned int GetID1() { return m_ID1; } + //! Return ID2 + unsigned int GetID2() { return m_ID2; } private: //! Store the calling class for retrieval MMelinator* m_Melinator; //! ID of the worker thread unsigned int m_ThreadID; + //! Special ID/index + unsigned int m_ID1; + //! Special ID/index + unsigned int m_ID2; }; @@ -335,6 +348,9 @@ void MMelinatorCallParallelCalibrationThread(void* address); //! Thread entry point for the parallel calibration void MMelinatorCallParallelLoadingThread(void* address); +//! Thread entry point for the parallel spectrum creation +void MMelinatorCallParallelSpectrumCreationThread(void* address); + //! Streamify the read-out data std::ostream& operator<<(std::ostream& os, const MMelinator& R); diff --git a/src/fretalon/melinator/src/MGUIMainMelinator.cxx b/src/fretalon/melinator/src/MGUIMainMelinator.cxx index 4d2d95bf5..af4d56ad9 100644 --- a/src/fretalon/melinator/src/MGUIMainMelinator.cxx +++ b/src/fretalon/melinator/src/MGUIMainMelinator.cxx @@ -42,6 +42,7 @@ using namespace std; // MEGAlib libs: #include "MStreams.h" +#include "MTimer.h" #include "MGUIDefaults.h" #include "MFile.h" #include "MMath.h" @@ -292,7 +293,7 @@ void MGUIMainMelinator::Create() m_HistogramBinningModeValue->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 1000000); BinningValueFrame->AddFrame(m_HistogramBinningModeValue, TopLeftLayout); - m_HistogramBinningModeValueLabel = new TGLabel(BinningValueFrame, "To be determined later"); + m_HistogramBinningModeValueLabel = new TGLabel(BinningValueFrame, " TBD later "); BinningValueFrame->AddFrame(m_HistogramBinningModeValueLabel, TopLeftTextLayout); OnSwitchHistogramBinningMode(m_Settings->GetHistogramBinningMode()); @@ -407,7 +408,7 @@ void MGUIMainMelinator::Create() m_PeakHistogramBinningModeValue->SetLimits(TGNumberFormat::kNELLimitMinMax, 1, 1000000); PeakBinningValueFrame->AddFrame(m_PeakHistogramBinningModeValue, TopLeftLayout); - m_PeakHistogramBinningModeValueLabel = new TGLabel(PeakBinningValueFrame, "To be determined later"); + m_PeakHistogramBinningModeValueLabel = new TGLabel(PeakBinningValueFrame, " TBD later"); PeakBinningValueFrame->AddFrame(m_PeakHistogramBinningModeValueLabel, TopLeftTextLayout); OnSwitchPeakHistogramBinningMode(m_Settings->GetPeakHistogramBinningMode()); @@ -1040,9 +1041,9 @@ bool MGUIMainMelinator::OnSwitchHistogramBinningMode(unsigned int ID) m_HistogramBinningModeValueLabel->SetText("ERROR"); } - MapSubwindows(); - MapWindow(); - Layout(); + //MapSubwindows(); + MapWindow(); + //Layout(); return true; } @@ -1634,7 +1635,7 @@ bool MGUIMainMelinator::UpdateDisplay(unsigned int Collection, unsigned int Line UpdateCollection(Collection, Line); UpdateLineFit(Collection, Line); UpdateCalibration(Collection, ActiveResultIsEnergy); - + return true; } @@ -1645,6 +1646,7 @@ bool MGUIMainMelinator::UpdateDisplay(unsigned int Collection, unsigned int Line //! Set the active collection and put it to the screen void MGUIMainMelinator::UpdateCollection(unsigned int Collection, unsigned int Line) { + UpdateSettings(); if (Collection < m_Melinator.GetNumberOfCollections()) { @@ -1666,6 +1668,7 @@ void MGUIMainMelinator::UpdateCollection(unsigned int Collection, unsigned int L m_Melinator.SetHistogramProperties(m_Settings->GetHistogramMin(), m_Settings->GetHistogramMax(), m_Settings->GetHistogramBinningMode(), m_Settings->GetHistogramBinningModeValue()); + m_Melinator.DrawSpectrum(*(m_SpectrumCanvas->GetCanvas()), m_ActiveCollection, Line); OnXAxis(m_Settings->GetHistogramLogX()); diff --git a/src/fretalon/melinator/src/MMelinator.cxx b/src/fretalon/melinator/src/MMelinator.cxx index fa6074177..645ef1424 100644 --- a/src/fretalon/melinator/src/MMelinator.cxx +++ b/src/fretalon/melinator/src/MMelinator.cxx @@ -80,6 +80,19 @@ ClassImp(MMelinator) //////////////////////////////////////////////////////////////////////////////// +//! Thread entry point for the parallel calibration +void MMelinatorCallParallelSpectrumCreationThread(void* Address) +{ + MMelinatorThreadCaller* Caller = (MMelinatorThreadCaller*) Address; + + MMelinator* M = Caller->GetThreadCaller(); + M->CreateSpectrumParallel(Caller->GetThreadID(), Caller->GetID1(), Caller->GetID2()); +} + + +//////////////////////////////////////////////////////////////////////////////// + + //! Default constructor MMelinator::MMelinator() { @@ -287,14 +300,14 @@ bool MMelinator::Load(const vector& FileNames, const vector 0) { // Start threads @@ -552,25 +565,90 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned Canvas.SetTopMargin(0.05); Canvas.SetBottomMargin(0.14); - - + if (m_HistogramChanged == true) { - + for (auto H: m_Histograms) delete H; m_Histograms.clear(); - //! Create the histograms - for (unsigned int g = 0; g < C.GetNumberOfReadOutDataGroups(); ++g) { - MReadOutDataGroup& G = C.GetReadOutDataGroup(g); - TH1D* H = CreateSpectrum(G.GetName(), G, m_HistogramMin, m_HistogramMax, m_HistogramBinningMode, m_HistogramBinningModeValue); - if (H->GetMaximum() > 0) { - m_Histograms.push_back(H); //C.GetReadOutElement().ToString(), G)); - } else { - m_Histograms.push_back(0); - delete H; + + // <-- Begin time critical + + unsigned int NThreads = C.GetNumberOfReadOutDataGroups(); + + if (NThreads > 1) { + m_Histograms.resize(NThreads); + + m_ThreadNextItem = 0; + m_Threads.resize(NThreads); + m_ThreadIsInitialized.resize(NThreads); + m_ThreadShouldTerminate.resize(NThreads); + m_ThreadIsFinished.resize(NThreads); + + // Start threads + for (unsigned int t = 0; t < NThreads; ++t) { + TString Name = "Loading thread #"; + Name += t; + //cout<<"Creating thread: "<Run(); + + // Wait until thread is initialized: + while (m_ThreadIsInitialized[t] == false && m_ThreadIsFinished[t] == false) { + // Sleep for a while... + TThread::Sleep(0, 10000000); + } + + } + + long Counter = 0; + bool ThreadsAreRunning = true; + while (ThreadsAreRunning == true) { + + // Sleep for a 10 ms + TThread::Sleep(0, 10000000); + // Whenever we slept ~0.1 sec update the UI + if (++Counter % 10 == 0) { + gSystem->ProcessEvents(); + } + + int Running = 0; + ThreadsAreRunning = false; + for (unsigned int t = 0; t < NThreads; ++t) { + if (m_ThreadIsFinished[t] == false) { + ThreadsAreRunning = true; + Running++; + } + } + } + + // None of the threads are running any more --- kill them + for (unsigned int t = 0; t < NThreads; ++t) { + m_Threads[t]->Kill(); + m_Threads[t] = 0; + } + + } else { + //! Create the histograms + for (unsigned int g = 0; g < C.GetNumberOfReadOutDataGroups(); ++g) { + MReadOutDataGroup& G = C.GetReadOutDataGroup(g); + TH1D* H = CreateSpectrum(G.GetName(), G, m_HistogramMin, m_HistogramMax, m_HistogramBinningMode, m_HistogramBinningModeValue); + if (H->GetMaximum() > 0) { + m_Histograms.push_back(H); + } else { + m_Histograms.push_back(nullptr); + delete H; + } } } - + // --> end time critical + + double Max = 0; double Min = numeric_limits::max(); for (unsigned int h = 0; h < m_Histograms.size(); ++h) { @@ -584,7 +662,8 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned } } } - + + for (unsigned int h = 0; h < m_Histograms.size(); ++h) { if (m_Histograms[h] == 0) continue; m_Histograms[h]->SetMaximum(1.1*Max); @@ -610,7 +689,7 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned m_Histograms[h]->GetYaxis()->CenterTitle(true); } } - + for (unsigned int h = 0; h < m_Histograms.size(); ++h) { if (m_Histograms[h] == 0) continue; @@ -620,7 +699,7 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned m_Histograms[h]->DrawCopy("HIST SAME"); } } - + vector ColorOffsets; ColorOffsets.push_back(-4); @@ -689,7 +768,7 @@ void MMelinator::DrawSpectrum(TCanvas& Canvas, unsigned int Collection, unsigned m_Histograms[h]->DrawCopy("AXIS SAME"); break; } - + Canvas.Update(); m_HistogramChanged = false; } @@ -1064,9 +1143,41 @@ void MMelinator::DrawCalibration(TCanvas& Canvas, unsigned int Collection, bool //////////////////////////////////////////////////////////////////////////////// +//! Perform parallel spectrum creation +bool MMelinator::CreateSpectrumParallel(unsigned int ThreadID, unsigned int CollectionID, unsigned int DataGroupID) +{ + if (g_Verbosity >= c_Info) cout<<"Parallel spectrum creation thread #"<GetMaximum() > 0) { + m_Histograms[DataGroupID] = H; + } else { + m_Histograms[DataGroupID] = nullptr; + { + TLockGuard G(g_Mutex); + delete H; + } + } + + m_ThreadIsFinished[ThreadID] = true; + + if (g_Verbosity >= c_Info) cout<<"Parallel spectrum creation thread #"<SetPrior(HistogramBinningModeValue); Binner = B; } - + Binner->SetMinMax(Min, Max); for (unsigned int d = 0; d < G.GetNumberOfReadOutDatas(); ++d) { MReadOutDataADCValue* ADC = dynamic_cast(G.GetReadOutData(d).Get(MReadOutDataADCValue::m_TypeID)); @@ -1091,7 +1202,7 @@ TH1D* MMelinator::CreateSpectrum(const MString& Title, MReadOutDataGroup& G, dou Binner->Add(ADC->GetADCValue()); } } - + TH1D* Histogram = 0; Histogram = Binner->GetNormalizedHistogram(Title, "read-out units", "counts / read-out unit"); Histogram->SetBit(kCanDelete); @@ -1099,7 +1210,7 @@ TH1D* MMelinator::CreateSpectrum(const MString& Title, MReadOutDataGroup& G, dou Histogram->SetFillStyle(0); delete Binner; - + return Histogram; } @@ -1144,7 +1255,7 @@ bool MMelinator::Calibrate(bool ShowDiagnostics) for (unsigned int t = 0; t < m_NThreads; ++t) { MString Name = "Calibration thread #"; Name += t; - //cout<<"Creatung thread: "< Date: Thu, 9 Nov 2023 11:06:30 +0100 Subject: [PATCH 022/192] Update MFunction3D.h --- src/global/misc/inc/MFunction3D.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/global/misc/inc/MFunction3D.h b/src/global/misc/inc/MFunction3D.h index 3d1b363a7..09e11c738 100644 --- a/src/global/misc/inc/MFunction3D.h +++ b/src/global/misc/inc/MFunction3D.h @@ -151,16 +151,25 @@ class MFunction3D //! The x-axis data vector m_X; + //! If the edges are equidistant this is the distance + double m_XDistance; //! The y-axis data vector m_Y; + //! If the edges are equidistant this is the distance + double m_YDistance; //! The z-axis data vector m_Z; + //! If the edges are equidistant this is the distance + double m_ZDistance; //! The value-axis data vector m_V; //! For random number generation store the maximum double m_Maximum; + //! The cumulative function for faster random number generation + vector m_Cumulative; + // private members: private: From 68f0c8d8960356bed5ff1b719bd3d1b26cf38e36 Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:07:12 +0100 Subject: [PATCH 023/192] Update MFunction3D.cxx --- src/global/misc/src/MFunction3D.cxx | 108 +++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 3 deletions(-) diff --git a/src/global/misc/src/MFunction3D.cxx b/src/global/misc/src/MFunction3D.cxx index 26de4025f..0d386c020 100644 --- a/src/global/misc/src/MFunction3D.cxx +++ b/src/global/misc/src/MFunction3D.cxx @@ -62,7 +62,7 @@ const unsigned int MFunction3D::c_InterpolationLinear = 2; MFunction3D::MFunction3D() - : m_InterpolationType(c_InterpolationUnknown) + : m_InterpolationType(c_InterpolationUnknown), m_XDistance(0), m_YDistance(0), m_ZDistance(0) { // Construct an instance of MFunction3D } @@ -78,8 +78,11 @@ MFunction3D::MFunction3D(const MFunction3D& F) m_InterpolationType = F.m_InterpolationType; m_X = F.m_X; + m_XDistance = F.m_XDistance; m_Y = F.m_Y; + m_YDistance = F.m_YDistance; m_Z = F.m_Z; + m_ZDistance = F.m_ZDistance; m_V = F.m_V; m_Maximum = F.m_Maximum; } @@ -104,8 +107,11 @@ const MFunction3D& MFunction3D::operator=(const MFunction3D& F) m_InterpolationType = F.m_InterpolationType; m_X = F.m_X; + m_XDistance = F.m_XDistance; m_Y = F.m_Y; + m_YDistance = F.m_YDistance; m_Z = F.m_Z; + m_ZDistance = F.m_ZDistance; m_V = F.m_V; m_Maximum = F.m_Maximum; @@ -224,6 +230,54 @@ bool MFunction3D::Set(const MString FileName, const MString KeyWord, } } + // Are m_X equidistant? + bool Equidistant = true; + double Equidistance = (m_X.back() - m_X.front()) / (m_X.size()-1); + for (unsigned int i = 2; i < m_X.size(); ++i) { + if (fabs((m_X[i] - m_X[i-1]) - Equidistance) > 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_XDistance = Equidistance; + cout<<"X is equidistant"< 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_YDistance = Equidistance; + } else { + m_YDistance = 0; + cout<<"Y not equidistant"< 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_ZDistance = Equidistance; + } else { + m_ZDistance = 0; + cout<<"Z not equidistant"<GetNTokens() == 0) continue; @@ -574,7 +628,7 @@ double MFunction3D::Evaluate(double x, double y, double z) const } if (m_InterpolationType == c_InterpolationConstant) { - return m_Z[0]; + return m_V[0]; } else if (m_InterpolationType == c_InterpolationLinear) { // Get Position: @@ -770,8 +824,23 @@ double MFunction3D::GetVMax() int MFunction3D::FindXBin(double x) const { - //! Find the z bin fast (switches between linear search and binary search) + //! Find the x bin fast (switches between linear search and binary search) + + if (m_XDistance == 0) { + auto I = lower_bound(m_X.begin(), m_X.end(), x); + if (I == m_X.begin()) { + return -1; // Smaller than the lowest bin edge + } else if (I == m_X.end()) { + return m_X.size(); // Greater than or equal to the largest bin edge + } else { + return distance(m_X.begin(), I); + } + } else { + // Equidistant case + return (int) ((x - m_X[0]) / m_XDistance); + } + /* massert(m_X.size() >= 2); if (x < m_X.front()) return -1; @@ -806,6 +875,7 @@ int MFunction3D::FindXBin(double x) const } return int(lower); } + */ } @@ -816,6 +886,21 @@ int MFunction3D::FindYBin(double y) const { //! Find the z bin fast (switches between linear search and binary search) + if (m_YDistance == 0) { + auto I = lower_bound(m_Y.begin(), m_Y.end(), y); + if (I == m_Y.begin()) { + return -1; // Smaller than the lowest bin edge + } else if (I == m_Y.end()) { + return m_Y.size(); // Greater than or equal to the largest bin edge + } else { + return distance(m_Y.begin(), I); + } + } else { + // Equidistant case + return (int) ((y - m_Y[0]) / m_YDistance); + } + + /* massert(m_Y.size() >= 2); if (y < m_Y.front()) return -1; @@ -850,6 +935,7 @@ int MFunction3D::FindYBin(double y) const } return int(lower); } + */ } @@ -860,6 +946,21 @@ int MFunction3D::FindZBin(double z) const { //! Find the z bin fast (switches between linear search and binary search) + if (m_ZDistance == 0) { + auto I = lower_bound(m_Z.begin(), m_Z.end(), z); + if (I == m_Z.begin()) { + return -1; // Smaller than the lowest bin edge + } else if (I == m_Z.end()) { + return m_Z.size(); // Greater than or equal to the largest bin edge + } else { + return distance(m_Z.begin(), I); + } + } else { + // Equidistant case + return (int) ((z - m_Z[0]) / m_ZDistance); + } + + /* massert(m_Z.size() >= 2); if (z < m_Z.front()) return -1; @@ -894,6 +995,7 @@ int MFunction3D::FindZBin(double z) const } return int(lower); } + */ } From 418b9032f7150693a00d88880423beb583f3e1cf Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:07:38 +0100 Subject: [PATCH 024/192] Update MFunction3DSpherical.cxx --- src/global/misc/src/MFunction3DSpherical.cxx | 192 +++++++++++++++++-- 1 file changed, 178 insertions(+), 14 deletions(-) diff --git a/src/global/misc/src/MFunction3DSpherical.cxx b/src/global/misc/src/MFunction3DSpherical.cxx index 97be65905..4f5e55d98 100644 --- a/src/global/misc/src/MFunction3DSpherical.cxx +++ b/src/global/misc/src/MFunction3DSpherical.cxx @@ -224,6 +224,53 @@ bool MFunction3DSpherical::Set(const MString FileName, const MString KeyWord, } } + // Are m_X equidistant? + bool Equidistant = true; + double Equidistance = (m_X.back() - m_X.front()) / (m_X.size()-1); + for (unsigned int i = 2; i < m_X.size(); ++i) { + if (fabs((m_X[i] - m_X[i-1]) - Equidistance) > 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_XDistance = Equidistance; + cout<<"X is equidistant"< 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_YDistance = Equidistance; + } else { + m_YDistance = 0; + cout<<"Y not equidistant"< 1E-10) { + Equidistant = false; + break; + } + } + if (Equidistant == true) { + m_ZDistance = Equidistance; + } else { + m_ZDistance = 0; + cout<<"Z not equidistant"<GetNTokens() == 0) continue; @@ -389,16 +436,92 @@ double MFunction3DSpherical::Integrate() const return Integral; } - + //////////////////////////////////////////////////////////////////////////////// -void MFunction3DSpherical::GetRandom(double& x, double& y, double& z) +void MFunction3DSpherical::GetRandom(double& X, double& Y, double& Z) { // Return a random number distributed as the underlying function // The following is an accurate and safe version but rather slow... + if (m_Cumulative.size() == 0) { + m_Cumulative.resize(m_X.size()*m_Y.size()*m_Z.size()); + for (unsigned int x = 0; x < m_X.size()-1; ++x) { + double xCenter = 0.5*(m_X[x+1] + m_X[x]); + double xSize = fabs((m_X[x+1] - m_X[x]))*c_Rad; + for (unsigned int y = 0; y < m_Y.size()-1; ++y) { + double yCenter = 0.5*(m_Y[y+1] + m_Y[y]); + double ySize = fabs(cos(m_Y[y]*c_Rad) - cos(m_Y[y+1]*c_Rad)); + for (unsigned int z = 0; z < m_Z.size()-1; ++z) { + double zCenter = 0.5*(m_Z[z+1] + m_Z[z]); + double zSize = fabs(m_Z[z+1] - m_Z[z]); + + unsigned long Bin = x + y*m_X.size() + z*m_X.size()*m_Y.size(); + m_Cumulative[Bin] = xSize*ySize*zSize*Evaluate(xCenter, yCenter, zCenter); + } + } + } + for (unsigned int i = 1; i < m_Cumulative.size(); ++i) { + m_Cumulative[i] += m_Cumulative[i-1]; + } + } + + + // Find a random bin + double RandomCumulative = gRandom->Rndm()*m_Cumulative.back(); + auto upperBoundIt = upper_bound(m_Cumulative.begin(), m_Cumulative.end(), RandomCumulative); + + if (upperBoundIt == m_Cumulative.end()) { + cout<<"Error: We should never, ever reach that part of the code..."<::max(); + for (unsigned int x = xBin; x <= xBin+1; ++x) { + for (unsigned int y = yBin; y <= yBin+1; ++y) { + for (unsigned int z = zBin; z <= zBin+1; ++z) { + double V = m_V[x + y*m_X.size() + z*m_X.size()*m_Y.size()]; + if (V > Max) Max = V; + } + } + } + //cout<<"Max: "<Rndm()*x_diff + x_min; + Y = acos(y_min - gRandom->Rndm()*y_diff)*c_Deg; + Z = gRandom->Rndm()*z_diff + z_min; + + V = Evaluate(X, Y, Z); + } while (Max*gRandom->Rndm() > V); + //cout<<"Final: "<Rndm()*x_diff + x_min; - y = acos(y_min - gRandom->Rndm()*y_diff)*c_Deg; - z = gRandom->Rndm()*z_diff + z_min; + X = gRandom->Rndm()*x_diff + x_min; + Y = acos(y_min - gRandom->Rndm()*y_diff)*c_Deg; + Z = gRandom->Rndm()*z_diff + z_min; - v = Evaluate(x, y, z); + v = Evaluate(X, Y, Z); } while (m_Maximum*gRandom->Rndm() > v); + */ } @@ -432,19 +556,24 @@ void MFunction3DSpherical::Plot(bool Random) if (m_X.size() >= 2 && m_Y.size() >= 2 && m_Z.size() >= 2) { - TH3D* Hist = new TH3D("MFunction3DSpherical", "MFunction3DSpherical", m_X.size(), m_X.front(), m_X.back(), m_Y.size(), m_Y.front(), m_Y.back(), m_Z.size(), m_Z.front(), m_Z.back()); + TH3D* Hist = new TH3D("MFunction3DSpherical", "MFunction3DSpherical", m_X.size()-1, &m_X[0], m_Y.size()-1, &m_Y[0], m_Z.size()-1, &m_Z[0]); Hist->SetXTitle("phi in degree"); Hist->SetYTitle("theta in degree"); Hist->SetZTitle("energy in keV"); - TH2D* Projection = new TH2D("MFunction3DSpherical-P", "MFunction3DSpherical-P", - m_X.size(), m_X.front(), m_X.back(), - m_Y.size(), m_Y.front(), m_Y.back()); + TH2D* Projection = new TH2D("MFunction3DSpherical-P", "MFunction3DSpherical-P", m_X.size()-1, &m_X[0], m_Y.size()-1, &m_Y[0]); Projection->SetXTitle("phi in degree"); Projection->SetYTitle("theta in degree"); + + TH1D* ProjectionZ = new TH1D("MFunction3DSpherical-Z", "MFunction3DSpherical-Z", m_Z.size()-1, &m_Z[0]); + ProjectionZ->SetXTitle("energy in [keV]"); + TCanvas* Canvas = new TCanvas("DiagnosticsCanvas", "DiagnosticsCanvas"); Canvas->cd(); + if (m_Z.back() / (m_Z.front() > 0 ? m_Z.front() : 1) > 1000) { + Canvas->SetLogz(); + } if (Random == true) { double x, y, z; @@ -458,13 +587,39 @@ void MFunction3DSpherical::Plot(bool Random) } GetRandom(x, y, z); Hist->Fill(x, y, z, 1); + Projection->Fill(x, y, 1); + ProjectionZ->Fill(z, 1); + } + for (int bx = 1; bx <= Hist->GetXaxis()->GetNbins(); ++bx) { + for (int by = 1; by <= Hist->GetYaxis()->GetNbins(); ++by) { + double Area = c_Pi*(Hist->GetXaxis()->GetBinUpEdge(bx)*c_Rad - Hist->GetXaxis()->GetBinLowEdge(bx)*c_Rad); + Area *= cos(Hist->GetYaxis()->GetBinLowEdge(by)*c_Rad) - cos(Hist->GetYaxis()->GetBinUpEdge(by)*c_Rad); + for (int bz = 1; bz <= Hist->GetZaxis()->GetNbins(); ++bz) { + Hist->SetBinContent(bx, by, bz, Hist->GetBinContent(bx, by, bz) / Area / Hist->GetZaxis()->GetBinWidth(bz)); + } + } + } + for (int bx = 1; bx <= Hist->GetXaxis()->GetNbins(); ++bx) { + for (int by = 1; by <= Hist->GetYaxis()->GetNbins(); ++by) { + double Area = c_Pi*(Projection->GetXaxis()->GetBinUpEdge(bx)*c_Rad - Projection->GetXaxis()->GetBinLowEdge(bx)*c_Rad); + Area *= cos(Projection->GetYaxis()->GetBinLowEdge(by)*c_Rad) - cos(Projection->GetYaxis()->GetBinUpEdge(by)*c_Rad); + Projection->SetBinContent(bx, by, Projection->GetBinContent(bx, by) / Area); + } + } + for (int bz = 1; bz <= Hist->GetZaxis()->GetNbins(); ++bz) { + ProjectionZ->SetBinContent(bz, ProjectionZ->GetBinContent(bz) / ProjectionZ->GetXaxis()->GetBinWidth(bz)); } } else { for (int bx = 1; bx <= Hist->GetXaxis()->GetNbins(); ++bx) { for (int by = 1; by <= Hist->GetYaxis()->GetNbins(); ++by) { for (int bz = 1; bz <= Hist->GetZaxis()->GetNbins(); ++bz) { - Hist->SetBinContent(bx, by, bz, Evaluate(Hist->GetXaxis()->GetBinCenter(bx), Hist->GetYaxis()->GetBinCenter(by), Hist->GetZaxis()->GetBinCenter(bz))); - Projection->SetBinContent(bx, by, Projection->GetBinContent(bx, by) + Evaluate(Hist->GetXaxis()->GetBinCenter(bx), Hist->GetYaxis()->GetBinCenter(by), Hist->GetZaxis()->GetBinCenter(bz))); + double x = Hist->GetXaxis()->GetBinCenter(bx); + double y = Hist->GetYaxis()->GetBinCenter(by); + double z = Hist->GetZaxis()->GetBinCenter(bz); + double v = Evaluate(x, y, z); + Hist->Fill(x, y, z, v); + Projection->Fill(x, y, v); + ProjectionZ->Fill(z, v); } } } @@ -478,8 +633,17 @@ void MFunction3DSpherical::Plot(bool Random) ProjectionCanvas->cd(); Projection->Draw("colz"); ProjectionCanvas->Update(); - - + + + TCanvas* ProjectionZCanvas = new TCanvas(); + if (m_Z.back() / (m_Z.front() > 0 ? m_Z.front() : 1) > 1000) { + ProjectionZCanvas->SetLogx(); + } + ProjectionZCanvas->cd(); + ProjectionZ->Draw(); + ProjectionZCanvas->Update(); + + gSystem->ProcessEvents(); for (unsigned int i = 0; i < 10; ++i) { From 8edb8780b337f0618d86a7b3e1d690bb4fc76647 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 7 Dec 2023 15:30:30 -0800 Subject: [PATCH 025/192] CHG: Make sure we have an example finalize --- src/fretalon/framework/inc/MModuleTemplate.h | 3 +++ src/fretalon/framework/src/MModuleTemplate.cxx | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/fretalon/framework/inc/MModuleTemplate.h b/src/fretalon/framework/inc/MModuleTemplate.h index 607c8022e..2e3efe7cc 100644 --- a/src/fretalon/framework/inc/MModuleTemplate.h +++ b/src/fretalon/framework/inc/MModuleTemplate.h @@ -47,6 +47,9 @@ class MModuleTemplate : public MModule //! Main data analysis routine, which updates the event to a new level virtual bool AnalyzeEvent(MReadOutAssembly* Event); + + //! Finalize the module + virtual void Finalize(); //! Show the options GUI virtual void ShowOptionsGUI(); diff --git a/src/fretalon/framework/src/MModuleTemplate.cxx b/src/fretalon/framework/src/MModuleTemplate.cxx index e35f5d746..2c42047ae 100644 --- a/src/fretalon/framework/src/MModuleTemplate.cxx +++ b/src/fretalon/framework/src/MModuleTemplate.cxx @@ -122,6 +122,19 @@ bool MModuleTemplate::AnalyzeEvent(MReadOutAssembly* Event) //////////////////////////////////////////////////////////////////////////////// +void MModuleTemplate::Finalize() +{ + // Initialize the module + + MModule::Finalize(); + + // Your code here +} + + +//////////////////////////////////////////////////////////////////////////////// + + void MModuleTemplate::ShowOptionsGUI() { //! Show the options GUI --- has to be overwritten! From 1d630c9a03b8e45de60c487a4f72e8bb08a82093 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Mon, 11 Dec 2023 13:47:46 -0800 Subject: [PATCH 026/192] CHG: Allow phi from -180 to 360 --- src/mimrec/src/MGUIEventSelection.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mimrec/src/MGUIEventSelection.cxx b/src/mimrec/src/MGUIEventSelection.cxx index 37fc5e6ab..4c642b83e 100644 --- a/src/mimrec/src/MGUIEventSelection.cxx +++ b/src/mimrec/src/MGUIEventSelection.cxx @@ -617,7 +617,7 @@ void MGUIEventSelection::Create() m_SourceSpheric = new MGUIEEntryList(SourceFrame, "Location (Theta, Phi) [deg]", MGUIEEntryList::c_SingleLine); m_SourceSpheric->Add("", m_Settings->GetSourceTheta(), kTRUE, 0.0, 180.0); - m_SourceSpheric->Add("", m_Settings->GetSourcePhi(), kTRUE, 0.0, 360.0); + m_SourceSpheric->Add("", m_Settings->GetSourcePhi(), kTRUE, -180.0, 360.0); m_SourceSpheric->SetEntryFieldSize(FieldSize); m_SourceSpheric->Create(); SourceFrame->AddFrame(m_SourceSpheric, SourceLayout); From cc4a4503f61c6c683ce976ae172ff2c9c2463a77 Mon Sep 17 00:00:00 2001 From: GallegoSav <123730578+GallegoSav@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:38:37 +0100 Subject: [PATCH 027/192] Apply MFunction.cxx correction for high value of x see the commit https://github.com/zoglauer/megalib/commit/dc0d7b576cc9f80f8e1f13d53774e6fb1898f4fd --- src/global/misc/src/MFunction.cxx | 79 ++++++++++++++++++------------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/src/global/misc/src/MFunction.cxx b/src/global/misc/src/MFunction.cxx index 7f1040a0f..ece0f8bdc 100644 --- a/src/global/misc/src/MFunction.cxx +++ b/src/global/misc/src/MFunction.cxx @@ -29,6 +29,7 @@ // Standard libs: #include #include +#include using namespace std; // ROOT libs: @@ -90,6 +91,7 @@ MFunction::MFunction(const MFunction& F) m_InterpolationType = F.m_InterpolationType; m_X = F.m_X; + m_XZero = F.m_XZero; m_Y = F.m_Y; m_Cumulative = F.m_Cumulative; m_YNonNegative = F.m_YNonNegative; @@ -124,6 +126,7 @@ const MFunction& MFunction::operator=(const MFunction& F) m_InterpolationType = F.m_InterpolationType; m_X = F.m_X; + m_XZero = F.m_XZero; m_Y = F.m_Y; m_Cumulative = F.m_Cumulative; m_YNonNegative = F.m_YNonNegative; @@ -271,6 +274,10 @@ bool MFunction::Set(const MString FileName, const MString KeyWord) CreateSplines(); } + for (auto x: m_X) { + m_XZero.push_back(x - m_X[0]); + } + return true; } @@ -339,6 +346,10 @@ bool MFunction::Set(const MResponseMatrixO1& Response) // Clean up: m_Cumulative.clear(); + for (auto x: m_X) { + m_XZero.push_back(x - m_X[0]); + } + return true; } @@ -364,6 +375,10 @@ bool MFunction::Set(const vector& X, const vector& Y, unsigned i // Clean up: m_Cumulative.clear(); + for (auto x: m_X) { + m_XZero.push_back(x - m_X[0]); + } + return true; } @@ -379,13 +394,16 @@ bool MFunction::Add(const double x, const double y) if (m_X.size() == 0) { m_X.push_back(x); m_Y.push_back(y); + m_XZero.push_back(x - m_X[0]); } else { if (x < m_X[0]) { m_X.insert(m_X.begin(), x); m_Y.insert(m_Y.begin(), y); + m_XZero.insert(m_X.begin(), x - m_X[0]); } else if (x > m_X.back()) { m_X.push_back(x); m_Y.push_back(y); + m_XZero.push_back(x - m_X[0]); } else { for (unsigned int i = 0; i < m_X.size(); ++i) { if (x == m_X[i]) { @@ -395,6 +413,7 @@ bool MFunction::Add(const double x, const double y) } else if (x < m_X[i]) { m_X.insert(m_X.begin()+i, x); m_Y.insert(m_Y.begin()+i, y); + m_XZero.insert(m_XZero.begin()+i, x - m_X[0]); break; } } @@ -438,9 +457,10 @@ void MFunction::ScaleX(double Scaler) { // Multiple the x-axis by some value - for (unsigned int i = 0; i < m_X.size(); ++i) { + for (unsigned int i = 0; i < m_X.size(); ++i) { m_X[i] *= Scaler; - } + m_XZero[i] = m_X[i] - m_X[0]; + } // We clear the cumulative function: m_Cumulative.clear(); @@ -1117,8 +1137,8 @@ double MFunction::FindX(double XStart, double Integral, bool Cyclic) //! Find the x value starting from Start which would be achieved after integrating for "Integral" //! If we go beyond x_max, x_max is returned if we are not cyclic, otherwise we continue at x_0 - //cout<<"XStart: "< m_X.back()) { + if (X > m_XZero.back()) { //merr<<"XStart ("< I unsigned int BinStart = 0; - if (X > m_X.front()) { - //BinStart = find_if(m_X.begin(), m_X.end(), bind2nd(greater(), X)) - m_X.begin() - 1; - BinStart = find_if(m_X.begin(), m_X.end(), bind(greater(), placeholders::_1, X)) - m_X.begin() - 1; + if (X > m_XZero.front()) { + //BinStart = find_if(m_XZero.begin(), m_XZero.end(), bind2nd(greater(), X)) - m_XZero.begin() - 1; + BinStart = find_if(m_XZero.begin(), m_XZero.end(), bind(greater(), placeholders::_1, X)) - m_XZero.begin() - 1; } //cout<<"x: "<::max(); - - //cout<<"UpperBin: "<::max(); + // Step 2: Interpolate --- only linear at the moment --- within the given bin to find the right x-value - - double m = (m_Y[NewUpperBin-1] - m_Y[NewUpperBin]) / (m_X[NewUpperBin-1] - m_X[NewUpperBin]); - double t = m_Y[NewUpperBin] - m*m_X[NewUpperBin]; - - //cout<<"m: "<= m_X[NewUpperBin-1] && x1 <= m_X[NewUpperBin] && (x2 < m_X[NewUpperBin-1] || x2 > m_X[NewUpperBin])) { + if (x1 >= m_XZero[NewUpperBin-1] && x1 <= m_XZero[NewUpperBin] && (x2 < m_XZero[NewUpperBin-1] || x2 > m_XZero[NewUpperBin])) { //mout<<"x="<= m_X[NewUpperBin-1] && x2 <= m_X[NewUpperBin] && (x1 < m_X[NewUpperBin-1] || x1 > m_X[NewUpperBin])) { + } else if (x2 >= m_XZero[NewUpperBin-1] && x2 <= m_XZero[NewUpperBin] && (x1 < m_XZero[NewUpperBin-1] || x1 > m_XZero[NewUpperBin])) { //mout<<"x="< m_X[NewUpperBin]) && (x1 < m_X[NewUpperBin-1] || x1 > m_X[NewUpperBin])) { - merr<<"FindX: Both possible results are outside choosen bin ["< Date: Mon, 8 Jan 2024 14:40:00 +0100 Subject: [PATCH 028/192] apply the MFunction.h correction for high value of x see the commit : https://github.com/zoglauer/megalib/commit/dc0d7b576cc9f80f8e1f13d53774e6fb1898f4fd --- src/global/misc/inc/MFunction.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/global/misc/inc/MFunction.h b/src/global/misc/inc/MFunction.h index 798d29b21..9e1289f68 100644 --- a/src/global/misc/inc/MFunction.h +++ b/src/global/misc/inc/MFunction.h @@ -160,6 +160,8 @@ class MFunction //! The x-axis data vector m_X; + //! The x-axis data starting at 0 + vector m_XZero; //! The y-axis data vector m_Y; From 20c47ba01a99ff26ecee3e33e916548ec16df88e Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Fri, 26 Jan 2024 01:14:22 -0800 Subject: [PATCH 029/192] CHG: Add energy windows to Bayesian and TMVA reconstrcution --- src/response/Makefile | 1 + src/response/inc/MResponseCreator.h | 2 +- src/response/inc/MResponseMultipleCompton.h | 47 +- .../inc/MResponseMultipleComptonBayes.h | 198 ++ src/response/src/MResponseCreator.cxx | 13 +- src/response/src/MResponseMultipleCompton.cxx | 475 +--- .../src/MResponseMultipleComptonBayes.cxx | 1980 +++++++++++++++++ .../src/MResponseMultipleComptonEventFile.cxx | 20 +- .../src/MResponseMultipleComptonTMVA.cxx | 18 +- 9 files changed, 2229 insertions(+), 525 deletions(-) create mode 100644 src/response/inc/MResponseMultipleComptonBayes.h create mode 100644 src/response/src/MResponseMultipleComptonBayes.cxx diff --git a/src/response/Makefile b/src/response/Makefile index 9f4bfb97d..07d03fa35 100644 --- a/src/response/Makefile +++ b/src/response/Makefile @@ -30,6 +30,7 @@ FILES := MResponseCreator \ MResponseClusteringDSS \ MResponseTracking \ MResponseMultipleCompton \ + MResponseMultipleComptonBayes \ MResponseMultipleComptonEventFile \ MResponseMultipleComptonLens \ MResponseMultipleComptonTMVA \ diff --git a/src/response/inc/MResponseCreator.h b/src/response/inc/MResponseCreator.h index b78ec935a..e8c839104 100644 --- a/src/response/inc/MResponseCreator.h +++ b/src/response/inc/MResponseCreator.h @@ -110,7 +110,7 @@ class MResponseCreator enum MResponseModes { c_ModeUnknown, c_ModeTracks, - c_ModeComptons, + c_ModeComptonsBayes, c_ModeComptonsEventFile, c_ModeComptonsLens, c_ModeComptonsNeuralNetwork, diff --git a/src/response/inc/MResponseMultipleCompton.h b/src/response/inc/MResponseMultipleCompton.h index e97692fa2..74511b7ea 100644 --- a/src/response/inc/MResponseMultipleCompton.h +++ b/src/response/inc/MResponseMultipleCompton.h @@ -52,25 +52,10 @@ class MResponseMultipleCompton : public MResponseBuilder void SetDoAbsorptions(const bool Flag = true) { m_DoAbsorptions = Flag; } //! Set whether or not absorptions should be considered void SetMaxNInteractions(const unsigned int MaxNInteractions) { m_MaxNInteractions = MaxNInteractions; } - - //! Initialize the response matrices and their generation - virtual bool Initialize(); - - //! Analyze th events (all if in file mode, one if in event-by-event mode) - virtual bool Analyze(); - - //! Finalize the response generation (i.e. save the data a final time ) - virtual bool Finalize(); - // protected methods: protected: - //! Save the response matrices - virtual bool Save(); - - - bool IsTrackStart(MRESE& Start, MRESE& Central, double Energy); bool IsTrackStop(MRESE& Central, MRESE& Stop, double Energy); @@ -126,6 +111,11 @@ class MResponseMultipleCompton : public MResponseBuilder // protected members: protected: + //! Minimum energy range + double m_EnergyMinimum; + //! Maximum energy range + double m_EnergyMaximum; + //! Do or not to do absorptions bool m_DoAbsorptions; //! MaximumSequenceLength up to which absorptions are considered @@ -139,33 +129,6 @@ class MResponseMultipleCompton : public MResponseBuilder double m_MaxTrackEnergyDifference; double m_MaxTrackEnergyDifferencePercent; - // The event/pdf matrices: - //! - MResponseMatrixO2 m_GoodBadTable; - //! - MResponseMatrixO4 m_PdfStartGood; - - MResponseMatrixO4 m_PdfStartBad; - - MResponseMatrixO6 m_PdfTrackGood; - - MResponseMatrixO6 m_PdfTrackBad; - - MResponseMatrixO4 m_PdfComptonScatterProbabilityGood; - - MResponseMatrixO4 m_PdfComptonScatterProbabilityBad; - - MResponseMatrixO4 m_PdfPhotoAbsorptionProbabilityGood; - - MResponseMatrixO4 m_PdfPhotoAbsorptionProbabilityBad; - - MResponseMatrixO6 m_PdfComptonGood; - - MResponseMatrixO6 m_PdfComptonBad; - - MResponseMatrixO4 m_PdfDualGood; - - MResponseMatrixO4 m_PdfDualBad; // private members: diff --git a/src/response/inc/MResponseMultipleComptonBayes.h b/src/response/inc/MResponseMultipleComptonBayes.h new file mode 100644 index 000000000..a5bf91791 --- /dev/null +++ b/src/response/inc/MResponseMultipleComptonBayes.h @@ -0,0 +1,198 @@ +/* + * MResponseMultipleComptonBayes.h + * + * Copyright (C) by Andreas Zoglauer. + * All rights reserved. + * + * Please see the source-file for the copyright-notice. + * + */ + + +#ifndef __MResponseMultipleComptonBayes__ +#define __MResponseMultipleComptonBayes__ + + +//////////////////////////////////////////////////////////////////////////////// + + +// Standard libs: + +// ROOT libs: + +// MEGAlib libs: +#include "MGlobal.h" +#include "MResponseBuilder.h" +#include "MResponseMultipleCompton.h" +#include "MRESE.h" +#include "MRETrack.h" +#include "MResponseMatrixO1.h" +#include "MResponseMatrixO2.h" +#include "MResponseMatrixO3.h" +#include "MResponseMatrixO4.h" +#include "MResponseMatrixO5.h" +#include "MResponseMatrixO6.h" +#include "MResponseMatrixO7.h" + +// Forward declarations: + + +//////////////////////////////////////////////////////////////////////////////// + +//! Create a Bayesian Compton sequenceing response +class MResponseMultipleComptonBayes : public MResponseMultipleCompton +{ + // public interface: + public: + //! Default constructor + MResponseMultipleComptonBayes(); + //! Default destructor + virtual ~MResponseMultipleComptonBayes(); + + //! Return a brief description of this response class + static MString Description(); + //! Return information on the parsable options for this response class + static MString Options(); + //! Parse the options + virtual bool ParseOptions(const MString& Options); + + //! Set whether or not absorptions should be considered + void SetDoAbsorptions(const bool Flag = true) { m_DoAbsorptions = Flag; } + //! Set whether or not absorptions should be considered + void SetMaxNInteractions(const unsigned int MaxNInteractions) { m_MaxNInteractions = MaxNInteractions; } + + //! Initialize the response matrices and their generation + virtual bool Initialize(); + + //! Analyze th events (all if in file mode, one if in event-by-event mode) + virtual bool Analyze(); + + //! Finalize the response generation (i.e. save the data a final time ) + virtual bool Finalize(); + + + // protected methods: + protected: + + //! Save the response matrices + virtual bool Save(); + + + + bool IsTrackStart(MRESE& Start, MRESE& Central, double Energy); + bool IsTrackStop(MRESE& Central, MRESE& Stop, double Energy); + + bool IsComptonStart(MRESE& Start, double Etot, double Eres); + bool IsComptonTrack(MRESE& Start, MRESE& Central, int StartPosition, + double Etot, double Eres); + bool IsComptonEnd(MRESE& Stop); + bool IsComptonSequence(MRESE& Start, MRESE& Stop, + int StartPosition, double StopEnergy, double Eres); + bool IsComptonSequence(MRESE& Start, MRESE& Central, MRESE& Stop, + int StartPosition, double StopEnergy, double Eres); + bool IsSingleCompton(MRESE& Start); + + bool AreInComptonSequence(const vector& StartOriginIds, + const vector& CentralOriginIds, + int StartPosition); + bool AreReseInSequence(MRESE& Start, MRESE& Central, MRESE& Stop, double Energy); + + bool ContainsOnlyComptonDependants(vector AllSimIds); + bool IsAbsorbed(const vector& AllSimIds, double Energy, double EnergyResolution); + bool IsTotalAbsorbed(const vector& AllSimIds, double Energy, double EnergyResolution); + bool IsTrackCompletelyAbsorbed(const vector& Ids, double Energy); + double GetIdealDepositedEnergy(int MinId); + + //! Return the number of Compton interaction from the Sim ID with the given origin + unsigned int NumberOfComptonInteractions(vector AllSimIds, int Origin); + + + int GetMaterial(MRESE& RESE); + + double CalculateDCosPhi(MRESE& Start, MRESE& Central, MRESE& Stop, double Etot); + double CalculateDPhiInDegree(MRESE& Start, MRESE& Central, MRESE& Stop, double Etot); + double CalculateCosPhiE(MRESE& Central, double Etot); + double CalculatePhiEInDegree(MRESE& Central, double Etot); + double CalculateCosPhiG(MRESE& Start, MRESE& Central, MRESE& Stop); + double CalculatePhiGInDegree(MRESE& Start, MRESE& Central, MRESE& Stop); + double CalculateCosAlphaE(MRETrack& Start, MRESE& Central, double Etot); + double CalculateAlphaEInDegree(MRETrack& Start, MRESE& Central, double Etot); + double CalculateCosAlphaG(MRETrack& Start, MRESE& Central, double Etot); + double CalculateAlphaGInDegree(MRETrack& Start, MRESE& Central, double Etot); + double CalculateDCosAlpha(MRETrack& Start, MRESE& Central, double Etot); + double CalculateDAlphaInDegree(MRETrack& Start, MRESE& Central, double Etot); + double CalculateMinLeverArm(MRESE& Start, MRESE& Central, MRESE& Stop); + + double CalculateAbsorptionProbabilityPhoto(MRESE& Start, MRESE& Stop, double Etot); + double CalculateAbsorptionProbabilityCompton(MRESE& Start, MRESE& Stop, double Etot); + double CalculateAbsorptionProbabilityTotal(MRESE& Start, MRESE& Stop, double Etot); + + // private methods: + private: + + + + // protected members: + protected: + //! Minimum energy range + double m_EnergyMinimum; + //! Maximum energy range + double m_EnergyMaximum; + + //! Do or not to do absorptions + bool m_DoAbsorptions; + //! MaximumSequenceLength up to which absorptions are considered + unsigned int m_MaxAbsorptions; + //! Maximum number of individual Compton interactions to be considered + unsigned int m_MaxNInteractions; + + double m_MaxEnergyDifference; + double m_MaxEnergyDifferencePercent; + + double m_MaxTrackEnergyDifference; + double m_MaxTrackEnergyDifferencePercent; + + // The event/pdf matrices: + //! + MResponseMatrixO2 m_GoodBadTable; + //! + MResponseMatrixO4 m_PdfStartGood; + + MResponseMatrixO4 m_PdfStartBad; + + MResponseMatrixO6 m_PdfTrackGood; + + MResponseMatrixO6 m_PdfTrackBad; + + MResponseMatrixO4 m_PdfComptonScatterProbabilityGood; + + MResponseMatrixO4 m_PdfComptonScatterProbabilityBad; + + MResponseMatrixO4 m_PdfPhotoAbsorptionProbabilityGood; + + MResponseMatrixO4 m_PdfPhotoAbsorptionProbabilityBad; + + MResponseMatrixO6 m_PdfComptonGood; + + MResponseMatrixO6 m_PdfComptonBad; + + MResponseMatrixO4 m_PdfDualGood; + + MResponseMatrixO4 m_PdfDualBad; + + + // private members: + private: + + +#ifdef ___CLING___ + public: + ClassDef(MResponseMultipleComptonBayes, 0) // no description +#endif + +}; + +#endif + + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/response/src/MResponseCreator.cxx b/src/response/src/MResponseCreator.cxx index 1cf4325ef..ce87dc1bb 100644 --- a/src/response/src/MResponseCreator.cxx +++ b/src/response/src/MResponseCreator.cxx @@ -39,7 +39,7 @@ using namespace std; #include "MAssert.h" #include "MStreams.h" #include "MResponseClusteringDSS.h" -#include "MResponseMultipleCompton.h" +#include "MResponseMultipleComptonBayes.h" #include "MResponseMultipleComptonEventFile.h" #include "MResponseMultipleComptonLens.h" #include "MResponseMultipleComptonTMVA.h" @@ -160,7 +160,8 @@ bool MResponseCreator::ParseCommandLine(int argc, char** argv) Usage<<" t : track"<SetCSROnlyCreateSequences(true); - - if (m_ReReader->PreAnalysis() == false) return false; - - double MaxCosineLimit = 10; - - // Axis representing the sequence length: - vector AxisSequenceLength; - for (unsigned int i = 2; i <= m_MaxNInteractions+1; ++i) { - AxisSequenceLength.push_back(i); - } - MString NameAxisSequenceLength = "Sequence length"; - - double MaxEnergy = 5000; - - // Material: 0: unknown, 1: Si, 2: Ge, 3: Xe, 4: CsI - // Make sure this is identical with: MERCSRBayesian::GetMaterial() - vector AxisMaterial; - AxisMaterial = CreateEquiDist(-0.5, 4.5, 5); - MString NameAxisMaterial = "Material (0: ?, 1: Si, 2: Ge, 3: Xe, 4: CsI)"; - - // Compton scatter angle axis: - // Make sure it starts, well below 0 and exceeds (slightly) 1! - vector AxisComptonScatterAngleStart; - AxisComptonScatterAngleStart = CreateEquiDist(-1.5, 1.1, 26, -MaxCosineLimit, +MaxCosineLimit); - MString NameAxisComptonScatterAngleStart = "cos#varphi"; - - // Scatter probability axis - vector AxisScatterProbability = CreateEquiDist(-0.025, 1.025, 42); - MString NameAxisScatterProbability = "Scatter probability"; - - // Total energy axis for scatter probabilities - vector AxisTotalEnergyDistances = CreateLogDist(15, MaxEnergy, 38, 1, 20000); - MString NameAxisTotalEnergyDistances = "Energy [keV]"; - - // Total energy axis for scatter probabilities - vector AxisTotalEnergyStart = CreateLogDist(100, MaxEnergy, 38, 1, 20000); - MString NameAxisTotalEnergyStart = "Energy [keV]"; - - - // Make sure it starts, well below 0 and exceeds (slightly) 1! - vector AxisComptonScatterAngleDual; - AxisComptonScatterAngleDual = CreateEquiDist(-1.5, 1.1, 26, -MaxCosineLimit, +MaxCosineLimit); - MString NameAxisComptonScatterAngleDual = "cos#varphi"; - - // Total energy axis for scatter probabilities - vector AxisTotalEnergyDual = CreateLogDist(100, MaxEnergy, 18, 1, 20000); - MString NameAxisTotalEnergyDual = "Energy [keV]"; - - // Scatter probability axis - vector AxisScatterProbabilityDual = CreateEquiDist(0, 1, 15, -0.025, 1.025); - MString NameAxisScatterProbabilityDual = "Scatter probability"; - - - - // Global good/bad: - m_GoodBadTable = MResponseMatrixO2("MC: Good/Bad ratio (=prior)", - CreateEquiDist(0, 2, 2), - AxisSequenceLength); - m_GoodBadTable.SetAxisNames("GoodBad", - NameAxisSequenceLength); - - // Dual: - m_PdfDualGood = MResponseMatrixO4("MC: Dual (good)", - AxisTotalEnergyDual, - AxisComptonScatterAngleDual, - AxisScatterProbabilityDual, - AxisMaterial); - m_PdfDualGood.SetAxisNames(NameAxisTotalEnergyStart, - NameAxisComptonScatterAngleStart, - NameAxisScatterProbabilityDual, - NameAxisMaterial); - m_PdfDualBad = MResponseMatrixO4("MC: Dual (bad)", - AxisTotalEnergyDual, - AxisComptonScatterAngleDual, - AxisScatterProbabilityDual, - AxisMaterial); - m_PdfDualBad.SetAxisNames(NameAxisTotalEnergyStart, - NameAxisComptonScatterAngleStart, - NameAxisScatterProbabilityDual, - NameAxisMaterial); - - - // Start point: - m_PdfStartGood = MResponseMatrixO4("MC: Start (good)", - AxisTotalEnergyStart, - AxisComptonScatterAngleStart, - AxisSequenceLength, - AxisMaterial); - m_PdfStartGood.SetAxisNames(NameAxisTotalEnergyStart, - NameAxisComptonScatterAngleStart, - NameAxisSequenceLength, - NameAxisMaterial); - m_PdfStartBad = MResponseMatrixO4("MC: Start (bad)", - AxisTotalEnergyStart, - AxisComptonScatterAngleStart, - AxisSequenceLength, - AxisMaterial); - m_PdfStartBad.SetAxisNames(NameAxisTotalEnergyStart, - NameAxisComptonScatterAngleStart, - NameAxisSequenceLength, - NameAxisMaterial); - - - // Track: - m_PdfTrackGood = MResponseMatrixO6("MC: Track (good)", - CreateEquiDist(-0.5, 1.5, 36, c_NoBound, MaxCosineLimit), - CreateEquiDist(-0.5, 1.5, 1, c_NoBound, MaxCosineLimit), - CreateEquiDist(0, 1000000, 1), - CreateLogDist(500, 10000, 10, 0, 100000, 0, false), - AxisSequenceLength, - AxisMaterial); - m_PdfTrackGood.SetAxisNames("#Delta #alpha [deg]", - "#alpha_{G} [deg]", - "d [cm]", - "E_{e}", - NameAxisSequenceLength, - NameAxisMaterial); - m_PdfTrackBad = MResponseMatrixO6("MC: Track (bad)", - CreateEquiDist(-0.5, 1.5, 36, c_NoBound, MaxCosineLimit), - CreateEquiDist(-0.5, 1.5, 1, c_NoBound, MaxCosineLimit), - CreateEquiDist(0, 1000000, 1), - CreateLogDist(500, 10000, 10, 0, 100000, 0, false), - AxisSequenceLength, - AxisMaterial); - m_PdfTrackBad.SetAxisNames("#Delta cos#alpha [deg]", - "cos#alpha_{G} [deg]", - "d [cm]", - "E_{e}", - NameAxisSequenceLength, - NameAxisMaterial); - - - // Compton scatter distance: - m_PdfComptonScatterProbabilityGood = MResponseMatrixO4("MC: Compton distance (good)", - AxisScatterProbability, - AxisTotalEnergyDistances, - AxisSequenceLength, - AxisMaterial); - m_PdfComptonScatterProbabilityGood.SetAxisNames(NameAxisScatterProbability, - NameAxisTotalEnergyDistances, - NameAxisSequenceLength, - NameAxisMaterial); - m_PdfComptonScatterProbabilityBad = MResponseMatrixO4("MC: Compton distance (bad)", - AxisScatterProbability, - AxisTotalEnergyDistances, - AxisSequenceLength, - AxisMaterial); - m_PdfComptonScatterProbabilityBad.SetAxisNames(NameAxisScatterProbability, - NameAxisTotalEnergyDistances, - NameAxisSequenceLength, - NameAxisMaterial); - - - // Lastdistance: - m_PdfPhotoAbsorptionProbabilityGood = MResponseMatrixO4("MC: Photo distance (good)", - AxisScatterProbability, - AxisTotalEnergyDistances, - AxisSequenceLength, - AxisMaterial); - m_PdfPhotoAbsorptionProbabilityGood.SetAxisNames(NameAxisScatterProbability, - NameAxisTotalEnergyDistances, - NameAxisSequenceLength, - NameAxisMaterial); - m_PdfPhotoAbsorptionProbabilityBad = MResponseMatrixO4("MC: Photo distance (bad)", - AxisScatterProbability, - AxisTotalEnergyDistances, - AxisSequenceLength, - AxisMaterial); - m_PdfPhotoAbsorptionProbabilityBad.SetAxisNames(NameAxisScatterProbability, - NameAxisTotalEnergyDistances, - NameAxisSequenceLength, - NameAxisMaterial); - - - // CentralCompton: - - // Assymetries would be best handled if -1 .. 1 - //vector AxisDifferenceComptonScatterAngle = - // CreateLogDist(1E-3, 2, 18, 0.0000001, MaxCosineLimit); - vector AxisDifferenceComptonScatterAngle; - vector A = CreateLogDist(0.003, 2, 14, c_NoBound, MaxCosineLimit); - for (unsigned int i = A.size()-1; i < A.size(); --i) { - AxisDifferenceComptonScatterAngle.push_back(-A[i]); - } - for (unsigned int i = 0; i < A.size(); ++i) { - AxisDifferenceComptonScatterAngle.push_back(A[i]); - } - MString NameAxisDifferenceComptonScatterAngle = "cos#varphi_{E} - cos#varphi_{G}"; - - vector AxisComptonScatterAngle; - AxisComptonScatterAngle = CreateEquiDist(-1.4, 1.2, 13, -MaxCosineLimit, c_NoBound); - MString NameAxisComptonScatterAngle = NameAxisComptonScatterAngleStart; - - - vector AxisDistance = - CreateLogDist(0.2, 10, 7, 0.01, 100, 0, false); - MString NameAxisDistance = "Distance [cm]"; - - vector AxisTotalEnergy = CreateLogDist(100, MaxEnergy, 4, 1, 10000, 0, false); - //CreateLogDist(1, 10000, 1); //, 1, 10000, 0, false); - //mimp<<"No total energy bins!"<GetNRESEs() <= 1) { - mdebug<<"GeneratePdf: Not enough hits!"<ToString()<GetStartPoint() == 0) continue; - - // Check if complete sequence is ok: - bool SequenceOk = true; - unsigned int SequenceLength = RE->GetNRESEs(); - int PreviousPosition = 0; - - if (SequenceLength > m_MaxNInteractions) continue; - - if (SequenceLength == 2) { - // Look at start: - MRESEIterator Iter; - Iter.Start(RE->GetStartPoint()); - Iter.GetNextRESE(); - Etot = RE->GetEnergy(); - Eres = RE->GetEnergyResolution(); - - double CosPhiE = CalculateCosPhiE(*Iter.GetCurrent(), Etot); - double PhotoDistance = CalculateAbsorptionProbabilityTotal(*Iter.GetCurrent(), *Iter.GetNext(), Iter.GetNext()->GetEnergy()); - - if (IsComptonStart(*Iter.GetCurrent(), Etot, Eres) == true) { - mdebug<<"--------> Found GOOD dual Compton event!"< Found bad dual Compton event!"<GetStartPoint()); - Iter.GetNextRESE(); - Etot = RE->GetEnergy(); - Eres = RE->GetEnergyResolution(); - if (IsComptonStart(*Iter.GetCurrent(), Etot, Eres) == true) { - mdebug<<"--------> Found GOOD Compton start!"< Found bad Compton start!"<GetType() == MRESE::c_Track) { - double dAlpha = CalculateDCosAlpha(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); - double Alpha = CalculateCosAlphaG(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); - if (IsComptonTrack(*Iter.GetCurrent(), *Iter.GetNext(), PreviousPosition, Etot, Eres) == true) { - mdebug<<"--------> Found GOOD Track start!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); - } else { - mdebug<<"--------> Found bad Track start!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); - SequenceOk = false; - } - } - - - // Central part of the Compton track - Iter.GetNextRESE(); - while (Iter.GetNext() != 0) { - // Add here - Etot -= Iter.GetPrevious()->GetEnergy(); - Eres = sqrt(Eres*Eres - Iter.GetPrevious()->GetEnergyResolution()*Iter.GetPrevious()->GetEnergyResolution()); - PreviousPosition++; - - // In the current implementation/simulation the hits have to be in increasing order... - if (m_DoAbsorptions == true && SequenceLength <= m_MaxAbsorptions) { - double ComptonDistance = - CalculateAbsorptionProbabilityCompton(*Iter.GetPrevious(), *Iter.GetCurrent(), Etot); - mdebug<<"Dist C: "<GetPosition() - Iter.GetPrevious()->GetPosition()).Mag()< Found GOOD Distance sequence!"< Found bad Distance sequence!"< Found GOOD internal Compton sequence!"< Found bad internal Compton sequence!"<GetType() == MRESE::c_Track) { - //MRETrack* T = (MRETrack*) Iter.GetCurrent(); - double dAlpha = CalculateDCosAlpha(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); - double Alpha = CalculateCosAlphaG(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); - if (IsComptonTrack(*Iter.GetCurrent(), *Iter.GetNext(), PreviousPosition, Etot, Eres) == true) { - mdebug<<"--------> Found GOOD Track start (central)!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); - } else { - mdebug<<"--------> Found bad Track start (central)!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); - SequenceOk = false; - } - } - Iter.GetNextRESE(); - } - - Etot -= Iter.GetPrevious()->GetEnergy(); - Eres = sqrt(Eres*Eres - Iter.GetPrevious()->GetEnergyResolution()*Iter.GetPrevious()->GetEnergyResolution()); - PreviousPosition++; - - // Decide if it is good or bad... - // In the current implementation/simulation the hits have to be in increasing order... - if (m_DoAbsorptions == true && SequenceLength <= m_MaxAbsorptions) { - double LastDistance = CalculateAbsorptionProbabilityPhoto(*Iter.GetPrevious(), *Iter.GetCurrent(), Etot); - mdebug<<"Dist P: "<GetPosition() - Iter.GetPrevious()->GetPosition()).Mag()< Found GOOD Lastdistance sequence!"< Found bad Lastdistance sequence!"< +#include +#include +using namespace std; + +// ROOT libs: + +// MEGAlib libs: +#include "MAssert.h" +#include "MStreams.h" +#include "MSettingsRevan.h" +#include "MRESEIterator.h" +#include "MERCSRBayesian.h" + + +//////////////////////////////////////////////////////////////////////////////// + + +#ifdef ___CLING___ +ClassImp(MResponseMultipleComptonBayes) +#endif + + +//////////////////////////////////////////////////////////////////////////////// + + +//! Default constructor +MResponseMultipleComptonBayes::MResponseMultipleComptonBayes() +{ + m_ResponseNameSuffix = "mc"; + + m_DoAbsorptions = true; + m_MaxAbsorptions = 5; + m_MaxNInteractions = 7; + + m_MaxEnergyDifference = 5; // keV + m_MaxEnergyDifferencePercent = 0.02; + + m_MaxTrackEnergyDifference = 30; // keV + m_MaxTrackEnergyDifferencePercent = 0.1; + + m_EnergyMinimum = 100; // keV + m_EnergyMaximum = 10000; // keV +} + + +//////////////////////////////////////////////////////////////////////////////// + + +//! Default destructor +MResponseMultipleComptonBayes::~MResponseMultipleComptonBayes() +{ + // Nothing to delete +} + + +//////////////////////////////////////////////////////////////////////////////// + + +//! Return a brief description of this response class +MString MResponseMultipleComptonBayes::Description() +{ + return MString("Compton event reconstruction (Bayes)"); +} + + +//////////////////////////////////////////////////////////////////////////////// + + +//! Return information on the parsable options for this response class +MString MResponseMultipleComptonBayes::Options() +{ + ostringstream out; + out<<" maxia: the maximum number of interactions (default: 7)"< Split1 = Options.Tokenize(":"); + // Split Option <-> Value + vector> Split2; + for (MString S: Split1) { + Split2.push_back(S.Tokenize("=")); + } + + // Basic sanity check and to lower for all options + for (unsigned int i = 0; i < Split2.size(); ++i) { + if (Split2[i].size() == 0) { + mout<<"Error: Empty option in string "< 2) { + mout<<"Error: Option has more than one value or you used the wrong separator (not \":\"): "<= m_EnergyMaximum) { + mout<<"Error: The minimum energy must be smaller than the maximum energy"<SetCSROnlyCreateSequences(true); + + if (m_ReReader->PreAnalysis() == false) return false; + + double MaxCosineLimit = 10; + + // Axis representing the sequence length: + vector AxisSequenceLength; + for (unsigned int i = 2; i <= m_MaxNInteractions+1; ++i) { + AxisSequenceLength.push_back(i); + } + MString NameAxisSequenceLength = "Sequence length"; + + // Material: 0: unknown, 1: Si, 2: Ge, 3: Xe, 4: CsI + // Make sure this is identical with: MERCSRBayesian::GetMaterial() + vector AxisMaterial; + AxisMaterial = CreateEquiDist(-0.5, 4.5, 5); + MString NameAxisMaterial = "Material (0: ?, 1: Si, 2: Ge, 3: Xe, 4: CsI)"; + + // Compton scatter angle axis: + // Make sure it starts, well below 0 and exceeds (slightly) 1! + vector AxisComptonScatterAngleStart; + AxisComptonScatterAngleStart = CreateEquiDist(-1.5, 1.1, 26, -MaxCosineLimit, +MaxCosineLimit); + MString NameAxisComptonScatterAngleStart = "cos#varphi"; + + // Scatter probability axis + vector AxisScatterProbability = CreateEquiDist(-0.025, 1.025, 42); + MString NameAxisScatterProbability = "Scatter probability"; + + // Total energy axis for scatter probabilities + vector AxisTotalEnergyDistances = CreateLogDist(15, m_EnergyMaximum, 38, 1, 20000); + MString NameAxisTotalEnergyDistances = "Energy [keV]"; + + // Total energy axis for scatter probabilities + vector AxisTotalEnergyStart = CreateLogDist(m_EnergyMinimum, m_EnergyMaximum, 38, 1, 20000); + MString NameAxisTotalEnergyStart = "Energy [keV]"; + + + // Make sure it starts, well below 0 and exceeds (slightly) 1! + vector AxisComptonScatterAngleDual; + AxisComptonScatterAngleDual = CreateEquiDist(-1.5, 1.1, 26, -MaxCosineLimit, +MaxCosineLimit); + MString NameAxisComptonScatterAngleDual = "cos#varphi"; + + // Total energy axis for scatter probabilities + vector AxisTotalEnergyDual = CreateLogDist(m_EnergyMinimum, m_EnergyMaximum, 18, 1, 20000); + MString NameAxisTotalEnergyDual = "Energy [keV]"; + + // Scatter probability axis + vector AxisScatterProbabilityDual = CreateEquiDist(0, 1, 15, -0.025, 1.025); + MString NameAxisScatterProbabilityDual = "Scatter probability"; + + + + // Global good/bad: + m_GoodBadTable = MResponseMatrixO2("MC: Good/Bad ratio (=prior)", + CreateEquiDist(0, 2, 2), + AxisSequenceLength); + m_GoodBadTable.SetAxisNames("GoodBad", + NameAxisSequenceLength); + + // Dual: + m_PdfDualGood = MResponseMatrixO4("MC: Dual (good)", + AxisTotalEnergyDual, + AxisComptonScatterAngleDual, + AxisScatterProbabilityDual, + AxisMaterial); + m_PdfDualGood.SetAxisNames(NameAxisTotalEnergyStart, + NameAxisComptonScatterAngleStart, + NameAxisScatterProbabilityDual, + NameAxisMaterial); + m_PdfDualBad = MResponseMatrixO4("MC: Dual (bad)", + AxisTotalEnergyDual, + AxisComptonScatterAngleDual, + AxisScatterProbabilityDual, + AxisMaterial); + m_PdfDualBad.SetAxisNames(NameAxisTotalEnergyStart, + NameAxisComptonScatterAngleStart, + NameAxisScatterProbabilityDual, + NameAxisMaterial); + + + // Start point: + m_PdfStartGood = MResponseMatrixO4("MC: Start (good)", + AxisTotalEnergyStart, + AxisComptonScatterAngleStart, + AxisSequenceLength, + AxisMaterial); + m_PdfStartGood.SetAxisNames(NameAxisTotalEnergyStart, + NameAxisComptonScatterAngleStart, + NameAxisSequenceLength, + NameAxisMaterial); + m_PdfStartBad = MResponseMatrixO4("MC: Start (bad)", + AxisTotalEnergyStart, + AxisComptonScatterAngleStart, + AxisSequenceLength, + AxisMaterial); + m_PdfStartBad.SetAxisNames(NameAxisTotalEnergyStart, + NameAxisComptonScatterAngleStart, + NameAxisSequenceLength, + NameAxisMaterial); + + + // Track: + m_PdfTrackGood = MResponseMatrixO6("MC: Track (good)", + CreateEquiDist(-0.5, 1.5, 36, c_NoBound, MaxCosineLimit), + CreateEquiDist(-0.5, 1.5, 1, c_NoBound, MaxCosineLimit), + CreateEquiDist(0, 1000000, 1), + CreateLogDist(500, 10000, 10, 0, 100000, 0, false), + AxisSequenceLength, + AxisMaterial); + m_PdfTrackGood.SetAxisNames("#Delta #alpha [deg]", + "#alpha_{G} [deg]", + "d [cm]", + "E_{e}", + NameAxisSequenceLength, + NameAxisMaterial); + m_PdfTrackBad = MResponseMatrixO6("MC: Track (bad)", + CreateEquiDist(-0.5, 1.5, 36, c_NoBound, MaxCosineLimit), + CreateEquiDist(-0.5, 1.5, 1, c_NoBound, MaxCosineLimit), + CreateEquiDist(0, 1000000, 1), + CreateLogDist(500, 10000, 10, 0, 100000, 0, false), + AxisSequenceLength, + AxisMaterial); + m_PdfTrackBad.SetAxisNames("#Delta cos#alpha [deg]", + "cos#alpha_{G} [deg]", + "d [cm]", + "E_{e}", + NameAxisSequenceLength, + NameAxisMaterial); + + + // Compton scatter distance: + m_PdfComptonScatterProbabilityGood = MResponseMatrixO4("MC: Compton distance (good)", + AxisScatterProbability, + AxisTotalEnergyDistances, + AxisSequenceLength, + AxisMaterial); + m_PdfComptonScatterProbabilityGood.SetAxisNames(NameAxisScatterProbability, + NameAxisTotalEnergyDistances, + NameAxisSequenceLength, + NameAxisMaterial); + m_PdfComptonScatterProbabilityBad = MResponseMatrixO4("MC: Compton distance (bad)", + AxisScatterProbability, + AxisTotalEnergyDistances, + AxisSequenceLength, + AxisMaterial); + m_PdfComptonScatterProbabilityBad.SetAxisNames(NameAxisScatterProbability, + NameAxisTotalEnergyDistances, + NameAxisSequenceLength, + NameAxisMaterial); + + + // Lastdistance: + m_PdfPhotoAbsorptionProbabilityGood = MResponseMatrixO4("MC: Photo distance (good)", + AxisScatterProbability, + AxisTotalEnergyDistances, + AxisSequenceLength, + AxisMaterial); + m_PdfPhotoAbsorptionProbabilityGood.SetAxisNames(NameAxisScatterProbability, + NameAxisTotalEnergyDistances, + NameAxisSequenceLength, + NameAxisMaterial); + m_PdfPhotoAbsorptionProbabilityBad = MResponseMatrixO4("MC: Photo distance (bad)", + AxisScatterProbability, + AxisTotalEnergyDistances, + AxisSequenceLength, + AxisMaterial); + m_PdfPhotoAbsorptionProbabilityBad.SetAxisNames(NameAxisScatterProbability, + NameAxisTotalEnergyDistances, + NameAxisSequenceLength, + NameAxisMaterial); + + + // CentralCompton: + + // Assymetries would be best handled if -1 .. 1 + //vector AxisDifferenceComptonScatterAngle = + // CreateLogDist(1E-3, 2, 18, 0.0000001, MaxCosineLimit); + vector AxisDifferenceComptonScatterAngle; + vector A = CreateLogDist(0.003, 2, 14, c_NoBound, MaxCosineLimit); + for (unsigned int i = A.size()-1; i < A.size(); --i) { + AxisDifferenceComptonScatterAngle.push_back(-A[i]); + } + for (unsigned int i = 0; i < A.size(); ++i) { + AxisDifferenceComptonScatterAngle.push_back(A[i]); + } + MString NameAxisDifferenceComptonScatterAngle = "cos#varphi_{E} - cos#varphi_{G}"; + + vector AxisComptonScatterAngle; + AxisComptonScatterAngle = CreateEquiDist(-1.4, 1.2, 13, -MaxCosineLimit, c_NoBound); + MString NameAxisComptonScatterAngle = NameAxisComptonScatterAngleStart; + + + vector AxisDistance = CreateLogDist(0.2, 10, 7, 0.01, 100, 0, false); + MString NameAxisDistance = "Distance [cm]"; + + vector AxisTotalEnergy = CreateLogDist(100, m_EnergyMaximum, 4, 1, 10000, 0, false); + //CreateLogDist(1, 10000, 1); //, 1, 10000, 0, false); + //mimp<<"No total energy bins!"<GetNRESEs() <= 1) { + mdebug<<"GeneratePdf: Not enough hits!"<GetEnergy() < m_EnergyMinimum || RE->GetEnergy() > m_EnergyMaximum) { + mdebug<<"GeneratePdf: Energy out of bounds!"<ToString()<GetStartPoint() == 0) continue; + + // Check if complete sequence is ok: + bool SequenceOk = true; + unsigned int SequenceLength = RE->GetNRESEs(); + int PreviousPosition = 0; + + if (SequenceLength > m_MaxNInteractions) continue; + + if (SequenceLength == 2) { + // Look at start: + MRESEIterator Iter; + Iter.Start(RE->GetStartPoint()); + Iter.GetNextRESE(); + Etot = RE->GetEnergy(); + Eres = RE->GetEnergyResolution(); + + double CosPhiE = CalculateCosPhiE(*Iter.GetCurrent(), Etot); + double PhotoDistance = CalculateAbsorptionProbabilityTotal(*Iter.GetCurrent(), *Iter.GetNext(), Iter.GetNext()->GetEnergy()); + + if (IsComptonStart(*Iter.GetCurrent(), Etot, Eres) == true) { + mdebug<<"--------> Found GOOD dual Compton event!"< Found bad dual Compton event!"<GetStartPoint()); + Iter.GetNextRESE(); + Etot = RE->GetEnergy(); + Eres = RE->GetEnergyResolution(); + if (IsComptonStart(*Iter.GetCurrent(), Etot, Eres) == true) { + mdebug<<"--------> Found GOOD Compton start!"< Found bad Compton start!"<GetType() == MRESE::c_Track) { + double dAlpha = CalculateDCosAlpha(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); + double Alpha = CalculateCosAlphaG(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); + if (IsComptonTrack(*Iter.GetCurrent(), *Iter.GetNext(), PreviousPosition, Etot, Eres) == true) { + mdebug<<"--------> Found GOOD Track start!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); + } else { + mdebug<<"--------> Found bad Track start!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); + SequenceOk = false; + } + } + + + // Central part of the Compton track + Iter.GetNextRESE(); + while (Iter.GetNext() != 0) { + // Add here + Etot -= Iter.GetPrevious()->GetEnergy(); + Eres = sqrt(Eres*Eres - Iter.GetPrevious()->GetEnergyResolution()*Iter.GetPrevious()->GetEnergyResolution()); + PreviousPosition++; + + // In the current implementation/simulation the hits have to be in increasing order... + if (m_DoAbsorptions == true && SequenceLength <= m_MaxAbsorptions) { + double ComptonDistance = + CalculateAbsorptionProbabilityCompton(*Iter.GetPrevious(), *Iter.GetCurrent(), Etot); + mdebug<<"Dist C: "<GetPosition() - Iter.GetPrevious()->GetPosition()).Mag()< Found GOOD Distance sequence!"< Found bad Distance sequence!"< Found GOOD internal Compton sequence!"< Found bad internal Compton sequence!"<GetType() == MRESE::c_Track) { + //MRETrack* T = (MRETrack*) Iter.GetCurrent(); + double dAlpha = CalculateDCosAlpha(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); + double Alpha = CalculateCosAlphaG(*((MRETrack*) Iter.GetCurrent()), *Iter.GetNext(), Etot); + if (IsComptonTrack(*Iter.GetCurrent(), *Iter.GetNext(), PreviousPosition, Etot, Eres) == true) { + mdebug<<"--------> Found GOOD Track start (central)!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); + } else { + mdebug<<"--------> Found bad Track start (central)!"<GetEnergy(), SequenceLength, GetMaterial(*Iter.GetCurrent())); + SequenceOk = false; + } + } + Iter.GetNextRESE(); + } + + Etot -= Iter.GetPrevious()->GetEnergy(); + Eres = sqrt(Eres*Eres - Iter.GetPrevious()->GetEnergyResolution()*Iter.GetPrevious()->GetEnergyResolution()); + PreviousPosition++; + + // Decide if it is good or bad... + // In the current implementation/simulation the hits have to be in increasing order... + if (m_DoAbsorptions == true && SequenceLength <= m_MaxAbsorptions) { + double LastDistance = CalculateAbsorptionProbabilityPhoto(*Iter.GetPrevious(), *Iter.GetCurrent(), Etot); + mdebug<<"Dist P: "<GetPosition() - Iter.GetPrevious()->GetPosition()).Mag()< Found GOOD Lastdistance sequence!"< Found bad Lastdistance sequence!"<GetStartPoint()); + Iter.GetNextRESE(); + if (IsTrackStart(*Iter.GetCurrent(), *Iter.GetNext(), Track->GetEnergy()) == false) { + mdebug<<"IsComptonTrack: Track is wrong!"< StartIds = GetReseIds(&Start); + vector CentralIds = GetReseIds(&Central); + if (StartIds.size() == 0) return false; + if (CentralIds.size() == 0) return false; + + + // Test (1) + if (AreIdsInSequence(StartIds) == false) { + mdebug<<" Is track start: Start IDs not in sequence"<GetHTAt(StartIds.back()-IdOffset)->GetTime(); + double TimeFirstLast = m_SiEvent->GetHTAt(CentralIds.front()-IdOffset)->GetTime(); + for (unsigned int h = 0; h < m_SiEvent->GetNHTs(); ++h) { + if (m_SiEvent->GetHTAt(h)->GetTime() > TimeLastFirst && + m_SiEvent->GetHTAt(h)->GetTime() < TimeFirstLast) { + mdebug<<" Is track start: Hit between first and central according to time: " + <GetHTAt(StartIds[i]-IdOffset)->GetNOrigins(); ++oi) { + for (unsigned int oj = 0; oj < m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetNOrigins(); ++oj) { + if (m_SiEvent->GetHTAt(StartIds[i]-IdOffset)->GetOriginAt(oi) == + m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetOriginAt(oj)) { + CommonOrigin = m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetOriginAt(oj); + break; + } + } + } + } + } + + if (CommonOrigin == -1) { + mdebug<<" Is track start: No common origin!"<::max(); + for (unsigned int i = 0; i < StartIds.size(); ++i) { + if (m_SiEvent->GetHTAt(StartIds[i]-IdOffset)->GetTime() < Timing) { + Timing = m_SiEvent->GetHTAt(StartIds[i]-IdOffset)->GetTime(); + } + } + unsigned int i_max = m_SiEvent->GetNHTs(); + for (unsigned int i = 0; i < i_max; ++i) { + if (m_SiEvent->GetHTAt(i)->IsOrigin(CommonOrigin)) { + if (m_SiEvent->GetHTAt(i)->GetTime() < Timing) { + mdebug<<" Is track start: Not first hit (timing)"< 0) { + if (IsTrackCompletelyAbsorbed(StartIds, Energy) == false) { + mdebug<<" Is track start: Not completely absorbed"< CentralIds = GetReseIds(&Central); + vector StopIds = GetReseIds(&Stop); + + // Test (1) + if (AreIdsInSequence(CentralIds) == false) { + mdebug<<" IsStop: Central IDs not in sequence"<GetHTAt(CentralIds.back()-IdOffset)->GetTime(); + double TimeFirstLast = m_SiEvent->GetHTAt(StopIds.front()-IdOffset)->GetTime(); + for (unsigned int h = 0; h < m_SiEvent->GetNHTs(); ++h) { + if (m_SiEvent->GetHTAt(h)->GetTime() > TimeLastFirst && + m_SiEvent->GetHTAt(h)->GetTime() < TimeFirstLast) { + mdebug<<" IsStop: Hit between first and central according to time!"<GetHTAt(CentralIds[i]-IdOffset)->GetNOrigins(); ++oi) { + for (unsigned int oj = 0; oj < m_SiEvent->GetHTAt(StopIds[j]-IdOffset)->GetNOrigins(); ++oj) { + if (m_SiEvent->GetHTAt(CentralIds[i]-IdOffset)->GetOriginAt(oi) == + m_SiEvent->GetHTAt(StopIds[j]-IdOffset)->GetOriginAt(oj)) { + CommonOrigin = m_SiEvent->GetHTAt(StopIds[j]-IdOffset)->GetOriginAt(oj); + break; + } + } + } + } + } + + if (CommonOrigin == -1) { + mdebug<<" IsStop: No common origin!"<::max(); + for (unsigned int i = 0; i < StopIds.size(); ++i) { + if (m_SiEvent->GetHTAt(StopIds[i]-IdOffset)->GetTime() > Timing) { + Timing = m_SiEvent->GetHTAt(StopIds[i]-IdOffset)->GetTime(); + } + } + unsigned int i_max = m_SiEvent->GetNHTs(); + for (unsigned int i = 0; i < i_max; ++i) { + if (m_SiEvent->GetHTAt(i)->IsOrigin(CommonOrigin)) { + if (m_SiEvent->GetHTAt(i)->GetTime() > Timing) { + mdebug<<" IsStop: Not last hit (timing)"< StartIds = GetReseIds(&Start); + vector CentralIds = GetReseIds(&Central); + vector StopIds = GetReseIds(&Stop); + + // Test (1) + if (AreIdsInSequence(StartIds) == false) { + mdebug<<" IsCentral: Start IDs not in sequence"<GetHTAt(StartIds.back()-IdOffset)->GetTime(); + double TimeFirstLast = m_SiEvent->GetHTAt(CentralIds.front()-IdOffset)->GetTime(); + for (unsigned int h = 0; h < m_SiEvent->GetNHTs(); ++h) { + if (m_SiEvent->GetHTAt(h)->GetTime() > TimeLastFirst && + m_SiEvent->GetHTAt(h)->GetTime() < TimeFirstLast) { + mdebug<<" IsCentral: Hit between first and central according to time!"<GetHTAt(CentralIds.back()-IdOffset)->GetTime(); + TimeFirstLast = m_SiEvent->GetHTAt(StopIds.front()-IdOffset)->GetTime(); + for (unsigned int h = 0; h < m_SiEvent->GetNHTs(); ++h) { + if (m_SiEvent->GetHTAt(h)->GetTime() > TimeLastFirst && + m_SiEvent->GetHTAt(h)->GetTime() < TimeFirstLast) { + mdebug<<" IsCentral: Hit between first and central according to time!"<GetHTAt(StartIds[i]-IdOffset)->GetNOrigins(); ++oi) { + for (unsigned int oj = 0; oj < m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetNOrigins(); ++oj) { + for (unsigned int ok = 0; ok < m_SiEvent->GetHTAt(StopIds[k]-IdOffset)->GetNOrigins(); ++ok) { + if (m_SiEvent->GetHTAt(StartIds[i]-IdOffset)->GetOriginAt(oi) == + m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetOriginAt(oj) && + m_SiEvent->GetHTAt(StartIds[i]-IdOffset)->GetOriginAt(oi) == + m_SiEvent->GetHTAt(StopIds[k]-IdOffset)->GetOriginAt(ok)) { + CommonOrigin = m_SiEvent->GetHTAt(CentralIds[j]-IdOffset)->GetOriginAt(oj); + break; + } + } + } + } + } + } + } + if (CommonOrigin == -1) { + mdebug<<" IsCentral: No common origin!"<GetHTAt(StartIds[0]-IdOffset)->GetTime() > + m_SiEvent->GetHTAt(CentralIds[0]-IdOffset)->GetTime() || + m_SiEvent->GetHTAt(CentralIds[0]-IdOffset)->GetTime() > + m_SiEvent->GetHTAt(StopIds[0]-IdOffset)->GetTime()) { + mdebug<<" IsCentral: Timing wrong"<= c_Chatty) mout<<"IsComptonStart: Looking at: "< StartOriginIds = GetOriginIds(&Start); + if (StartOriginIds.size() == 0) { + if (g_Verbosity >= c_Chatty) mout<<"IsComptonStart: Start has no Sim IDs!"<::max(); + for (unsigned int i = 0; i < StartOriginIds.size(); ++i) { + if (StartOriginIds[i] < SmallestOriginID) SmallestOriginID = StartOriginIds[i]; + } + + // Find the real Origin + int TrueOrigin = m_SiEvent->GetIAAt(SmallestOriginID-1)->GetOriginID(); + + // Test (1) - Absorption: + if (Etot > 0) { + // First hit + if (IsAbsorbed(StartOriginIds, Start.GetEnergy(), Start.GetEnergyResolution()) == false) { + if (g_Verbosity >= c_Chatty) mout<<"IsComptonStart: IA not completely absorbed!"<= c_Chatty) mout<<"IsComptonStart: Not completely absorbed!"<GetIAAt(m_SiEvent->GetIAAt(SmallestOriginID-1)->GetOriginID()-1); + if (OriginIA->GetSecondaryParticleID() == 1 || // create photon + (OriginIA->GetSecondaryParticleID() == 0 && OriginIA->GetMotherParticleID() == 1)) { // create nothing and be a photon + // good... + } else { + // Only photons can be good... + if (g_Verbosity >= c_Chatty) mout<<"IsComptonStart: IA which triggered first RESE did not create a photon or is not photon and create nothing"<= c_Chatty) mout<<"IsComptonStart: Start contains not only Compton dependants"<= c_Chatty) mout<<"IsComptonStart: Not exactly one Compton in interaction"<= c_Chatty) mout<<"IsComptonStart: Passed!"< AllSimIds, int Origin) +{ + unsigned int N = 0; + + for (unsigned int i = 0; i < AllSimIds.size(); ++i) { + if (m_SiEvent->GetIAAt(AllSimIds[i]-1)->GetProcess() == "COMP" && m_SiEvent->GetIAAt(AllSimIds[i]-1)->GetOriginID() == Origin) { + ++N; + } + } + + return N; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +bool MResponseMultipleComptonBayes::IsComptonSequence(MRESE& Start, MRESE& Central, + int StartPosition, double Etot, + double Eres) +{ + // Return true if the given RESEs are in sequence + // + // A good start point for double Comptons requires: + // (1) An absorption better than 99% + // (2) the IDs of their hits are in increasing order without holes + // (3) Start is the StartPosition's Compton IA + + mdebug<<"IsComptonSequence2: Looking at: "< StartIds = GetReseIds(Start); + vector StartOriginIds = GetOriginIds(&Start); + if (StartOriginIds.size() == 0) { + mdebug<<"IsComptonSequence2: Start has no Sim IDs!"< CentralIds = GetReseIds(Central); + vector CentralOriginIds = GetOriginIds(&Central); + if (CentralOriginIds.size() == 0) { + mdebug<<"IsComptonSequence2: Central has no Sim IDs!"< 0) { + if (IsTotalAbsorbed(CentralOriginIds, Etot, Eres) == false) { + mdebug<<"IsComptonSequence2: Not completely absorbed!"< StartIds = GetReseIds(Start); + vector StartOriginIds = GetOriginIds(&Start); + if (StartOriginIds.size() == 0) { + mdebug<<"IsComptonSequence3: Start has no Sim IDs!"< CentralIds = GetReseIds(Central); + vector CentralOriginIds = GetOriginIds(&Central); + if (CentralOriginIds.size() == 0) { + mdebug<<"IsComptonSequence3: Central has no Sim IDs!"< StopIds = GetReseIds(Stop); + vector StopOriginIds = GetOriginIds(&Stop); + if (StopOriginIds.size() == 0) { + mdebug<<"IsComptonSequence3: Stop has no Sim IDs!"< CentralIds = GetReseIds(Central); +// vector CentralOriginIds = GetOriginIds(CentralIds); +// if (CentralOriginIds.size() == 0) { +// mdebug<<"IsComptonEnd: Central has no Sim IDs!"< EndIds = GetReseIds(End); + vector EndOriginIds = GetOriginIds(&End); + if (EndOriginIds.size() == 0) { + mdebug<<"IsComptonEnd: End has no Sim IDs!"<GetNIAs() < 3) { + mdebug<<"IsComptonEnd: Not enough interactions!"<GetNIAs(); ++i) { +// if (m_SiEvent->GetIAAt(i)->GetOriginID() == 1) { +// LastIA = i+1; +// } else { +// break; +// } +// } +// bool FoundLastIA = false; +// for (unsigned int i = 0; i < EndOriginIds.size(); ++i) { +// if (EndOriginIds[i] == LastIA) { +// FoundLastIA = true; +// break; +// } +// } +// if (FoundLastIA == false) { +// mdebug<<"IsComptonEnd: Last interaction of track 1 not part of last hit"<GetIAAt(Smallest-1)->GetOriginID() == 0) { + if (m_SiEvent->GetIAAt(Smallest-1)->GetProcess() != "ANNI" && + m_SiEvent->GetIAAt(Smallest-1)->GetProcess() != "INIT") { + return false; + } + } else { + if (m_SiEvent->GetIAAt(m_SiEvent->GetIAAt(Smallest-1)->GetOriginID()-1)->GetProcess() != "ANNI" && + m_SiEvent->GetIAAt(m_SiEvent->GetIAAt(Smallest-1)->GetOriginID()-1)->GetProcess() != "INIT") { + return false; + } + } + + return true; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +bool MResponseMultipleComptonBayes::IsSingleCompton(MRESE& Start) +{ + // Check if all interaction in start are from one single Compton interaction: + + //cout< StartIds = GetReseIds(Start); + vector StartOriginIds = GetOriginIds(&Start); + if (StartOriginIds.size() == 0) { + mdebug<<"IsSingleCompton: Start has no Sim IDs!"<GetIAAt(StartOriginIds[i]-1)->GetProcess() == "COMP") { + NComptons++; + } else if (m_SiEvent->GetIAAt(StartOriginIds[i]-1)->GetProcess() == "PHOT") { + NPhotos++; + } + } + + if (NComptons == 1 && NPhotos >= 0) { + mdebug<<"IsSingleCompton: Single Compton: C="<GetIAAt(StartOriginIds[0]-1)->GetOriginID() != + m_SiEvent->GetIAAt(CentralOriginIds[0]-1)->GetOriginID()) { + mdebug<<"CS: No common origin"<GetIAAt(StartOriginIds[0]-1)->GetMotherParticleNumber() != 1) { +// mdebug<<"CS: Mother is no photon: "<GetIAAt(StartOriginIds[0]-1)->GetMotherParticleNumber()< AllSimIds) +{ + // We do two checks here, one down the tree and one up the tree + + // First check upwards: Is everything in there originating from somewhere else in there or is it an initial process (COMP, INIT, produced a photon) + for (unsigned int i = 0; i < AllSimIds.size(); ++i) { + int ID = AllSimIds[i]; + int HighestOriginID = ID; + while (true) { + // Get new origin ID + ID = m_SiEvent->GetIAAt(ID-1)->GetOriginID(); + // Check if included + for (unsigned int j = 0; j < AllSimIds.size(); ++j) { + if (i != j && ID == AllSimIds[j]) { + HighestOriginID = ID; + break; + } + } + + // Check if we are done + if (m_SiEvent->GetIAAt(ID-1)->GetProcess() == "INIT") break; // Compton dependents, remember? + } + + // We are good if the end point is a Compton scatter or a photo effect which is preceeded by a Compton in the list: + bool IsGood = false; + if (m_SiEvent->GetIAAt(HighestOriginID-1)->GetProcess() == "COMP") { + IsGood = true; + } else if (m_SiEvent->GetIAAt(HighestOriginID-1)->GetProcess() == "PHOT") { + int Predeccessor = HighestOriginID-1; + while (true) { + if (Predeccessor == 1) break; // we reached init + if (m_SiEvent->GetIAAt(Predeccessor-1)->GetOriginID() == m_SiEvent->GetIAAt(HighestOriginID-1)->GetOriginID()) { + if (m_SiEvent->GetIAAt(Predeccessor-1)->GetProcess() == "COMP") { + if (find(AllSimIds.begin(), AllSimIds.end(), Predeccessor) != AllSimIds.end()) { + IsGood = true; + break; + } else { + mdebug<<"ContainsOnlyComptonDependants: Preceeding Compton IA is missing"<GetIAAt(SimIDs[i]-1)->GetOriginID() == m_SiEvent->GetIAAt(SimIDs[i]-2)->GetOriginID() && m_SiEvent->GetIAAt(SimIDs[i]-2)->GetProcess() != "PHOT") { + CleanedSimIDs.push_back(SimIDs[i]); + } + } else { + CleanedSimIDs.push_back(SimIDs[i]); + } + } + SimIDs = CleanedSimIDs; + CleanedSimIDs.clear(); + + // (c) Exclude fluoresence COMP + for (unsigned int i = 0; i < SimIDs.size(); ++i) { + if (m_SiEvent->GetIAAt(SimIDs[i]-1)->GetProcess() == "COMP") { + if (m_SiEvent->GetIAAt(SimIDs[i]-1)->GetSecondaryParticleID() == 3) { + CleanedSimIDs.push_back(SimIDs[i]); + } + } else { + CleanedSimIDs.push_back(SimIDs[i]); + } + } + SimIDs = CleanedSimIDs; + CleanedSimIDs.clear(); + + mdebug<<"SimIDs: "; for (int i: SimIDs) mdebug<GetIAAt(SimIDs[i]-1)->GetProcess() != "COMP" && m_SiEvent->GetIAAt(SimIDs[i]-1)->GetProcess() != "PHOT") { + cout<<"Error: We only should have COMP and PHOT IA's at this point and not \""<GetIAAt(SimIDs[i]-1)->GetProcess()<<"\". Did you use hadronic processes for the simulations?"<GetIAAt(SimIDs[i]-1)->GetProcess() == "COMP") { + if (m_SiEvent->GetIAAt(SimIDs[i]-2)->GetProcess() == "COMP" || m_SiEvent->GetIAAt(SimIDs[i]-2)->GetProcess() == "RAYL") { + mdebug<<"COMP with COMP/RAYL predeccessor: Adding mother difference energy: "<GetIAAt(SimIDs[i]-2)->GetMotherEnergy() - m_SiEvent->GetIAAt(SimIDs[i]-1)->GetMotherEnergy()<GetIAAt(SimIDs[i]-2)->GetMotherEnergy() - m_SiEvent->GetIAAt(SimIDs[i]-1)->GetMotherEnergy(); + } else { + mdebug<<"COMP WITHOUT COMP/RAYL predeccessor: Adding secondary-mother difference energy: "<GetIAAt(SimIDs[i]-2)->GetSecondaryEnergy() - m_SiEvent->GetIAAt(SimIDs[i]-1)->GetMotherEnergy()<GetIAAt(SimIDs[i]-2)->GetSecondaryEnergy() - m_SiEvent->GetIAAt(SimIDs[i]-1)->GetMotherEnergy(); + } + } else if (m_SiEvent->GetIAAt(SimIDs[i]-1)->GetProcess() == "PHOT") { + if (m_SiEvent->GetIAAt(SimIDs[i]-2)->GetProcess() == "COMP" || m_SiEvent->GetIAAt(SimIDs[i]-2)->GetProcess() == "RAYL") { + mdebug<<"PHOT with COMP/RAYL predeccessor: Adding mother energy: "<GetIAAt(SimIDs[i]-2)->GetMotherEnergy()<GetIAAt(SimIDs[i]-2)->GetMotherEnergy(); + } else { + mdebug<<"PHOT withOUT COMP/RAYL predeccessor: Adding secondary energy: "<GetIAAt(SimIDs[i]-2)->GetSecondaryEnergy()<GetIAAt(SimIDs[i]-2)->GetSecondaryEnergy(); + } + } else { + cout<<"Error: We only should have COMP and PHOT IA's at this point. Did you use hadronic processes for the simulations?"< EnergyResolution) { + mdebug<<"IsAbsorbed(): Not completely absorbed: ideal="<GetMotherEnergy(); + } else { + Ideal = Top->GetSecondaryEnergy(); + } + + if (MinId-2 != 0) { + Ideal = m_SiEvent->GetIAAt(MinId-2)->GetMotherEnergy(); + } else { + Ideal = m_SiEvent->GetIAAt(MinId-2)->GetSecondaryEnergy(); + } + + if (fabs(Ideal - Energy) > EnergyResolution) { + mdebug<<"Is totally absorbed: Not completely absorbed: Tot abs: i="<GetMotherEnergy()-Bottom->GetMotherEnergy(); + } else { + Ideal = Top->GetSecondaryEnergy()-Bottom->GetMotherEnergy(); + } + + return Ideal; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +bool MResponseMultipleComptonBayes::IsTrackCompletelyAbsorbed(const vector& Ids, double Energy) +{ + // Return true if the track is completely absorbed + // + // Prerequisites: Ids have only one common origin! + // Realization: Nothing originates from this ID AFTER this hit: + + const int IdOffset = 2; + + // Get origin Id + int Origin = -1; + for (unsigned int i = 0; i < Ids.size(); ++i) { + for (unsigned int oi = 0; oi < m_SiEvent->GetHTAt(Ids[i]-IdOffset)->GetNOrigins(); ++oi) { + if (m_SiEvent->GetHTAt(Ids[i]-IdOffset)->GetOriginAt(oi) != 1) { + Origin = m_SiEvent->GetHTAt(Ids[i]-IdOffset)->GetOriginAt(oi); + break; + } + } + } + if (Origin <= 1) { + mdebug<<" IsTrackCompletelyAbsorbed: No origin"<GetNIAs(); ++i) { +// if (m_SiEvent->GetIAAt(i)->GetOriginID() == Origin) { +// if (m_SiEvent->GetIAAt(i)->GetProcess() == "BREM") { +// // Search the closest hit: +// int MinHT = -1; +// double MinDist = numeric_limits::max(); +// for (unsigned int h = 0; h < m_SiEvent->GetNHTs(); ++h) { +// if (m_SiEvent->GetHTAt(h)->IsOrigin(Origin) == true) { +// if ((m_SiEvent->GetIAAt(i)->GetPosition() - m_SiEvent->GetHTAt(h)->GetPosition()).Mag() < MinDist) { +// MinDist = (m_SiEvent->GetIAAt(i)->GetPosition() - m_SiEvent->GetHTAt(h)->GetPosition()).Mag(); +// MinHT = h; +// } +// } +// } +// if (MinHT > 0) { +// if (m_SiEvent->GetHTAt(MinHT)->GetTime() >= m_SiEvent->GetHTAt(Ids[0]-IdOffset)->GetTime()) { +// mdebug<<" IsTrackCompletelyAbsorbed: Bremsstrahlung emitted after this hit!"<GetIAAt(i)->GetProcess()<GetNHTs(); ++h) { + if (m_SiEvent->GetHTAt(h)->IsOrigin(Origin) == true) { + if (m_SiEvent->GetHTAt(h)->GetTime() >= m_SiEvent->GetHTAt(Ids[0]-IdOffset)->GetTime()) { + RealEnergy += m_SiEvent->GetHTAt(h)->GetEnergy(); + } + } + } + + if (fabs(Energy - RealEnergy) > EnergyLimit && + fabs(Energy - RealEnergy)/RealEnergy > EnergyLimitPercent) { + mdebug<<" IsTrackCompletelyAbsorbed: Missing/Not much energy: i=" + <GetAbsorptionProbability(Start.GetPosition(), + Stop.GetPosition(), Etot); + + //cout<<"Probability: "<GetComptonAbsorptionProbability(Start.GetPosition(), + Stop.GetPosition(), Etot); + + //cout<<"Distance: "<::max(); @@ -102,7 +105,9 @@ MString MResponseMultipleComptonEventFile::Options() { ostringstream out; out<<" initial: use the path to the initial IA (default: true)"<GetEnergy() < m_EnergyMinimum || RE->GetEnergy() > m_EnergyMaximum) { + mdebug<<"CreateResponse: Energy out of bounds!"<GetRejectionReason() == MRERawEvent::c_RejectionTotalEnergyOutOfLimits || RE->GetRejectionReason() == MRERawEvent::c_RejectionLeverArmOutOfLimits || RE->GetRejectionReason() == MRERawEvent::c_RejectionEventIdOutOfLimits) { diff --git a/src/response/src/MResponseMultipleComptonTMVA.cxx b/src/response/src/MResponseMultipleComptonTMVA.cxx index f6da9a951..f2e156379 100644 --- a/src/response/src/MResponseMultipleComptonTMVA.cxx +++ b/src/response/src/MResponseMultipleComptonTMVA.cxx @@ -73,9 +73,12 @@ MResponseMultipleComptonTMVA::MResponseMultipleComptonTMVA() m_ResponseNameSuffix = "tmva"; m_MaxNEvents = 10000000; // 10 Mio - m_MaxNInteractions = 5; + m_MaxNInteractions = 7; m_MethodsString = "BDTD"; - + + m_EnergyMinimum = 100; // keV + m_EnergyMaximum = 10000; // keV + SetDefaultOptions(); } @@ -148,6 +151,8 @@ MString MResponseMultipleComptonTMVA::Options() ostringstream out; out<<" methods: the selected TMVA methods (default: BDTD)"< Date: Fri, 26 Jan 2024 01:16:32 -0800 Subject: [PATCH 030/192] CHG: Changes to internal cfitsio --- config/Makefile.linuxgcc | 10 +++++----- config/Makefile.macosx | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/Makefile.linuxgcc b/config/Makefile.linuxgcc index d9f7ca68b..a1dcf0d73 100644 --- a/config/Makefile.linuxgcc +++ b/config/Makefile.linuxgcc @@ -33,11 +33,11 @@ LINK := ln -s -f # HEASoft HEACFLAGS := HEALIBS := -ifneq ("$(wildcard $(LHEASOFT)/include/fitsio.h)", "") - HEACFLAGS += -I$(LHEASOFT)/include - HEALIBS += -L$(LHEASOFT)/lib +ifeq ("$(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --exists cfitsio 1>&2 2> /dev/null; echo $$?)", "0") + HEACFLAGS += $(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --cflags cfitsio) + HEALIBS += $(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --libs cfitsio --static) else ifeq ("$(shell pkg-config --exists cfitsio 1>&2 2> /dev/null; echo $$?)", "0") - HEACFLAGS += $(shell pkg-config --cflags cfitsio) - HEALIBS += $(shell pkg-config --libs cfitsio) + HEACFLAGS += $(shell pkg-config --cflags cfitsio) + HEALIBS += $(shell pkg-config --libs cfitsio) endif diff --git a/config/Makefile.macosx b/config/Makefile.macosx index 7ed957113..1cd2fa743 100644 --- a/config/Makefile.macosx +++ b/config/Makefile.macosx @@ -34,9 +34,9 @@ LINK := ln -s -f # HEASoft HEACFLAGS := HEALIBS := -ifneq ("$(wildcard $(LHEASOFT)/include/fitsio.h)", "") - HEACFLAGS += -I$(LHEASOFT)/include - HEALIBS += -L$(LHEASOFT)/lib +ifeq ("$(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --exists cfitsio 1>&2 2> /dev/null; echo $$?)", "0") + HEACFLAGS += $(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --cflags cfitsio) + HEALIBS += $(shell PKG_CONFIG_PATH=$(LHEASOFT)/lib/pkgconfig pkg-config --libs cfitsio --static) else ifeq ("$(shell pkg-config --exists cfitsio 1>&2 2> /dev/null; echo $$?)", "0") HEACFLAGS += $(shell pkg-config --cflags cfitsio) HEALIBS += $(shell pkg-config --libs cfitsio) From fda5eb17ebebd1de2cb1ec3bb3dfc68c1630e12f Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Fri, 26 Jan 2024 11:11:20 -0800 Subject: [PATCH 031/192] ADD: Save the cfg file via command line in revan and mimrec --- src/mimrec/src/MInterfaceMimrec.cxx | 8 +++++++- src/revan/src/MInterfaceRevan.cxx | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mimrec/src/MInterfaceMimrec.cxx b/src/mimrec/src/MInterfaceMimrec.cxx index a8251e42e..d9a2c920e 100644 --- a/src/mimrec/src/MInterfaceMimrec.cxx +++ b/src/mimrec/src/MInterfaceMimrec.cxx @@ -159,6 +159,8 @@ bool MInterfaceMimrec::ParseCommandLine(int argc, char** argv) Usage<<" Perform polarization analysis. If the -o option is given then the image is saved to this file."< Date: Thu, 8 Feb 2024 11:31:56 -0800 Subject: [PATCH 032/192] CHG: Minimum energy must be 0 --- src/mimrec/src/MInterfaceMimrec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mimrec/src/MInterfaceMimrec.cxx b/src/mimrec/src/MInterfaceMimrec.cxx index d9a2c920e..f13a7c4dc 100644 --- a/src/mimrec/src/MInterfaceMimrec.cxx +++ b/src/mimrec/src/MInterfaceMimrec.cxx @@ -4056,7 +4056,7 @@ void MInterfaceMimrec::EnergyDistributionElectronPhoton() if (InitializeEventLoader() == false) return; bool xLog = m_Settings->GetLogBinningSpectrum(); - double xMin = GetTotalEnergyMin(); + double xMin = 0; double xMax = GetTotalEnergyMax(); if (xLog == true) { From 896ef505732b8b46e0752cf085a1b3dcce918304 Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 8 Feb 2024 16:06:56 -0800 Subject: [PATCH 033/192] CHG: Sort masses by name --- src/geomega/src/MDGeometry.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/geomega/src/MDGeometry.cxx b/src/geomega/src/MDGeometry.cxx index 3aa595eb8..d8810d48d 100644 --- a/src/geomega/src/MDGeometry.cxx +++ b/src/geomega/src/MDGeometry.cxx @@ -4646,16 +4646,25 @@ void MDGeometry::CalculateMasses() } } + map MassByName; + for (MassesIter = Masses.begin(); MassesIter != Masses.end(); ++MassesIter) { + MassByName[(*MassesIter).first->GetName()] = (*MassesIter).second; + } + ostringstream out; out.setf(ios_base::fixed, ios_base::floatfield); out.precision(3); out<GetName()<<" : "<GetName()<<" : "< Date: Thu, 23 May 2024 17:15:51 -0700 Subject: [PATCH 034/192] CHG: More ROOTPATH sanity checks --- config/check-rootversion.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/check-rootversion.sh b/config/check-rootversion.sh index 19769d1e9..60df5477b 100755 --- a/config/check-rootversion.sh +++ b/config/check-rootversion.sh @@ -126,9 +126,15 @@ if [ "${GOOD}" == "true" ]; then fi if [ "${CHECK}" == "true" ]; then + if [ ! -d ${ROOTPATH} ]; then + echo " " + echo "ERROR: The given directory ${ROOTPATH} does no exist." + exit 1; + fi + if [ ! -f ${ROOTPATH}/bin/root-config ]; then echo " " - echo "ERROR: The given directory ${ROOTPATH} does no contain a correct ROOT installation" + echo "ERROR: The file ${ROOTPATH}/bin/root-config does exist and thus you do not have a standard ROOT installation" exit 1; fi From e9a32b745b9654e00d0ae74c18f593bdccdb052a Mon Sep 17 00:00:00 2001 From: Andreas Zoglauer Date: Thu, 23 May 2024 17:16:17 -0700 Subject: [PATCH 035/192] CHG: Update Doxyfile to latest version --- resource/Doxyfile | 2829 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 2735 insertions(+), 94 deletions(-) mode change 100755 => 100644 resource/Doxyfile diff --git a/resource/Doxyfile b/resource/Doxyfile old mode 100755 new mode 100644 index df3d13543..260e2c928 --- a/resource/Doxyfile +++ b/resource/Doxyfile @@ -1,181 +1,2822 @@ -# Doxyfile 0.1 +# Doxyfile 1.9.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- -# General configuration options +# Project related configuration options #--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + PROJECT_NAME = "MEGAlib" -PROJECT_NUMBER = 2.XX + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "the medium-energy gamma-ray astronomy library" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = NO -STRIP_CODE_COMMENTS = NO -CASE_SENSE_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = NO -SHOW_INCLUDE_FILES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = SYSTEM + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + SORT_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 16 -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -ALIASES = -ENABLED_SECTIONS = + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = NO + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = /tmp/doxygen -FILE_PATTERNS = *.cpp \ - *.h \ - *.cxx \ + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, +# *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, *.php, +# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be +# provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ *.cc \ + *.cxx \ + *.cxxm \ + *.cpp \ + *.cppm \ + *.c++ \ + *.c++m \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.ixx \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- -SOURCE_BROWSER = YES + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + INLINE_SOURCES = NO -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 4 -IGNORE_PREFIX = ZD + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_OUTPUT = html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + TOC_EXPAND = NO + +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /