133 std::unique_ptr< std::vector<anab::T0> > T0col(
new std::vector<anab::T0>);
134 std::unique_ptr< art::Assns<recob::Track, anab::T0> > Trackassn(
new art::Assns<recob::Track, anab::T0>);
138 art::Handle< std::vector<recob::Track> > tpcTrackListHandle;
139 std::vector<art::Ptr<recob::Track> > tpcTrackList;
141 art::fill_ptr_vector(tpcTrackList, tpcTrackListHandle);
147 art::Handle< std::vector<sbn::crt::CRTTrack> > crtTrackListHandle;
148 std::vector<art::Ptr<sbn::crt::CRTTrack> > crtTrackList;
150 art::fill_ptr_vector(crtTrackList, crtTrackListHandle);
152 std::vector<sbn::crt::CRTTrack> crtTracks;
153 for(
auto const& crtTrack : crtTrackList){
154 crtTracks.push_back(*crtTrack);
157 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event);
160 if (tpcTrackListHandle.isValid() && crtTrackListHandle.isValid() ){
162 mf::LogInfo(
"CRTTrackMatching")
163 <<
"Number of TPC tracks = "<<tpcTrackList.size()<<
"\n"
164 <<
"Number of CRT tracks = "<<crtTrackList.size();
165 for (
size_t tpc_i = 0; tpc_i < tpcTrackList.size(); tpc_i++){
168 *tpcTrackList[tpc_i], crtTracks, event);
169 int matchedID = matchedResult.first;
170 double matchedScore = matchedResult.second;
172 if(matchedID != -99999){
173 double crtTime = ((double)(
int)crtTracks.at(matchedID).ts1_ns);
174 T0col->push_back(
anab::T0(crtTime, 0, tpcTrackList[tpc_i]->ID(), (*T0col).size(), matchedScore));
182 event.put(std::move(T0col));
183 event.put(std::move(Trackassn));
art::InputTag fCrtTrackModuleLabel
name of crt producer
art::InputTag fTpcTrackModuleLabel
name of track producer
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
CRTTrackMatchAlg trackAlg
std::pair< int, double > GetMatchedCRTTrackIdAndScore(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)