From 527d8d2e4b32da4036b2eb0288690d2af99153db Mon Sep 17 00:00:00 2001 From: gconesab <26649152+gconesab@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:18:18 +0200 Subject: [PATCH] Port fixes of Ivana preventing crashes with Geant4 to V5 09 54 patches (#1491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updating the mass of exotic bound states (#1472) * Include additional hidden strangeness Pentaquark states (#1389) * Add Theta_c pentaquark * Introduce f0_1500 resonance (#1464) * First trial * update the format * update format * Added Sexaquark * Added sexaquark (updated pdg code) * Update nuclei masses with the latest CODATA release (#1245) Using 2018 values summarised in https://physics.nist.gov/cuu/pdf/wall_2018.pdf * Fix PDG charges (after 20 years) Fixing wrong charges added in commits: https://github.com/alisw/AliRoot/commit/8ff209d4372162d79b02c86dbfb4c41fc8595177 https://github.com/alisw/AliRoot/commit/d3df3965d473189007440b8a7e4d36f2905c8bc3 partially because of wrong ROOT documentation, which was fixed later in https://github.com/root-project/root/commit/6a82edd615f1284f2de238bab195a but not propagated to AliRoot. * Fixing problems observed in production: - AliMC: Added protection in AddTrackReference call against undefined track id (<0) - Initialized arrays (if not done) passed to TVirtualMC::Gmtod and Gdtom calls as output parameters --------- Co-authored-by: Bong-Hwi Lim Co-authored-by: JakeMartinez <57108467+JakeMartinez@users.noreply.github.com> Co-authored-by: Fabrizio Grosa Co-authored-by: Bong-Hwi Lim Co-authored-by: Alberto Caliva Co-authored-by: Maximiliano Puccio Co-authored-by: Vít Kučera Co-authored-by: Ivana Hrivnacova --- HMPID/HMPIDsim/AliHMPIDv1.cxx | 2 +- HMPID/HMPIDsim/AliHMPIDv2.cxx | 4 ++-- HMPID/HMPIDsim/AliHMPIDv3.cxx | 4 ++-- HMPID/HMPIDsim/AliHMPIDvG4.cxx | 2 +- ITSMFT/ITS/v0/AliITSupgrade.cxx | 2 +- PHOS/AliPHOSDebug.cxx | 4 ++-- PHOS/PHOSsim/AliPHOSv1.cxx | 8 ++++---- PHOS/PHOSsim/AliPHOSvImpacts.cxx | 2 +- PMD/PMDsim/AliPMDv0.cxx | 2 +- PMD/PMDsim/AliPMDv1.cxx | 2 +- PMD/PMDsim/AliPMDv2008.cxx | 2 +- STEER/STEER/AliMC.cxx | 12 ++++++++++-- T0/AliT0v2.cxx | 2 +- ZDC/ZDCsim/AliZDCv3.cxx | 2 +- 14 files changed, 29 insertions(+), 21 deletions(-) diff --git a/HMPID/HMPIDsim/AliHMPIDv1.cxx b/HMPID/HMPIDsim/AliHMPIDv1.cxx index 164e0a7256c..729080657b5 100644 --- a/HMPID/HMPIDsim/AliHMPIDv1.cxx +++ b/HMPID/HMPIDsim/AliHMPIDv1.cxx @@ -277,7 +277,7 @@ void AliHMPIDv1::GenFee(Float_t qtot) Int_t iNphotons=TVirtualMC::GetMC()->GetRandom()->Poisson(0.02*qtot); //# of feedback photons is proportional to the charge of hit AliDebug(1,Form("N photons=%i",iNphotons)); Int_t j; - Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4]; + Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4] = {0.}; //Generate photons for(Int_t i=0;iGetRandom()->Poisson(0.02*qtot); //# of feedback photons is proportional to the charge of hit AliDebug(1,Form("N photons=%i",iNphotons)); Int_t j; - Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4]; + Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4] = {0.}; //Generate photons for(Int_t i=0;iTrackPid(),flag.Data(),path.Data(),TVirtualMC::GetMC()->TrackMass(),TVirtualMC::GetMC()->TrackCharge(),TVirtualMC::GetMC()->Edep()*1e9,TVirtualMC::GetMC()->Etot()); Double_t gMcTrackPos[3]; TVirtualMC::GetMC()->TrackPosition(gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2]); - Double_t gMcTrackPosLoc[3]; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); + Double_t gMcTrackPosLoc[3] = {0.}; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); Printf("TVirtualMC::GetMC() Track Position (MARS) x: %5.3lf, y: %5.3lf, z: %5.3lf (r: %5.3lf) ---> (LOC) x: %5.3f, y: %5.3f, z: %5.3f",gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2],TMath::Sqrt(gMcTrackPos[0]*gMcTrackPos[0]+gMcTrackPos[1]*gMcTrackPos[1]+gMcTrackPos[2]*gMcTrackPos[2]),gMcTrackPosLoc[0],gMcTrackPosLoc[1],gMcTrackPosLoc[2]); diff --git a/HMPID/HMPIDsim/AliHMPIDv3.cxx b/HMPID/HMPIDsim/AliHMPIDv3.cxx index 360138916ca..538f0d49443 100644 --- a/HMPID/HMPIDsim/AliHMPIDv3.cxx +++ b/HMPID/HMPIDsim/AliHMPIDv3.cxx @@ -600,7 +600,7 @@ void AliHMPIDv3::GenFee(Float_t qtot) Int_t iNphotons=TVirtualMC::GetMC()->GetRandom()->Poisson(0.02*qtot); //# of feedback photons is proportional to the charge of hit AliDebug(1,Form("N photons=%i",iNphotons)); Int_t j; - Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4]; + Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4] = {0.}; //Generate photons for(Int_t i=0;iTrackPid(),flag.Data(),path.Data(),TVirtualMC::GetMC()->TrackMass(),TVirtualMC::GetMC()->TrackCharge(),TVirtualMC::GetMC()->Edep()*1e9,TVirtualMC::GetMC()->Etot()); Double_t gMcTrackPos[3]; TVirtualMC::GetMC()->TrackPosition(gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2]); - Double_t gMcTrackPosLoc[3]; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); + Double_t gMcTrackPosLoc[3] = {0.}; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); Printf("TVirtualMC::GetMC() Track Position (MARS) x: %5.3lf, y: %5.3lf, z: %5.3lf (r: %5.3lf) ---> (LOC) x: %5.3f, y: %5.3f, z: %5.3f",gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2],TMath::Sqrt(gMcTrackPos[0]*gMcTrackPos[0]+gMcTrackPos[1]*gMcTrackPos[1]+gMcTrackPos[2]*gMcTrackPos[2]),gMcTrackPosLoc[0],gMcTrackPosLoc[1],gMcTrackPosLoc[2]); diff --git a/HMPID/HMPIDsim/AliHMPIDvG4.cxx b/HMPID/HMPIDsim/AliHMPIDvG4.cxx index 3e5a1da3106..4769516233b 100644 --- a/HMPID/HMPIDsim/AliHMPIDvG4.cxx +++ b/HMPID/HMPIDsim/AliHMPIDvG4.cxx @@ -54,7 +54,7 @@ void AliHMPIDvG4::GenFee(Float_t qtot) AliDebug(1,Form("N photons=%i",iNphotons)); if (iNphotons > fMaxFeed) return; Int_t j; - Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4]; + Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop,dir[3], phi,pol[3], mom[4] = {0.}; //Generate photons for(Int_t i=0;iTrackPid(),flag.Data(),path.Data(),TVirtualMC::GetMC()->TrackMass(),TVirtualMC::GetMC()->TrackCharge(),TVirtualMC::GetMC()->Edep()*1e9,TVirtualMC::GetMC()->Etot())); Double_t gMcTrackPos[3]; TVirtualMC::GetMC()->TrackPosition(gMcTrackPos[0],gMcTrackPos[1],gMcTrackPos[2]); - Double_t gMcTrackPosLoc[3]; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); + Double_t gMcTrackPosLoc[3] = {0.}; TVirtualMC::GetMC()->Gmtod(gMcTrackPos,gMcTrackPosLoc,1); TString v(volumeName.Data()); v.ReplaceAll("LayerSilicon",""); Int_t ilayer = v.Atoi(); diff --git a/PHOS/AliPHOSDebug.cxx b/PHOS/AliPHOSDebug.cxx index eeb4c6de49d..2118495ad34 100644 --- a/PHOS/AliPHOSDebug.cxx +++ b/PHOS/AliPHOSDebug.cxx @@ -515,7 +515,7 @@ void AliPHOSv1::StepManager(void) // Current position of the hit in the local ref. system TVirtualMC::GetMC() -> TrackPosition(pos); - Float_t xyzm[3], xyzd[3] ; + Float_t xyzm[3], xyzd[3] = {0.}; Int_t i; for (i=0; i<3; i++) xyzm[i] = pos[i]; TVirtualMC::GetMC() -> Gmtod (xyzm, xyzd, 1); // transform coordinate from master to daughter system @@ -526,7 +526,7 @@ void AliPHOSv1::StepManager(void) // Current momentum of the hit's track in the local ref. system TVirtualMC::GetMC() -> TrackMomentum(pmom); - Float_t pm[3], pd[3]; + Float_t pm[3], pd[3] = {0.}; for (i=0; i<3; i++) pm[i] = pmom[i]; TVirtualMC::GetMC() -> Gmtod (pm, pd, 2); // transform 3-momentum from master to daughter system pmom[0] = pd[0]; diff --git a/PHOS/PHOSsim/AliPHOSv1.cxx b/PHOS/PHOSsim/AliPHOSv1.cxx index 99603335854..858d80b75b5 100644 --- a/PHOS/PHOSsim/AliPHOSv1.cxx +++ b/PHOS/PHOSsim/AliPHOSv1.cxx @@ -196,7 +196,7 @@ void AliPHOSv1::StepManager(void) fMC -> TrackPosition(pos); - Float_t xyzm[3], xyzd[3] ; + Float_t xyzm[3], xyzd[3] = {0.}; Int_t i; for (i=0; i<3; i++) xyzm[i] = pos[i]; fMC -> Gmtod (xyzm, xyzd, 1); // transform coordinate from master to daughter system @@ -210,7 +210,7 @@ void AliPHOSv1::StepManager(void) // Current momentum of the hit's track in the local ref. system TLorentzVector pmom ; //momentum of the particle initiated hit fMC -> TrackMomentum(pmom); - Float_t pm[3], pd[3]; + Float_t pm[3], pd[3] = {0.}; for (i=0; i<3; i++) pm[i] = pmom[i]; @@ -296,12 +296,12 @@ void AliPHOSv1::StepManager(void) //Put in the TreeK particle entering PHOS and all its parents if ( fMC->IsTrackEntering() ){ - Float_t xyzd[3] ; + Float_t xyzd[3] = {0.}; fMC -> Gmtod (xyzte, xyzd, 1); // transform coordinate from master to daughter system if (xyzd[1] < -GetGeometry()->GetCrystalSize(1)/2.+0.1){ //Entered close to forward surface Int_t parent = gAlice->GetMCApp()->GetCurrentTrackNumber() ; TParticle * part = gAlice->GetMCApp()->Particle(parent) ; - Float_t vert[3],vertd[3] ; + Float_t vert[3], vertd[3] = {0.}; vert[0]=part->Vx() ; vert[1]=part->Vy() ; vert[2]=part->Vz() ; diff --git a/PHOS/PHOSsim/AliPHOSvImpacts.cxx b/PHOS/PHOSsim/AliPHOSvImpacts.cxx index 7c26f9e3b17..ddd6f0f1e00 100644 --- a/PHOS/PHOSsim/AliPHOSvImpacts.cxx +++ b/PHOS/PHOSsim/AliPHOSvImpacts.cxx @@ -215,7 +215,7 @@ void AliPHOSvImpacts::StepManager(void) AliPHOSv1::StepManager(); - Float_t xyzm[3], xyzd[3], pm[3], pd[3]; + Float_t xyzm[3], xyzd[3] = {0.}, pm[3], pd[3] = {0.}; TLorentzVector pmom ; // Lorentz momentum of the particle initiated hit TLorentzVector pos ; // Lorentz vector of the track current position Int_t copy ; diff --git a/PMD/PMDsim/AliPMDv0.cxx b/PMD/PMDsim/AliPMDv0.cxx index 86043c48aab..a7c56bc6c18 100644 --- a/PMD/PMDsim/AliPMDv0.cxx +++ b/PMD/PMDsim/AliPMDv0.cxx @@ -854,7 +854,7 @@ void AliPMDv0::StepManager() // Called at each step in the PMD // Int_t copy; - Float_t hits[5], destep; + Float_t hits[5] = {0.}, destep; Float_t center[3] = {0,0,0}; Int_t vol[6]; //char *namep; diff --git a/PMD/PMDsim/AliPMDv1.cxx b/PMD/PMDsim/AliPMDv1.cxx index 61facf38741..d9112ae6e19 100644 --- a/PMD/PMDsim/AliPMDv1.cxx +++ b/PMD/PMDsim/AliPMDv1.cxx @@ -2219,7 +2219,7 @@ void AliPMDv1::StepManager() // Int_t copy; - Float_t hits[5], destep; + Float_t hits[5] = {0.}, destep; Float_t center[3] = {0,0,0}; Int_t vol[6]; //const char *namep; diff --git a/PMD/PMDsim/AliPMDv2008.cxx b/PMD/PMDsim/AliPMDv2008.cxx index b7fc9454a32..157adca2225 100644 --- a/PMD/PMDsim/AliPMDv2008.cxx +++ b/PMD/PMDsim/AliPMDv2008.cxx @@ -1473,7 +1473,7 @@ void AliPMDv2008::StepManager() // Int_t copy; - Float_t hits[5], destep; + Float_t hits[5] = {0.}, destep; Float_t center[3] = {0,0,0}; Int_t vol[6]; diff --git a/STEER/STEER/AliMC.cxx b/STEER/STEER/AliMC.cxx index d3bf22c5474..f969ab6cde0 100644 --- a/STEER/STEER/AliMC.cxx +++ b/STEER/STEER/AliMC.cxx @@ -1449,8 +1449,16 @@ void AliMC::Stepping() // write tracke reference for track which is dissapearing - MI if (fMC->IsTrackDisappeared() && !(fMC->IsTrackAlive())) { - if (fMC->Etot() > 0.05) AddTrackReference(GetCurrentTrackNumber(), - AliTrackReference::kDisappeared); + //if (fMC->Etot() > 0.05) AddTrackReference(GetCurrentTrackNumber(), + // AliTrackReference::kDisappeared); + if (fMC->Etot() > 0.05) { + Int_t currentTrackNumber = GetCurrentTrackNumber(); + if (currentTrackNumber < 0) { + std::cerr << !!! "Cannot add track reference, currentTrackNumber < 0: " << currentTrackNumber << std::endl; + } else { + AddTrackReference(currentTrackNumber, AliTrackReference::kDisappeared); + } + } } diff --git a/T0/AliT0v2.cxx b/T0/AliT0v2.cxx index 56a4074b123..8722b45a975 100644 --- a/T0/AliT0v2.cxx +++ b/T0/AliT0v2.cxx @@ -294,7 +294,7 @@ void AliT0v2::StepManager() Int_t id; Int_t copy; // Int_t copy1; - Float_t xyz[3]; + Float_t xyz[3] = {0.}; Float_t XYZ[3]; Float_t hitPhoton[6]; static Float_t hits[7]; diff --git a/ZDC/ZDCsim/AliZDCv3.cxx b/ZDC/ZDCsim/AliZDCv3.cxx index 297c45c9ccd..8ba9ce096f7 100644 --- a/ZDC/ZDCsim/AliZDCv3.cxx +++ b/ZDC/ZDCsim/AliZDCv3.cxx @@ -2252,7 +2252,7 @@ void AliZDCv3::StepManager() // Routine called at every step in the Zero Degree Calorimeters // Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0; - Float_t hits[14], x[3], xdet[3]={999.,999.,999.}, um[3], ud[3]; + Float_t hits[14], x[3], xdet[3]={999.,999.,999.}, um[3], ud[3]={0.}; Float_t destep=0., be=0., out=0.; Double_t s[3], p[4]; const char *knamed = (fMC)->CurrentVolName();