Skip to content

Commit d66cb19

Browse files
author
Erin O'Sullivan
committed
Now passing the hits collection name when instantiating the sensitive detector
1 parent ee90789 commit d66cb19

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

include/WCSimWCSD.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class G4HCofThisEvent;
1111
class WCSimWCSD : public G4VSensitiveDetector
1212
{
1313
public:
14-
WCSimWCSD(G4String,WCSimDetectorConstruction*);
14+
WCSimWCSD(G4String,G4String,WCSimDetectorConstruction*);
1515
~WCSimWCSD();
1616

1717
void Initialize(G4HCofThisEvent*);

src/WCSimConstructPMT.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4Str
150150
G4SDManager* SDman = G4SDManager::GetSDMpointer();
151151
G4String SDName = "/WCSim/";
152152
SDName += CollectionName;
153-
aWCPMT = new WCSimWCSD(SDName,this );
153+
aWCPMT = new WCSimWCSD(CollectionName,SDName,this );
154154
SDman->AddNewDetector( aWCPMT );
155155
}
156156
logicGlassFaceWCPMT->SetSensitiveDetector( aWCPMT );

src/WCSimWCSD.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "WCSimDetectorConstruction.hh"
1414
#include "WCSimTrackInformation.hh"
1515

16-
WCSimWCSD::WCSimWCSD(G4String name,WCSimDetectorConstruction* myDet)
16+
WCSimWCSD::WCSimWCSD(G4String CollectionName, G4String name,WCSimDetectorConstruction* myDet)
1717
:G4VSensitiveDetector(name)
1818
{
1919
// Place the name of this collection on the list. We can have more than one
@@ -23,8 +23,7 @@ WCSimWCSD::WCSimWCSD(G4String name,WCSimDetectorConstruction* myDet)
2323
// Which has a "/" in it, I can find this collection later using
2424
// GetCollectionID()
2525

26-
G4String HCname;
27-
collectionName.insert(HCname="glassFaceWCPMT");
26+
collectionName.insert(CollectionName);
2827

2928
fdet = myDet;
3029

0 commit comments

Comments
 (0)