LDMX Software
SensitiveDetector.cxx
1#include "SimCore/SDs/SensitiveDetector.h"
2
3#include "G4ChargedGeantino.hh"
4#include "G4Geantino.hh"
5#include "G4SDManager.hh"
6#include "G4Step.hh"
7
8namespace simcore {
9
11 const std::string& name, simcore::ConditionsInterface& ci,
12 const framework::config::Parameters& parameters)
13 : G4VSensitiveDetector(name), conditions_interface_(ci) {
14 // register us with the manager
15 G4SDManager::GetSDMpointer()->AddNewDetector(this);
16}
17
18bool SensitiveDetector::isGeantino(const G4Step* step) const {
19 auto particle_def{step->GetTrack()->GetDefinition()};
20 return (particle_def == G4Geantino::Definition() or
21 particle_def == G4ChargedGeantino::Definition());
22}
23
25
26} // namespace simcore
#define DEFINE_FACTORY(classtype)
This should go into an implementation file for your prototype class.
Definition Factory.h:408
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Handle to the conditions system, provided at construction to classes which require it.
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...
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.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...