diff --git a/SimG4CMS/Calo/interface/CaloSD.h b/SimG4CMS/Calo/interface/CaloSD.h index 1e3a750b88c3b..b86e0c6785e83 100644 --- a/SimG4CMS/Calo/interface/CaloSD.h +++ b/SimG4CMS/Calo/interface/CaloSD.h @@ -50,7 +50,7 @@ class CaloSD : public SensitiveCaloDetector, public: CaloSD(G4String aSDname, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager*, int tSlice=1, bool ignoreTkID=false); virtual ~CaloSD(); diff --git a/SimG4CMS/Calo/interface/CaloTrkProcessing.h b/SimG4CMS/Calo/interface/CaloTrkProcessing.h index 593338db80e65..b35d4b33df807 100644 --- a/SimG4CMS/Calo/interface/CaloTrkProcessing.h +++ b/SimG4CMS/Calo/interface/CaloTrkProcessing.h @@ -26,7 +26,7 @@ class CaloTrkProcessing : public SensitiveCaloDetector, public: CaloTrkProcessing(G4String aSDname, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager*); virtual ~CaloTrkProcessing(); virtual void Initialize(G4HCofThisEvent * ) {} diff --git a/SimG4CMS/Calo/interface/ECalSD.h b/SimG4CMS/Calo/interface/ECalSD.h index 9c9d850deb5b3..7d212e31e14d2 100644 --- a/SimG4CMS/Calo/interface/ECalSD.h +++ b/SimG4CMS/Calo/interface/ECalSD.h @@ -27,7 +27,7 @@ class ECalSD : public CaloSD { public: - ECalSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, + ECalSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const & p, const SimTrackManager*); virtual ~ECalSD(); virtual double getEnergyDeposit(G4Step*); diff --git a/SimG4CMS/Calo/interface/HCalSD.h b/SimG4CMS/Calo/interface/HCalSD.h index 0fe0bc5110081..44bfabadd1b27 100644 --- a/SimG4CMS/Calo/interface/HCalSD.h +++ b/SimG4CMS/Calo/interface/HCalSD.h @@ -34,7 +34,7 @@ class HCalSD : public CaloSD { public: - HCalSD(G4String , const DDCompactView &, SensitiveDetectorCatalog &, + HCalSD(G4String , const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~HCalSD(); virtual bool ProcessHits(G4Step * , G4TouchableHistory * ); diff --git a/SimG4CMS/Calo/src/CaloSD.cc b/SimG4CMS/Calo/src/CaloSD.cc index 19e7018870ba9..a31043115bc4b 100644 --- a/SimG4CMS/Calo/src/CaloSD.cc +++ b/SimG4CMS/Calo/src/CaloSD.cc @@ -22,7 +22,7 @@ //#define DebugLog CaloSD::CaloSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager, int tSlice, bool ignoreTkID) : SensitiveCaloDetector(name, cpv, clg, p), @@ -87,9 +87,9 @@ CaloSD::CaloSD(G4String name, const DDCompactView & cpv, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); it !=lvNames.end(); ++it) { + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); ++it) { this->AssignSD(*it); #ifdef DebugLog LogDebug("CaloSim") << "CaloSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/Calo/src/CaloTrkProcessing.cc b/SimG4CMS/Calo/src/CaloTrkProcessing.cc index a96053385e083..9574379e48b3f 100644 --- a/SimG4CMS/Calo/src/CaloTrkProcessing.cc +++ b/SimG4CMS/Calo/src/CaloTrkProcessing.cc @@ -25,7 +25,7 @@ CaloTrkProcessing::CaloTrkProcessing(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveCaloDetector(name, cpv, clg, p), lastTrackID(-1), diff --git a/SimG4CMS/Calo/src/ECalSD.cc b/SimG4CMS/Calo/src/ECalSD.cc index c5be4a2f08c1c..09c5719ea2fe6 100644 --- a/SimG4CMS/Calo/src/ECalSD.cc +++ b/SimG4CMS/Calo/src/ECalSD.cc @@ -37,7 +37,7 @@ bool any(const std::vector & v, const T &what) } ECalSD::ECalSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager, p.getParameter("ECalSD").getParameter("TimeSliceUnit"), diff --git a/SimG4CMS/Calo/src/HCalSD.cc b/SimG4CMS/Calo/src/HCalSD.cc index ed45bd406b27e..58654a44d3da8 100644 --- a/SimG4CMS/Calo/src/HCalSD.cc +++ b/SimG4CMS/Calo/src/HCalSD.cc @@ -36,7 +36,7 @@ //#define plotDebug HCalSD::HCalSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager, p.getParameter("HCalSD").getParameter("TimeSliceUnit"), diff --git a/SimG4CMS/CherenkovAnalysis/interface/DreamSD.h b/SimG4CMS/CherenkovAnalysis/interface/DreamSD.h index 5ea14d866d934..c49d3016f56d8 100644 --- a/SimG4CMS/CherenkovAnalysis/interface/DreamSD.h +++ b/SimG4CMS/CherenkovAnalysis/interface/DreamSD.h @@ -20,7 +20,7 @@ class DreamSD : public CaloSD { public: - DreamSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, + DreamSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~DreamSD() {} virtual bool ProcessHits(G4Step * step,G4TouchableHistory * tHistory); diff --git a/SimG4CMS/CherenkovAnalysis/src/DreamSD.cc b/SimG4CMS/CherenkovAnalysis/src/DreamSD.cc index 1f5ad4f989e1a..f1fcc810fd995 100644 --- a/SimG4CMS/CherenkovAnalysis/src/DreamSD.cc +++ b/SimG4CMS/CherenkovAnalysis/src/DreamSD.cc @@ -27,7 +27,7 @@ //________________________________________________________________________________________ DreamSD::DreamSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager) { diff --git a/SimG4CMS/EcalTestBeam/interface/EcalTBH4BeamSD.h b/SimG4CMS/EcalTestBeam/interface/EcalTBH4BeamSD.h index 469704488c8c7..70e124ea3a8dd 100755 --- a/SimG4CMS/EcalTestBeam/interface/EcalTBH4BeamSD.h +++ b/SimG4CMS/EcalTestBeam/interface/EcalTBH4BeamSD.h @@ -21,7 +21,7 @@ class EcalTBH4BeamSD : public CaloSD { public: - EcalTBH4BeamSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, + EcalTBH4BeamSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~EcalTBH4BeamSD(); virtual double getEnergyDeposit(G4Step*); diff --git a/SimG4CMS/EcalTestBeam/src/EcalTBH4BeamSD.cc b/SimG4CMS/EcalTestBeam/src/EcalTBH4BeamSD.cc index f273f20b2828b..99c125e457d6f 100755 --- a/SimG4CMS/EcalTestBeam/src/EcalTBH4BeamSD.cc +++ b/SimG4CMS/EcalTestBeam/src/EcalTBH4BeamSD.cc @@ -20,7 +20,7 @@ #include "G4SystemOfUnits.hh" EcalTBH4BeamSD::EcalTBH4BeamSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager), numberingScheme(0) { diff --git a/SimG4CMS/FP420/interface/FP420SD.h b/SimG4CMS/FP420/interface/FP420SD.h index d308540a978de..9eff1e18c2b50 100644 --- a/SimG4CMS/FP420/interface/FP420SD.h +++ b/SimG4CMS/FP420/interface/FP420SD.h @@ -59,7 +59,7 @@ class FP420SD : public SensitiveTkDetector, public: - FP420SD(std::string, const DDCompactView &, SensitiveDetectorCatalog &, + FP420SD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager* ); //------------------------------------------------------------------- diff --git a/SimG4CMS/FP420/plugins/FP420SD.cc b/SimG4CMS/FP420/plugins/FP420SD.cc index c25ea6843b4d6..8b1ffeca3b292 100644 --- a/SimG4CMS/FP420/plugins/FP420SD.cc +++ b/SimG4CMS/FP420/plugins/FP420SD.cc @@ -55,7 +55,7 @@ using std::string; //#define debug //------------------------------------------------------------------- FP420SD::FP420SD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), numberingScheme(0), name(name), hcID(-1), theHC(0), theManager(manager), currentHit(0), theTrack(0), @@ -96,11 +96,11 @@ FP420SD::FP420SD(G4String name, const DDCompactView & cpv, // // attach detectors (LogicalVolumes) // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++) { this->AssignSD(*it); edm::LogInfo("FP420Sim") << "FP420SD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/Forward/interface/Bcm1fSD.h b/SimG4CMS/Forward/interface/Bcm1fSD.h index 9d8fc34e1b157..745c31947ace2 100644 --- a/SimG4CMS/Forward/interface/Bcm1fSD.h +++ b/SimG4CMS/Forward/interface/Bcm1fSD.h @@ -35,7 +35,7 @@ class Bcm1fSD : public SensitiveTkDetector, public: Bcm1fSD(std::string, const DDCompactView &, - SensitiveDetectorCatalog &, + const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~Bcm1fSD(); diff --git a/SimG4CMS/Forward/interface/BscSD.h b/SimG4CMS/Forward/interface/BscSD.h index f598a5a8ab455..a3f8f5a1663d5 100644 --- a/SimG4CMS/Forward/interface/BscSD.h +++ b/SimG4CMS/Forward/interface/BscSD.h @@ -58,7 +58,7 @@ class BscSD : public SensitiveTkDetector, public: - BscSD(std::string, const DDCompactView &, SensitiveDetectorCatalog &, + BscSD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager* ); diff --git a/SimG4CMS/Forward/interface/CastorSD.h b/SimG4CMS/Forward/interface/CastorSD.h index 8f9acbeeecc50..947c7e149a903 100644 --- a/SimG4CMS/Forward/interface/CastorSD.h +++ b/SimG4CMS/Forward/interface/CastorSD.h @@ -31,7 +31,7 @@ class CastorSD : public CaloSD { public: - CastorSD(G4String, const DDCompactView &, SensitiveDetectorCatalog & clg, + CastorSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog & clg, edm::ParameterSet const &, const SimTrackManager*); virtual ~CastorSD(); virtual double getEnergyDeposit(G4Step* ); diff --git a/SimG4CMS/Forward/interface/PltSD.h b/SimG4CMS/Forward/interface/PltSD.h index ee9771db83d7f..1a9aa2a17ff4d 100644 --- a/SimG4CMS/Forward/interface/PltSD.h +++ b/SimG4CMS/Forward/interface/PltSD.h @@ -35,7 +35,7 @@ class PltSD : public SensitiveTkDetector, public: PltSD(std::string, const DDCompactView &, - SensitiveDetectorCatalog &, + const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~PltSD(); @@ -78,4 +78,4 @@ class PltSD : public SensitiveTkDetector, }; -#endif \ No newline at end of file +#endif diff --git a/SimG4CMS/Forward/interface/TotemSD.h b/SimG4CMS/Forward/interface/TotemSD.h index 68ada5e881af7..537a079b68b8c 100644 --- a/SimG4CMS/Forward/interface/TotemSD.h +++ b/SimG4CMS/Forward/interface/TotemSD.h @@ -45,7 +45,7 @@ class TotemSD : public SensitiveTkDetector, public: - TotemSD(std::string, const DDCompactView &, SensitiveDetectorCatalog &, + TotemSD(std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~TotemSD(); diff --git a/SimG4CMS/Forward/interface/ZdcSD.h b/SimG4CMS/Forward/interface/ZdcSD.h index eda7869d08849..3af0e7068d4ff 100755 --- a/SimG4CMS/Forward/interface/ZdcSD.h +++ b/SimG4CMS/Forward/interface/ZdcSD.h @@ -14,7 +14,7 @@ class ZdcSD : public CaloSD { public: - ZdcSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, + ZdcSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &,const SimTrackManager*); virtual ~ZdcSD(); diff --git a/SimG4CMS/Forward/src/Bcm1fSD.cc b/SimG4CMS/Forward/src/Bcm1fSD.cc index 6ceb5da79885e..bcde311376486 100644 --- a/SimG4CMS/Forward/src/Bcm1fSD.cc +++ b/SimG4CMS/Forward/src/Bcm1fSD.cc @@ -32,7 +32,7 @@ Bcm1fSD::Bcm1fSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), myName(name), mySimHit(0), diff --git a/SimG4CMS/Forward/src/BscSD.cc b/SimG4CMS/Forward/src/BscSD.cc index 0382f08d38f6f..59f047a1fa244 100644 --- a/SimG4CMS/Forward/src/BscSD.cc +++ b/SimG4CMS/Forward/src/BscSD.cc @@ -46,7 +46,7 @@ #define debug //------------------------------------------------------------------- BscSD::BscSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), numberingScheme(0), name(name), hcID(-1), theHC(0), theManager(manager), currentHit(0), theTrack(0), @@ -76,11 +76,11 @@ BscSD::BscSD(std::string name, const DDCompactView & cpv, // // attach detectors (LogicalVolumes) // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++) { this->AssignSD(*it); edm::LogInfo("BscSim") << "BscSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/Forward/src/CastorSD.cc b/SimG4CMS/Forward/src/CastorSD.cc index ada2cfe928cfa..48970281226c6 100644 --- a/SimG4CMS/Forward/src/CastorSD.cc +++ b/SimG4CMS/Forward/src/CastorSD.cc @@ -29,7 +29,7 @@ //#define debugLog CastorSD::CastorSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager), numberingScheme(0), lvC3EF(0), diff --git a/SimG4CMS/Forward/src/PltSD.cc b/SimG4CMS/Forward/src/PltSD.cc index 60d06f1211114..9c96bb72a5e3f 100644 --- a/SimG4CMS/Forward/src/PltSD.cc +++ b/SimG4CMS/Forward/src/PltSD.cc @@ -34,7 +34,7 @@ PltSD::PltSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), myName(name), mySimHit(0), @@ -51,9 +51,9 @@ oldVolume(0), lastId(0), lastTrack(0), eventno(0) { slave = new TrackingSlaveSD(name); // Now attach the right detectors (LogicalVolumes) to me - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it = lvNames.begin(); + for (std::vector::const_iterator it = lvNames.begin(); it != lvNames.end(); it++) { edm::LogInfo("PltSD")<< name << " attaching LV " << *it; this->AssignSD(*it); diff --git a/SimG4CMS/Forward/src/TotemSD.cc b/SimG4CMS/Forward/src/TotemSD.cc index 801782532e450..96081812e81b3 100644 --- a/SimG4CMS/Forward/src/TotemSD.cc +++ b/SimG4CMS/Forward/src/TotemSD.cc @@ -46,7 +46,7 @@ // constructors and destructor // TotemSD::TotemSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), numberingScheme(0), name(name), hcID(-1), theHC(0), theManager(manager), currentHit(0), theTrack(0), @@ -73,9 +73,9 @@ TotemSD::TotemSD(std::string name, const DDCompactView & cpv, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++) { this->AssignSD(*it); edm::LogInfo("ForwardSim") << "TotemSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/Forward/src/ZdcSD.cc b/SimG4CMS/Forward/src/ZdcSD.cc index 0418cca9110b5..6b13f59ca7c38 100644 --- a/SimG4CMS/Forward/src/ZdcSD.cc +++ b/SimG4CMS/Forward/src/ZdcSD.cc @@ -21,7 +21,7 @@ #include "G4Poisson.hh" ZdcSD::ZdcSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p,const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager), numberingScheme(0) { edm::ParameterSet m_ZdcSD = p.getParameter("ZdcSD"); diff --git a/SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h b/SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h index c675b52888453..ba34f6e5f01a9 100644 --- a/SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h +++ b/SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h @@ -29,7 +29,7 @@ class HcalTB02SD : public CaloSD { public: - HcalTB02SD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, + HcalTB02SD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~HcalTB02SD(); virtual double getEnergyDeposit(G4Step*); diff --git a/SimG4CMS/HcalTestBeam/interface/HcalTB06BeamSD.h b/SimG4CMS/HcalTestBeam/interface/HcalTB06BeamSD.h index 5b484f0c01d4a..ff9048267d201 100644 --- a/SimG4CMS/HcalTestBeam/interface/HcalTB06BeamSD.h +++ b/SimG4CMS/HcalTestBeam/interface/HcalTB06BeamSD.h @@ -21,7 +21,7 @@ class HcalTB06BeamSD : public CaloSD { public: - HcalTB06BeamSD(G4String , const DDCompactView &, SensitiveDetectorCatalog &, + HcalTB06BeamSD(G4String , const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~HcalTB06BeamSD(); virtual double getEnergyDeposit(G4Step* ); diff --git a/SimG4CMS/HcalTestBeam/src/HcalTB02SD.cc b/SimG4CMS/HcalTestBeam/src/HcalTB02SD.cc index fd4faa2c24de8..e1b2ad82effe4 100644 --- a/SimG4CMS/HcalTestBeam/src/HcalTB02SD.cc +++ b/SimG4CMS/HcalTestBeam/src/HcalTB02SD.cc @@ -34,7 +34,7 @@ // HcalTB02SD::HcalTB02SD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager), numberingScheme(0) { diff --git a/SimG4CMS/HcalTestBeam/src/HcalTB06BeamSD.cc b/SimG4CMS/HcalTestBeam/src/HcalTB06BeamSD.cc index 37f8d74a631a0..c5c0fb59a4d68 100644 --- a/SimG4CMS/HcalTestBeam/src/HcalTB06BeamSD.cc +++ b/SimG4CMS/HcalTestBeam/src/HcalTB06BeamSD.cc @@ -19,7 +19,7 @@ #include "CLHEP/Units/GlobalSystemOfUnits.h" HcalTB06BeamSD::HcalTB06BeamSD(G4String name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : CaloSD(name, cpv, clg, p, manager) { diff --git a/SimG4CMS/Muon/interface/MuonSensitiveDetector.h b/SimG4CMS/Muon/interface/MuonSensitiveDetector.h index f6a3c1b251902..3b9e631ca718b 100644 --- a/SimG4CMS/Muon/interface/MuonSensitiveDetector.h +++ b/SimG4CMS/Muon/interface/MuonSensitiveDetector.h @@ -49,7 +49,7 @@ public Observer public: MuonSensitiveDetector(std::string, const DDCompactView &, - SensitiveDetectorCatalog &, edm::ParameterSet const &, + const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~MuonSensitiveDetector(); virtual G4bool ProcessHits(G4Step *,G4TouchableHistory *); diff --git a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc index 423462907861a..3da99ded5c2d5 100644 --- a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc +++ b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc @@ -29,7 +29,7 @@ MuonSensitiveDetector::MuonSensitiveDetector(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), @@ -72,9 +72,9 @@ MuonSensitiveDetector::MuonSensitiveDetector(std::string name, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it = lvNames.begin(); it != lvNames.end(); it++){ + for (std::vector::const_iterator it = lvNames.begin(); it != lvNames.end(); it++){ LogDebug("MuonSimDebug") << name << " MuonSensitiveDetector:: attaching SD to LV " << *it << std::endl; this->AssignSD(*it); } diff --git a/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h b/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h index 0ce56eba79c70..7258595cb7651 100644 --- a/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h +++ b/SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h @@ -29,7 +29,7 @@ class FiberSD : public SensitiveCaloDetector, public: - FiberSD(std::string, const DDCompactView&, SensitiveDetectorCatalog&, + FiberSD(std::string, const DDCompactView&, const SensitiveDetectorCatalog&, edm::ParameterSet const &, const SimTrackManager*); virtual ~FiberSD(); diff --git a/SimG4CMS/ShowerLibraryProducer/interface/HFChamberSD.h b/SimG4CMS/ShowerLibraryProducer/interface/HFChamberSD.h index 76fc1f6bcce47..ee6132ee3d8b2 100644 --- a/SimG4CMS/ShowerLibraryProducer/interface/HFChamberSD.h +++ b/SimG4CMS/ShowerLibraryProducer/interface/HFChamberSD.h @@ -20,7 +20,7 @@ class HFChamberSD : public SensitiveCaloDetector { public: - HFChamberSD(std::string, const DDCompactView&, SensitiveDetectorCatalog&, + HFChamberSD(std::string, const DDCompactView&, const SensitiveDetectorCatalog&, edm::ParameterSet const &, const SimTrackManager*); virtual ~HFChamberSD(); diff --git a/SimG4CMS/ShowerLibraryProducer/interface/HFWedgeSD.h b/SimG4CMS/ShowerLibraryProducer/interface/HFWedgeSD.h index fb3c997e012e1..ebd8cbd2c531d 100644 --- a/SimG4CMS/ShowerLibraryProducer/interface/HFWedgeSD.h +++ b/SimG4CMS/ShowerLibraryProducer/interface/HFWedgeSD.h @@ -24,7 +24,7 @@ class HFWedgeSD : public SensitiveCaloDetector { public: HFWedgeSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager*); virtual ~HFWedgeSD(); diff --git a/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc b/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc index 17c77bb0791e6..cf19038129304 100644 --- a/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc +++ b/SimG4CMS/ShowerLibraryProducer/src/FiberSD.cc @@ -15,7 +15,7 @@ #include "G4ios.hh" FiberSD::FiberSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveCaloDetector(name, cpv, clg, p), theName(name), m_trackManager(manager), theHCID(-1), theHC(0) { @@ -35,9 +35,9 @@ FiberSD::FiberSD(std::string name, const DDCompactView & cpv, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++){ this->AssignSD(*it); LogDebug("FiberSim") << "FiberSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/ShowerLibraryProducer/src/HFChamberSD.cc b/SimG4CMS/ShowerLibraryProducer/src/HFChamberSD.cc index 070ccdae96528..08e336a276f28 100644 --- a/SimG4CMS/ShowerLibraryProducer/src/HFChamberSD.cc +++ b/SimG4CMS/ShowerLibraryProducer/src/HFChamberSD.cc @@ -17,7 +17,7 @@ #include "G4SystemOfUnits.hh" HFChamberSD::HFChamberSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveCaloDetector(name, cpv, clg, p), theName(name), m_trackManager(manager), theHCID(-1), theHC(0), theNSteps(0) { @@ -35,9 +35,9 @@ HFChamberSD::HFChamberSD(std::string name, const DDCompactView & cpv, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++){ this->AssignSD(*it); LogDebug("FiberSim") << "HFChamberSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/ShowerLibraryProducer/src/HFWedgeSD.cc b/SimG4CMS/ShowerLibraryProducer/src/HFWedgeSD.cc index ae4f58e7167d2..fd4e27976a977 100644 --- a/SimG4CMS/ShowerLibraryProducer/src/HFWedgeSD.cc +++ b/SimG4CMS/ShowerLibraryProducer/src/HFWedgeSD.cc @@ -17,7 +17,7 @@ #include "G4SystemOfUnits.hh" HFWedgeSD::HFWedgeSD(std::string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveCaloDetector(name, cpv, clg, p), theName(name), m_trackManager(manager), hcID(-1), theHC(0), currentHit(0) { @@ -35,9 +35,9 @@ HFWedgeSD::HFWedgeSD(std::string name, const DDCompactView & cpv, // // Now attach the right detectors (LogicalVolumes) to me // - std::vector lvNames = clg.logicalNames(name); + const std::vector& lvNames = clg.logicalNames(name); this->Register(); - for (std::vector::iterator it=lvNames.begin(); + for (std::vector::const_iterator it=lvNames.begin(); it !=lvNames.end(); it++){ this->AssignSD(*it); LogDebug("FiberSim") << "HFWedgeSD : Assigns SD to LV " << (*it); diff --git a/SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h b/SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h index b1bb9cdf80537..0e9a7e0c6c075 100644 --- a/SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h +++ b/SimG4CMS/Tracker/interface/TkAccumulatingSensitiveDetector.h @@ -35,7 +35,7 @@ public Observer { public: TkAccumulatingSensitiveDetector(std::string, const DDCompactView &, - SensitiveDetectorCatalog &, + const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager*); virtual ~TkAccumulatingSensitiveDetector(); diff --git a/SimG4CMS/Tracker/src/TkAccumulatingSensitiveDetector.cc b/SimG4CMS/Tracker/src/TkAccumulatingSensitiveDetector.cc index f5137be9e964b..27728fab7a879 100644 --- a/SimG4CMS/Tracker/src/TkAccumulatingSensitiveDetector.cc +++ b/SimG4CMS/Tracker/src/TkAccumulatingSensitiveDetector.cc @@ -63,7 +63,7 @@ numberingScheme(const DDCompactView& cpv, const GeometricDet& det) TkAccumulatingSensitiveDetector::TkAccumulatingSensitiveDetector(string name, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* manager) : SensitiveTkDetector(name, cpv, clg, p), myName(name), myRotation(0), mySimHit(0),theManager(manager), @@ -105,9 +105,9 @@ TkAccumulatingSensitiveDetector::TkAccumulatingSensitiveDetector(string name, slaveHighTof = new TrackingSlaveSD(name+"HighTof"); // Now attach the right detectors (LogicalVolumes) to me - vector lvNames = clg.logicalNames(name); + const vector& lvNames = clg.logicalNames(name); this->Register(); - for (vector::iterator it = lvNames.begin(); it != lvNames.end(); it++) + for (vector::const_iterator it = lvNames.begin(); it != lvNames.end(); it++) { edm::LogInfo("TrackerSimInfo")<< name << " attaching LV " << *it; this->AssignSD(*it); diff --git a/SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h b/SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h index 2376c96820b72..1a5b760a5c8a8 100644 --- a/SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h +++ b/SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h @@ -9,13 +9,13 @@ class SensitiveDetectorCatalog { public: typedef std::map > MapType; - void insert(std::string &, std::string&, std::string&); - std::vector logicalNames(std::string & readoutName); - std::vector logicalNamesFromClassName(std::string & className); - std::vector readoutNames(std::string & className); - std::vector readoutNames(); - std::string className(std::string & readoutName); - std::vector classNames(); + void insert(const std::string &, const std::string&, const std::string&); + const std::vector& logicalNames(const std::string & readoutName) const; + std::vector logicalNamesFromClassName(const std::string & className) const; + const std::vector& readoutNames(const std::string & className) const; + std::vector readoutNames() const; + std::string className(const std::string & readoutName) const; + std::vector classNames() const; private: MapType theClassNameMap; diff --git a/SimG4Core/Geometry/src/SensitiveDetectorCatalog.cc b/SimG4Core/Geometry/src/SensitiveDetectorCatalog.cc index 83a642f19daeb..0172eb5666f7b 100644 --- a/SimG4Core/Geometry/src/SensitiveDetectorCatalog.cc +++ b/SimG4Core/Geometry/src/SensitiveDetectorCatalog.cc @@ -5,8 +5,8 @@ #include -void SensitiveDetectorCatalog::insert(std::string& cN, std::string& rN, - std::string& lvN) { +void SensitiveDetectorCatalog::insert(const std::string& cN, const std::string& rN, + const std::string& lvN) { theClassNameMap[cN].push_back(rN); theROUNameMap[rN].push_back(lvN); #ifdef DEBUG @@ -21,7 +21,7 @@ void SensitiveDetectorCatalog::insert(std::string& cN, std::string& rN, #endif } -std::vector SensitiveDetectorCatalog::readoutNames() { +std::vector SensitiveDetectorCatalog::readoutNames() const { std::vector temp; for (MapType::const_iterator it = theROUNameMap.begin(); it != theROUNameMap.end(); it++) @@ -29,24 +29,24 @@ std::vector SensitiveDetectorCatalog::readoutNames() { return temp; } -std::vector SensitiveDetectorCatalog::readoutNames(std::string & className) { - return theClassNameMap[className]; +const std::vector& SensitiveDetectorCatalog::readoutNames(const std::string & className) const { + return theClassNameMap.at(className); } -std::vector SensitiveDetectorCatalog::logicalNames(std::string & readoutName) { - return theROUNameMap[readoutName]; +const std::vector& SensitiveDetectorCatalog::logicalNames(const std::string & readoutName) const { + return theROUNameMap.at(readoutName); } -std::vector SensitiveDetectorCatalog::logicalNamesFromClassName(std::string & className) { +std::vector SensitiveDetectorCatalog::logicalNamesFromClassName(const std::string & className) const { std::vector temp; - std::vector rous = theClassNameMap[className]; + const std::vector& rous = theClassNameMap.at(className); for (std::vector::const_iterator it = rous.begin(); it!= rous.end(); it++) temp.push_back(*it); return temp; } -std::string SensitiveDetectorCatalog::className(std::string & readoutName) { +std::string SensitiveDetectorCatalog::className(const std::string & readoutName) const { for (MapType::const_iterator it = theClassNameMap.begin(); it != theClassNameMap.end(); it++) { std::vector temp = (*it).second; @@ -58,7 +58,7 @@ std::string SensitiveDetectorCatalog::className(std::string & readoutName) { return "NotFound"; } -std::vector SensitiveDetectorCatalog::classNames() { +std::vector SensitiveDetectorCatalog::classNames() const { std::vector temp; for (MapType::const_iterator it = theClassNameMap.begin(); it != theClassNameMap.end(); it++) diff --git a/SimG4Core/SensitiveDetector/interface/AttachSD.h b/SimG4Core/SensitiveDetector/interface/AttachSD.h index 00851b5304b8e..4228782141172 100644 --- a/SimG4Core/SensitiveDetector/interface/AttachSD.h +++ b/SimG4Core/SensitiveDetector/interface/AttachSD.h @@ -18,7 +18,7 @@ class AttachSD std::pair< std::vector, std::vector > create(const DDDWorld & w, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* m, SimActivityRegistry& reg ) const; diff --git a/SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h b/SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h index a3334fd4769e6..1cd6b97c01e5f 100644 --- a/SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h +++ b/SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h @@ -11,7 +11,7 @@ class SensitiveCaloDetector : public SensitiveDetector { public: SensitiveCaloDetector(std::string & iname, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p) : SensitiveDetector(iname,cpv,clg,p) {} virtual void fillHits(edm::PCaloHitContainer &, std::string name = 0) = 0; diff --git a/SimG4Core/SensitiveDetector/interface/SensitiveDetector.h b/SimG4Core/SensitiveDetector/interface/SensitiveDetector.h index 319bc8c9e4600..f5b781d738748 100644 --- a/SimG4Core/SensitiveDetector/interface/SensitiveDetector.h +++ b/SimG4Core/SensitiveDetector/interface/SensitiveDetector.h @@ -23,7 +23,7 @@ class SensitiveDetector : public G4VSensitiveDetector { public: explicit SensitiveDetector(std::string & iname, const DDCompactView & cpv, - SensitiveDetectorCatalog & , + const SensitiveDetectorCatalog & , edm::ParameterSet const & p); virtual ~SensitiveDetector(); virtual void Initialize(G4HCofThisEvent * eventHC); @@ -31,7 +31,7 @@ class SensitiveDetector : public G4VSensitiveDetector virtual G4bool ProcessHits(G4Step * step ,G4TouchableHistory * tHistory) = 0; virtual uint32_t setDetUnitId(G4Step * step) = 0; void Register(); - virtual void AssignSD(std::string & vname); + virtual void AssignSD(const std::string & vname); virtual void EndOfEvent(G4HCofThisEvent * eventHC); enum coordinates {WorldCoordinates, LocalCoordinates}; Local3DPoint InitialStepPosition(G4Step * s, coordinates); diff --git a/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMaker.h b/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMaker.h index 6ee57ae93a4ea..9169f9237a7b9 100644 --- a/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMaker.h +++ b/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMaker.h @@ -38,7 +38,7 @@ class SensitiveDetectorMaker : public SensitiveDetectorMakerBase // ---------- const member functions --------------------- virtual void make(const std::string& iname, const DDCompactView& cpv, - SensitiveDetectorCatalog& clg, + const SensitiveDetectorCatalog& clg, const edm::ParameterSet& p, const SimTrackManager* m, SimActivityRegistry& reg, diff --git a/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h b/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h index 07b84fbc94cce..270a9c5613d9e 100644 --- a/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h +++ b/SimG4Core/SensitiveDetector/interface/SensitiveDetectorMakerBase.h @@ -43,7 +43,7 @@ class SensitiveDetectorMakerBase // ---------- const member functions --------------------- virtual void make(const std::string& iname, const DDCompactView& cpv, - SensitiveDetectorCatalog& clg, + const SensitiveDetectorCatalog& clg, const edm::ParameterSet& p, const SimTrackManager* m, SimActivityRegistry& reg, diff --git a/SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h b/SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h index 13bff67834bbc..f74eb7124c280 100644 --- a/SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h +++ b/SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h @@ -11,7 +11,7 @@ class SensitiveTkDetector : public SensitiveDetector { public: SensitiveTkDetector(std::string & iname, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p) : SensitiveDetector(iname, cpv, clg, p) {} virtual void fillHits(edm::PSimHitContainer &, std::string name = 0) = 0; diff --git a/SimG4Core/SensitiveDetector/src/AttachSD.cc b/SimG4Core/SensitiveDetector/src/AttachSD.cc index dcd690c9242ab..eb632c11083ee 100644 --- a/SimG4Core/SensitiveDetector/src/AttachSD.cc +++ b/SimG4Core/SensitiveDetector/src/AttachSD.cc @@ -22,7 +22,7 @@ std::pair< std::vector, std::vector > AttachSD::create(const DDDWorld & w, const DDCompactView & cpv, - SensitiveDetectorCatalog & clg, + const SensitiveDetectorCatalog & clg, edm::ParameterSet const & p, const SimTrackManager* m, SimActivityRegistry& reg) const @@ -33,8 +33,8 @@ AttachSD::create(const DDDWorld & w, //cout << " Initializing AttachSD " << endl; LogDebug("SimG4CoreSensitiveDetector") << " AttachSD: Initializing" ; //#endif - std::vector rouNames = clg.readoutNames(); - for (std::vector::iterator it = rouNames.begin(); + const std::vector& rouNames = clg.readoutNames(); + for (std::vector::const_iterator it = rouNames.begin(); it != rouNames.end(); it++) { std::string className = clg.className(*it); //std::cout<<" trying to find something for "<AddNewDetector(this); } -void SensitiveDetector::AssignSD(std::string & vname) +void SensitiveDetector::AssignSD(const std::string & vname) { G4LogicalVolumeStore * theStore = G4LogicalVolumeStore::GetInstance(); G4LogicalVolumeStore::const_iterator it;