19#include "BDSSDFilterMaterial.hh"
21#include "G4LogicalVolume.hh"
23#include "G4StepPoint.hh"
27#include "G4VPhysicalVolume.hh"
33 const std::vector<G4Material*>& materialsIn,
36 materials(materialsIn),
37 inclusive(inclusiveIn)
40BDSSDFilterMaterial::~BDSSDFilterMaterial()
46 const G4Step* realWorldStep = aStep->GetTrack()->GetStep();
49 G4LogicalVolume* stepLV = realWorldStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
50 G4Material* stepMaterial = stepLV->GetMaterial();
52 G4bool found = std::find(materials.begin(), materials.end(), stepMaterial) != materials.end();
53 return inclusive ? found : !found;
virtual G4bool Accept(const G4Step *aStep) const
Whether the step will be accepted or rejected.
BDSSDFilterMaterial(const G4String &name, const std::vector< G4Material * > &materialsIn, G4bool inclusiveIn)