Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions geometry/pion/Lucite/pionDetectorLucite.gdml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
<solidref ref="pionDetectorLucitePMTWindowDisk_solid"/>
<auxiliary auxtype="SensDet" auxvalue="pionLucitePMTWindow"/>
<auxiliary auxtype="DetNo" auxvalue="8000"/>
<auxiliary auxtype="CopyDepth" auxvalue="4"/>
<auxiliary auxtype="DetType" auxvalue="opticalphoton"/>
<auxiliary auxtype="Color" auxvalue="White"/>
<auxiliary auxtype="Alpha" auxvalue="0.5"/>
Expand Down
5 changes: 5 additions & 0 deletions include/remollGenericDetector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ class remollGenericDetector : public G4VSensitiveDetector {

void BuildStaticMessenger();

virtual void SetCopyDepth(G4int copy_depth) {
fCopyDepth = copy_depth;
}

virtual void SetDetectorType(G4String det_type) {
auto icompare = [](const G4String& lhs, const G4String& rhs) {
#if G4VERSION_NUMBER < 1100
Expand Down Expand Up @@ -253,6 +257,7 @@ class remollGenericDetector : public G4VSensitiveDetector {
G4bool fDetectBoundaryHits;

G4int fDetNo;
G4int fCopyDepth;

G4bool fEnabled;

Expand Down
11 changes: 11 additions & 0 deletions src/remollDetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,17 @@ void remollDetectorConstruction::ParseAuxiliarySensDetInfo()

}

// Find aux list entries with type CopyDepth
for (auto it_copydepth = NextAuxWithType(list.begin(), list.end(), "CopyDepth");
it_copydepth != list.end();
it_copydepth = NextAuxWithType(++it_copydepth, list.end(), "CopyDepth")) {

// Set copy depth
int copydepth = atoi(it_copydepth->value.data());
if (remollsd != nullptr) remollsd->SetCopyDepth(copydepth);

}

} // end of loop over volumes

if (fVerboseLevel > 0)
Expand Down
6 changes: 3 additions & 3 deletions src/remollGenericDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ remollGenericDetector::remollGenericDetector( G4String name, G4int detnum )
{
assert(detnum > 0);
SetDetNo(detnum);
SetCopyDepth(0);

fDetectSecondaries = false;
fDetectOpticalPhotons = false;
Expand Down Expand Up @@ -150,9 +151,8 @@ G4bool remollGenericDetector::ProcessHits(G4Step* step, G4TouchableHistory*)
// Get copy ID from touchable history
G4TouchableHistory* hist
= (G4TouchableHistory*) (prepoint->GetTouchable());
G4VPhysicalVolume* volume = hist->GetVolume();
G4int copyID = volume->GetCopyNo();

G4VPhysicalVolume* volume = hist->GetVolume(fCopyDepth);
G4int copyID = (volume != nullptr? volume->GetCopyNo(): 0);

// Add energy deposit to detector sum
G4int pid = particle->GetPDGEncoding();
Expand Down