All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/CosmicId/Algs/CrtTrackCosmicIdAlg.cc
Go to the documentation of this file.
1 #include "CrtTrackCosmicIdAlg.h"
2 
3 namespace sbnd{
4 
6 
7  this->reconfigure(config);
8 
9 }
10 
11 
13 
14 }
15 
16 
18 
19 }
20 
21 
23 
24  trackMatchAlg = config.TrackMatchAlg();
25  fBeamTimeMin = config.BeamTimeLimits().BeamTimeMin();
26  fBeamTimeMax = config.BeamTimeLimits().BeamTimeMax();
27 
28  return;
29 }
30 
31 
32 // Tags track as cosmic if it matches a CRTTrack
34  recob::Track track, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event){
35 
36  // Get the closest matching CRT track ID
37  int crtID = trackMatchAlg.GetMatchedCRTTrackId(detProp, track, crtTracks, event);
38 
39  // If matching failed
40  if(crtID == -99999) return false;
41 
42  // If track matched to a through going CRT track then it is a cosmic
43  if(crtTracks.at(crtID).complete) return true;
44 
45  // If it matches a track through just the top planes make sure it is outside of the beam time
46  double crtTime = ((double)(int)crtTracks.at(crtID).ts1_ns) * 1e-3; // [us]
47  if(crtTime < fBeamTimeMin || crtTime > fBeamTimeMax) return true;
48 
49  return false;
50 
51 }
52 
53 }
int GetMatchedCRTTrackId(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
process_name use argoneut_mc_hitfinder track
bool CrtTrackCosmicId(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
do i e
stream1 can override from command line with o or output services user sbnd
auto const detProp
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: