LDMX Software
SensitiveDetector.cxx
1#include "SimCore/SensitiveDetector.h"
2
3#include "Framework/Exception/Exception.h"
4#include "G4ChargedGeantino.hh"
5#include "G4Geantino.hh"
6#include "G4SDManager.hh"
7#include "G4Step.hh"
8
9namespace simcore {
10
12 const std::string& name, simcore::ConditionsInterface& ci,
13 const framework::config::Parameters& parameters)
14 : G4VSensitiveDetector(name), conditions_interface_(ci) {
15 // register us with the manager
16 G4SDManager::GetSDMpointer()->AddNewDetector(this);
17}
18
19bool SensitiveDetector::isGeantino(const G4Step* step) const {
20 auto particle_def{step->GetTrack()->GetDefinition()};
21 return (particle_def == G4Geantino::Definition() or
22 particle_def == G4ChargedGeantino::Definition());
23}
24
25} // namespace simcore
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Handle to the conditions system, provided at construction to classes which require it.
bool isGeantino(const G4Step *step) const
Check if the passed step is a step of a geantino.
SensitiveDetector(const std::string &name, simcore::ConditionsInterface &ci, const framework::config::Parameters &parameters)
Constructor.