From 98d3873748c1933a9c29167b56adb507fa6cb65a Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <averbyts@cern.ch> Date: Sat, 22 Aug 2020 14:46:18 +0200 Subject: [PATCH 1/6] Explicit usage of std:: namespace for string,map,vector and some math functions in Generator codes --- .../CosmicGenerator/src/CosmicGenerator.cxx | 4 +-- .../EvgenProdTools/src/SimTimeEstimate.cxx | 2 +- Generators/EvtGen_i/EvtGen_i/EvtDecay.h | 9 +++-- .../EvtGen_i/src/EvtExternalGenFactory.cxx | 13 ++++--- Generators/EvtGen_i/src/EvtInclusiveDecay.cxx | 8 ++--- Generators/EvtGen_i/src/EvtPhotosEngine.cxx | 7 ++-- .../src/EvtPythia6CommandConverter.cxx | 29 ++++++++------- Generators/EvtGen_i/src/EvtPythiaEngine.cxx | 35 +++++++++---------- Generators/EvtGen_i/src/EvtTauolaEngine.cxx | 21 ++++++----- .../GeneratorFilters/src/BSignalFilter.cxx | 24 ++++++------- .../src/BoostedHadTopAndTopPair.cxx | 2 +- .../GeneratorFilters/src/DecayModeFilter.cxx | 6 ++-- .../src/FourLeptonMassFilter.cxx | 4 +-- .../src/HeavyFlavorHadronFilter.cxx | 4 +-- .../GeneratorFilters/src/LeptonPairFilter.cxx | 8 ++--- .../GeneratorFilters/src/MassRangeFilter.cxx | 2 +- .../src/PtmissAndOrLeptonFilter.cxx | 2 +- .../src/TTbarWToLeptonFilter.cxx | 2 +- .../GeneratorFilters/src/VHtoVVFilter.cxx | 8 ++--- .../src/WMultiLeptonFilter.cxx | 8 ++--- .../GeneratorFilters/src/XtoVVDecayFilter.cxx | 8 ++--- .../src/McEventCollectionCnv_p3.cxx | 8 ++--- .../src/McEventCollectionCnv_p4.cxx | 11 ++---- .../src/McEventCollectionCnv_p5.cxx | 11 ++---- Generators/HepMCAnalysis_i/share/RTTrun.C | 1 - Generators/Hijing_i/Hijing_i/Hijing.h | 7 ++-- Generators/Hydjet_i/Hydjet_i/Hydjet_i.h | 1 - Generators/Pythia8_i/Pythia8_i/Pythia8_i.h | 1 - .../Pythia8_i/Pythia8_i/UserHooksFactory.h | 7 ++-- .../Pythia8_i/Pythia8_i/UserProcessFactory.h | 10 +++--- .../Pythia8_i/UserResonanceFactory.h | 8 ++--- .../Pythia8_i/src/UserHooks/UserSetting.h | 7 ++-- .../UserProcesses/Sigma2qqbar2lStarlBar.cxx | 2 +- .../Sigma2qqbar2lStarlStarBar.cxx | 4 +-- .../Pythia8_i/src/UserResonanceFactory.cxx | 8 ++--- .../src/UserResonances/ResonanceExcitedCI.cxx | 2 +- .../src/UserResonances/ResonanceLQ.cxx | 2 +- .../Starlight_i/Starlight_i/Starlight_i.h | 1 - 38 files changed, 132 insertions(+), 165 deletions(-) diff --git a/Generators/CosmicGenerator/src/CosmicGenerator.cxx b/Generators/CosmicGenerator/src/CosmicGenerator.cxx index 11a0c08867e0..37da2e4b4cc8 100644 --- a/Generators/CosmicGenerator/src/CosmicGenerator.cxx +++ b/Generators/CosmicGenerator/src/CosmicGenerator.cxx @@ -525,9 +525,9 @@ StatusCode CosmicGenerator::callGenerator() { // m_pdgCode.push_back(charge*13); m_pdgCode.push_back(charge*-13); - const HepPDT::ParticleData* particle = particleData(abs(m_pdgCode.back())); + const HepPDT::ParticleData* particle = particleData(std::abs(m_pdgCode.back())); if (particle==nullptr){ - ATH_MSG_FATAL( "Particle with PDG ID=" << abs(m_pdgCode.back()) << " returned a nullptr" ); + ATH_MSG_FATAL( "Particle with PDG ID=" << std::abs(m_pdgCode.back()) << " returned a nullptr" ); return StatusCode::FAILURE; } diff --git a/Generators/EvgenProdTools/src/SimTimeEstimate.cxx b/Generators/EvgenProdTools/src/SimTimeEstimate.cxx index f3392250e464..88fd58bd1d3c 100644 --- a/Generators/EvgenProdTools/src/SimTimeEstimate.cxx +++ b/Generators/EvgenProdTools/src/SimTimeEstimate.cxx @@ -50,7 +50,7 @@ StatusCode SimTimeEstimate::execute() // it decays. This algorithm will always be a little tricky // in those cases, but better to *overestimate* the sim time. - if(std::find(m_pidsToSkip.begin(), m_pidsToSkip.end(), abs(part->pdg_id())) != m_pidsToSkip.end()) continue; + if(std::find(m_pidsToSkip.begin(), m_pidsToSkip.end(), std::abs(part->pdg_id())) != m_pidsToSkip.end()) continue; // Add in the total energy m_total_Energy += pmom.e(); m_eventEnergy += pmom.e(); diff --git a/Generators/EvtGen_i/EvtGen_i/EvtDecay.h b/Generators/EvtGen_i/EvtGen_i/EvtDecay.h index 017cf24ba1ad..aef94805058c 100644 --- a/Generators/EvtGen_i/EvtGen_i/EvtDecay.h +++ b/Generators/EvtGen_i/EvtGen_i/EvtDecay.h @@ -42,20 +42,19 @@ //#include "StoreGate/DataHandle.h" #include "GeneratorObjects/McEventCollection.h" -using std::string; class IAtRndmGenSvc; class EvtCLHepRandom : public EvtRandomEngine { public: - EvtCLHepRandom(IAtRndmGenSvc* atRndmGenSvc, string streamName); + EvtCLHepRandom(IAtRndmGenSvc* atRndmGenSvc, std::string streamName); double random(); virtual ~EvtCLHepRandom(); private: IAtRndmGenSvc* m_atRndmGenSvc; - string m_streamName; + std::string m_streamName; }; @@ -100,10 +99,10 @@ class EvtDecay : public Algorithm { IAtRndmGenSvc* m_atRndmGenSvc; // jobOption parameters - string m_DecayDec, m_PdtTable, m_userDecFileName; + std::string m_DecayDec, m_PdtTable, m_userDecFileName; double m_LambdabPol; bool m_PolarizedLambdab; - string m_randomStreamName, m_inputKeyName; + std::string m_randomStreamName, m_inputKeyName; IAtRndmGenSvc* m_AtRndmGenSvc; }; diff --git a/Generators/EvtGen_i/src/EvtExternalGenFactory.cxx b/Generators/EvtGen_i/src/EvtExternalGenFactory.cxx index 1c1668d4a74e..ca84bf9f9e8b 100644 --- a/Generators/EvtGen_i/src/EvtExternalGenFactory.cxx +++ b/Generators/EvtGen_i/src/EvtExternalGenFactory.cxx @@ -36,7 +36,6 @@ #endif #include <iostream> -using std::endl; EvtExternalGenFactory::EvtExternalGenFactory() { @@ -80,16 +79,16 @@ void EvtExternalGenFactory::definePythiaGenerator(std::string xmlDir, int genId = EvtExternalGenFactory::PythiaGenId; EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Defining EvtPythiaEngine: data tables defined in " - <<xmlDir<<endl; + <<xmlDir<<std::endl; if (convertPhysCodes == true) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Pythia 6 codes in decay files will be converted to Pythia 8 codes"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Pythia 6 codes in decay files will be converted to Pythia 8 codes"<<std::endl; } else { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Pythia 8 codes need to be used in decay files"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Pythia 8 codes need to be used in decay files"<<std::endl; } if (useEvtGenRandom == true) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random engine for Pythia 8 as well"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random engine for Pythia 8 as well"<<std::endl; } EvtAbsExternalGen* pythiaGenerator = new EvtPythiaEngine(xmlDir, convertPhysCodes, useEvtGenRandom); @@ -108,7 +107,7 @@ void EvtExternalGenFactory::definePythiaGenerator(std::string , void EvtExternalGenFactory::definePhotosGenerator(std::string photonType, bool useEvtGenRandom) { int genId = EvtExternalGenFactory::PhotosGenId; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Defining EvtPhotosEngine using photonType = "<<photonType<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Defining EvtPhotosEngine using photonType = "<<photonType<<std::endl; EvtAbsExternalGen* photosGenerator = new EvtPhotosEngine(photonType, useEvtGenRandom); m_extGenMap[genId] = photosGenerator; } @@ -122,7 +121,7 @@ void EvtExternalGenFactory::definePhotosGenerator(std::string, bool) #ifdef EVTGEN_TAUOLA void EvtExternalGenFactory::defineTauolaGenerator(bool useEvtGenRandom) { int genId = EvtExternalGenFactory::TauolaGenId; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Defining EvtTauolaEngine."<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Defining EvtTauolaEngine."<<std::endl; EvtAbsExternalGen* tauolaGenerator = new EvtTauolaEngine(useEvtGenRandom); m_extGenMap[genId] = tauolaGenerator; } diff --git a/Generators/EvtGen_i/src/EvtInclusiveDecay.cxx b/Generators/EvtGen_i/src/EvtInclusiveDecay.cxx index ed66103f0d02..1e4b9c346e41 100644 --- a/Generators/EvtGen_i/src/EvtInclusiveDecay.cxx +++ b/Generators/EvtGen_i/src/EvtInclusiveDecay.cxx @@ -590,20 +590,20 @@ bool EvtInclusiveDecay::isToBeDecayed(const HepMC::GenParticlePtr p, bool doCros for (HepMC::GenVertex::particle_iterator itd = v->particles_begin(HepMC::children); itd != v->particles_end(HepMC::children); ++itd) { - if (abs((*itd)->pdg_id()) == abs(id)) return false; + if (std::abs((*itd)->pdg_id()) == std::abs(id)) return false; } #endif } // Check blackList - if (m_blackListSet.count(abs(id))>0) return false; + if (m_blackListSet.count(std::abs(id))>0) return false; // Check allow* settings if (m_allowAllKnownDecays && nModes>0) return true; if (m_allowDefaultBDecays && isDefaultB(id)) return true; // Check whiteList - if (m_whiteListSet.count(abs(id))>0) return true; + if (m_whiteListSet.count(std::abs(id))>0) return true; return false; // Default is NOT to decay through EvtGen } @@ -614,7 +614,7 @@ bool EvtInclusiveDecay::isToBeDecayed(const HepMC::GenParticlePtr p, bool doCros // The following mimicks the particle selection implemented in EvtDecay. // bool EvtInclusiveDecay::isDefaultB(const int pId) const { - int id = abs(pId); + int id = std::abs(pId); if ( id == 511 || id == 521 || id == 531 || diff --git a/Generators/EvtGen_i/src/EvtPhotosEngine.cxx b/Generators/EvtGen_i/src/EvtPhotosEngine.cxx index ceb15390b021..30b722e91a7a 100644 --- a/Generators/EvtGen_i/src/EvtPhotosEngine.cxx +++ b/Generators/EvtGen_i/src/EvtPhotosEngine.cxx @@ -39,7 +39,6 @@ #include <sstream> #include <vector> -using std::endl; EvtPhotosEngine::EvtPhotosEngine(std::string photonType, bool useEvtGenRandom) { @@ -47,11 +46,11 @@ EvtPhotosEngine::EvtPhotosEngine(std::string photonType, bool useEvtGenRandom) { _gammaId = EvtId(-1,-1); _mPhoton = 0.0; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting up PHOTOS."<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting up PHOTOS."<<std::endl; if (useEvtGenRandom == true) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random number engine also for Photos++"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random number engine also for Photos++"<<std::endl; Photospp::Photos::setRandomGenerator(EvtRandom::Flat); @@ -82,7 +81,7 @@ void EvtPhotosEngine::initialise() { if (_gammaId == EvtId(-1,-1)) { EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPhotosEngine. Do not recognise the photon type " - <<_photonType<<". Setting this to \"gamma\". "<<endl; + <<_photonType<<". Setting this to \"gamma\". "<<std::endl; _gammaId = EvtPDL::getId("gamma"); } diff --git a/Generators/EvtGen_i/src/EvtPythia6CommandConverter.cxx b/Generators/EvtGen_i/src/EvtPythia6CommandConverter.cxx index 829132f8c22d..175ae4df0c67 100644 --- a/Generators/EvtGen_i/src/EvtPythia6CommandConverter.cxx +++ b/Generators/EvtGen_i/src/EvtPythia6CommandConverter.cxx @@ -25,7 +25,6 @@ #include <iostream> #include <stdlib.h> -using std::endl; std::vector<std::string> convertPythia6Command(Command command) { std::string module = command["MODULE"]; @@ -44,8 +43,8 @@ std::vector<std::string> convertPythia6Command(Command command) { break; case 1: case 4: - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(11)="<<value<<" is only implicitly supported."<<endl; - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(11)=5 and ensure PARJ(46) and PARJ(47) are both set appropriately."<<endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(11)="<<value<<" is only implicitly supported."<<std::endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(11)=5 and ensure PARJ(46) and PARJ(47) are both set appropriately."<<std::endl; ::abort(); case 5: commandStrings.push_back("StringZ:usePetersonC = off"); @@ -53,8 +52,8 @@ std::vector<std::string> convertPythia6Command(Command command) { commandStrings.push_back("StringZ:usePetersonH = off"); break; default: - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(11)="<<value<<" is not currently supported."<<endl; - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(11)=3 or MSTJ(11)=5."<<endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(11)="<<value<<" is not currently supported."<<std::endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(11)=3 or MSTJ(11)=5."<<std::endl; ::abort(); } break; @@ -67,8 +66,8 @@ std::vector<std::string> convertPythia6Command(Command command) { commandStrings.push_back("StringFlav:suppressLeadingB = on"); break; default: - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(12)="<<value<<" is not currently supported."<<endl; - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(12)=2 or MSTJ(12)=3."<<endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(12)="<<value<<" is not currently supported."<<std::endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please use MSTJ(12)=2 or MSTJ(12)=3."<<std::endl; ::abort(); } break; @@ -98,15 +97,15 @@ std::vector<std::string> convertPythia6Command(Command command) { commandStrings.push_back("BoseEinstein:Pion = on"); break; default: - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(52)="<<value<<" is not allowed."<<endl; - EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please select 3,7 or 9."<<endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Pythia6 parameter: MSTJ(52)="<<value<<" is not allowed."<<std::endl; + EvtGenReport(EVTGEN_ERROR,"EvtGen")<<"Please select 3,7 or 9."<<std::endl; ::abort(); } break; //53-57,91-93,101-121 default: - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<endl; - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<std::endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<std::endl; } } else if(module == "PARJ") { switch(atoi(param.c_str())) { @@ -227,12 +226,12 @@ std::vector<std::string> convertPythia6Command(Command command) { //121-171 parameters for ee event generation - can't find these in Pythia8 //180-195 Various coupling constants & parameters related to couplings - can't find these in Pythia8 default: - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<endl; - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<std::endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<std::endl; } } else { - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<endl; - EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"Pythia6 parameter: "<<module<<"("<<param<<") is not currently supported and will be ignored."<<std::endl; + EvtGenReport(EVTGEN_WARNING,"EvtGen")<<"A similar Pythia8 parameter may be available."<<std::endl; } return commandStrings; } diff --git a/Generators/EvtGen_i/src/EvtPythiaEngine.cxx b/Generators/EvtGen_i/src/EvtPythiaEngine.cxx index 4f27902bed7e..249c0f5b17a3 100644 --- a/Generators/EvtGen_i/src/EvtPythiaEngine.cxx +++ b/Generators/EvtGen_i/src/EvtPythiaEngine.cxx @@ -34,7 +34,6 @@ #include <iostream> #include <sstream> -using std::endl; EvtPythiaEngine::EvtPythiaEngine(std::string xmlDir, bool convertPhysCodes, bool useEvtGenRandom) { @@ -47,11 +46,11 @@ EvtPythiaEngine::EvtPythiaEngine(std::string xmlDir, bool convertPhysCodes, // versions in one Pythia generator, we can use two generators to // get the required behaviour. - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Creating generic Pythia generator"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Creating generic Pythia generator"<<std::endl; _genericPythiaGen = new Pythia8::Pythia(xmlDir); _genericPartData = _genericPythiaGen->particleData; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Creating alias Pythia generator"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Creating alias Pythia generator"<<std::endl; _aliasPythiaGen = new Pythia8::Pythia(xmlDir); _aliasPartData = _aliasPythiaGen->particleData; @@ -154,7 +153,7 @@ bool EvtPythiaEngine::doDecay(EvtParticle* theParticle) { if (_initialised == false) {this->initialise();} if (theParticle == 0) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPythiaEngine::doDecay. The mother particle is null. Not doing any Pythia decay."<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPythiaEngine::doDecay. The mother particle is null. Not doing any Pythia decay."<<std::endl; return false; } @@ -291,7 +290,7 @@ void EvtPythiaEngine::storeDaughterInfo(EvtParticle* theParticle, int startInt) void EvtPythiaEngine::createDaughterEvtParticles(EvtParticle* theParent) { if (theParent == 0) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPythiaEngine::createDaughterEvtParticles. The parent is null"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPythiaEngine::createDaughterEvtParticles. The parent is null"<<std::endl; return; } @@ -479,10 +478,10 @@ void EvtPythiaEngine::updateParticleLists() { } // Loop over EvtPDL entries - //EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Writing out changed generic Pythia decay list"<<endl; + //EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Writing out changed generic Pythia decay list"<<std::endl; //_genericPythiaGen->particleData.listChanged(); - //EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Writing out changed alias Pythia decay list"<<endl; + //EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Writing out changed alias Pythia decay list"<<std::endl; //_aliasPythiaGen->particleData.listChanged(); } @@ -577,14 +576,14 @@ void EvtPythiaEngine::updatePythiaDecayTable(EvtId& particleId, int aliasInt, in EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Warning in EvtPythiaEngine. Trying to redefine Pythia table for " <<EvtPDL::name(particleId)<<" for a decay channel that has no daughters." - <<" Keeping Pythia default (if available)."<<endl; + <<" Keeping Pythia default (if available)."<<std::endl; } } else { EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Error in EvtPythiaEngine. decayModel is null for particle " - <<EvtPDL::name(particleId)<<" mode number "<<iMode<<endl; + <<EvtPDL::name(particleId)<<" mode number "<<iMode<<std::endl; } @@ -673,7 +672,7 @@ int EvtPythiaEngine::getModeInt(EvtDecayBase* decayModel) { modeInt = 0; // off mass shell particles. } else { EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Pythia mode integer "<<tmpModeInt - <<" is not recognised. Using phase-space model"<<endl; + <<" is not recognised. Using phase-space model"<<std::endl; modeInt = 0; // Use phase-space for anything else } @@ -721,7 +720,7 @@ void EvtPythiaEngine::createPythiaParticle(EvtId& particleId, int PDGCode) { std::ostringstream oss; oss.setf(std::ios::scientific); - int absPDGCode = abs(PDGCode); + int absPDGCode = std::abs(PDGCode); oss << absPDGCode << ":new = " << aliasName << " " << antiName << " " << spin << " " << charge << " " << colour << " " << m0 << " " << mWidth << " " << mMin << " " << mMax << " " @@ -768,15 +767,15 @@ void EvtPythiaEngine::updatePhysicsParameters() { std::vector<std::string> commandStrings; if(command["VERSION"] == "PYTHIA6") { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Converting Pythia 6 command: "<<command["MODULE"]<<"("<<command["PARAM"]<<")="<<command["VALUE"]<<"..."<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Converting Pythia 6 command: "<<command["MODULE"]<<"("<<command["PARAM"]<<")="<<command["VALUE"]<<"..."<<std::endl; commandStrings = convertPythia6Command(command); } else if(command["VERSION"] == "PYTHIA8") { commandStrings.push_back(command["MODULE"]+":"+command["PARAM"]+" = "+command["VALUE"]); } else { - EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Pythia command received by EvtPythiaEngine has bad version:"<<endl; - EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Received "<<command["VERSION"]<<" but expected PYTHIA6 or PYTHIA8."<<endl; - EvtGenReport(EVTGEN_ERROR, "EvtGen") << "The error is likely to be in EvtDecayTable.cpp"<<endl; - EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtGen will now abort."<<endl; + EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Pythia command received by EvtPythiaEngine has bad version:"<<std::endl; + EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Received "<<command["VERSION"]<<" but expected PYTHIA6 or PYTHIA8."<<std::endl; + EvtGenReport(EVTGEN_ERROR, "EvtGen") << "The error is likely to be in EvtDecayTable.cpp"<<std::endl; + EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtGen will now abort."<<std::endl; ::abort(); } std::string generator = command["GENERATOR"]; @@ -784,7 +783,7 @@ void EvtPythiaEngine::updatePhysicsParameters() { generator == "BOTH" || generator == "Both" || generator == "both") { std::vector<std::string>::iterator it2 = commandStrings.begin(); for( ; it2!=commandStrings.end(); it2++) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Configuring generic Pythia generator: " << (*it2) << endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Configuring generic Pythia generator: " << (*it2) <<std::endl; _genericPythiaGen->readString(*it2); } } @@ -792,7 +791,7 @@ void EvtPythiaEngine::updatePhysicsParameters() { generator == "BOTH" || generator == "Both" || generator == "both") { std::vector<std::string>::iterator it2 = commandStrings.begin(); for( ; it2!=commandStrings.end(); it2++) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Configuring alias Pythia generator: " << (*it2) << endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Configuring alias Pythia generator: " << (*it2) <<std::endl; _aliasPythiaGen->readString(*it2); } } diff --git a/Generators/EvtGen_i/src/EvtTauolaEngine.cxx b/Generators/EvtGen_i/src/EvtTauolaEngine.cxx index cd7ae034f795..ee549febe8f5 100644 --- a/Generators/EvtGen_i/src/EvtTauolaEngine.cxx +++ b/Generators/EvtGen_i/src/EvtTauolaEngine.cxx @@ -41,7 +41,6 @@ #include <string> #include <cmath> -using std::endl; EvtTauolaEngine::EvtTauolaEngine(bool useEvtGenRandom) { @@ -50,7 +49,7 @@ EvtTauolaEngine::EvtTauolaEngine(bool useEvtGenRandom) { // Number of possible decay modes in Tauola _nTauolaModes = 22; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting up TAUOLA."<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting up TAUOLA."<<std::endl; // These three lines are not really necessary since they are the default. // But they are here so that we know what the initial conditions are. @@ -61,7 +60,7 @@ EvtTauolaEngine::EvtTauolaEngine(bool useEvtGenRandom) { // Initial the Tauola external generator if (useEvtGenRandom == true) { - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random number engine also for Tauola++"<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Using EvtGen random number engine also for Tauola++"<<std::endl; Tauolapp::Tauola::setRandomGenerator(EvtRandom::Flat); @@ -117,7 +116,7 @@ void EvtTauolaEngine::setUpPossibleTauModes() { EvtId particleId = EvtPDL::getEntry(iPDL); int PDGId = EvtPDL::getStdHep(particleId); - if (abs(PDGId) == _tauPDG && gotAnyTauolaModes == false) { + if (std::abs(PDGId) == _tauPDG && gotAnyTauolaModes == false) { int aliasInt = particleId.getAlias(); @@ -172,7 +171,7 @@ void EvtTauolaEngine::setUpPossibleTauModes() { if (gotAnyTauolaModes == true && nNonTauolaModes > 0) { EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Please remove all non-TAUOLA decay modes for particle " - <<EvtPDL::name(particleId)<<endl; + <<EvtPDL::name(particleId)<<std::endl; ::abort(); } @@ -182,19 +181,19 @@ void EvtTauolaEngine::setUpPossibleTauModes() { if (totalTauModeBF > 0.0) { EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting TAUOLA BF modes using the definitions for the particle " - <<EvtPDL::name(particleId)<<endl; + <<EvtPDL::name(particleId)<<std::endl; for (iTauMode = 0; iTauMode < _nTauolaModes; iTauMode++) { tauolaModeBFs[iTauMode] /= totalTauModeBF; double modeBF = tauolaModeBFs[iTauMode]; - EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting TAUOLA BF for mode "<<iTauMode+1<<" = "<<modeBF<<endl; + EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Setting TAUOLA BF for mode "<<iTauMode+1<<" = "<<modeBF<<std::endl; Tauolapp::Tauola::setTauBr(iTauMode+1, modeBF); } EvtGenReport(EVTGEN_INFO,"EvtGen")<<"Any other TAUOLA BF modes for other tau particle decay mode definitions will be ignored!" - <<endl; + <<std::endl; } @@ -230,7 +229,7 @@ bool EvtTauolaEngine::doDecay(EvtParticle* tauParticle) { // Check that we have a tau particle. EvtId partId = tauParticle->getId(); - if (abs(EvtPDL::getStdHep(partId)) != _tauPDG) {return false;} + if (std::abs(EvtPDL::getStdHep(partId)) != _tauPDG) {return false;} int nTauDaug = tauParticle->getNDaug(); @@ -310,7 +309,7 @@ void EvtTauolaEngine::decayTauEvent(EvtParticle* tauParticle) { EvtId theId = theDaughter->getId(); int PDGInt = EvtPDL::getStdHep(theId); - if (abs(PDGInt) == _tauPDG) { + if (std::abs(PDGInt) == _tauPDG) { // Delete any siblings for the tau particle if (theDaughter->getNDaug() > 0) {theDaughter->deleteDaughters(false);} tauMap[hepMCDaughter] = theDaughter; @@ -353,7 +352,7 @@ void EvtTauolaEngine::decayTauEvent(EvtParticle* tauParticle) { // Check to see if we have a tau particle HepMC::GenParticle* aParticle = (*eventIter); - if (aParticle != 0 && abs(aParticle->pdg_id()) == _tauPDG) { + if (aParticle != 0 && std::abs(aParticle->pdg_id()) == _tauPDG) { // Find out what EvtParticle corresponds to the HepMC particle. // We need this to create and attach EvtParticle daughters. diff --git a/Generators/GeneratorFilters/src/BSignalFilter.cxx b/Generators/GeneratorFilters/src/BSignalFilter.cxx index 01def0f4ab2c..bb4217ab74c9 100644 --- a/Generators/GeneratorFilters/src/BSignalFilter.cxx +++ b/Generators/GeneratorFilters/src/BSignalFilter.cxx @@ -174,7 +174,7 @@ StatusCode BSignalFilter::filterEvent() // for(auto part: *genEvt) { - if ( abs(part->pdg_id()) <= 6 && part->status() == 1 ) + if ( std::abs(part->pdg_id()) <= 6 && part->status() == 1 ) { acceptEvent = false; const int pID = part->pdg_id(); @@ -371,7 +371,7 @@ bool BSignalFilter::LVL1_Mu_Trigger(HepMC::ConstGenParticlePtr child) const double myPT = child->momentum().perp(); double myEta = child->momentum().pseudoRapidity(); - if ( (abs(pID) == 13) && m_localLVL1MuonCutOn ) + if ( (std::abs(pID) == 13) && m_localLVL1MuonCutOn ) accept = test_cuts( myPT, m_localLVL1MuonCutPT, myEta, m_localLVL1MuonCutEta ); return accept; @@ -386,9 +386,9 @@ bool BSignalFilter::LVL2_eMu_Trigger(HepMC::ConstGenParticlePtr child) const double myPT = child->momentum().perp(); double myEta = child->momentum().pseudoRapidity(); - if ( (abs(pID) == 11) && m_localLVL2ElectronCutOn ) + if ( (std::abs(pID) == 11) && m_localLVL2ElectronCutOn ) accept = test_cuts( myPT, m_localLVL2ElectronCutPT, myEta, m_localLVL2ElectronCutEta ); - if ( (abs(pID) == 13) && m_localLVL2MuonCutOn ) + if ( (std::abs(pID) == 13) && m_localLVL2MuonCutOn ) accept = test_cuts( myPT, m_localLVL2MuonCutPT, myEta, m_localLVL2MuonCutEta ); return accept; @@ -409,11 +409,11 @@ void BSignalFilter::FindAllChildren(HepMC::ConstGenParticlePtr mother,std::strin { foundSignal=true; bool passedCut = FinalStatePassedCuts(mother); // X = X && ... in case of multiple particles (e.g. KK) - if ( m_cuts_f_e_on && abs(pID)==11 ) passedAllCuts = passedAllCuts && passedCut; - if ( m_cuts_f_mu_on && abs(pID)==13 ) passedAllCuts = passedAllCuts && passedCut; + if ( m_cuts_f_e_on && std::abs(pID)==11 ) passedAllCuts = passedAllCuts && passedCut; + if ( m_cuts_f_mu_on && std::abs(pID)==13 ) passedAllCuts = passedAllCuts && passedCut; if ( m_cuts_f_had_on && MC::PID::isHadron(pID) && MC::PID::isCharged(pID) ) passedAllCuts = passedAllCuts && passedCut; - if ( m_cuts_f_gam_on && abs(pID)==22 ) passedAllCuts = passedAllCuts && passedCut; - if ( m_cuts_f_K0_on && abs(pID)==311 ) passedAllCuts = passedAllCuts && passedCut; + if ( m_cuts_f_gam_on && std::abs(pID)==22 ) passedAllCuts = passedAllCuts && passedCut; + if ( m_cuts_f_K0_on && std::abs(pID)==311 ) passedAllCuts = passedAllCuts && passedCut; // if ( m_InvMass_switch && m_InvMass_PartId1==pID ) p1.SetPxPyPzE(mother->momentum().x(),mother->momentum().y(),mother->momentum().z(),mother->momentum().e()); @@ -487,7 +487,7 @@ bool BSignalFilter::FinalStatePassedCuts(HepMC::ConstGenParticlePtr child) const if ( m_cuts_f_e_on ) { - if ( abs(pID) == 11 ) + if ( std::abs(pID) == 11 ) { ATH_MSG_DEBUG(" ** ( pT , eta ) cuts applied on the electron --> ( " << m_cuts_f_e_pT << " , " << m_cuts_f_e_eta << " )"); @@ -509,7 +509,7 @@ bool BSignalFilter::FinalStatePassedCuts(HepMC::ConstGenParticlePtr child) const } if ( m_cuts_f_mu_on ) { - if ( abs(pID) == 13 ) + if ( std::abs(pID) == 13 ) { ATH_MSG_DEBUG(" ** ( pT , eta ) cuts applied on the muon --> ( " << m_cuts_f_mu_pT << " , " << m_cuts_f_mu_eta << " )"); @@ -553,7 +553,7 @@ bool BSignalFilter::FinalStatePassedCuts(HepMC::ConstGenParticlePtr child) const } if ( m_cuts_f_gam_on ) { - if ( abs(pID) == 22 ) + if ( std::abs(pID) == 22 ) { ATH_MSG_DEBUG(" ** ( pT , eta ) cuts applied on the gamma --> ( " << m_cuts_f_gam_pT << " , " << m_cuts_f_gam_eta << " )"); @@ -575,7 +575,7 @@ bool BSignalFilter::FinalStatePassedCuts(HepMC::ConstGenParticlePtr child) const } if ( m_cuts_f_K0_on ) { - if ( abs(pID) == 311 ) + if ( std::abs(pID) == 311 ) { ATH_MSG_DEBUG(" ** ( pT , eta ) cuts applied on the K0 --> ( " << m_cuts_f_K0_pT << " , " << m_cuts_f_K0_eta << " )"); diff --git a/Generators/GeneratorFilters/src/BoostedHadTopAndTopPair.cxx b/Generators/GeneratorFilters/src/BoostedHadTopAndTopPair.cxx index 27d4df28ce55..f508cffb3028 100644 --- a/Generators/GeneratorFilters/src/BoostedHadTopAndTopPair.cxx +++ b/Generators/GeneratorFilters/src/BoostedHadTopAndTopPair.cxx @@ -110,7 +110,7 @@ bool BoostedHadTopAndTopPair::isFromTop(HepMC::ConstGenParticlePtr part) const{ HepMC::GenVertex::particle_iterator endParent = prod->particles_end(HepMC::parents); for(;firstParent!=endParent; ++firstParent){ //if( part->barcode() < (*firstParent)->barcode() ) continue; /// protection for sherpa - if( abs( (*firstParent)->pdg_id() ) == 6 ) return true; + if( std::abs( (*firstParent)->pdg_id() ) == 6 ) return true; } #endif return false; diff --git a/Generators/GeneratorFilters/src/DecayModeFilter.cxx b/Generators/GeneratorFilters/src/DecayModeFilter.cxx index 97952d560db7..b36b7d30088c 100644 --- a/Generators/GeneratorFilters/src/DecayModeFilter.cxx +++ b/Generators/GeneratorFilters/src/DecayModeFilter.cxx @@ -10,7 +10,7 @@ using namespace std; inline bool isIn(const std::vector<unsigned int>& pdgs, int pdg) { - return std::find(pdgs.begin(), pdgs.end(), static_cast<unsigned int>(abs(pdg))) != pdgs.end(); + return std::find(pdgs.begin(), pdgs.end(), static_cast<unsigned int>(std::abs(pdg))) != pdgs.end(); } @@ -140,8 +140,8 @@ StatusCode DecayModeFilter::filterEvent() { bool parent1ok(false), parent2ok(false); for (size_t i = 0; i < m_producedParticles_PDG.size(); ++i) { - if (abs(parent1->pdg_id()) == (int) m_producedParticles_PDG[i]) parent1ok = true; - if (abs(parent2->pdg_id()) == (int) m_producedParticles_PDG[i]) parent2ok = true; + if (std::abs(parent1->pdg_id()) == (int) m_producedParticles_PDG[i]) parent1ok = true; + if (std::abs(parent2->pdg_id()) == (int) m_producedParticles_PDG[i]) parent2ok = true; } if (!(parent1ok && parent2ok)) continue; diff --git a/Generators/GeneratorFilters/src/FourLeptonMassFilter.cxx b/Generators/GeneratorFilters/src/FourLeptonMassFilter.cxx index e7cf205ca5bb..93dadaec833a 100644 --- a/Generators/GeneratorFilters/src/FourLeptonMassFilter.cxx +++ b/Generators/GeneratorFilters/src/FourLeptonMassFilter.cxx @@ -54,7 +54,7 @@ StatusCode FourLeptonMassFilter::filterEvent() { if ((*pitr2)->status()!=1 || pitr1 == pitr2) continue; // Pick electrons or muons with Pt > m_inPt and |eta| < m_maxEta int pdgId2((*pitr2)->pdg_id()); - if (!(abs(pdgId2) == 11 || abs(pdgId2) == 13)) continue; + if (!(std::abs(pdgId2) == 11 || abs(pdgId2) == 13)) continue; if (!((*pitr2)->momentum().perp() >= m_minPt && std::abs((*pitr2)->momentum().pseudoRapidity()) <= m_maxEta)) continue; // Loop over all remaining particles in the event @@ -78,7 +78,7 @@ StatusCode FourLeptonMassFilter::filterEvent() { // Pick electrons or muons with Pt > m_inPt and |eta| < m_maxEta int pdgId4((*pitr4)->pdg_id()); - if (!(abs(pdgId4) == 11 || abs(pdgId4) == 13)) continue; + if (!(std::abs(pdgId4) == 11 || abs(pdgId4) == 13)) continue; if (!((*pitr4)->momentum().perp() >= m_minPt && std::abs((*pitr4)->momentum().pseudoRapidity()) <= m_maxEta)) continue; decltype(pitr1) apitr[4] = {pitr1,pitr2,pitr3,pitr4}; diff --git a/Generators/GeneratorFilters/src/HeavyFlavorHadronFilter.cxx b/Generators/GeneratorFilters/src/HeavyFlavorHadronFilter.cxx index 48d368aafa2c..6bccf15d15d4 100644 --- a/Generators/GeneratorFilters/src/HeavyFlavorHadronFilter.cxx +++ b/Generators/GeneratorFilters/src/HeavyFlavorHadronFilter.cxx @@ -207,7 +207,7 @@ StatusCode HeavyFlavorHadronFilter::filterEvent() { bool HeavyFlavorHadronFilter::isBwithWeakDK(const int pID) const { - int id = abs(pID); + int id = std::abs(pID); return ( id == 511 || // B+ id == 521 || // B0 id == 531 || // Bs @@ -223,7 +223,7 @@ bool HeavyFlavorHadronFilter::isBwithWeakDK(const int pID) const { bool HeavyFlavorHadronFilter::isDwithWeakDK(const int pID) const { - int id = abs(pID); + int id = std::abs(pID); return ( id == 411 || // D+ id == 421 || // D0 id == 431 || // Ds diff --git a/Generators/GeneratorFilters/src/LeptonPairFilter.cxx b/Generators/GeneratorFilters/src/LeptonPairFilter.cxx index e10105b1f66c..a5099b985c0e 100644 --- a/Generators/GeneratorFilters/src/LeptonPairFilter.cxx +++ b/Generators/GeneratorFilters/src/LeptonPairFilter.cxx @@ -227,10 +227,10 @@ StatusCode LeptonPairFilter::filterEvent() { id1 = vLeptonPDGIDs[i]; id2 = vLeptonPDGIDs[j]; //classify the pair and count it - if(abs(id1)==abs(id2) && id1*id2 < 0) nSFOS+=1; - else if(abs(id1)==abs(id2) && id1*id2 > 0) nSFSS+=1; - else if(abs(id1)!=abs(id2) && id1*id2 < 0) nOFOS+=1; - else if(abs(id1)!=abs(id2) && id1*id2 > 0) nOFSS+=1; + if(std::abs(id1)==std::abs(id2) && id1*id2 < 0) nSFOS+=1; + else if(std::abs(id1)==std::abs(id2) && id1*id2 > 0) nSFSS+=1; + else if(std::abs(id1)!=std::abs(id2) && id1*id2 < 0) nOFOS+=1; + else if(std::abs(id1)!=std::abs(id2) && id1*id2 > 0) nOFSS+=1; else ATH_MSG_ERROR( "Couldn't classify lepton pair" ); } } diff --git a/Generators/GeneratorFilters/src/MassRangeFilter.cxx b/Generators/GeneratorFilters/src/MassRangeFilter.cxx index 2f5e92caa28d..ccb91664dafe 100644 --- a/Generators/GeneratorFilters/src/MassRangeFilter.cxx +++ b/Generators/GeneratorFilters/src/MassRangeFilter.cxx @@ -35,7 +35,7 @@ StatusCode MassRangeFilter::filterInitialize() { StatusCode MassRangeFilter::filterEvent() { double invMassMax = 0.; - bool samePDGID = (abs(m_PartId) == abs(m_PartId2)); + bool samePDGID = (std::abs(m_PartId) == std::abs(m_PartId2)); for (McEventCollection::const_iterator itr = events()->begin(); itr != events()->end(); ++itr) { const HepMC::GenEvent* genEvt = *itr; int n = 0; diff --git a/Generators/GeneratorFilters/src/PtmissAndOrLeptonFilter.cxx b/Generators/GeneratorFilters/src/PtmissAndOrLeptonFilter.cxx index 83a21e587239..9993f222190c 100644 --- a/Generators/GeneratorFilters/src/PtmissAndOrLeptonFilter.cxx +++ b/Generators/GeneratorFilters/src/PtmissAndOrLeptonFilter.cxx @@ -89,7 +89,7 @@ StatusCode PtmissAndOrLeptonFilter::filterEvent() { const HepMC::GenEvent* genEvt = (*itr); for (auto part: *genEvt){ if (part->status() != 1) continue; - const int abspid = abs(part->pdg_id()); + const int abspid = std::abs(part->pdg_id()); const double abseta = std::abs(part->momentum().pseudoRapidity()); if (abspid == 11 && part->momentum().perp() > m_PtminElectron && abseta <= m_MaxEtaElectron) nelec++; if (abspid == 13 && part->momentum().perp() > m_PtminMuon && abseta <= m_MaxEtaMuon) nmuon++; diff --git a/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx b/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx index 0276a6e5a594..855435211b2e 100644 --- a/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx +++ b/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx @@ -125,7 +125,7 @@ StatusCode TTbarWToLeptonFilter::filterEvent() { break; } - if (abs(grandchild_pid) == 11 || abs(grandchild_pid) == 13 || abs(grandchild_pid) == 15) { + if (std::abs(grandchild_pid) == 11 || abs(grandchild_pid) == 13 || abs(grandchild_pid) == 15) { if (grandchild_mcpart->momentum().perp() >= m_Ptmin) N_pt_above_cut++; // W decay lepton is found. Break loop over the decay product particles break; diff --git a/Generators/GeneratorFilters/src/VHtoVVFilter.cxx b/Generators/GeneratorFilters/src/VHtoVVFilter.cxx index 2e7ad43d5d55..4b758809f604 100644 --- a/Generators/GeneratorFilters/src/VHtoVVFilter.cxx +++ b/Generators/GeneratorFilters/src/VHtoVVFilter.cxx @@ -109,7 +109,7 @@ StatusCode VHtoVVFilter::filterEvent() { #else for (HepMC::GenEvent::particle_const_iterator pitr = genEvt->particles_begin(); pitr != genEvt->particles_end(); ++pitr ) { // Loop over particles from the primary interaction that match the PDG Parent - if ( abs((*pitr)->pdg_id()) == m_PDGParent && (*pitr)->status() == 3) { + if ( std::abs((*pitr)->pdg_id()) == m_PDGParent && (*pitr)->status() == 3) { HepMC::GenVertex::particle_iterator firstMother = (*pitr)->production_vertex()->particles_begin(HepMC::parents); HepMC::GenVertex::particle_iterator endMother = (*pitr)->production_vertex()->particles_end(HepMC::parents); HepMC::GenVertex::particle_iterator thisMother = firstMother; @@ -134,12 +134,12 @@ StatusCode VHtoVVFilter::filterEvent() { ATH_MSG_DEBUG(" child " << (*thisChild)->pdg_id()); if (!okPDGHVChild1) { for (size_t i = 0; i < m_PDGHVChild1.size(); ++i) - if (abs((*thisChild)->pdg_id()) == m_PDGHVChild1[i]) okPDGHVChild1 = true; + if (std::abs((*thisChild)->pdg_id()) == m_PDGHVChild1[i]) okPDGHVChild1 = true; if (okPDGHVChild1) break; } if (!okPDGHVChild2) { for (size_t i = 0; i < m_PDGHVChild2.size(); ++i) - if (abs((*thisChild)->pdg_id()) == m_PDGHVChild2[i]) okPDGHVChild2 = true; + if (std::abs((*thisChild)->pdg_id()) == m_PDGHVChild2[i]) okPDGHVChild2 = true; if (okPDGHVChild2) break; } } @@ -154,7 +154,7 @@ StatusCode VHtoVVFilter::filterEvent() { ATH_MSG_DEBUG(" child " << (*thisChild)->pdg_id()); if (!okPDGAssocVChild) { for (unsigned int i=0;i<m_PDGAssocVChild.size();++i) - if (abs((*thisChild)->pdg_id()) == m_PDGAssocVChild[i]) okPDGAssocVChild = true; + if (std::abs((*thisChild)->pdg_id()) == m_PDGAssocVChild[i]) okPDGAssocVChild = true; if (okPDGAssocVChild) break; } diff --git a/Generators/GeneratorFilters/src/WMultiLeptonFilter.cxx b/Generators/GeneratorFilters/src/WMultiLeptonFilter.cxx index c45165ff448c..8766511bb802 100644 --- a/Generators/GeneratorFilters/src/WMultiLeptonFilter.cxx +++ b/Generators/GeneratorFilters/src/WMultiLeptonFilter.cxx @@ -78,7 +78,7 @@ StatusCode WMultiLeptonFilter::filterEvent() { } #else for (HepMC::GenEvent::particle_const_iterator pitr = genEvt->particles_begin(); pitr != genEvt->particles_end(); ++pitr) { - if ( abs((*pitr)->pdg_id()) == 24 && (*pitr)->status() == 3) { + if ( std::abs((*pitr)->pdg_id()) == 24 && (*pitr)->status() == 3) { HepMC::GenVertex::particle_iterator firstMother = (*pitr)->production_vertex()->particles_begin(HepMC::parents); HepMC::GenVertex::particle_iterator endMother = (*pitr)->production_vertex()->particles_end(HepMC::parents); HepMC::GenVertex::particle_iterator thisMother = firstMother; @@ -88,14 +88,14 @@ StatusCode WMultiLeptonFilter::filterEvent() { ATH_MSG_DEBUG(" W barcode " << (*pitr)->barcode() << " status = " << (*pitr)->status()); ATH_MSG_DEBUG(" a W mother " << (*thisMother)->pdg_id()<< " barc = " << (*thisMother)->barcode()); if ( (*thisMother)->pdg_id() == 25 ) fromhiggs = true; - if ( abs((*thisMother)->pdg_id()) == 6 ) fromtop = true; + if ( std::abs((*thisMother)->pdg_id()) == 6 ) fromtop = true; ATH_MSG_DEBUG(" W from " << fromhiggs << " " << fromtop); } HepMC::GenVertex::particle_iterator firstChild = (*pitr)->end_vertex()->particles_begin(HepMC::children); HepMC::GenVertex::particle_iterator endChild = (*pitr)->end_vertex()->particles_end(HepMC::children); HepMC::GenVertex::particle_iterator thisChild = firstChild; for (; thisChild != endChild; ++thisChild) { - if ( (abs((*thisChild)->pdg_id()) == 11) ) { + if ( (std::abs((*thisChild)->pdg_id()) == 11) ) { if (fromhiggs) NLeptonsH++; if (fromtop) NLeptonsT++; if (fromhiggs && ((*thisChild)->pdg_id() == -11) ) m_H_WPlus_e++; @@ -105,7 +105,7 @@ StatusCode WMultiLeptonFilter::filterEvent() { ATH_MSG_DEBUG(" electron from W "); } - if ( (abs((*thisChild)->pdg_id()) == 13) ) { + if ( (std::abs((*thisChild)->pdg_id()) == 13) ) { if (fromhiggs) NLeptonsH++; if (fromtop) NLeptonsT++; if (fromhiggs && ((*thisChild)->pdg_id() == -13) ) m_H_WPlus_m++; diff --git a/Generators/GeneratorFilters/src/XtoVVDecayFilter.cxx b/Generators/GeneratorFilters/src/XtoVVDecayFilter.cxx index 0d496ff78154..f9f91c64e77c 100644 --- a/Generators/GeneratorFilters/src/XtoVVDecayFilter.cxx +++ b/Generators/GeneratorFilters/src/XtoVVDecayFilter.cxx @@ -55,7 +55,7 @@ StatusCode XtoVVDecayFilter::filterEvent() { // Loop over all particles in the event const HepMC::GenEvent* genEvt = (*itr); for (auto pitr: *genEvt) { - if ( abs(pitr->pdg_id()) != m_PDGParent || pitr->status() != m_StatusParent) continue; + if ( std::abs(pitr->pdg_id()) != m_PDGParent || pitr->status() != m_StatusParent) continue; bool isGrandParentOK = false; #ifdef HEPMC3 auto firstMother = pitr->production_vertex()->particles_in().begin(); @@ -103,12 +103,12 @@ void XtoVVDecayFilter::FindAncestor(HepMC::ConstGenVertexPtr searchvertex, #endif for ( auto thisAncestor = firstAncestor; thisAncestor != endAncestor; ++thisAncestor){ //ATH_MSG_DEBUG(" child " << (*thisAncestor)->pdg_id()); - if (abs((*thisAncestor)->pdg_id()) == targetPDGID) { //same particle as parent + if (std::abs((*thisAncestor)->pdg_id()) == targetPDGID) { //same particle as parent FindAncestor((*thisAncestor)->end_vertex(), targetPDGID, okPDGChild1, okPDGChild2); } else { if (!okPDGChild1) { for (size_t i = 0; i < m_PDGChild1.size(); ++i) { - if (abs((*thisAncestor)->pdg_id()) == m_PDGChild1[i]) { + if (std::abs((*thisAncestor)->pdg_id()) == m_PDGChild1[i]) { okPDGChild1 = true; break; } @@ -117,7 +117,7 @@ void XtoVVDecayFilter::FindAncestor(HepMC::ConstGenVertexPtr searchvertex, } if (!okPDGChild2) { for (size_t i = 0; i < m_PDGChild2.size(); ++i) { - if (abs((*thisAncestor)->pdg_id()) == m_PDGChild2[i]) { + if (std::abs((*thisAncestor)->pdg_id()) == m_PDGChild2[i]) { okPDGChild2 = true; break; } diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx index deee70416c6e..20ada766f826 100755 --- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx @@ -233,10 +233,6 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart, ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const { - using std::abs; - using std::sqrt; - using std::pow; - DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part; HepMC::GenParticlePtr p = poolOfParticles.nextElementPtr(); p->m_pdg_id = persPart.m_pdgId; @@ -256,7 +252,7 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart, p->m_momentum.setPx( persPart.m_px ); p->m_momentum.setPy( persPart.m_py ); p->m_momentum.setPz( persPart.m_pz ); - double temp_e = sqrt( (long double)(persPart.m_px)*persPart.m_px + + double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + (long double)(persPart.m_m) *persPart.m_m ); @@ -264,7 +260,7 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart, } else { const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 ); const double persPart_ene = - sqrt( abs((long double)(persPart.m_px)*persPart.m_px + + std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + signM2* (long double)(persPart.m_m)* persPart.m_m)); diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx index c9fd90e17b92..75a8fa2a8bf4 100755 --- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx @@ -343,10 +343,6 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart, ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const { - using std::abs; - using std::sqrt; - using std::pow; - DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part; HepMC::GenParticlePtr p(0); if (m_isPileup) @@ -380,7 +376,7 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart, p->m_momentum.setPx( persPart.m_px); p->m_momentum.setPy( persPart.m_py); p->m_momentum.setPz( persPart.m_pz); - double temp_e = sqrt( (long double)(persPart.m_px)*persPart.m_px + + double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + (long double)(persPart.m_m) *persPart.m_m ); @@ -390,7 +386,7 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart, { const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 ); const double persPart_ene = - sqrt( abs((long double)(persPart.m_px)*persPart.m_px + + std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + signM2* (long double)(persPart.m_m)* persPart.m_m)); @@ -460,7 +456,6 @@ void McEventCollectionCnv_p4::writeGenVertex( const HepMC::GenVertex& vtx, int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p, McEventCollection_p4& persEvt ) const { - using std::abs; const HepMC::FourVector& mom = p.m_momentum; const double ene = mom.e(); const double m2 = mom.m2(); @@ -468,7 +463,7 @@ int McEventCollectionCnv_p4::writeGenParticle( const HepMC::GenParticle& p, // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition const bool useP2M2 = !(m2 > 0) && // !isTimelike (m2 < 0) && // isSpacelike - !(abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike + !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike // const bool useP2M2 = !isTimelike () && // mom.isSpacelike() && diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx index a47035f08ec4..8b8666049429 100755 --- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p5.cxx @@ -422,10 +422,6 @@ HepMC::GenParticlePtr McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart, ParticlesMap_t& partToEndVtx, HepMC::DataPool* datapools ) const { - using std::abs; - using std::sqrt; - using std::pow; - DataPool<HepMC::GenParticle>& poolOfParticles = datapools->part; HepMC::GenParticlePtr p(0); if (m_isPileup) { @@ -456,7 +452,7 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart, p->m_momentum.setPx( persPart.m_px); p->m_momentum.setPy( persPart.m_py); p->m_momentum.setPz( persPart.m_pz); - double temp_e = sqrt( (long double)(persPart.m_px)*persPart.m_px + + double temp_e = std::sqrt( (long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + (long double)(persPart.m_m) *persPart.m_m ); @@ -464,7 +460,7 @@ McEventCollectionCnv_p5::createGenParticle( const GenParticle_p5& persPart, } else { const int signM2 = ( persPart.m_m >= 0. ? 1 : -1 ); const double persPart_ene = - sqrt( abs((long double)(persPart.m_px)*persPart.m_px + + std::sqrt( std::abs((long double)(persPart.m_px)*persPart.m_px + (long double)(persPart.m_py)*persPart.m_py + (long double)(persPart.m_pz)*persPart.m_pz + signM2* (long double)(persPart.m_m)* persPart.m_m)); @@ -530,7 +526,6 @@ void McEventCollectionCnv_p5::writeGenVertex( const HepMC::GenVertex& vtx, int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p, McEventCollection_p5& persEvt ) const { - using std::abs; const HepMC::FourVector& mom = p.m_momentum; const double ene = mom.e(); const double m2 = mom.m2(); @@ -538,7 +533,7 @@ int McEventCollectionCnv_p5::writeGenParticle( const HepMC::GenParticle& p, // Definitions of Bool isTimeLilike, isSpacelike and isLightlike according to HepLorentzVector definition const bool useP2M2 = !(m2 > 0) && // !isTimelike (m2 < 0) && // isSpacelike - !(abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike + !(std::abs(m2) < 2.0*DBL_EPSILON*ene*ene); // !isLightlike // const bool useP2M2 = !isTimelike () && // mom.isSpacelike() && diff --git a/Generators/HepMCAnalysis_i/share/RTTrun.C b/Generators/HepMCAnalysis_i/share/RTTrun.C index c827d1a7ec0a..648052831119 100644 --- a/Generators/HepMCAnalysis_i/share/RTTrun.C +++ b/Generators/HepMCAnalysis_i/share/RTTrun.C @@ -7,7 +7,6 @@ #include <typeinfo> #include <stdio.h> #include <string> -using std::string; // Main macro to run - returns 0 in case of success int RTTrun(TString jobOptionFile="", diff --git a/Generators/Hijing_i/Hijing_i/Hijing.h b/Generators/Hijing_i/Hijing_i/Hijing.h index 3a885d50c9ed..bc58ab221d41 100644 --- a/Generators/Hijing_i/Hijing_i/Hijing.h +++ b/Generators/Hijing_i/Hijing_i/Hijing.h @@ -18,7 +18,6 @@ #include "Hijing_i/HiStrng.h" #include "Hijing_i/HijCrdn.h" -using std::string; typedef std::vector<std::string> CommandVector; // new to store hijing event parameters @@ -58,9 +57,9 @@ protected: // inputs to HIJSET (Hijing initialization) ... float m_efrm; - string m_frame; - string m_proj; - string m_targ; + std::string m_frame; + std::string m_proj; + std::string m_targ; int m_iap; int m_iat; int m_izp; diff --git a/Generators/Hydjet_i/Hydjet_i/Hydjet_i.h b/Generators/Hydjet_i/Hydjet_i/Hydjet_i.h index 0e5d2490e0ef..0e8c49b9ce8a 100644 --- a/Generators/Hydjet_i/Hydjet_i/Hydjet_i.h +++ b/Generators/Hydjet_i/Hydjet_i/Hydjet_i.h @@ -36,7 +36,6 @@ #include "Hydjet_i/PySubs.h" #include "Hydjet_i/PyqPar.h" -using std::string; typedef std::vector<std::string> CommandVector; // new to store hydjet event parameters diff --git a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h index a5f8ac5c417b..7ae5814ae2de 100644 --- a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h +++ b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h @@ -24,7 +24,6 @@ typedef HepMC3::Pythia8ToHepMC3 Pythia8ToHepMC; #include <stdexcept> -using std::string; /* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration diff --git a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h index 40cb8a326dde..decd25f0f8c6 100644 --- a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h +++ b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h @@ -13,14 +13,13 @@ namespace Pythia8_UserHooks{ using Pythia8::UserHooks; - using std::string; class UserHooksFactory{ public: - static UserHooks* create(const string &hookName); + static UserHooks* create(const std::string &hookName); private: @@ -39,7 +38,7 @@ namespace Pythia8_UserHooks{ public: - Creator(const string &name){ + Creator(const std::string &name){ m_name = name; UserHooksFactory::s_creators()[name] = this; } @@ -56,7 +55,7 @@ namespace Pythia8_UserHooks{ private: - string m_name; + std::string m_name; }; template<typename T> diff --git a/Generators/Pythia8_i/Pythia8_i/UserProcessFactory.h b/Generators/Pythia8_i/Pythia8_i/UserProcessFactory.h index fe3bb8d825c2..3de2590d9a1e 100644 --- a/Generators/Pythia8_i/Pythia8_i/UserProcessFactory.h +++ b/Generators/Pythia8_i/Pythia8_i/UserProcessFactory.h @@ -16,14 +16,12 @@ namespace Pythia8_UserProcess{ using Pythia8::Sigma2Process; - using std::string; - using std::map; class UserProcessFactory{ public: - static Sigma2Process* create(const string &procName); + static Sigma2Process* create(const std::string &procName); private: @@ -41,7 +39,7 @@ namespace Pythia8_UserProcess{ class Creator: public ICreator{ public: - Creator(const string &name){ + Creator(const std::string &name){ m_name = name; UserProcessFactory::s_creators()[name] = this; } @@ -58,12 +56,12 @@ namespace Pythia8_UserProcess{ private: - string m_name; + std::string m_name; }; private: - static map<string, const ICreator*> &s_creators(); + static std::map<std::string, const ICreator*> &s_creators(); }; } diff --git a/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h b/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h index 32736c4bb005..00818dd9cc08 100644 --- a/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h +++ b/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h @@ -12,8 +12,6 @@ namespace Pythia8_UserResonance{ using Pythia8::ResonanceWidths; - using std::string; - using std::map; class UserResonanceFactory{ @@ -42,7 +40,7 @@ namespace Pythia8_UserResonance{ class Creator: public ICreator{ public: - Creator(const string &name){ + Creator(const std::string &name){ m_name = name; UserResonanceFactory::s_creators()[name] = this; } @@ -59,12 +57,12 @@ namespace Pythia8_UserResonance{ private: - string m_name; + std::string m_name; }; private: - static map<string, const ICreator*> &s_creators(); + static std::map<std::string, const ICreator*> &s_creators(); }; } diff --git a/Generators/Pythia8_i/src/UserHooks/UserSetting.h b/Generators/Pythia8_i/src/UserHooks/UserSetting.h index 70f1e283748e..960c10be2b5c 100644 --- a/Generators/Pythia8_i/src/UserHooks/UserSetting.h +++ b/Generators/Pythia8_i/src/UserHooks/UserSetting.h @@ -14,14 +14,13 @@ namespace Pythia8_UserHooks{ - using std::string; template <class T> class UserSetting{ public: - UserSetting(string name, T defaultValue): + UserSetting(std::string name, T defaultValue): m_paramName(name), m_param(defaultValue), m_settingsPtr(0), @@ -49,7 +48,7 @@ namespace Pythia8_UserHooks{ protected: - string m_paramName; + std::string m_paramName; T m_param; Pythia8::Settings *m_settingsPtr; bool m_retrieved; @@ -81,7 +80,7 @@ namespace Pythia8_UserHooks{ } template<> - inline string UserSetting<string>::uncachedRetrieve(){ + inline std::string UserSetting<string>::uncachedRetrieve(){ if(m_settingsPtr->isWord(m_paramName)){ return m_settingsPtr->word(m_paramName); } diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx index b3d362e651cb..cc31d03416a6 100644 --- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx +++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx @@ -147,7 +147,7 @@ namespace Pythia8 { virtual string name() const {return nameSave;} virtual int code() const {return codeSave;} virtual string inFlux() const {return "qqbarSame";} - virtual int id3Mass() const {return abs(idRes);} + virtual int id3Mass() const {return std::abs(idRes);} //virtual bool convertM2() const {return false;} //true is only suitable for resonance production pp->A->ll //virtual bool convert2mb() const {return true;} diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx index 02c0d32dfa61..8bf48aa84d06 100644 --- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx +++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx @@ -142,8 +142,8 @@ namespace Pythia8 { virtual string name() const {return nameSave;} virtual int code() const {return codeSave;} virtual string inFlux() const {return "qqbarSame";} - virtual int id3Mass() const {return abs(idRes);} - virtual int id4Mass() const {return abs(idRes);} + virtual int id3Mass() const {return std::abs(idRes);} + virtual int id4Mass() const {return std::abs(idRes);} virtual bool convertM2() const {return false;} //true is only suitable for resonance production pp->A->ll virtual bool convert2mb() const {return true;} diff --git a/Generators/Pythia8_i/src/UserResonanceFactory.cxx b/Generators/Pythia8_i/src/UserResonanceFactory.cxx index 04d513c862d2..b6cb54a644f8 100644 --- a/Generators/Pythia8_i/src/UserResonanceFactory.cxx +++ b/Generators/Pythia8_i/src/UserResonanceFactory.cxx @@ -11,12 +11,10 @@ #include <stdexcept> namespace Pythia8_UserResonance{ - - using std::vector; ResonanceWidths *UserResonanceFactory::create(const string &name, int pdgid){ - map<string, const ICreator*>::const_iterator it = s_creators().find(name); + std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name); if(it == s_creators().end()){ //eek! throw std::runtime_error("Pythia 8 UserResonanceFactory: cannot create user resonance " + name); @@ -25,8 +23,8 @@ namespace Pythia8_UserResonance{ } ///static function to instantiate map of string name Vs. creator object on first use - map<string, const UserResonanceFactory::ICreator*> &UserResonanceFactory::s_creators(){ - static map<string, const UserResonanceFactory::ICreator*> creators; + std::map<std::string, const UserResonanceFactory::ICreator*> &UserResonanceFactory::s_creators(){ + static map<std::string, const UserResonanceFactory::ICreator*> creators; return creators; } diff --git a/Generators/Pythia8_i/src/UserResonances/ResonanceExcitedCI.cxx b/Generators/Pythia8_i/src/UserResonances/ResonanceExcitedCI.cxx index 9d9a45f40f34..393261b31652 100644 --- a/Generators/Pythia8_i/src/UserResonances/ResonanceExcitedCI.cxx +++ b/Generators/Pythia8_i/src/UserResonances/ResonanceExcitedCI.cxx @@ -98,7 +98,7 @@ namespace Pythia8{ widNow = preFac * pow2(mHat) / pow2(m_lambda) / 96. / M_PI ; if( id3Abs < 10 ) widNow *= 3.; // quarks in final state. id1 is highest pdgId of f, f' if( id1Abs == id2Abs && id1Abs == id3Abs ){ - if( abs(idRes)-4000000 < 10 ) widNow *= 4./3.; + if( std::abs(idRes)-4000000 < 10 ) widNow *= 4./3.; else widNow *= 2.; } } diff --git a/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx b/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx index 3be8f3770918..3dd70745c403 100644 --- a/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx +++ b/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx @@ -52,7 +52,7 @@ namespace Pythia8{ id1Now = 2; particlePtr->channel(0).product(0, id1Now); } - if (abs(id2Now) < 11 || abs(id2Now) > 16) { + if (std::abs(id2Now) < 11 || std::abs(id2Now) > 16) { std::cout << "ERROR in ResonanceLQ::init:unallowed input lepton flavour reset to e-" << std::endl; id2Now = 11; particlePtr->channel(0).product(1, id2Now); diff --git a/Generators/Starlight_i/Starlight_i/Starlight_i.h b/Generators/Starlight_i/Starlight_i/Starlight_i.h index 1ac829e36e74..a584a96f66b3 100644 --- a/Generators/Starlight_i/Starlight_i/Starlight_i.h +++ b/Generators/Starlight_i/Starlight_i/Starlight_i.h @@ -27,7 +27,6 @@ #include "upcevent.h" #include "inputParameters.h" -using std::string; typedef std::vector<std::string> CommandVector; class StoreGateSvc; -- GitLab From 6bef4c5a5b777c0a530cece175e5c1e04cc500c0 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <averbyts@cern.ch> Date: Sun, 23 Aug 2020 12:03:00 +0200 Subject: [PATCH 2/6] Pythia --- .../Pythia8_i/UserResonanceFactory.h | 2 +- Generators/Pythia8_i/src/Pythia8_i.cxx | 38 +++++++++---------- .../src/UserHooks/PTRelVetoedShower.cxx | 2 +- .../Pythia8_i/src/UserHooks/UserSetting.h | 2 +- .../Pythia8_i/src/UserProcessFactory.cxx | 8 ++-- .../src/UserResonances/ResonanceLQ.cxx | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h b/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h index 00818dd9cc08..401d8f031390 100644 --- a/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h +++ b/Generators/Pythia8_i/Pythia8_i/UserResonanceFactory.h @@ -22,7 +22,7 @@ namespace Pythia8_UserResonance{ * e.g. create("MyResonance", 23) will return a MyResonance instance that will be applied to the Z * */ - static ResonanceWidths* create(const string &name, int pdgid); + static ResonanceWidths* create(const std::string &name, int pdgid); private: diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx index c7ddc100abb6..d6644333287d 100644 --- a/Generators/Pythia8_i/src/Pythia8_i.cxx +++ b/Generators/Pythia8_i/src/Pythia8_i.cxx @@ -138,9 +138,9 @@ StatusCode Pythia8_i::genInitialize() { m_pythia->readString("PDF:pSet= LHAPDF6:cteq6ll.LHpdf"); // have to find any old-style Pythia 8.18x PDF commands and convert them - for(string &cmd : m_commands){ + for(std::string &cmd : m_commands){ try{ - string val = findValue(cmd, "PDF:LHAPDFset"); + std::string val = findValue(cmd, "PDF:LHAPDFset"); if(val != ""){ cmd = "PDF:pSet = LHAPDF6:" + val; }else{ @@ -162,8 +162,8 @@ StatusCode Pythia8_i::genInitialize() { } } - for(const string ¶m : m_userParams){ - std::vector<string> splits; + for(const std::string ¶m : m_userParams){ + std::vector<std::string> splits; boost::split(splits, param, boost::is_any_of("=")); if(splits.size() != 2){ ATH_MSG_ERROR("Cannot interpret user param command: " + param); @@ -175,8 +175,8 @@ StatusCode Pythia8_i::genInitialize() { m_commands+=param; } - for(const string &mode : m_userModes){ - std::vector<string> splits; + for(const std::string &mode : m_userModes){ + std::vector<std::string> splits; boost::split(splits, mode, boost::is_any_of("=")); if(splits.size() != 2){ ATH_MSG_ERROR("Cannot interpret user mode command: " + mode); @@ -189,11 +189,11 @@ StatusCode Pythia8_i::genInitialize() { } // Now apply the settings from the JO - for(const string &cmd : m_commands){ + for(const std::string &cmd : m_commands){ if(cmd.compare("")==0) continue; try{ - string val = findValue(cmd, "Tune:pp"); + std::string val = findValue(cmd, "Tune:pp"); if(val != ""){ int tune = boost::lexical_cast<int>(val); if(tune > s_allowedTunes(m_version)){ @@ -276,7 +276,7 @@ StatusCode Pythia8_i::genInitialize() { if(m_userResonances != ""){ - std::vector<string> resonanceArgs; + std::vector<std::string> resonanceArgs; boost::split(resonanceArgs, m_userResonances, boost::is_any_of(":")); if(resonanceArgs.size() != 2){ @@ -285,7 +285,7 @@ StatusCode Pythia8_i::genInitialize() { ATH_MSG_ERROR("Where name is the name of your UserResonance, and id1,id2,id3 are a comma separated list of PDG IDs to which it is applied"); canInit = false; } - std::vector<string> resonanceIds; + std::vector<std::string> resonanceIds; boost::split(resonanceIds, resonanceArgs.back(), boost::is_any_of(",")); if(resonanceIds.size()==0){ ATH_MSG_ERROR("You did not specifiy any PDG ids to which your user resonance width should be applied!"); @@ -294,7 +294,7 @@ StatusCode Pythia8_i::genInitialize() { canInit=false; } - for(std::vector<string>::const_iterator sId = resonanceIds.begin(); + for(std::vector<std::string>::const_iterator sId = resonanceIds.begin(); sId != resonanceIds.end(); ++sId){ int idResIn = boost::lexical_cast<int>(*sId); m_userResonancePtrs.push_back(Pythia8_UserResonance::UserResonanceFactory::create(resonanceArgs.front(), idResIn)); @@ -466,10 +466,10 @@ StatusCode Pythia8_i::fillEvt(HepMC::GenEvent *evt){ ATH_MSG_DEBUG("Event weights: phase space weight, merging weight, total weight = "<<phaseSpaceWeight<<", "<<mergingWeight<<", "<<eventWeight); std::map<std::string,double> fWeights; - std::vector<string>::const_iterator id = m_weightIDs.begin(); + std::vector<std::string>::const_iterator id = m_weightIDs.begin(); if(m_pythia->info.getWeightsDetailedSize() != 0){ - for(std::map<string, Pythia8::LHAwgt>::const_iterator wgt = m_pythia->info.rwgt->wgts.begin(); + for(std::map<std::string, Pythia8::LHAwgt>::const_iterator wgt = m_pythia->info.rwgt->wgts.begin(); wgt != m_pythia->info.rwgt->wgts.end(); ++wgt){ if(m_internal_event_number == 1){ @@ -550,9 +550,9 @@ StatusCode Pythia8_i::genFinalize(){ if(m_doLHE3Weights || m_weightIDs.size()>1 ){ std::cout<<"MetaData: weights = "; - for(const string &id : m_weightIDs){ + for(const std::string &id : m_weightIDs){ - std::map<string, Pythia8::LHAweight>::const_iterator weight = m_pythia->info.init_weights->find(id); + std::map<std::string, Pythia8::LHAweight>::const_iterator weight = m_pythia->info.init_weights->find(id); if(weight != m_pythia->info.init_weights->end()){ std::cout<<weight->second.contents<<" | "; @@ -572,10 +572,10 @@ double Pythia8_i::pythiaVersion()const{ } //////////////////////////////////////////////////////////////////////////////// -string Pythia8_i::findValue(const string &command, const string &key){ +std::string Pythia8_i::findValue(const std::string &command, const std::string &key){ if(command.find(key) == std::string::npos) return ""; - std::vector<string> splits; + std::vector<std::string> splits; boost::split(splits, command, boost::is_any_of("=")); if(splits.size() != 2){ throw Pythia8_i::CommandException(command); @@ -587,9 +587,9 @@ string Pythia8_i::findValue(const string &command, const string &key){ } //////////////////////////////////////////////////////////////////////////////// -string Pythia8_i::xmlpath(){ +std::string Pythia8_i::xmlpath(){ - string foundpath = ""; + std::string foundpath = ""; // Try to find the xmldoc directory using PathResolver: foundpath = PathResolverFindCalibDirectory( "Pythia8/xmldoc" ); diff --git a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx index 7fa73342dc42..1433e61cbc2a 100644 --- a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx @@ -76,7 +76,7 @@ namespace Pythia8{ if(nPwgOutgoing == m_nPoWHEGFinal) return false; if(nPwgOutgoing != m_nPoWHEGFinal + 1){ - throw std::runtime_error("Wrong number of final state PoWHEG legs: " + boost::lexical_cast<string>(nPwgOutgoing)); + throw std::runtime_error("Wrong number of final state PoWHEG legs: " + boost::lexical_cast<std::string>(nPwgOutgoing)); } // momentum components to boost to CMS frame diff --git a/Generators/Pythia8_i/src/UserHooks/UserSetting.h b/Generators/Pythia8_i/src/UserHooks/UserSetting.h index 960c10be2b5c..97e70eadbc98 100644 --- a/Generators/Pythia8_i/src/UserHooks/UserSetting.h +++ b/Generators/Pythia8_i/src/UserHooks/UserSetting.h @@ -80,7 +80,7 @@ namespace Pythia8_UserHooks{ } template<> - inline std::string UserSetting<string>::uncachedRetrieve(){ + inline std::string UserSetting<std::string>::uncachedRetrieve(){ if(m_settingsPtr->isWord(m_paramName)){ return m_settingsPtr->word(m_paramName); } diff --git a/Generators/Pythia8_i/src/UserProcessFactory.cxx b/Generators/Pythia8_i/src/UserProcessFactory.cxx index 5dbacc6888b8..e4fcd7ab6300 100644 --- a/Generators/Pythia8_i/src/UserProcessFactory.cxx +++ b/Generators/Pythia8_i/src/UserProcessFactory.cxx @@ -8,8 +8,8 @@ namespace Pythia8_UserProcess{ - Sigma2Process *UserProcessFactory::create(const string &name){ - map<string, const ICreator*>::const_iterator it = s_creators().find(name); + Sigma2Process *UserProcessFactory::create(const std::string &name){ + std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name); if(it == s_creators().end()){ //eek! throw std::runtime_error("Pythia 8 UserProcessFactory: cannot create user process " + name); @@ -19,8 +19,8 @@ namespace Pythia8_UserProcess{ } ///static function to instantiate map of string name Vs. creator object on first use - map<string, const UserProcessFactory::ICreator*> &UserProcessFactory::s_creators(){ - static map<string, const UserProcessFactory::ICreator*> creators; + std::map<std::string, const UserProcessFactory::ICreator*> &UserProcessFactory::s_creators(){ + static std::map<std::string, const UserProcessFactory::ICreator*> creators; return creators; } diff --git a/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx b/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx index 3dd70745c403..0e11cbd60528 100644 --- a/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx +++ b/Generators/Pythia8_i/src/UserResonances/ResonanceLQ.cxx @@ -66,7 +66,7 @@ namespace Pythia8{ particlePtr->setChargeType(chargeLQ); - string nameLQ = "LQ_" + particleDataPtr->name(id1Now) + "," + std::string nameLQ = "LQ_" + particleDataPtr->name(id1Now) + "," + particleDataPtr->name(id2Now); particlePtr->setNames(nameLQ, nameLQ + "bar"); -- GitLab From 328cb3c32c04806a61187a7ef92055d0ef586c2d Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <averbyts@cern.ch> Date: Sun, 23 Aug 2020 23:40:45 +0200 Subject: [PATCH 3/6] Fix pythia --- Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h | 2 +- Generators/Pythia8_i/src/Pythia8_i.cxx | 8 ++++---- Generators/Pythia8_i/src/UserHooksFactory.cxx | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h index decd25f0f8c6..b1b1fbc53495 100644 --- a/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h +++ b/Generators/Pythia8_i/Pythia8_i/UserHooksFactory.h @@ -67,7 +67,7 @@ namespace Pythia8_UserHooks{ private: - static std::map<string, const ICreator*> &s_creators(); + static std::map<std::string, const ICreator*> &s_creators(); }; diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx index d6644333287d..4d322184a9eb 100644 --- a/Generators/Pythia8_i/src/Pythia8_i.cxx +++ b/Generators/Pythia8_i/src/Pythia8_i.cxx @@ -330,9 +330,9 @@ StatusCode Pythia8_i::genInitialize() { } }else{ canInit = canInit && m_pythia->readString("Beams:frameType = 1"); - canInit = canInit && m_pythia->readString("Beams:idA = " + boost::lexical_cast<string>(beam1)); - canInit = canInit && m_pythia->readString("Beams:idB = " + boost::lexical_cast<string>(beam2)); - canInit = canInit && m_pythia->readString("Beams:eCM = " + boost::lexical_cast<string>(m_collisionEnergy)); + canInit = canInit && m_pythia->readString("Beams:idA = " + boost::lexical_cast<std::string>(beam1)); + canInit = canInit && m_pythia->readString("Beams:idB = " + boost::lexical_cast<std::string>(beam2)); + canInit = canInit && m_pythia->readString("Beams:eCM = " + boost::lexical_cast<std::string>(m_collisionEnergy)); } if(m_procPtr != 0){ @@ -483,7 +483,7 @@ StatusCode Pythia8_i::fillEvt(HepMC::GenEvent *evt){ ++id; } - std::map<string, Pythia8::LHAweight>::const_iterator weightName = m_pythia->info.init_weights->find(wgt->first); + std::map<std::string, Pythia8::LHAweight>::const_iterator weightName = m_pythia->info.init_weights->find(wgt->first); if(weightName != m_pythia->info.init_weights->end()){ fWeights[weightName->second.contents] = mergingWeight * wgt->second.contents; }else{ diff --git a/Generators/Pythia8_i/src/UserHooksFactory.cxx b/Generators/Pythia8_i/src/UserHooksFactory.cxx index 83d65314dbf7..a3d199997ab3 100644 --- a/Generators/Pythia8_i/src/UserHooksFactory.cxx +++ b/Generators/Pythia8_i/src/UserHooksFactory.cxx @@ -8,7 +8,7 @@ namespace Pythia8_UserHooks{ UserHooks *UserHooksFactory::create(const string &name){ - std::map<string, const ICreator*>::const_iterator it = s_creators().find(name); + std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name); if(it == s_creators().end()){ //eek! throw std::runtime_error("Pythia 8 UserHooksFactory: cannot create user hook " + name); @@ -17,8 +17,8 @@ namespace Pythia8_UserHooks{ } ///static function to instantiate map of string name Vs. creator object on first use - std::map<string, const UserHooksFactory::ICreator*> &UserHooksFactory::s_creators(){ - static std::map<string, const UserHooksFactory::ICreator*> creators; + std::map<std::string, const UserHooksFactory::ICreator*> &UserHooksFactory::s_creators(){ + static std::map<std::string, const UserHooksFactory::ICreator*> creators; return creators; } -- GitLab From 1c907ab8e83a2088103943e0cfd5ad6fe7001dcc Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <averbyts@cern.ch> Date: Mon, 24 Aug 2020 10:32:59 +0200 Subject: [PATCH 4/6] Fix two more strings --- Generators/Pythia8_i/src/Pythia8_i.cxx | 2 +- Generators/Pythia8_i/src/UserHooksFactory.cxx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx index 4d322184a9eb..2dbfd77f6133 100644 --- a/Generators/Pythia8_i/src/Pythia8_i.cxx +++ b/Generators/Pythia8_i/src/Pythia8_i.cxx @@ -49,7 +49,7 @@ std::string py8version() //////////////////////////////////////////////////////////////////////////////// -Pythia8_i::Pythia8_i(const string &name, ISvcLocator *pSvcLocator) +Pythia8_i::Pythia8_i(const std::string &name, ISvcLocator *pSvcLocator) : GenModule(name, pSvcLocator), m_internal_event_number(0), m_version(-1.), diff --git a/Generators/Pythia8_i/src/UserHooksFactory.cxx b/Generators/Pythia8_i/src/UserHooksFactory.cxx index a3d199997ab3..34e04bed03fc 100644 --- a/Generators/Pythia8_i/src/UserHooksFactory.cxx +++ b/Generators/Pythia8_i/src/UserHooksFactory.cxx @@ -7,10 +7,9 @@ */ namespace Pythia8_UserHooks{ - UserHooks *UserHooksFactory::create(const string &name){ + UserHooks *UserHooksFactory::create(const std::string &name){ std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name); if(it == s_creators().end()){ - //eek! throw std::runtime_error("Pythia 8 UserHooksFactory: cannot create user hook " + name); } return it->second->create(); -- GitLab From 191f492bc2e64d69f5dda98326e8e208385c1b01 Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de> Date: Mon, 24 Aug 2020 12:29:11 +0200 Subject: [PATCH 5/6] Fix more Pythia8 --- .../Pythia8_i/src/UserHooks/ISRVetoedShower.cxx | 2 +- .../Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx | 2 +- .../Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx | 2 +- Generators/Pythia8_i/src/UserHooks/PowhegBB4L.cxx | 12 ++++++------ .../Pythia8_i/src/UserHooks/QCDVetoedShower.cxx | 2 +- .../Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx | 4 ++-- .../src/UserProcesses/Sigma2qqbar2lStarlBar.cxx | 6 +++--- .../src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx | 6 +++--- Generators/Pythia8_i/src/UserResonanceFactory.cxx | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx index 8aa845e09e20..eb45b23e70a9 100644 --- a/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx @@ -67,7 +67,7 @@ namespace Pythia8{ double pzCMS = 0.; double eCMS = 0.; - vector<Particle> powhegLegs; + std::vector<Particle> powhegLegs; // Find the entries corresponding to outgoing legs from PoWHEG // start the loop at 1, since entry 0 represents the event as a whole diff --git a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx index 1433e61cbc2a..3d25262b9693 100644 --- a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx @@ -86,7 +86,7 @@ namespace Pythia8{ double eCMS = 0.; // The outgoing powheg legs - vector<Particle> powhegLegs; + std::vector<Particle> powhegLegs; // Find the entries corresponding to outgoing legs from PoWHEG // start the loop at 1, since entry 0 represents the event as a whole diff --git a/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx index cce7c4451afc..b046e9c5f260 100644 --- a/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx @@ -66,7 +66,7 @@ namespace Pythia8{ double pzCMS = 0.; double eCMS = 0.; - vector<Particle> powhegLegs; + std::vector<Particle> powhegLegs; // Find the entries corresponding to outgoing legs from PoWHEG // start the loop at 1, since entry 0 represents the event as a whole diff --git a/Generators/Pythia8_i/src/UserHooks/PowhegBB4L.cxx b/Generators/Pythia8_i/src/UserHooks/PowhegBB4L.cxx index 9ee0d643c531..e46661d89467 100644 --- a/Generators/Pythia8_i/src/UserHooks/PowhegBB4L.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PowhegBB4L.cxx @@ -87,7 +87,7 @@ public: // id wildcard is specified as 0 if match is obtained, the positions and the momenta of these particles are returned in vectors `positions` and `momenta` // respectively // if exitOnExtraLegs==true, it will exit if the decay has more particles than expected, but not less - inline bool match_decay(int iparticle, const Event &e, const vector<int> &ids, vector<int> &positions, vector<Vec4> &momenta, bool exitOnExtraLegs = true){ + inline bool match_decay(int iparticle, const Event &e, const std::vector<int> &ids, std::vector<int> &positions, std::vector<Vec4> &momenta, bool exitOnExtraLegs = true){ // compare sizes if (e[iparticle].daughterList().size() != ids.size()) { if (exitOnExtraLegs && e[iparticle].daughterList().size() > ids.size()) exit(-1); @@ -156,11 +156,11 @@ public: vector<int> positions; // 1.) t > b W - if ( match_decay(i_top, e, vector<int> {wid, bid}, positions, momenta, false) ) { + if ( match_decay(i_top, e, std::vector<int> {wid, bid}, positions, momenta, false) ) { double h; int i_b = positions[1]; // a.+b.) b > 3 or b > b g - if ( match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) ) + if ( match_decay(i_b, e, std::vector<int> {bid, gid}, positions, momenta) ) h = qSplittingScale(e[i_top].p(), momenta[0], momenta[1]); // c.) b > other else @@ -168,17 +168,17 @@ public: return h; } // 2.) t > b W g - else if ( match_decay(i_top, e, vector<int> {wid, bid, gid}, positions, momenta, false) ) { + else if ( match_decay(i_top, e, std::vector<int> {wid, bid, gid}, positions, momenta, false) ) { double h1, h2; int i_b = positions[1], i_g = positions[2]; // a.+b.) b > 3 or b > b g - if ( match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) ) + if ( match_decay(i_b, e, std::vector<int> {bid, gid}, positions, momenta) ) h1 = qSplittingScale(e[i_top].p(), momenta[0], momenta[1]); // c.) b > other else h1 = -1; // i.+ii.) g > 3 or g > 2 - if ( match_decay(i_g, e, vector<int> {wildcard, wildcard}, positions, momenta) ) + if ( match_decay(i_g, e, std::vector<int> {wildcard, wildcard}, positions, momenta) ) h2 = gSplittingScale(e[i_top].p(), momenta[0], momenta[1]); // c.) b > other else diff --git a/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx index fa2c01aac40b..9367c9d99d6e 100644 --- a/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx @@ -132,7 +132,7 @@ namespace Pythia8{ double m_powhegScale; // Indices of the PoWHEG legs in the event record - vector<size_t> m_powhegLegs; + std::vector<size_t> m_powhegLegs; }; } diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx index c23d6288e5c1..733751247297 100644 --- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx +++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2emu.cxx @@ -106,10 +106,10 @@ namespace Pythia8 { } // Info on the subprocess. - string name() const {return "q qbar -> e mu (t:squark)";} + std::string name() const {return "q qbar -> e mu (t:squark)";} //cab Need Codes for q qbar -> e+- mu-+ int code() const {return 10001;} - string inFlux() const {return "qq";} + std::string inFlux() const {return "qq";} //cab It looks like here is where the final state is specified //cab electrons are +-11, muons are +-13 int id3Mass() const {return 11;} diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx index cc31d03416a6..eef31521ec55 100644 --- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx +++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlBar.cxx @@ -144,9 +144,9 @@ namespace Pythia8 { } // Info on the subprocess. - virtual string name() const {return nameSave;} + virtual std::string name() const {return nameSave;} virtual int code() const {return codeSave;} - virtual string inFlux() const {return "qqbarSame";} + virtual std::string inFlux() const {return "qqbarSame";} virtual int id3Mass() const {return std::abs(idRes);} //virtual bool convertM2() const {return false;} //true is only suitable for resonance production pp->A->ll @@ -154,7 +154,7 @@ namespace Pythia8 { // Parameters set at initialization or for current kinematics. int idl, idRes, codeSave; - string nameSave; + std::string nameSave; double Lambda, preFac, openFracPos, openFracNeg, sigma; double m2ResTimes4; }; diff --git a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx index 8bf48aa84d06..a41ce65a2005 100644 --- a/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx +++ b/Generators/Pythia8_i/src/UserProcesses/Sigma2qqbar2lStarlStarBar.cxx @@ -139,9 +139,9 @@ namespace Pythia8 { } // Info on the subprocess. - virtual string name() const {return nameSave;} + virtual std::string name() const {return nameSave;} virtual int code() const {return codeSave;} - virtual string inFlux() const {return "qqbarSame";} + virtual std::string inFlux() const {return "qqbarSame";} virtual int id3Mass() const {return std::abs(idRes);} virtual int id4Mass() const {return std::abs(idRes);} @@ -150,7 +150,7 @@ namespace Pythia8 { // Parameters set at initialization or for current kinematics. int idl, idRes, codeSave; - string nameSave; + std::string nameSave; double Lambda, preFac, openFracPos, openFracNeg, sigma; double m2ResTimes4; }; diff --git a/Generators/Pythia8_i/src/UserResonanceFactory.cxx b/Generators/Pythia8_i/src/UserResonanceFactory.cxx index b6cb54a644f8..b0c784cdb251 100644 --- a/Generators/Pythia8_i/src/UserResonanceFactory.cxx +++ b/Generators/Pythia8_i/src/UserResonanceFactory.cxx @@ -12,7 +12,7 @@ namespace Pythia8_UserResonance{ - ResonanceWidths *UserResonanceFactory::create(const string &name, int pdgid){ + ResonanceWidths *UserResonanceFactory::create(const std::string &name, int pdgid){ std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name); if(it == s_creators().end()){ @@ -24,7 +24,7 @@ namespace Pythia8_UserResonance{ ///static function to instantiate map of string name Vs. creator object on first use std::map<std::string, const UserResonanceFactory::ICreator*> &UserResonanceFactory::s_creators(){ - static map<std::string, const UserResonanceFactory::ICreator*> creators; + static std::map<std::string, const UserResonanceFactory::ICreator*> creators; return creators; } -- GitLab From a13eaf7219ba130e3cabd1517ffa3e9165d5465a Mon Sep 17 00:00:00 2001 From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de> Date: Mon, 24 Aug 2020 12:32:30 +0200 Subject: [PATCH 6/6] Fix more Pythia8 --- Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx | 8 ++++---- Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx | 8 ++++---- Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx | 8 ++++---- Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx index eb45b23e70a9..5a5c5f2e2d2f 100644 --- a/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/ISRVetoedShower.cxx @@ -89,7 +89,7 @@ namespace Pythia8{ // compare the pT of each leg to the powheg scale. // Set the scale to the lowest (or leave the scale unchanged if it is already lower) - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT(); } @@ -100,19 +100,19 @@ namespace Pythia8{ pzCMS *= norm; // boost all outgoing legs to the CMS frame - for(vector<Particle>::iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ leg->bst(pxCMS, pyCMS, pzCMS); } - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT(); // calculate the pT relative to each other leg // if any such pT is lower than the current scale, reset the scale to that value - for(vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); + for(std::vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); otherLeg != powhegLegs.end(); ++otherLeg){ if(otherLeg == leg) continue; diff --git a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx index 3d25262b9693..be1e8dd5b049 100644 --- a/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PTRelVetoedShower.cxx @@ -113,7 +113,7 @@ namespace Pythia8{ // compare the pT of each leg to the powheg scale. // Set the scale to the lowest - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ double pTTmp = leg->pT(); if(pTTmp < m_powhegScale )m_powhegScale = pTTmp; @@ -126,16 +126,16 @@ namespace Pythia8{ m_pzCMS *= norm; // ...and boost all outgoing legs to that frame - for(vector<Particle>::iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ leg->bst(m_pxCMS, m_pyCMS, m_pzCMS); } - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ // calculate the pT relative to each other leg // if any such pT is lower than the current scale, reset the scale to that value - for(vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); + for(std::vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); otherLeg != powhegLegs.end(); ++otherLeg){ if(otherLeg == leg) continue; diff --git a/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx index b046e9c5f260..3805bf7feaad 100644 --- a/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/PoWHEGVetoedShower.cxx @@ -88,7 +88,7 @@ namespace Pythia8{ // compare the pT of each leg to the powheg scale. // Set the scale to the lowest (or leave the scale unchanged if it is already lower) - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT(); } @@ -99,19 +99,19 @@ namespace Pythia8{ pzCMS *= norm; // boost all outgoing legs to the CMS frame - for(vector<Particle>::iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ leg->bst(pxCMS, pyCMS, pzCMS); } - for(vector<Particle>::const_iterator leg=powhegLegs.begin(); + for(std::vector<Particle>::const_iterator leg=powhegLegs.begin(); leg != powhegLegs.end(); ++leg){ if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT(); // calculate the pT relative to each other leg // if any such pT is lower than the current scale, reset the scale to that value - for(vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); + for(std::vector<Particle>::const_iterator otherLeg = powhegLegs.begin(); otherLeg != powhegLegs.end(); ++otherLeg){ if(otherLeg == leg) continue; diff --git a/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx b/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx index 9367c9d99d6e..6a220d8ef503 100644 --- a/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx +++ b/Generators/Pythia8_i/src/UserHooks/QCDVetoedShower.cxx @@ -122,7 +122,7 @@ namespace Pythia8{ // determine pT relative to each outgoing PoWHEG leg and veto if above veto scale - for(vector<size_t>::const_iterator legIndex = m_powhegLegs.begin(); + for(std::vector<size_t>::const_iterator legIndex = m_powhegLegs.begin(); legIndex != m_powhegLegs.end(); ++legIndex){ if(Pythia8_UserHooks::pTLeg(emission, *legIndex, evt) > m_powhegScale)return true; -- GitLab