23 #include "cetlib_except/exception.h" 96 std::multimap<double, KHitTrack> newmap;
111 newmap.insert(std::make_pair(s, trh));
137 std::vector<recob::tracking::Point_t> xyz;
138 std::vector<recob::tracking::Vector_t> pxpypz;
139 std::vector<recob::tracking::SMatrixSym55> cov;
140 std::vector<recob::TrajectoryPointFlags> outFlags;
160 xyz.push_back({pos[0], pos[1], pos[2]});
167 double p = std::sqrt(mom[0] * mom[0] + mom[1] * mom[1] + mom[2] * mom[2]);
168 if (p == 0.)
throw cet::exception(
"KGTrack") << __func__ <<
": null momentum\n";
169 pxpypz.push_back({mom[0], mom[1], mom[2]});
182 const std::shared_ptr<const Surface> psurf(
183 new SurfXYZPlane(pos[0], pos[1], pos[2], mom[0], mom[1], mom[2]));
186 if (!dist)
throw cet::exception(
"KGTrack") << __func__ <<
": error propagation failed\n";
187 for (
int i = 0; i < 5; ++i) {
188 for (
int j = 0; j < 5; ++j)
195 cov.push_back(covar);
203 if (xyz.size() >= 2) {
237 const std::shared_ptr<const KHitBase>&
hit = track.
getHit();
238 if (
const KHitWireX* phit = dynamic_cast<const KHitWireX*>(&*hit)) {
242 hittpindex.push_back(counter - 1);
245 else if (
const KHitWireLine* phit = dynamic_cast<const KHitWireLine*>(&*hit)) {
249 hittpindex.push_back(counter - 1);
264 double oldxyz[3] = {0., 0., 0.};
268 double s = ele.first;
274 double tmom = std::sqrt(mom[0] * mom[0] + mom[1] * mom[1] + mom[2] * mom[2]);
281 double dx = xyz[0] - oldxyz[0];
282 double dy = xyz[1] - oldxyz[1];
283 double dz = xyz[2] - oldxyz[2];
284 len += std::sqrt(dx * dx + dy * dy + dz * dz);
288 std::ios_base::fmtflags
f = out.flags();
294 <<
", plane=" <<
std::setw(1) << plane <<
"\n";
311 return trg.
Print(out);
const TrackError & getError() const
Track error matrix.
void reserve(size_type n)
const std::shared_ptr< const KHitBase > & getHit() const
Measurement.
void fillHits(art::PtrVector< recob::Hit > &hits, std::vector< unsigned int > &hittpindex) const
Fill a PtrVector of Hits.
static constexpr Mask_t makeMask(Flags...flags)
Returns a bit mask with only the specified bit set.
void recalibrate()
Recalibrate track map.
int getMeasPlane() const
Measurement plane index.
const KHitTrack & endTrack() const
Track at end point.
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 > > SMatrixSym55
Kalman filter wire-time measurement on a SurfWireX surface.
void addTrack(const KHitTrack &trh)
Add track.
Q_EXPORT QTSManip setprecision(int p)
void fillTrack(detinfo::DetectorPropertiesData const &detProp, recob::Track &track, int id) const
Fill a recob::Track.
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
void push_back(Ptr< U > const &p)
void getPosition(double xyz[3]) const
Get position of track.
double getPath() const
Propagation distance.
Propagate to SurfXYZPlane surface.
std::optional< double > err_prop(KETrack &tre, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, KTrack *ref=0, TrackMatrix *prop_matrix=0) const
Propagate with error, but without noise.
bool isNull() const noexcept
Set of flags pertaining a point of the track.
Detector simulation of raw signals on wires.
Q_EXPORT QTSManip setw(int w)
std::multimap< double, KHitTrack > fTrackMap
KHitTrack collection, indexed by path distance.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
void getMomentum(double mom[3]) const
Get momentum vector of track.
std::ostream & Print(std::ostream &out) const
Printout.
Kalman filter wire-time measurement on a SurfWireLine surface.
Provides recob::Track data product.
void setPath(double path)
Set propagation distance.
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
A collection of KHitTracks.
second_as<> second
Type of time stored in seconds, in double precision.
bool isValid() const
Validity flag.
double getChisq() const
Fit chisquare.
const KHitTrack & startTrack() const
Track at start point.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
cet::coded_exception< error, detail::translate > exception
bool isValid() const
Test if track is valid.