2 #include "art/Utilities/ToolMacros.h"
3 #include "fhiclcpp/ParameterSet.h"
62 fFVInsetMinX(p.
get<double>(
"FVInsetMinX")),
63 fFVInsetMaxX(p.
get<double>(
"FVInsetMaxX")),
64 fFVInsetMinY(p.
get<double>(
"FVInsetMinY")),
65 fFVInsetMaxY(p.
get<double>(
"FVInsetMaxY")),
66 fFVInsetMinZ(p.
get<double>(
"FVInsetMinZ")),
67 fFVInsetMaxZ(p.
get<double>(
"FVInsetMaxZ")),
68 fMinTimeTickInset(p.
get<double>(
"MinTimeTickInset")),
69 fMaxTimeTickInset(p.
get<double>(
"MaxTimeTickInset")),
70 fEndMediandQdxCut(p.
get<double>(
"EndMediandQdxCut")),
71 fNumberTimeSamples(p.
get<unsigned>(
"NumberTimeSamples")),
72 fRequireDownwards(p.
get<
bool>(
"RequireDownwards",
true)),
73 fMediandQdxRRMax(p.
get<double>(
"MediandQdxRRMax", 5.)),
74 fCheckFiducialX(p.
get<
bool>(
"CheckFiducialX"))
82 tend = geometry->
end_TPC(cryo.ID());
83 std::vector<geo::BoxBoundedGeo> this_tpc_volumes;
84 while (iTPC != tend) {
100 for (
const std::vector<geo::BoxBoundedGeo> &tpcs:
fTPCVolumes) {
101 double XMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinX() < rhs.MinX(); })->MinX();
102 double YMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinY() < rhs.MinY(); })->MinY();
103 double ZMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinZ() < rhs.MinZ(); })->MinZ();
105 double XMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxX() < rhs.MaxX(); })->MaxX();
106 double YMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxY() < rhs.MaxY(); })->MaxY();
107 double ZMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxZ() < rhs.MaxZ(); })->MaxZ();
124 bool end_is_fid =
false;
144 std::vector<double> endp_dqdx;
148 double med_dqdx = -1;
149 if (endp_dqdx.size()) {
150 unsigned middle = endp_dqdx.size() / 2;
151 std::nth_element(endp_dqdx.begin(), endp_dqdx.begin() + middle, endp_dqdx.end());
152 med_dqdx = endp_dqdx[middle];
155 if (endp_dqdx.size() % 2 == 0) {
156 unsigned other_middle = middle - 1;
157 std::nth_element(endp_dqdx.begin(), endp_dqdx.begin() + other_middle, endp_dqdx.end());
158 med_dqdx = (med_dqdx + endp_dqdx[other_middle]) / 2.;
164 return downwards && end_is_fid && time_is_fid && valid_med_dqdx;
float hit_max_time_p2_tpcE
Max hit time of track on plane 2 TPC E.
TrackCaloSkimmerSelectStoppingTrack(const fhicl::ParameterSet &p)
Utilities related to art service access.
const geo::GeometryCore * geometry
std::vector< geo::BoxBoundedGeo > fFiducialVolumes
Geometry information for a single TPC.
float hit_min_time_p2_tpcE
Min hit time of track on plane 2 TPC E.
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
return track match has_match and!particle is_contained
std::vector< geo::BoxBoundedGeo > fActiveVolumes
std::vector< std::vector< geo::BoxBoundedGeo > > fTPCVolumes
Vector3D end
End position of track [cm].
TPC_iterator begin_TPC() const
Returns an iterator pointing to the first TPC in the detector.
float dqdx
Initial computed dq/dx of hit [ADC/cm].
Access the description of detector geometry.
~TrackCaloSkimmerSelectStoppingTrack()
auto end(FixedBins< T, C > const &) noexcept
Description of geometry of one entire detector.
bool Select(const TrackInfo &t) override
For children to implement: Whether to select a given track.
float rr
Residual range of hit along track [cm].
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
float hit_min_time_p2_tpcW
Min hit time of track on plane 2 TPC W.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
std::vector< TrackHitInfo > hits2
List of hits on plane 2.
Forward iterator browsing all geometry elements in the detector.
Vector3D dir
Direction of track.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
unsigned fNumberTimeSamples
bool oncalo
Whether the hit is on the track calorimetry.
float hit_max_time_p2_tpcW
Max hit time of track on plane 2 TPC W.
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
art framework interface to geometry description
TPC_iterator end_TPC() const
Returns an iterator pointing after the last TPC in the detector.