10#ifndef BIASING_TARGETDARKBREMFILTER_H_
11#define BIASING_TARGETDARKBREMFILTER_H_
21#include "G4RunManager.hh"
22#include "G4VPhysicalVolume.hh"
27#include "SimCore/UserAction.h"
64 std::vector<simcore::TYPE>
getTypes()
override {
65 return {simcore::TYPE::STEPPING, simcore::TYPE::EVENT};
86 void stepping(
const G4Step* step)
override;
119 if (!vol)
return true;
120 auto region = vol->GetRegion();
121 return region ? (region->GetName().compareTo(
"target") != 0) :
true;
132 void AbortEvent(
const std::string& reason)
const;
This class is meant to filter for events that produce a dark brem matching originating in the target ...
~TargetDarkBremFilter()=default
Class destructor.
void stepping(const G4Step *step) override
Looking for A' while primary is stepping.
double threshold_
Minimum energy [MeV] that the A' should have to keep the event.
bool isOutsideTargetRegion(const G4VPhysicalVolume *vol) const
Check if the volume is outside the target region.
void EndOfEventAction(const G4Event *event) override
Check flag signaling finding of A', if false, abort the event so it isn't saved.
bool isOutsideTargetRegion(const G4LogicalVolume *vol) const
Check if the volume is outside the target region.
void BeginOfEventAction(const G4Event *e) override
Reset flag signaling finding of A' to false.
void AbortEvent(const std::string &reason) const
Helper to abort an event with a message.
bool found_aprime_
flag to signal that we saw an A'
std::vector< simcore::TYPE > getTypes() override
Get the types of actions this class can do.
Class encapsulating parameters for configuring a processor.
Interface that defines a user action.