diff --git a/DDCore/src/plugins/CodeGenerator.cpp b/DDCore/src/plugins/CodeGenerator.cpp index d9044132b1e1f15fe8e3a153df23690240cb1346..349efcf35b094857b0ffe6f03e8dfb9623c24af0 100644 --- a/DDCore/src/plugins/CodeGenerator.cpp +++ b/DDCore/src/plugins/CodeGenerator.cpp @@ -667,9 +667,8 @@ static long generate_cxx(Detector& description, int argc, char** argv) { for(int i=0; i<argc; ++i) { char c = ::tolower(argv[i][0]); - char* p = argv[i]; - if ( c == '-' ) { ++p; c = ::tolower(argv[i][1]); } - if ( c == '-' ) { ++p; c = ::tolower(argv[i][1]); } + if ( c == '-' ) { c = ::tolower(argv[i][1]); } + if ( c == '-' ) { c = ::tolower(argv[i][1]); } if ( c == 'o' && i+1<argc ) output = argv[++i]; else if ( c == 'f' && i+1<argc ) diff --git a/DDCore/src/plugins/TGeoCodeGenerator.cpp b/DDCore/src/plugins/TGeoCodeGenerator.cpp index ea560ea128ecd07d52a540015ad9d1f76d2fcec6..de4e2c91e03243991b0474ef083a80d133ae310b 100644 --- a/DDCore/src/plugins/TGeoCodeGenerator.cpp +++ b/DDCore/src/plugins/TGeoCodeGenerator.cpp @@ -536,9 +536,8 @@ static long generate_cxx(Detector& description, int argc, char** argv) { for(int i=0; i<argc; ++i) { char c = ::tolower(argv[i][0]); - char* p = argv[i]; - if ( c == '-' ) { ++p; c = ::tolower(argv[i][1]); } - if ( c == '-' ) { ++p; c = ::tolower(argv[i][1]); } + if ( c == '-' ) { c = ::tolower(argv[i][1]); } + if ( c == '-' ) { c = ::tolower(argv[i][1]); } if ( c == 'o' && i+1<argc ) output = argv[++i]; else if ( c == 'f' && i+1<argc ) diff --git a/DDDigi/src/DigiSegmentSplitter.cpp b/DDDigi/src/DigiSegmentSplitter.cpp index c3486b780bb0c31a7ace6608c1458400b09bafa1..092eeef949cada2370e23772ef3154d507ba5e5f 100644 --- a/DDDigi/src/DigiSegmentSplitter.cpp +++ b/DDDigi/src/DigiSegmentSplitter.cpp @@ -87,7 +87,6 @@ std::vector<std::string> DigiSegmentSplitter::collection_names() const { /// Initialization function void DigiSegmentSplitter::initialize() { char text[256]; - std::size_t count = 0; m_split_tool.set_detector(m_detector_name); m_keys = m_split_tool.collection_keys(); @@ -135,7 +134,6 @@ void DigiSegmentSplitter::initialize() { auto* w = new worker_t(proc, m_split_context); w->options.enable(id); m_workers.insert(w); - ++count; } info("+++ Detector splitter is now fully initialized!"); } diff --git a/DDEve/src/ElementList.cpp b/DDEve/src/ElementList.cpp index caaaa5ed5d154f94649a98f31c0f71bfbc0835e9..23c01ba20df5d0731393ff6510b90e5fdf20805e 100644 --- a/DDEve/src/ElementList.cpp +++ b/DDEve/src/ElementList.cpp @@ -55,8 +55,8 @@ TEveElementList* ElementList::CloneElement() const { /// Instantiator ElementListContextMenu& ElementListContextMenu::install(Display* disp) { - static ElementListContextMenu s(disp); - return s; + static ElementListContextMenu menu(disp); + return menu; } /// Initializing constructor diff --git a/DDEve/src/ParticleActors.cpp b/DDEve/src/ParticleActors.cpp index 71b5f0284ba2855f14223f24139f1a9d4f2eec7b..f6057710923887171ce9711e14def1952e04df47 100644 --- a/DDEve/src/ParticleActors.cpp +++ b/DDEve/src/ParticleActors.cpp @@ -89,13 +89,11 @@ void MCParticleCreator::addCompound(const std::string& name, TEveLine* e) { void MCParticleCreator::addCompoundLight(const std::string& name, TEveLine* e) { Compounds::const_iterator i = types.find(name); if ( i == types.end() ) { - static int icol = 0; TEveCompound* o = new TEveCompound(name.c_str(),name.c_str()); particles->AddElement(o); i = types.emplace(name,o).first; o->SetMainColor(kBlack); o->CSCApplyMainColorToAllChildren(); - ++icol; } TEveCompound* c = (*i).second; e->SetLineWidth(1); diff --git a/DDG4/plugins/Geant4EventReaderHepMC.cpp b/DDG4/plugins/Geant4EventReaderHepMC.cpp index a761ad0a2778db7845864a731606bacf87cb1ef2..f83978fa37bb4576b393df51b1d7da6cae950f53 100644 --- a/DDG4/plugins/Geant4EventReaderHepMC.cpp +++ b/DDG4/plugins/Geant4EventReaderHepMC.cpp @@ -728,17 +728,13 @@ void HepMC::EventStream::clear() { bool HepMC::EventStream::read() { EventStream& info = *this; bool event_read = false; - static int num_evt = 0; - int num_line = 0, num_line_accepted = 0; detail::releaseObjects(vertices()); detail::releaseObjects(particles()); - ++num_evt; while( instream.good() ) { char value = instream.peek(); std::istringstream input_line; - ++num_line; if ( value == 'E' && event_read ) break; else if ( instream.eof() && event_read ) @@ -755,7 +751,6 @@ bool HepMC::EventStream::read() { if( !input_line || value < 0 ) goto Skip; - ++num_line_accepted; switch( value ) { case 'H': { int iotype = 0; diff --git a/DDG4/src/Geant4ParticleHandler.cpp b/DDG4/src/Geant4ParticleHandler.cpp index 5011528f6f7b3ea2782765465bc8187856a4bf52..b0a9353b8c9d8d1b67fdd82e238ea6f808753184 100644 --- a/DDG4/src/Geant4ParticleHandler.cpp +++ b/DDG4/src/Geant4ParticleHandler.cpp @@ -37,7 +37,6 @@ // C/C++ include files #include <set> -#include <stdexcept> #include <algorithm> using namespace dd4hep::sim; @@ -508,11 +507,11 @@ void Geant4ParticleHandler::rebaseSimulatedTracks(int ) { Geant4ParticleHandle p = (*ipar).second; equivalents[(*ie).first] = p->id; // requires (1) to be filled properly! const G4ParticleDefinition* def = p.definition(); - int pdg = int(fabs(def->GetPDGEncoding())+0.1); + int pdg = int(std::abs(def->GetPDGEncoding())+0.1); if ( pdg != 0 && pdg<36 && !(pdg > 10 && pdg < 17) && pdg != 22 ) { error("+++ ERROR: Geant4 particle for track:%d last known is:%d -- is gluon or quark!",equiv,g4_equiv); } - pdg = int(fabs(p->pdgID)+0.1); + pdg = int(std::abs(p->pdgID)+0.1); if ( pdg != 0 && pdg<36 && !(pdg > 10 && pdg < 17) && pdg != 22 ) { error("+++ ERROR(2): Geant4 particle for track:%d last known is:%d -- is gluon or quark!",equiv,g4_equiv); } diff --git a/UtilityApps/src/materialBudget.cpp b/UtilityApps/src/materialBudget.cpp index 47960495f4354ca283df19cc9cac04666fd5a63a..8bfc6b5004a5f15c3c36dcd4601addc51850b5ea 100644 --- a/UtilityApps/src/materialBudget.cpp +++ b/UtilityApps/src/materialBudget.cpp @@ -217,14 +217,15 @@ int main_wrapper(int argc, char** argv) { for(int i=0 ; i< nbins ;++i){ double theta = ( etaMax > 0. ? 2. * atan ( exp ( - ( etaMin + (0.5+i)*dEta) ) ) : ( thetaMin + (0.5+i)*dTheta ) ) ; - std::stringstream line; + std::stringstream paramLine; - line << std::scientific << theta << " " ; + paramLine << std::scientific << theta << " " ; for( auto& det : subdets ) { Vector3D p0 = pointOnCylinder( theta, det.r0 , det.z0 , phi0 ) ;// double theta, double r, double z, double phi) Vector3D p1 = pointOnCylinder( theta, det.r1 , det.z1 , phi0 ) ;// double theta, double r, double z, double phi) const MaterialVec& materials = matMgr.materialsBetween(p0, p1); - double sum_x0(0.), sum_lambda(0.),path_length(0.); + double sum_x0(0.), sum_lambda(0.); + // double path_length(0.); for( auto amat : materials ) { TGeoMaterial* mat = amat.first->GetMaterial(); @@ -233,15 +234,15 @@ int main_wrapper(int argc, char** argv) { sum_x0 += nx0; double nLambda = length / mat->GetIntLen(); sum_lambda += nLambda; - path_length += length; + // path_length += length; } double binX = ( etaMax > 0. ? (etaMin + (0.5+i)*dEta) : -theta/M_PI*180. ) ; det.hx->Fill( binX , sum_x0 ) ; det.hl->Fill( binX , sum_lambda ) ; - line << std::scientific << sum_x0 << " " << sum_lambda << " " ; // << path_length ; + paramLine << std::scientific << sum_x0 << " " << sum_lambda << " " ; // << path_length ; } - std::cout << line.str() << std::endl; + std::cout << paramLine.str() << std::endl; } std::cout << "====================================================================================================" << std::endl ; rootFile->Write();