git://git.uio.no
/
u
/
mrichter
/
AliRoot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New&delete used for array with variable size
[u/mrichter/AliRoot.git]
/
ZDC
/
AliZDCFragment.cxx
diff --git
a/ZDC/AliZDCFragment.cxx
b/ZDC/AliZDCFragment.cxx
index 4cfb3135a059365f7929737454c0e2a4ff7fcf4d..f95f926b734e69d3a16abf73a88c820337c65d48 100644
(file)
--- a/
ZDC/AliZDCFragment.cxx
+++ b/
ZDC/AliZDCFragment.cxx
@@
-212,7
+212,7
@@
void AliZDCFragment::GenerateIMF(Int_t* fZZ, Int_t &fNalpha)
// Extract randomly the charge of the fragments from the distribution
// Extract randomly the charge of the fragments from the distribution
- Float_t
zz
[fNimf];
+ Float_t
* zz = new Float_t
[fNimf];
for(Int_t j=0; j<fNimf; j++){
zz[j] =0;
}
for(Int_t j=0; j<fNimf; j++){
zz[j] =0;
}
@@
-223,7
+223,7
@@
void AliZDCFragment::GenerateIMF(Int_t* fZZ, Int_t &fNalpha)
delete funTau;
// Sorting vector in ascending order with C function QSORT
delete funTau;
// Sorting vector in ascending order with C function QSORT
- qsort((void*)zz,fNimf,sizeof(
floa
t),comp);
+ qsort((void*)zz,fNimf,sizeof(
Float_
t),comp);
// for(Int_t i=0; i<fNimf; i++){
// for(Int_t i=0; i<fNimf; i++){
@@
-236,6
+236,8
@@
void AliZDCFragment::GenerateIMF(Int_t* fZZ, Int_t &fNalpha)
if(fZZ[j]<3) fZZ[j] = 3;
// printf("\n fZZ[%d] = %d \n",j,fZZ[j]);
}
if(fZZ[j]<3) fZZ[j] = 3;
// printf("\n fZZ[%d] = %d \n",j,fZZ[j]);
}
+
+ delete[] zz;
// Check that the sum of the bound charges is not > than Zbound-Zalfa
// Check that the sum of the bound charges is not > than Zbound-Zalfa