15 #include "CLHEP/Evaluator/Evaluator.h" 22 : fAuxDetGeom{&auxDetGeom}
24 HepTool::Evaluator eval;
26 eval.setSystemOfUnits();
28 const std::string scaleExpression =
"MeV / " + energyUnitsScale;
56 std::vector<sim::AuxDetHit>
const& adhits)
const 58 std::vector<unsigned int> AuxDetChanNumber;
59 AuxDetChanNumber.reserve(
size(adhits));
61 for (
auto const&
hit : adhits) {
64 std::find(AuxDetChanNumber.begin(), AuxDetChanNumber.end(),
hit.GetID());
66 if (Chanitr == AuxDetChanNumber.end()) {
68 AuxDetChanNumber.push_back(
hit.GetID());
72 return AuxDetChanNumber;
76 std::vector<sim::AuxDetHit>
const& adhits,
77 unsigned int inputchannel)
const 81 std::vector<sim::AuxDetIDE> IDEvector;
83 size_t ad_id_no = 9999;
84 size_t ad_sen_id_no = 9999;
86 for (
auto const& auxDetHit : adhits) {
88 double xcoordinate = (auxDetHit.GetEntryX() + auxDetHit.GetExitX()) / 2.0;
89 double ycoordinate = (auxDetHit.GetEntryY() + auxDetHit.GetExitY()) / 2.0;
90 double zcoordinate = (auxDetHit.GetEntryZ() + auxDetHit.GetExitZ()) / 2.0;
91 geo::Point_t const worldPos{xcoordinate, ycoordinate, zcoordinate};
93 if (auxDetHit.GetID() == inputchannel)
99 <<
"Found an AuxDetHit with ID " << auxDetHit.GetID() <<
" for AuxDet ID " << ad_id_no
100 <<
" Sens ID " << ad_sen_id_no << std::endl;
105 std::find(IDEvector.begin(), IDEvector.end(), tempIDE);
107 if (IDEitr != IDEvector.end()) {
110 IDEitr->energyDeposited += tempIDE.energyDeposited;
111 IDEitr->exitX = tempIDE.exitX;
112 IDEitr->exitY = tempIDE.exitY;
113 IDEitr->exitZ = tempIDE.exitZ;
114 IDEitr->exitT = tempIDE.exitT;
115 IDEitr->exitMomentumX = tempIDE.exitMomentumX;
116 IDEitr->exitMomentumY = tempIDE.exitMomentumY;
117 IDEitr->exitMomentumZ = tempIDE.exitMomentumZ;
120 IDEvector.push_back(std::move(tempIDE));
129 <<
"Returning AuxDetSimChannel for ID " << ad_id_no <<
" " << ad_sen_id_no <<
", with " 130 << IDEvector.size() <<
" IDEs." << std::endl;
138 std::vector<sim::AuxDetHit>
const& adhits)
const 141 std::vector<sim::AuxDetSimChannel> auxDetVector;
142 auxDetVector.reserve(
size(auxDetChannels));
144 for (
auto const channelNum : auxDetChannels) {
std::vector< unsigned int > GetAuxDetChannels(std::vector< AuxDetHit > const &adhits) const
unsigned int GetTrackID() const
AuxDetIDE toAuxDetIDE(AuxDetHit const &adhit) const
AuxDetSimChannel GetAuxDetSimChannelByNumber(std::vector< AuxDetHit > const &adhits, unsigned int inputchannel) const
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
geo::AuxDetGeometryCore const * fAuxDetGeom
Description of physical geometry of one set of auxiliary detectors.
Access the description of auxiliary detector geometry.
float GetExitMomentumY() const
float exitY
Exit position Y of particle.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Collection of particles crossing one auxiliary detector cell.
float entryT
Entry time of particle.
float exitMomentumX
Exit X-Momentum of particle.
GenericCRTUtility(std::string const &energyUnitsScale, geo::AuxDetGeometryCore const &auxDetGeom)
float exitT
Exit time of particle.
float GetEnergyDeposited() const
float exitZ
Exit position Z of particle.
float entryZ
Entry position Z of particle.
float exitX
Exit position X of particle.
Detector simulation of raw signals on wires.
void FindAuxDetSensitiveAtPosition(Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
float energyDeposited
total energy deposited for this track ID and time
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
float entryX
Entry position X of particle.
float entryY
Entry position Y of particle.
float GetExitMomentumX() const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MC truth information to make RawDigits and do back tracking.
float exitMomentumY
Exit Y-Momentum of particle.
float GetExitMomentumZ() const
std::vector< AuxDetSimChannel > GetAuxDetSimChannels(std::vector< AuxDetHit > const &adhits) const