Skip to content

Commit

Permalink
Port fixes of Ivana preventing crashes with Geant4 to V5 09 54 patches (
Browse files Browse the repository at this point in the history
#1491)

* 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:
8ff209d
d3df396
partially because of wrong ROOT documentation,
which was fixed later in root-project/root@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 <[email protected]>
Co-authored-by: JakeMartinez <[email protected]>
Co-authored-by: Fabrizio Grosa <[email protected]>
Co-authored-by: Bong-Hwi Lim <[email protected]>
Co-authored-by: Alberto Caliva <[email protected]>
Co-authored-by: Maximiliano Puccio <[email protected]>
Co-authored-by: Vít Kučera <[email protected]>
Co-authored-by: Ivana Hrivnacova <[email protected]>
  • Loading branch information
9 people authored Jul 24, 2023
1 parent 4e9cd5e commit 527d8d2
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion HMPID/HMPIDsim/AliHMPIDv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;i<iNphotons;i++){//feedbacks loop
Double_t ranf[2];
Expand Down
4 changes: 2 additions & 2 deletions HMPID/HMPIDsim/AliHMPIDv2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ void AliHMPIDv2::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;i<iNphotons;i++){//feedbacks loop
Double_t ranf[2];
Expand Down Expand Up @@ -778,7 +778,7 @@ void AliHMPIDv2::StepHistory()
Printf("Step %i: %s (%i) %s %s m=%.6f GeV q=%.1f dEdX=%.4f Etot=%.4f",iStepN,sParticle,TVirtualMC::GetMC()->TrackPid(),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]);


Expand Down
4 changes: 2 additions & 2 deletions HMPID/HMPIDsim/AliHMPIDv3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;i<iNphotons;i++){//feedbacks loop
Double_t ranf[2];
Expand Down Expand Up @@ -852,7 +852,7 @@ void AliHMPIDv3::StepHistory()
Printf("Step %i: %s (%i) %s %s m=%.6f GeV q=%.1f dEdX=%.4f Etot=%.4f",iStepN,sParticle,TVirtualMC::GetMC()->TrackPid(),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]);


Expand Down
2 changes: 1 addition & 1 deletion HMPID/HMPIDsim/AliHMPIDvG4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;i<iNphotons;i++){//feedbacks loop
Double_t ranf[2];
Expand Down
2 changes: 1 addition & 1 deletion ITSMFT/ITS/v0/AliITSupgrade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void AliITSupgrade::StepHistory()
AliInfo(Form("\n Step %i: %s (%i) %s %s m=%.6f GeV q=%.1f dEdX=%.4f Etot=%.4f",iStepN,sParticle,TVirtualMC::GetMC()->TrackPid(),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();
Expand Down
4 changes: 2 additions & 2 deletions PHOS/AliPHOSDebug.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions PHOS/PHOSsim/AliPHOSv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];

Expand Down Expand Up @@ -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() ;
Expand Down
2 changes: 1 addition & 1 deletion PHOS/PHOSsim/AliPHOSvImpacts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
2 changes: 1 addition & 1 deletion PMD/PMDsim/AliPMDv0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion PMD/PMDsim/AliPMDv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion PMD/PMDsim/AliPMDv2008.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
12 changes: 10 additions & 2 deletions STEER/STEER/AliMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


}
Expand Down
2 changes: 1 addition & 1 deletion T0/AliT0v2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion ZDC/ZDCsim/AliZDCv3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 527d8d2

Please sign in to comment.