167 art::Handle< std::vector<recob::PFParticle> > pfParticleHandle;
169 art::FindManyP< recob::Track > pfPartToTrackAssoc(pfParticleHandle, event,
fTpcTrackModuleLabel);
174 art::FindManyP<anab::Calorimetry> findManyCalo(tpcTrackHandle, event,
fCaloModuleLabel);
177 std::vector<recob::Track> nuTracks;
178 for (
const size_t daughterId : pfparticle.
Daughters()){
181 art::Ptr<recob::PFParticle> pParticle = pfParticleMap.at(daughterId);
182 const std::vector< art::Ptr<recob::Track> > associatedTracks(pfPartToTrackAssoc.at(pParticle.key()));
183 if(associatedTracks.size() != 1)
continue;
186 nuTracks.push_back(track);
197 if(nuTracks.size() == 0)
return false;
200 std::sort(nuTracks.begin(), nuTracks.end(), [](
auto&
left,
auto&
right){
201 return left.Length() >
right.Length();});
205 std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(track.ID());
221 auto crtTrackHandle =
event.getValidHandle<std::vector<sbn::crt::CRTTrack>>(
fCrtTrackModuleLabel);
222 std::vector<sbn::crt::CRTTrack> crtTracks = (*crtTrackHandle);
229 std::vector<recob::Track>
tracks;
230 for(
auto const& tpcTrack : (*tpcTrackHandle)){
231 tracks.push_back(tpcTrack);
238 std::vector<std::pair<recob::Track, double>> secondaryTracks;
240 TVector3 start = track.Vertex<TVector3>();
241 TVector3
end = track.End<TVector3>();
245 for(
size_t i = 1; i < nuTracks.size(); i++){
249 TVector3 start2 = track2.
Vertex<TVector3>();
250 TVector3 end2 = track2.
End<TVector3>();
253 double angle = (end - start).Angle(end2 - start2);
254 secondaryTracks.push_back(std::make_pair(track2, angle));
260 if(secondaryTracks.size() > 0){
262 std::sort(secondaryTracks.begin(), secondaryTracks.end(), [](
auto&
left,
auto&
right){
276 std::vector<art::Ptr<anab::Calorimetry>> calos = findManyCalo.at(track.ID());
279 std::vector<art::Ptr<anab::Calorimetry>> calos2 = findManyCalo.at(track2.
ID());
288 std::vector<art::Ptr<recob::Hit>> hits2 = findManyHits.at(track2.
ID());
295 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCrtHitModuleLabel);
296 std::vector<sbn::crt::CRTHit> crtHits = (*crtHitHandle);
305 if(secondaryTracks.size() == 0){
309 std::vector<art::Ptr<anab::Calorimetry>> calos = findManyCalo.at(track.ID());
320 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCrtHitModuleLabel);
321 std::vector<sbn::crt::CRTHit> crtHits = (*crtHitHandle);
bool CrtHitCosmicId(recob::Track track, std::vector< art::Ptr< recob::Hit >> hits, std::vector< sbn::crt::CRTHit > crtHits)
bool CrtTrackCosmicId(recob::Track track, std::vector< art::Ptr< recob::Hit >> hits, std::vector< sbn::crt::CRTTrack > crtTracks)
bool GeometryCosmicId(recob::Track &track, std::vector< art::Ptr< recob::Hit >> &hits, std::map< geo::TPCID, bool > &tpc_flashes)
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
bool FiducialVolumeCosmicId(recob::Track track)
ClusterModuleLabel join with tracks
art::InputTag fTpcTrackModuleLabel
double fMinVertexDistance
bool ApaCrossCosmicId(const recob::Track &track, std::vector< art::Ptr< recob::Hit >> &hits, std::map< geo::CryostatID, std::vector< double >> &t_zeros)
process_name use argoneut_mc_hitfinder track
bool InFiducial(geo::Point_t point)
ApaCrossCosmicIdAlg acTag
StoppingParticleCosmicIdAlg spTag
PandoraT0CosmicIdAlg ptTag
CrtTrackCosmicIdAlg ctTag
FiducialVolumeCosmicIdAlg fvTag
double Length(size_t p=0) const
Access to various track properties.
art::InputTag fCaloModuleLabel
Point_t const & Vertex() const
auto end(FixedBins< T, C > const &) noexcept
bool BeamFlash(std::vector< double > flashes, double beamTimeMin, double beamTimeMax)
art::InputTag fCrtTrackModuleLabel
double fMinSecondTrackLength
bool CpaCrossCosmicId(recob::Track track, std::vector< recob::Track > tracks, art::FindManyP< recob::Hit > hitAssoc)
bool PandoraT0CosmicId(recob::Track track, const art::Event &event)
GeometryCosmicIdAlg geoTag
Point_t const & End() const
finds tracks best matching by angle
CpaCrossCosmicIdAlg ccTag
art::InputTag fCrtHitModuleLabel
art::InputTag fPandoraLabel
bool StoppingParticleCosmicId(recob::Track track, std::vector< art::Ptr< anab::Calorimetry >> calos)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: