From a3e0b48797ee8535af5fa312ca25078f1bbda8d0 Mon Sep 17 00:00:00 2001 From: "Richard T. Jones" Date: Tue, 26 Nov 2024 11:58:32 -0500 Subject: [PATCH] * rename Particle_t enum Unknown to UnknownParticle, to coordinate with the current release of HDDM. It is too confusing to have this constant named Unknown floating around in the global namespace. [rtj] --- src/programs/Simulation/GEN2HDDM/GEN2HDDM_jpsi.cc | 2 +- src/programs/Simulation/GEN2HDDM/GEN2HDDM_new.cc | 2 +- src/programs/Simulation/HDGeant/SConscript | 2 +- src/programs/Simulation/decay_evtgen/decay_evtgen.cc | 4 ++-- src/programs/Simulation/decay_evtgen/evtgenParticleString.h | 2 +- src/programs/Simulation/genEtaRegge/genEtaRegge.cc | 4 ++-- src/programs/Simulation/gen_ALP/gen_ALP.cc | 4 ++-- .../Simulation/gen_primex_eta_he4/gen_primex_eta_he4.cc | 4 ++-- src/programs/Simulation/gen_schannel/gen_schannel.cc | 2 +- src/programs/Simulation/gen_whizard/HddmOut.h | 2 +- src/programs/Simulation/geneta/bg_hddm.cc | 4 ++-- src/programs/Simulation/genr8_2_hddm/genr8_2_hddm.cc | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/programs/Simulation/GEN2HDDM/GEN2HDDM_jpsi.cc b/src/programs/Simulation/GEN2HDDM/GEN2HDDM_jpsi.cc index 317e86af7..64b0a97dc 100644 --- a/src/programs/Simulation/GEN2HDDM/GEN2HDDM_jpsi.cc +++ b/src/programs/Simulation/GEN2HDDM/GEN2HDDM_jpsi.cc @@ -352,7 +352,7 @@ void Usage(void) int Str2GeantParticleID(char *str) { if (strcmp(str, "unknown") == 0 || strcmp(str, "Unknown") == 0) - return Unknown; + return UnknownParticle; if (strcmp(str, "gamma") == 0 || strcmp(str, "Gamma") == 0) return Gamma; if (strcmp(str, "positron") == 0 || strcmp(str, "Positron") == 0) diff --git a/src/programs/Simulation/GEN2HDDM/GEN2HDDM_new.cc b/src/programs/Simulation/GEN2HDDM/GEN2HDDM_new.cc index 5b9a086b4..a8031a377 100644 --- a/src/programs/Simulation/GEN2HDDM/GEN2HDDM_new.cc +++ b/src/programs/Simulation/GEN2HDDM/GEN2HDDM_new.cc @@ -460,7 +460,7 @@ void Usage(void) int Str2GeantParticleID(char *str) { if (strcmp(str, "unknown") == 0 || strcmp(str, "Unknown") == 0) - return Unknown; + return UnknownParticle; if (strcmp(str, "gamma") == 0 || strcmp(str, "Gamma") == 0) return Gamma; if (strcmp(str, "positron") == 0 || strcmp(str, "Positron") == 0) diff --git a/src/programs/Simulation/HDGeant/SConscript b/src/programs/Simulation/HDGeant/SConscript index 412f9477c..e1640de1a 100644 --- a/src/programs/Simulation/HDGeant/SConscript +++ b/src/programs/Simulation/HDGeant/SConscript @@ -27,7 +27,7 @@ else: version_string = postgcc[0:vers_end] else: version_string = postgcc - versions = version_string.split('.') + versions = (version_string + ".0.0").split('.') if int(versions[0]) >= 4 and int(versions[1]) >= 8 or int(versions[0]) >= 5: env.PrependUnique(FORTRANFLAGS = ['-fno-aggressive-loop-optimizations']) diff --git a/src/programs/Simulation/decay_evtgen/decay_evtgen.cc b/src/programs/Simulation/decay_evtgen/decay_evtgen.cc index 155a9723d..6089392dd 100644 --- a/src/programs/Simulation/decay_evtgen/decay_evtgen.cc +++ b/src/programs/Simulation/decay_evtgen/decay_evtgen.cc @@ -39,7 +39,7 @@ using namespace std; typedef struct { int id = -1; - Particle_t type = Unknown; + Particle_t type = UnknownParticle; int pdgtype = -1; bool decayed = false; TLorentzVector momentum; @@ -228,7 +228,7 @@ void DecayParticles(hddm_s::HDDM * hddmevent, vector< gen_particle_info_t > &par default: myGenerator->generateDecay(parent); if(parent->getNDaug() > 0) - part.hddmProduct->setType(Unknown); // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? + part.hddmProduct->setType(UnknownParticle); // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? break; } diff --git a/src/programs/Simulation/decay_evtgen/evtgenParticleString.h b/src/programs/Simulation/decay_evtgen/evtgenParticleString.h index 3cb7cdf9a..d84af477e 100644 --- a/src/programs/Simulation/decay_evtgen/evtgenParticleString.h +++ b/src/programs/Simulation/decay_evtgen/evtgenParticleString.h @@ -8,7 +8,7 @@ inline static char* EvtGenOutputString(Particle_t p) p = RemapParticleID(p); switch (p) { - case Unknown: + case UnknownParticle: return (char*)"Unknown"; case Gamma: return (char*)"gamma"; diff --git a/src/programs/Simulation/genEtaRegge/genEtaRegge.cc b/src/programs/Simulation/genEtaRegge/genEtaRegge.cc index a99460eef..665703334 100644 --- a/src/programs/Simulation/genEtaRegge/genEtaRegge.cc +++ b/src/programs/Simulation/genEtaRegge/genEtaRegge.cc @@ -370,7 +370,7 @@ void WriteEvent(unsigned int eventNumber,TLorentzVector &beam,TLorentzVector &ta for (unsigned int i=0;imult++){ Particle_t my_particle=particle_types[i]; if(particle_decayed[i]) - ps->in[ps->mult].type = Unknown; // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? + ps->in[ps->mult].type = UnknownParticle; // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? else ps->in[ps->mult].type = my_particle; ps->in[ps->mult].pdgtype = PDGtype(my_particle); @@ -1191,7 +1191,7 @@ int main(int narg, char *argv[]) } for (int j=0;jGetConfigName("fermi_file") != "" && ReadFile->GetConfigName("participant") != "" && ReadFile->GetConfigName("spectator") != "") { m_Fermi_file = ReadFile->GetConfigName("fermi_file"); cout << "Fermi_file " << m_Fermi_file << endl; diff --git a/src/programs/Simulation/gen_schannel/gen_schannel.cc b/src/programs/Simulation/gen_schannel/gen_schannel.cc index d998b3397..069105374 100644 --- a/src/programs/Simulation/gen_schannel/gen_schannel.cc +++ b/src/programs/Simulation/gen_schannel/gen_schannel.cc @@ -232,7 +232,7 @@ void WriteEvent(unsigned int eventNumber, TLorentzVector &beam, float vert[3], origin->vy = vert[1]; origin->vz = vert[2]; // Final state particle - ps->in[0].type = Unknown; // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? + ps->in[0].type = UnknownParticle; // zero out particle type info so that hdgeant won't decay the particle. maybe there is a better way? //ps->in[0].type = particle_type; ps->in[0].pdgtype = particle_type; ps->in[0].id = 0; /* unique value for this particle within the event */ diff --git a/src/programs/Simulation/gen_whizard/HddmOut.h b/src/programs/Simulation/gen_whizard/HddmOut.h index e6a8d0b03..f0503c4fd 100644 --- a/src/programs/Simulation/gen_whizard/HddmOut.h +++ b/src/programs/Simulation/gen_whizard/HddmOut.h @@ -123,7 +123,7 @@ class HddmOut { } else if (evt.rxn != "a_to_e") { for (int i = 0; i < (evt.nGen -1); i ++) { - Particle_t TYPE = Unknown; + Particle_t TYPE = UnknownParticle; if (evt.pdg[i] == 11) TYPE = Electron; if (evt.pdg[i] == -11) TYPE = Positron; if (evt.pdg[i] == 22) TYPE = Gamma; diff --git a/src/programs/Simulation/geneta/bg_hddm.cc b/src/programs/Simulation/geneta/bg_hddm.cc index 0b5bca726..b48df7b97 100644 --- a/src/programs/Simulation/geneta/bg_hddm.cc +++ b/src/programs/Simulation/geneta/bg_hddm.cc @@ -181,7 +181,7 @@ int GEANT_to_PDG(Particle_t type) map::iterator iter = GEANT_to_PDG_map.find(type); if (iter == GEANT_to_PDG_map.end()) - type = Unknown; + type = UnknownParticle; return GEANT_to_PDG_map[type]; } @@ -192,7 +192,7 @@ int GEANT_to_PDG(Particle_t type) void InitializePDGGEANTmaps(void) { // Set values in GEANT_to_PDG_map first, then copy them into PDG_to_GEANT_map - GEANT_to_PDG_map[Unknown] = 0; + GEANT_to_PDG_map[UnknownParticle] = 0; GEANT_to_PDG_map[Gamma] = 22; GEANT_to_PDG_map[Positron] = -11; GEANT_to_PDG_map[Electron] = 11; diff --git a/src/programs/Simulation/genr8_2_hddm/genr8_2_hddm.cc b/src/programs/Simulation/genr8_2_hddm/genr8_2_hddm.cc index 53f0a02cd..425f91f5f 100644 --- a/src/programs/Simulation/genr8_2_hddm/genr8_2_hddm.cc +++ b/src/programs/Simulation/genr8_2_hddm/genr8_2_hddm.cc @@ -293,7 +293,7 @@ void Usage(void) int Str2GeantParticleID(char *str) { if (strcmp(str, "unknown") == 0 || strcmp(str, "Unknown") == 0) - return Unknown; + return UnknownParticle; if (strcmp(str, "gamma") == 0 || strcmp(str, "Gamma") == 0) return Gamma; if (strcmp(str, "positron") == 0 || strcmp(str, "Positron") == 0)