Skip to content

Commit

Permalink
Make most SensitiveDetectorCatalog methods const, and AttachSD::creat…
Browse files Browse the repository at this point in the history
…e() to take const SensitiveDetectorCatalog

Percolate the change through SensitiveDetector class hierarchy. Needed
to integrate Geant4MT to our framework.
  • Loading branch information
makortel committed Jul 3, 2014
1 parent fb78455 commit 7ff2ba9
Show file tree
Hide file tree
Showing 50 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/CaloSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/CaloTrkProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 * ) {}
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/ECalSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HCalSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 * );
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/src/CaloSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -87,9 +87,9 @@ CaloSD::CaloSD(G4String name, const DDCompactView & cpv,
//
// Now attach the right detectors (LogicalVolumes) to me
//
std::vector<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);
this->Register();
for (std::vector<std::string>::iterator it=lvNames.begin(); it !=lvNames.end(); ++it) {
for (std::vector<std::string>::const_iterator it=lvNames.begin(); it !=lvNames.end(); ++it) {
this->AssignSD(*it);
#ifdef DebugLog
LogDebug("CaloSim") << "CaloSD : Assigns SD to LV " << (*it);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/CaloTrkProcessing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/ECalSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool any(const std::vector<T> & 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<edm::ParameterSet>("ECalSD").getParameter<int>("TimeSliceUnit"),
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/HCalSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<edm::ParameterSet>("HCalSD").getParameter<int>("TimeSliceUnit"),
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/CherenkovAnalysis/interface/DreamSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/CherenkovAnalysis/src/DreamSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/EcalTestBeam/interface/EcalTBH4BeamSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/EcalTestBeam/src/EcalTBH4BeamSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/FP420/interface/FP420SD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );

//-------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/FP420/plugins/FP420SD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -96,11 +96,11 @@ FP420SD::FP420SD(G4String name, const DDCompactView & cpv,
//
// attach detectors (LogicalVolumes)
//
std::vector<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);

this->Register();

for (std::vector<std::string>::iterator it=lvNames.begin();
for (std::vector<std::string>::const_iterator it=lvNames.begin();
it !=lvNames.end(); it++) {
this->AssignSD(*it);
edm::LogInfo("FP420Sim") << "FP420SD : Assigns SD to LV " << (*it);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/interface/Bcm1fSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Bcm1fSD : public SensitiveTkDetector,
public:

Bcm1fSD(std::string, const DDCompactView &,
SensitiveDetectorCatalog &,
const SensitiveDetectorCatalog &,
edm::ParameterSet const &, const SimTrackManager*);
virtual ~Bcm1fSD();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/interface/BscSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );


Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/interface/CastorSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Forward/interface/PltSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PltSD : public SensitiveTkDetector,
public:

PltSD(std::string, const DDCompactView &,
SensitiveDetectorCatalog &,
const SensitiveDetectorCatalog &,
edm::ParameterSet const &, const SimTrackManager*);
virtual ~PltSD();

Expand Down Expand Up @@ -78,4 +78,4 @@ class PltSD : public SensitiveTkDetector,

};

#endif
#endif
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/interface/TotemSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/interface/ZdcSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/src/Bcm1fSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Forward/src/BscSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -76,11 +76,11 @@ BscSD::BscSD(std::string name, const DDCompactView & cpv,
//
// attach detectors (LogicalVolumes)
//
std::vector<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);

this->Register();

for (std::vector<std::string>::iterator it=lvNames.begin();
for (std::vector<std::string>::const_iterator it=lvNames.begin();
it !=lvNames.end(); it++) {
this->AssignSD(*it);
edm::LogInfo("BscSim") << "BscSD : Assigns SD to LV " << (*it);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/src/CastorSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Forward/src/PltSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);
this->Register();
for (std::vector<std::string>::iterator it = lvNames.begin();
for (std::vector<std::string>::const_iterator it = lvNames.begin();
it != lvNames.end(); it++) {
edm::LogInfo("PltSD")<< name << " attaching LV " << *it;
this->AssignSD(*it);
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Forward/src/TotemSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -73,9 +73,9 @@ TotemSD::TotemSD(std::string name, const DDCompactView & cpv,
//
// Now attach the right detectors (LogicalVolumes) to me
//
std::vector<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);
this->Register();
for (std::vector<std::string>::iterator it=lvNames.begin();
for (std::vector<std::string>::const_iterator it=lvNames.begin();
it !=lvNames.end(); it++) {
this->AssignSD(*it);
edm::LogInfo("ForwardSim") << "TotemSD : Assigns SD to LV " << (*it);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/src/ZdcSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<edm::ParameterSet>("ZdcSD");
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/HcalTestBeam/interface/HcalTB06BeamSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/HcalTestBeam/src/HcalTB02SD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/HcalTestBeam/src/HcalTB06BeamSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Muon/interface/MuonSensitiveDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Observer<const EndOfEvent*>

public:
MuonSensitiveDetector(std::string, const DDCompactView &,
SensitiveDetectorCatalog &, edm::ParameterSet const &,
const SensitiveDetectorCatalog &, edm::ParameterSet const &,
const SimTrackManager*);
virtual ~MuonSensitiveDetector();
virtual G4bool ProcessHits(G4Step *,G4TouchableHistory *);
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Muon/src/MuonSensitiveDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -72,9 +72,9 @@ MuonSensitiveDetector::MuonSensitiveDetector(std::string name,
//
// Now attach the right detectors (LogicalVolumes) to me
//
std::vector<std::string> lvNames = clg.logicalNames(name);
const std::vector<std::string>& lvNames = clg.logicalNames(name);
this->Register();
for (std::vector<std::string>::iterator it = lvNames.begin(); it != lvNames.end(); it++){
for (std::vector<std::string>::const_iterator it = lvNames.begin(); it != lvNames.end(); it++){
LogDebug("MuonSimDebug") << name << " MuonSensitiveDetector:: attaching SD to LV " << *it << std::endl;
this->AssignSD(*it);
}
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/ShowerLibraryProducer/interface/FiberSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/ShowerLibraryProducer/interface/HFChamberSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/ShowerLibraryProducer/interface/HFWedgeSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Loading

0 comments on commit 7ff2ba9

Please sign in to comment.