Skip to content

Commit 7dfdc9d

Browse files
ChristianTackeGSIkarabowi
authored andcommitted
fix(Base): warnings in FairMCApplication
- variable 'Counter' set but not used - C Style Cast Also use auto and move variables into inner scope.
1 parent 761b32f commit 7dfdc9d

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

fairroot/base/sim/FairMCApplication.cxx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -755,20 +755,16 @@ void FairMCApplication::ConstructGeometry()
755755

756756
fState = FairMCApplicationState::kConstructGeometry;
757757

758-
Int_t NoOfVolumes = 0;
759-
Int_t NoOfVolumesBefore = 0;
760-
Int_t ModId = 0;
761-
762758
TObjArray* tgeovolumelist = gGeoManager->GetListOfVolumes();
763759

764760
for (auto Mod : fListModules) {
765-
NoOfVolumesBefore = tgeovolumelist->GetEntriesFast();
761+
auto NoOfVolumesBefore = tgeovolumelist->GetEntriesFast();
766762
Mod->InitParContainers();
767763
Mod->ConstructGeometry();
768-
ModId = Mod->GetModId();
769-
NoOfVolumes = tgeovolumelist->GetEntriesFast();
764+
auto ModId = Mod->GetModId();
765+
auto NoOfVolumes = tgeovolumelist->GetEntriesFast();
770766
for (Int_t n = NoOfVolumesBefore; n < NoOfVolumes; n++) {
771-
TGeoVolume* v = (TGeoVolume*)tgeovolumelist->At(n);
767+
auto v = static_cast<TGeoVolume*>(tgeovolumelist->At(n));
772768
fModVolMap.insert(pair<Int_t, Int_t>(v->GetNumber(), ModId));
773769
}
774770
}
@@ -795,9 +791,8 @@ void FairMCApplication::ConstructGeometry()
795791
LOG(info) << "TGeometry will not be imported to VMC"
796792
<< "\n";
797793
}
798-
Int_t Counter = 0;
799794
TDatabasePDG* pdgDatabase = TDatabasePDG::Instance();
800-
const THashList* list = pdgDatabase->ParticleList();
795+
const TCollection* list = pdgDatabase->ParticleList();
801796
if (list == 0)
802797
pdgDatabase->ReadPDGTable();
803798
list = pdgDatabase->ParticleList();
@@ -807,10 +802,9 @@ void FairMCApplication::ConstructGeometry()
807802
continue;
808803
}
809804
TString Name = gGeoManager->GetPdgName(Particle->PdgCode());
810-
// LOG(info) << Counter <<" : Particle name: "<< Name.Data() << " PDG " << Particle->PdgCode();
805+
// LOG(info) << " : Particle name: "<< Name.Data() << " PDG " << Particle->PdgCode();
811806
if (Name == "XXX")
812807
gGeoManager->SetPdgName(Particle->PdgCode(), Particle->GetName());
813-
Counter++;
814808
}
815809
}
816810
for (auto Mod : fListModules) {

0 commit comments

Comments
 (0)