466 std::vector<art::Ptr<recob::PFParticle>>
const& pfparticles =
e.getProduct<std::vector<art::Ptr<recob::PFParticle>>> (
fT0selProducer);
467 if(pfparticles.empty()) {
472 std::vector<sim::BeamGateInfo>
const& beamgate =
e.getProduct<std::vector<sim::BeamGateInfo>> (
fBeamGateProducer);
474 mf::LogWarning(
fLogCategory) <<
"No Beam Gate Information!";
476 if(beamgate.size() > 1)
477 mf::LogWarning(
fLogCategory) <<
"Event has multiple beam gate info labels! (maybe this changes later to be standard)";
492 art::FindOneP<recob::Track> particleTracks(pfparticles,
e,
fTrackProducer);
493 art::FindOneP<anab::T0> t0Tracks(pfparticles,
e,
fT0Producer);
494 std::vector<recob::OpFlash>
const &particleFlashes =
e.getProduct<std::vector<recob::OpFlash>>(
fFlashProducer);
497 art::ValidHandle<std::vector<recob::Track>> allTracks =
e.getValidHandle<std::vector<recob::Track>>(
fTrackProducer);
498 art::FindManyP<recob::Hit,recob::TrackHitMeta> trkht(allTracks,
e,
fTrackProducer);
499 art::FindManyP<anab::Calorimetry> calorim(allTracks,
e,
fCaloProducer);
504 unsigned int processed = 0;
505 for(
unsigned int iPart = 0; iPart < pfparticles.size(); ++iPart)
507 art::Ptr<recob::Track>
const& trackPtr = particleTracks.at(iPart);
508 if(trackPtr.isNull())
continue;
514 art::Ptr<anab::T0>
const& t0Ptr = t0Tracks.at(iPart);
515 float const track_t0 = t0Ptr->Time();
516 if(!particleFlashes.empty())
519 for(
unsigned int iFlash = 0; iFlash < particleFlashes.size(); ++iFlash)
523 float const flash_pe = flashPtr.
TotalPE();
524 float const flash_time = flashPtr.
Time();
525 float const flash_x = flashPtr.
XCenter();
526 float const flash_y = flashPtr.
YCenter();
527 float const flash_z = flashPtr.
ZCenter();
528 float flash_t0_diff = flash_time - track_t0/1e3;
544 trackInfo.
trackID = trackPtr->ID();
545 trackInfo.
t0 = track_t0/1e3;
554 std::swap(startPoint, endPoint);
555 startDir = -trackPtr->EndDirection();
558 trackInfo.
start_x = startPoint.X();
559 trackInfo.
start_y = startPoint.Y();
560 trackInfo.
start_z = startPoint.Z();
561 trackInfo.
end_x = endPoint.X();
562 trackInfo.
end_y = endPoint.Y();
563 trackInfo.
end_z = endPoint.Z();
564 trackInfo.
dir_x = startDir.X();
565 trackInfo.
dir_y = startDir.Y();
566 trackInfo.
dir_z = startDir.Z();
567 trackInfo.
length = trackPtr->Length();
569 std::vector<geo::Point_t>
const trackPath
570 = extractTrajectory(*trackPtr, flipTrack);
573 trackInfo.
middle_x = middlePoint.X();
574 trackInfo.
middle_y = middlePoint.Y();
575 trackInfo.
middle_z = middlePoint.Z();
589 auto itBeforeCathode = trackPath.begin() + crossInfo.
indexBefore;
590 auto itAfterCathode = trackPath.begin() + crossInfo.
indexAfter;
598 if (
distance(middleAfterCathode, cathode) < 0.0) {
599 assert(
distance(middleBeforeCathode, cathode) >= 0.0);
601 std::swap(itBeforeCathode, itAfterCathode);
603 std::swap(middleBeforeCathode, middleAfterCathode);
626 unsigned int plane = 0;
628 std::vector<art::Ptr<recob::Hit>>
const& allHits = trkht.at(trackPtr.key());
629 std::vector<const recob::TrackHitMeta*>
const& trkmetas = trkht.data(trackPtr.key());
630 std::vector<art::Ptr<anab::Calorimetry>>
const& calorimetrycol = calorim.at(trackPtr.key());
631 std::vector<std::vector<unsigned int>> hits(plane);
635 for (
size_t ih = 0; ih < allHits.size(); ++ih)
638 sbn::selHitInfo hinfo =
makeHit(*allHits[ih], allHits[ih].key(), *trackPtr, *trkmetas[ih], calorimetrycol, geom);
646 for (
size_t i = 0; i <
fHitStore.size(); ++i)
659 totq_dqdx += q_hit_dqdx;
683 triggerResponseExtractors.
fetch(iPart);
690 mf::LogInfo(
fLogCategory) <<
"Particles Processed: " << processed;
sbn::selTriggerInfo fTriggerInfo
std::vector< sbn::selLightInfo > fFlashStore
std::vector< sbn::selHitInfo > fHitStore
sbn::selBeamInfo fBeamInfo
float middle_y
Half-way distance along the trajectory.
art::InputTag const fTriggerProducer
art::InputTag const fBeamGateProducer
art::InputTag const fFlashProducer
float atcathode_z
Cathode crossing point of trajectory.
geo::Point_t crossingPoint
Trajectory crossing point.
sbn::details::TriggerResponseManager fTriggerResponses
Manages filling of trigger result branches.
CathodeDesc_t findTPCcathode(geo::Point_t const &point, geo::GeometryCore const &geom)
Returns cathode information for cryostat at the specified point.
sbn::selLightInfo fFlashInfo
double after
Length of the path "after" the cathode.
unsigned int beamGateType
float atcathode_x
Cathode crossing point of trajectory.
art::InputTag const fCaloProducer
float beforecathode
Track path length before cathode (lower x).
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Simple description for the cathode.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
float midaftercathode_x
Midpoint of subpath after cathode.
float atcathode_y
Cathode crossing point of trajectory.
std::size_t indexBefore
Index of the point "before" cathode.
float middle_x
Half-way distance along the trajectory.
float midaftercathode_z
Midpoint of subpath after cathode.
std::string const fLogCategory
Description of geometry of one entire detector.
float midbeforecathode_x
Midpoint of subpath before cathode.
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Extractors extractorsFor(art::Event const &event)
Returns an object to extract trigger information from event.
std::uint64_t beamGateTime
art::InputTag const fT0selProducer
unsigned int fTotalProcessed
float midbeforecathode_y
Midpoint of subpath before cathode.
float aftercathode
Track path length before cathode (higher x).
CathodeCrossing_t detectCrossing(Iter begin, Iter end, CathodeDesc_t const &cathode)
Returns the crossing point of a trajectory on the cathode.
float midaftercathode_y
Midpoint of subpath after cathode.
double before
Length of the path "before" the cathode.
float middle_z
Half-way distance along the trajectory.
sbn::selHitInfo makeHit(const recob::Hit &hit, unsigned hkey, const recob::Track &trk, const recob::TrackHitMeta &thm, const std::vector< art::Ptr< anab::Calorimetry >> &calo, const geo::GeometryCore *geo)
sbn::selTrackInfo fTrackInfo
float midbeforecathode_z
Midpoint of subpath before cathode.
auto pathMiddlePoint(FIter itFirst, LIter itLast, double relTarget=0.5)
Returns the geometric point in the middle of the specified path.
art::InputTag const fTrackProducer
std::uint64_t triggerTime
double XCenter() const
Returns the estimated center on x direction (.
bool const fForceDowngoing
Whether to force all tracks to be downgoing.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Information about the cathode crossing of a path.
BeamType_t BeamType() const
std::size_t indexAfter
Index of the point "after" cathode.
geo::Point_t middlePoint(BeginIter begin, EndIter end)
Returns the middle of the specified points.
art::InputTag const fT0Producer