141 std::unique_ptr<vector<sbn::crt::CRTTrack> > CRTTrackCol(
new vector<sbn::crt::CRTTrack>);
142 std::unique_ptr< art::Assns<sbn::crt::CRTTrack, sbn::crt::CRTHit> > Trackassn(
new art::Assns<sbn::crt::CRTTrack, sbn::crt::CRTHit>);
143 art::PtrMaker<sbn::crt::CRTTrack> makeTrackPtr(
evt);
146 art::Handle< vector<sbn::crt::CRTHit> > rawHandle;
150 if(!rawHandle.isValid()){
151 mf::LogWarning(
"CRTTrackProducer")
160 vector<art::Ptr<sbn::crt::CRTHit> > hitlist;
163 art::fill_ptr_vector(hitlist, rawHandle);
165 map<art::Ptr<sbn::crt::CRTHit>,
int> hitIds;
167 for(
size_t i = 0; i<hitlist.size(); i++){
168 hitIds[hitlist[i]] = i;
174 for(
size_t i = 0; i<CRTTzeroVect.size(); i++){
178 map<int, vector<art::Ptr<sbn::crt::CRTHit>>> hits;
180 for (
size_t ah = 0; ah< CRTTzeroVect[i].size(); ++ah){
183 int ip = CRTTzeroVect[i][ah]->plane;
184 hits[ip].push_back(CRTTzeroVect[i][ah]);
188 vector<pair<sbn::crt::CRTHit, vector<int>>> allHits;
190 for (
auto &keyVal : hits){
193 int ip = keyVal.first;
194 vector<pair<sbn::crt::CRTHit, vector<int>>> ahits =
trackAlg.
AverageHits(hits[ip], hitIds);
196 allHits.insert(allHits.end(), ahits.begin(), ahits.end());
211 nTrack += trackCandidates.size();
213 for(
size_t j = 0; j < trackCandidates.size(); j++){
215 CRTTrackCol->emplace_back(trackCandidates[j].
first);
216 art::Ptr<sbn::crt::CRTTrack> trackPtr = makeTrackPtr(CRTTrackCol->size()-1);
218 for (
size_t ah = 0; ah< CRTTzeroVect[i].size(); ++ah){
219 Trackassn->addSingle(trackPtr, CRTTzeroVect[i][ah]);
222 if(trackCandidates[j].first.complete)
375 evt.put(std::move(CRTTrackCol));
376 evt.put(std::move(Trackassn));
378 mf::LogInfo(
"CRTTrackProducer")
379 <<
"Number of tracks = "<<nTrack<<
"\n"
380 <<
"Number of complete tracks = "<<nCompTrack<<
"\n"
381 <<
"Number of incomplete tracks = "<<nIncTrack;
vector< vector< art::Ptr< sbn::crt::CRTHit > > > CreateCRTTzeros(vector< art::Ptr< sbn::crt::CRTHit >>)
vector< pair< sbn::crt::CRTHit, vector< int > > > AverageHits(vector< art::Ptr< sbn::crt::CRTHit >> hits, map< art::Ptr< sbn::crt::CRTHit >, int > hitIds)
vector< pair< sbn::crt::CRTTrack, vector< int > > > CreateTracks(vector< pair< sbn::crt::CRTHit, vector< int >>> hits)