14 #include "CLHEP/Evaluator/Evaluator.h" 21 HepTool::Evaluator eval;
23 eval.setSystemOfUnits();
25 const std::string scaleExpression =
"MeV / " + energyUnitsScale;
53 const std::vector<sim::AuxDetHit>& InputHitVector)
const 56 std::vector<unsigned int> AuxDetChanNumber;
57 AuxDetChanNumber.reserve(
size(InputHitVector));
59 for (
auto const&
hit : InputHitVector) {
62 std::find(AuxDetChanNumber.begin(), AuxDetChanNumber.end(),
hit.GetID());
64 if (Chanitr == AuxDetChanNumber.end()) {
66 AuxDetChanNumber.push_back(
hit.GetID());
70 return AuxDetChanNumber;
74 const std::vector<sim::AuxDetHit>& InputHitVector,
75 unsigned int inputchannel)
const 77 std::vector<sim::AuxDetIDE> IDEvector;
80 size_t ad_id_no = 9999;
81 size_t ad_sen_id_no = 9999;
83 for (
auto const& auxDetHit : InputHitVector) {
85 double xcoordinate = (auxDetHit.GetEntryX() + auxDetHit.GetExitX()) / 2.0;
86 double ycoordinate = (auxDetHit.GetEntryY() + auxDetHit.GetExitY()) / 2.0;
87 double zcoordinate = (auxDetHit.GetEntryZ() + auxDetHit.GetExitZ()) / 2.0;
88 geo::Point_t const worldPos{xcoordinate, ycoordinate, zcoordinate};
90 if (auxDetHit.GetID() == inputchannel)
96 <<
"Found an AuxDetHit with ID " << auxDetHit.GetID() <<
" for AuxDet ID " << ad_id_no
97 <<
" Sens ID " << ad_sen_id_no << std::endl;
102 std::find(IDEvector.begin(), IDEvector.end(), tempIDE);
104 if (IDEitr != IDEvector.end()) {
106 IDEitr->energyDeposited += tempIDE.energyDeposited;
107 IDEitr->exitX = tempIDE.exitX;
108 IDEitr->exitY = tempIDE.exitY;
109 IDEitr->exitZ = tempIDE.exitZ;
110 IDEitr->exitT = tempIDE.exitT;
111 IDEitr->exitMomentumX = tempIDE.exitMomentumX;
112 IDEitr->exitMomentumY = tempIDE.exitMomentumY;
113 IDEitr->exitMomentumZ = tempIDE.exitMomentumZ;
116 IDEvector.push_back(std::move(tempIDE));
125 <<
"Returning AuxDetSimChannel for ID " << ad_id_no <<
" " << ad_sen_id_no <<
", with " 126 << IDEvector.size() <<
" IDEs." << std::endl;
134 const std::vector<sim::AuxDetHit>& InputHitVector)
const 137 std::vector<sim::AuxDetSimChannel> auxDetVector;
138 auxDetVector.reserve(
size(auxDetChannels));
140 for (
auto const channelNum : auxDetChannels) {
unsigned int GetTrackID() const
sim::AuxDetIDE toAuxDetIDE(sim::AuxDetHit const &InputHit) const
sim::AuxDetSimChannel GetAuxDetSimChannelByNumber(const std::vector< sim::AuxDetHit > &InputHitVector, unsigned int inputchannel) const
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
std::vector< unsigned int > GetAuxDetChannels(const std::vector< sim::AuxDetHit > &InputHitVector) const
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.
art::ServiceHandle< geo::Geometry const > fGeo
float entryT
Entry time of particle.
std::vector< sim::AuxDetSimChannel > GetAuxDetSimChannels(const std::vector< sim::AuxDetHit > &InputHitVector) const
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 exitMomentumX
Exit X-Momentum of particle.
GenericCRTUtility(const std::string energyUnitsScale)
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.
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