From 1530a3c5d0527bb923cb1b747e6b5c0c32f8fd2d Mon Sep 17 00:00:00 2001 From: Enrico Gamberini Date: Fri, 21 Jun 2024 11:26:34 +0200 Subject: [PATCH] fix compilation warnings --- UpstreamTagger/UpstreamTaggerHit.cxx | 24 ++++++++++++------------ charmdet/ShipPixelHit.h | 1 - ecal/ecalStructure.cxx | 1 - passive/ShipMuonShield.h | 2 +- shipgen/FixedTargetGenerator.cxx | 26 +++++++++++++------------- 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/UpstreamTagger/UpstreamTaggerHit.cxx b/UpstreamTagger/UpstreamTaggerHit.cxx index cb9964e5db..c996a5a1ad 100644 --- a/UpstreamTagger/UpstreamTaggerHit.cxx +++ b/UpstreamTagger/UpstreamTaggerHit.cxx @@ -66,10 +66,10 @@ std::vector UpstreamTaggerHit::GetTime(Double_t x){ Dist(x, lpos, lneg); Double_t dt = T_resol; Double_t t = ( (t_1-lneg/v_drift) + (t_2-lpos/v_drift) )/2; - std::vector m; - m.push_back(t); - m.push_back(dt); - return m; + std::vector retVal; + retVal.push_back(t); + retVal.push_back(dt); + return retVal; } // ---- return mean time information std::vector UpstreamTaggerHit::GetTime(){ @@ -80,17 +80,17 @@ std::vector UpstreamTaggerHit::GetTime(){ else t0 = (t_1+t_2)/2. - 55.5/v_drift;// strip length = 111 cm in y Double_t dt = T_resol; - std::vector m; - m.push_back(t0); - m.push_back(dt); - return m; + std::vector retVal; + retVal.push_back(t0); + retVal.push_back(dt); + return retVal; } std::vector UpstreamTaggerHit::GetMeasurements(){ - std::vector m; - m.push_back( t_1); - m.push_back( t_2); - return m; + std::vector retVal; + retVal.push_back( t_1); + retVal.push_back( t_2); + return retVal; } // distance to edges diff --git a/charmdet/ShipPixelHit.h b/charmdet/ShipPixelHit.h index 9b34bada24..68ede6b84c 100644 --- a/charmdet/ShipPixelHit.h +++ b/charmdet/ShipPixelHit.h @@ -34,7 +34,6 @@ class ShipPixelHit : public ShipHit { ShipPixelHit(const ShipPixelHit &other); ShipPixelHit operator=(const ShipPixelHit &other); - int32_t detID; uint16_t tot; ClassDef(ShipPixelHit, 3); diff --git a/ecal/ecalStructure.cxx b/ecal/ecalStructure.cxx index 664e4227da..95a8c4f0dc 100755 --- a/ecal/ecalStructure.cxx +++ b/ecal/ecalStructure.cxx @@ -251,7 +251,6 @@ void ecalStructure::CreateNLists(ecalCell* cell) cerr << "Cell: CenterX=" << x << ", CenterY=" << y << "." << endl; return; } - tl.empty(); for(ptml=tml.begin();ptml!=tml.end();++ptml) { _add_not_null((*ptml)->GetCellsY(y-dy-d),tl); _add_not_null((*ptml)->GetCellsY(y+dy+d),tl); diff --git a/passive/ShipMuonShield.h b/passive/ShipMuonShield.h index ccef9b58aa..ea904dc79e 100644 --- a/passive/ShipMuonShield.h +++ b/passive/ShipMuonShield.h @@ -37,7 +37,7 @@ class ShipMuonShield : public FairModule void SetSupports(Bool_t supports) { fSupport = supports; - LOG(WARNING) <<"Setting supports to %s. This will not have any effect if called after the geometry has been constructed.", fSupport ? "true" : "false"; + LOG(WARNING) <<"Setting supports to "<< (fSupport ? "true" : "false") << ". This will not have any effect if called after the geometry has been constructed."; } protected: diff --git a/shipgen/FixedTargetGenerator.cxx b/shipgen/FixedTargetGenerator.cxx index 4f4c606e7d..67540d01c8 100644 --- a/shipgen/FixedTargetGenerator.cxx +++ b/shipgen/FixedTargetGenerator.cxx @@ -70,24 +70,24 @@ Bool_t FixedTargetGenerator::InitForCharmOrBeauty(TString fInName, Int_t nev, Do nTree->SetBranchAddress("mpz",&n_mpz); nTree->SetBranchAddress("mE",&n_mE); if (nTree->GetBranch("k")){ - fLogger->Info(MESSAGE_ORIGIN,"+++has branch+++"); + LOG(INFO) << "+++has branch+++"; nTree->SetBranchAddress("k",&ck);} // check if we deal with charm or beauty: nTree->GetEvent(0); if (!setByHand and n_M>5){ chicc = chibb; - fLogger->Info(MESSAGE_ORIGIN,"automatic detection of beauty, configured for beauty"); - fLogger->Info(MESSAGE_ORIGIN,"bb cross section / mbias %f",chicc); + LOG(INFO) << "automatic detection of beauty, configured for beauty"; + LOG(INFO) << "bb cross section / mbias " << chicc; }else{ - fLogger->Info(MESSAGE_ORIGIN,"cc cross section / mbias %f",chicc); + LOG(INFO) << "cc cross section / mbias " << chicc; } // convert pot to weight corresponding to one spill of 5e13 pot // get histogram with number of pot to normalise // pot are counted double, i.e. for each signal, i.e. pot/2. Int_t nrcpot=((TH1F*)fin->Get("2"))->GetBinContent(1)/2.; // number of primary interactions wspill = nrpotspill*chicc/nrcpot*nEvents/nev; - fLogger->Info(MESSAGE_ORIGIN,"Input file: %s with %i entries, corresponding to nr-pot=%f",fInName.Data(),nEvents,nrcpot/chicc); - fLogger->Info(MESSAGE_ORIGIN,"weight %f corresponding to %f p.o.t. per spill for %i events to process",wspill,nrpotspill,nev); + LOG(INFO) << "Input file: " << fInName.Data() << " with " << nEvents << " entries, corresponding to nr-pot=" << (nrcpot/chicc); + LOG(INFO) << "weight " << wspill << " corresponding to " << nrpotspill << " p.o.t. per spill for " << nev << " events to process"; pot=0.; //Determine fDs on this file for primaries @@ -103,7 +103,7 @@ Bool_t FixedTargetGenerator::Init() if (Option == "Primary" && !G4only){ fPythiaN = new Pythia8::Pythia(); }else if (Option != "charm" && Option != "beauty" && !G4only) { - fLogger->Error(MESSAGE_ORIGIN,"Option not known %s, abort",Option.Data()); + LOG(ERROR) << "Option not known "<< Option.Data() << ", abort"; } if (fUseRandom1) fRandomEngine = new PyTr1Rng(); if (fUseRandom3) fRandomEngine = new PyTr3Rng(); @@ -171,18 +171,18 @@ Bool_t FixedTargetGenerator::Init() if (p->tau0()>1){ string particle = std::to_string(n)+":mayDecay = false"; fPythia->readString(particle); - fLogger->Info(MESSAGE_ORIGIN,"Made %s stable for Pythia, should decay in Geant4",p->name().c_str()); + LOG(INFO) << "Made " << p->name().c_str() << " stable for Pythia, should decay in Geant4"; } } // boost branching fraction of rare di-muon decays // eta omega rho0 eta' phi if (fBoost != 1.){ - fLogger->Info(MESSAGE_ORIGIN,"Rescale BRs of dimuon decays in Pythia: %f",fBoost); + LOG(INFO) << "Rescale BRs of dimuon decays in Pythia: " << fBoost; for (unsigned int i=0; iparticleData.particleDataEntryPtr(r[i]); Pythia8::DecayChannel ch = V->channel(c[i]); if (TMath::Abs(ch.product(0))!=13 || TMath::Abs(ch.product(1))!=13){ - fLogger->Info(MESSAGE_ORIGIN,"this is not the right decay channel: %i %i",r[i],c[i]); + LOG(INFO) << "this is not the right decay channel: " << r[i] << " " << c[i]; }else{ TString tmp=""; tmp+=r[i];tmp+=":";tmp+= c[i]; @@ -254,7 +254,7 @@ Bool_t FixedTargetGenerator::Init() TGeoVolume* top = gGeoManager->GetTopVolume(); TGeoNode* target = top->FindNode(targetName); if (!target){ - fLogger->Error(MESSAGE_ORIGIN,"target not found, %s, program will crash",targetName.Data()); + LOG(ERROR) << "target not found, " << targetName.Data() << ", program will crash"; } Double_t z_middle = target->GetMatrix()->GetTranslation()[2]; TGeoBBox* sha = (TGeoBBox*)target->GetVolume()->GetShape(); @@ -343,7 +343,7 @@ Bool_t FixedTargetGenerator::ReadEvent(FairPrimaryGenerator* cpg) } }else{ if (nEntry==nEvents){ - fLogger->Info(MESSAGE_ORIGIN,"Rewind input file: %i",nEntry); + LOG(INFO) << "Rewind input file: " << nEntry; nEntry=0;} nTree->GetEvent(nEntry); nEntry+=1; @@ -363,7 +363,7 @@ Bool_t FixedTargetGenerator::ReadEvent(FairPrimaryGenerator* cpg) cpg->AddTrack(int(n_mid),n_mpx,n_mpy,n_mpz, xOff/cm,yOff/cm,zinter/cm,-1,kFALSE,n_mE,0.,wspill,procID); // second charm hadron in the event nTree->GetEvent(nEntry); - if (nID1 * n_id > 0){fLogger->Info(MESSAGE_ORIGIN,"same sign charm: %i, %i, %i",nEntry,nID1,n_id);} + if (nID1 * n_id > 0){LOG(INFO) << "same sign charm: " << nEntry << ", " << nID1 << ", " << n_id;} nEntry+=1; fPythiaP->event.append(int(n_id),1,0,0,n_px,n_py,n_pz,n_E,n_M,0.,9.); fPythiaP->next();