Skip to content

Commit 4a55063

Browse files
shahor02MohammadAlTurany
authored andcommitted
using namespace AliceO2::MathUtils instead of explicit prefixing
1 parent 669a1f3 commit 4a55063

1 file changed

Lines changed: 40 additions & 39 deletions

File tree

field/MagneticWrapperChebyshev.cxx

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "FairLogger.h"
1010

1111
using namespace AliceO2::Field;
12+
using namespace AliceO2::MathUtils;
1213

1314
ClassImp(MagneticWrapperChebyshev)
1415

@@ -182,7 +183,7 @@ void MagneticWrapperChebyshev::copyFrom(const MagneticWrapperChebyshev& src)
182183
sizeof(Int_t) * mNumberOfDistinctRSegmentsSolenoid);
183184
mParameterizationSolenoid = new TObjArray(mNumberOfParameterizationSolenoid);
184185
for (int i = 0; i < mNumberOfParameterizationSolenoid; i++) {
185-
mParameterizationSolenoid->AddAtAndExpand(new AliceO2::MathUtils::Chebyshev3D(*src.getParameterSolenoid(i)), i);
186+
mParameterizationSolenoid->AddAtAndExpand(new Chebyshev3D(*src.getParameterSolenoid(i)), i);
186187
}
187188
}
188189

@@ -212,7 +213,7 @@ void MagneticWrapperChebyshev::copyFrom(const MagneticWrapperChebyshev& src)
212213
sizeof(Int_t) * mNumberOfDistinctRSegmentsTPC);
213214
mParameterizationTPC = new TObjArray(mNumberOfParameterizationTPC);
214215
for (int i = 0; i < mNumberOfParameterizationTPC; i++) {
215-
mParameterizationTPC->AddAtAndExpand(new AliceO2::MathUtils::Chebyshev3D(*src.getParameterTPCIntegral(i)), i);
216+
mParameterizationTPC->AddAtAndExpand(new Chebyshev3D(*src.getParameterTPCIntegral(i)), i);
216217
}
217218
}
218219

@@ -242,7 +243,7 @@ void MagneticWrapperChebyshev::copyFrom(const MagneticWrapperChebyshev& src)
242243
sizeof(Int_t) * mNumberOfDistinctRSegmentsTPCRat);
243244
mParameterizationTPCRat = new TObjArray(mNumberOfParameterizationTPCRat);
244245
for (int i = 0; i < mNumberOfParameterizationTPCRat; i++) {
245-
mParameterizationTPCRat->AddAtAndExpand(new AliceO2::MathUtils::Chebyshev3D(*src.getParameterTPCRatIntegral(i)), i);
246+
mParameterizationTPCRat->AddAtAndExpand(new Chebyshev3D(*src.getParameterTPCRatIntegral(i)), i);
246247
}
247248
}
248249

@@ -271,7 +272,7 @@ void MagneticWrapperChebyshev::copyFrom(const MagneticWrapperChebyshev& src)
271272
sizeof(Int_t) * mNumberOfDistinctXSegmentsDipole);
272273
mParameterizationDipole = new TObjArray(mNumberOfParameterizationDipole);
273274
for (int i = 0; i < mNumberOfParameterizationDipole; i++) {
274-
mParameterizationDipole->AddAtAndExpand(new AliceO2::MathUtils::Chebyshev3D(*src.getParameterDipole(i)), i);
275+
mParameterizationDipole->AddAtAndExpand(new Chebyshev3D(*src.getParameterDipole(i)), i);
275276
}
276277
}
277278
}
@@ -419,7 +420,7 @@ void MagneticWrapperChebyshev::Field(const Double_t* xyz, Double_t* b) const
419420
if (iddip < 0) {
420421
return;
421422
}
422-
AliceO2::MathUtils::Chebyshev3D* par = getParameterDipole(iddip);
423+
Chebyshev3D* par = getParameterDipole(iddip);
423424
#ifndef _BRING_TO_BOUNDARY_
424425
if (!par->isInside(xyz)) {
425426
return;
@@ -441,7 +442,7 @@ Double_t MagneticWrapperChebyshev::getBz(const Double_t* xyz) const
441442
if (iddip < 0) {
442443
return 0.;
443444
}
444-
AliceO2::MathUtils::Chebyshev3D* par = getParameterDipole(iddip);
445+
Chebyshev3D* par = getParameterDipole(iddip);
445446
#ifndef _BRING_TO_BOUNDARY_
446447
if (!par->isInside(xyz)) {
447448
return 0.;
@@ -722,7 +723,7 @@ void MagneticWrapperChebyshev::fieldCylindricalSolenoid(const Double_t* rphiz, D
722723
if (id < 0) {
723724
return;
724725
}
725-
AliceO2::MathUtils::Chebyshev3D* par = getParameterSolenoid(id);
726+
Chebyshev3D* par = getParameterSolenoid(id);
726727
#ifndef _BRING_TO_BOUNDARY_ // exact matching to fitted volume is requested
727728
if (!par->isInside(rphiz)) {
728729
return;
@@ -738,7 +739,7 @@ Double_t MagneticWrapperChebyshev::fieldCylindricalSolenoidBz(const Double_t* rp
738739
if (id < 0) {
739740
return 0.;
740741
}
741-
AliceO2::MathUtils::Chebyshev3D* par = getParameterSolenoid(id);
742+
Chebyshev3D* par = getParameterSolenoid(id);
742743
#ifndef _BRING_TO_BOUNDARY_
743744
return par->isInside(rphiz) ? par->Eval(rphiz, 2) : 0;
744745
#else
@@ -758,7 +759,7 @@ void MagneticWrapperChebyshev::getTPCIntegralCylindrical(const Double_t* rphiz,
758759
b[0] = b[1] = b[2] = 0;
759760
return;
760761
}
761-
AliceO2::MathUtils::Chebyshev3D* par = getParameterTPCIntegral(id);
762+
Chebyshev3D* par = getParameterTPCIntegral(id);
762763
if (par->isInside(rphiz)) {
763764
par->Eval(rphiz, b);
764765
return;
@@ -779,7 +780,7 @@ void MagneticWrapperChebyshev::getTPCRatIntegralCylindrical(const Double_t* rphi
779780
b[0] = b[1] = b[2] = 0;
780781
return;
781782
}
782-
AliceO2::MathUtils::Chebyshev3D* par = getParameterTPCRatIntegral(id);
783+
Chebyshev3D* par = getParameterTPCRatIntegral(id);
783784
if (par->isInside(rphiz)) {
784785
par->Eval(rphiz, b);
785786
return;
@@ -802,7 +803,7 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
802803
}
803804

804805
TString buffs;
805-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
806+
Chebyshev3DCalc::readLine(buffs, stream);
806807

807808
if (!buffs.BeginsWith("START")) {
808809
Error("LoadData", "Expected: \"START <name>\", found \"%s\"\nStop\n", buffs.Data());
@@ -814,98 +815,98 @@ void MagneticWrapperChebyshev::loadData(const char* inpfile)
814815
}
815816

816817
// Solenoid part
817-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
818+
Chebyshev3DCalc::readLine(buffs, stream);
818819

819820
if (!buffs.BeginsWith("START SOLENOID")) {
820821
Error("LoadData", "Expected: \"START SOLENOID\", found \"%s\"\nStop\n", buffs.Data());
821822
exit(1);
822823
}
823-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream); // nparam
824+
Chebyshev3DCalc::readLine(buffs, stream); // nparam
824825
int nparSol = buffs.Atoi();
825826

826827
for (int ip = 0; ip < nparSol; ip++) {
827-
AliceO2::MathUtils::Chebyshev3D* cheb = new AliceO2::MathUtils::Chebyshev3D();
828+
Chebyshev3D* cheb = new Chebyshev3D();
828829
cheb->loadData(stream);
829830
addParameterSolenoid(cheb);
830831
}
831832

832-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
833+
Chebyshev3DCalc::readLine(buffs, stream);
833834
if (!buffs.BeginsWith("END SOLENOID")) {
834835
Error("LoadData", "Expected \"END SOLENOID\", found \"%s\"\nStop\n", buffs.Data());
835836
exit(1);
836837
}
837838

838839
// TPCInt part
839-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
840+
Chebyshev3DCalc::readLine(buffs, stream);
840841
if (!buffs.BeginsWith("START TPCINT")) {
841842
Error("LoadData", "Expected: \"START TPCINT\", found \"%s\"\nStop\n", buffs.Data());
842843
exit(1);
843844
}
844-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream); // nparam
845+
Chebyshev3DCalc::readLine(buffs, stream); // nparam
845846
int nparTPCInt = buffs.Atoi();
846847

847848
for (int ip = 0; ip < nparTPCInt; ip++) {
848-
AliceO2::MathUtils::Chebyshev3D* cheb = new AliceO2::MathUtils::Chebyshev3D();
849+
Chebyshev3D* cheb = new Chebyshev3D();
849850
cheb->loadData(stream);
850851
addParameterTPCIntegral(cheb);
851852
}
852853

853-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
854+
Chebyshev3DCalc::readLine(buffs, stream);
854855

855856
if (!buffs.BeginsWith("END TPCINT")) {
856857
Error("LoadData", "Expected \"END TPCINT\", found \"%s\"\nStop\n", buffs.Data());
857858
exit(1);
858859
}
859860

860861
// TPCRatInt part
861-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
862+
Chebyshev3DCalc::readLine(buffs, stream);
862863

863864
if (!buffs.BeginsWith("START TPCRatINT")) {
864865
Error("LoadData", "Expected: \"START TPCRatINT\", found \"%s\"\nStop\n", buffs.Data());
865866
exit(1);
866867
}
867868

868-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream); // nparam
869+
Chebyshev3DCalc::readLine(buffs, stream); // nparam
869870
int nparTPCRatInt = buffs.Atoi();
870871

871872
for (int ip = 0; ip < nparTPCRatInt; ip++) {
872-
AliceO2::MathUtils::Chebyshev3D* cheb = new AliceO2::MathUtils::Chebyshev3D();
873+
Chebyshev3D* cheb = new Chebyshev3D();
873874
cheb->loadData(stream);
874875
addParameterTPCRatIntegral(cheb);
875876
}
876877

877-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
878+
Chebyshev3DCalc::readLine(buffs, stream);
878879

879880
if (!buffs.BeginsWith("END TPCRatINT")) {
880881
Error("LoadData", "Expected \"END TPCRatINT\", found \"%s\"\nStop\n", buffs.Data());
881882
exit(1);
882883
}
883884

884885
// Dipole part
885-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
886+
Chebyshev3DCalc::readLine(buffs, stream);
886887

887888
if (!buffs.BeginsWith("START DIPOLE")) {
888889
Error("LoadData", "Expected: \"START DIPOLE\", found \"%s\"\nStop\n", buffs.Data());
889890
exit(1);
890891
}
891892

892-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream); // nparam
893+
Chebyshev3DCalc::readLine(buffs, stream); // nparam
893894
int nparDip = buffs.Atoi();
894895

895896
for (int ip = 0; ip < nparDip; ip++) {
896-
AliceO2::MathUtils::Chebyshev3D* cheb = new AliceO2::MathUtils::Chebyshev3D();
897+
Chebyshev3D* cheb = new Chebyshev3D();
897898
cheb->loadData(stream);
898899
addParameterDipole(cheb);
899900
}
900901

901-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
902+
Chebyshev3DCalc::readLine(buffs, stream);
902903

903904
if (!buffs.BeginsWith("END DIPOLE")) {
904905
Error("LoadData", "Expected \"END DIPOLE\", found \"%s\"\nStop\n", buffs.Data());
905906
exit(1);
906907
}
907908

908-
AliceO2::MathUtils::Chebyshev3DCalc::readLine(buffs, stream);
909+
Chebyshev3DCalc::readLine(buffs, stream);
909910

910911
if (!buffs.BeginsWith("END ") && !buffs.Contains(GetName())) {
911912
Error("LoadData", "Expected: \"END %s\", found \"%s\"\nStop\n", GetName(), buffs.Data());
@@ -1027,48 +1028,48 @@ MagneticWrapperChebyshev::MagneticWrapperChebyshev(const char* inputFile)
10271028
loadData(inputFile);
10281029
}
10291030

1030-
void MagneticWrapperChebyshev::addParameterSolenoid(const AliceO2::MathUtils::Chebyshev3D* param)
1031+
void MagneticWrapperChebyshev::addParameterSolenoid(const Chebyshev3D* param)
10311032
{
10321033
if (!mParameterizationSolenoid) {
10331034
mParameterizationSolenoid = new TObjArray();
10341035
}
1035-
mParameterizationSolenoid->Add((AliceO2::MathUtils::Chebyshev3D*)param);
1036+
mParameterizationSolenoid->Add((Chebyshev3D*)param);
10361037
mNumberOfParameterizationSolenoid++;
10371038
if (mMaxRadiusSolenoid < param->getBoundMax(0)) {
10381039
mMaxRadiusSolenoid = param->getBoundMax(0);
10391040
}
10401041
}
10411042

1042-
void MagneticWrapperChebyshev::addParameterTPCIntegral(const AliceO2::MathUtils::Chebyshev3D* param)
1043+
void MagneticWrapperChebyshev::addParameterTPCIntegral(const Chebyshev3D* param)
10431044
{
10441045
if (!mParameterizationTPC) {
10451046
mParameterizationTPC = new TObjArray();
10461047
}
1047-
mParameterizationTPC->Add((AliceO2::MathUtils::Chebyshev3D*)param);
1048+
mParameterizationTPC->Add((Chebyshev3D*)param);
10481049
mNumberOfParameterizationTPC++;
10491050
if (mMaxRadiusTPC < param->getBoundMax(0)) {
10501051
mMaxRadiusTPC = param->getBoundMax(0);
10511052
}
10521053
}
10531054

1054-
void MagneticWrapperChebyshev::addParameterTPCRatIntegral(const AliceO2::MathUtils::Chebyshev3D* param)
1055+
void MagneticWrapperChebyshev::addParameterTPCRatIntegral(const Chebyshev3D* param)
10551056
{
10561057
if (!mParameterizationTPCRat) {
10571058
mParameterizationTPCRat = new TObjArray();
10581059
}
1059-
mParameterizationTPCRat->Add((AliceO2::MathUtils::Chebyshev3D*)param);
1060+
mParameterizationTPCRat->Add((Chebyshev3D*)param);
10601061
mNumberOfParameterizationTPCRat++;
10611062
if (mMaxRadiusTPCRat < param->getBoundMax(0)) {
10621063
mMaxRadiusTPCRat = param->getBoundMax(0);
10631064
}
10641065
}
10651066

1066-
void MagneticWrapperChebyshev::addParameterDipole(const AliceO2::MathUtils::Chebyshev3D* param)
1067+
void MagneticWrapperChebyshev::addParameterDipole(const Chebyshev3D* param)
10671068
{
10681069
if (!mParameterizationDipole) {
10691070
mParameterizationDipole = new TObjArray();
10701071
}
1071-
mParameterizationDipole->Add((AliceO2::MathUtils::Chebyshev3D*)param);
1072+
mParameterizationDipole->Add((Chebyshev3D*)param);
10721073
mNumberOfParameterizationDipole++;
10731074
}
10741075

@@ -1248,7 +1249,7 @@ void MagneticWrapperChebyshev::buildTable(Int_t npar, TObjArray* parArr, Int_t&
12481249
for (int ix = 0; ix < nx; ix++) {
12491250
xyz[0] = (tmpSegX[ix] + tmpSegX[ix + 1]) / 2.; // mean X of this segment
12501251
for (int ipar = 0; ipar < npar; ipar++) {
1251-
AliceO2::MathUtils::Chebyshev3D* cheb = (AliceO2::MathUtils::Chebyshev3D*)parArr->At(ipar);
1252+
Chebyshev3D* cheb = (Chebyshev3D*)parArr->At(ipar);
12521253
if (!cheb->isInside(xyz)) {
12531254
continue;
12541255
}
@@ -1355,7 +1356,7 @@ void MagneticWrapperChebyshev::buildTable(Int_t npar, TObjArray* parArr, Int_t&
13551356
// for (int ix=0;ix<nx;ix++) {
13561357
// xyz[0] = (tmpSegX[ix]+tmpSegX[ix+1])/2.; // mean X of this segment
13571358
// for (int ipar=0;ipar<mNumberOfParameterizationDipole;ipar++) {
1358-
// AliceO2::MathUtils::Chebyshev3D* cheb = (AliceO2::MathUtils::Chebyshev3D*) mParameterizationDipole->At(ipar);
1359+
// Chebyshev3D* cheb = (Chebyshev3D*) mParameterizationDipole->At(ipar);
13591360
// if (!cheb->isInside(xyz)) continue;
13601361
// segID[mNumberOfDistinctXSegmentsDipole+ix] = ipar;
13611362
// break;
@@ -1440,7 +1441,7 @@ Int_t MagneticWrapperChebyshev::segmentDimension(float** seg, const TObjArray* p
14401441
int* tmpInd = new int[2 * npar];
14411442
int nseg0 = 0;
14421443
for (int ip = 0; ip < npar; ip++) {
1443-
AliceO2::MathUtils::Chebyshev3D* cheb = (AliceO2::MathUtils::Chebyshev3D*)par->At(ip);
1444+
Chebyshev3D* cheb = (Chebyshev3D*)par->At(ip);
14441445
if (xmn < xmx && (cheb->getBoundMin(0) > (xmx + xmn) / 2 || cheb->getBoundMax(0) < (xmn + xmx) / 2)) {
14451446
continue;
14461447
}

0 commit comments

Comments
 (0)