133 mf::LogWarning(
"SpacePointAlg_TimeSort")
134 <<
"Time offsets not set before createSpacePoints call!"
135 <<
"\nYou should call SpacePointAlg_TimeSort::setTimeOffsets() in beginRun()!"
136 <<
"\nWill be set now, but you should modify your code!";
140 mf::LogWarning(
"SpacePointAlg_TimeSort")
141 <<
"Coordinate arrays not filled before createSpacePoints call!"
142 <<
"\nYou should call SpacePointAlg_TimeSort::fillCoordinateArrays() in beginRun()!"
143 <<
"\nWill be filled now, but you should modify your code!";
152 MF_LOG_DEBUG(
"SpacePointAlg_TimeSort")
153 <<
"Sorted " << hitVec_U.size() <<
" u hits, " << hitVec_V.size() <<
" v hits, "
154 << hitVec_Y.size() <<
" y hits.";
157 std::vector<art::Ptr<recob::Hit>>::iterator ihitu = hitVec_U.begin();
158 std::vector<art::Ptr<recob::Hit>>::iterator ihitv = hitVec_V.begin();
159 std::vector<art::Ptr<recob::Hit>>::iterator ihity = hitVec_Y.begin();
160 std::vector<art::Ptr<recob::Hit>>::iterator ihitv_inner, ihity_inner;
164 double time_hitv_inner, time_hity_inner;
165 while (ihitu != hitVec_U.end()) {
168 mf::LogInfo(
"SpacePointAlg_TimeSort")
169 <<
"Hit times (u,v,y)=(" << time_hitu <<
"," << time_hitv <<
"," << time_hity <<
")";
174 if (ihitv == hitVec_V.end())
break;
177 if (ihitv == hitVec_V.end())
break;
182 if (ihity == hitVec_Y.end())
break;
185 if (ihity == hitVec_Y.end())
break;
200 mf::LogInfo(
"SpacePointAlg_TimeSort") <<
"Matching hit times (u,v,y)=(" << time_hitu <<
","
201 << time_hitv <<
"," << time_hity <<
")";
206 time_hitv_inner = (*ihitv_inner)->PeakTime() +
TIME_OFFSET_V;
208 time_hity_inner = (*ihity_inner)->PeakTime() +
TIME_OFFSET_Y;
213 unsigned int uwire = (*ihitu)->WireID().Wire;
214 unsigned int vwire = (*ihitv_inner)->WireID().Wire;
215 unsigned int ywire = (*ihity_inner)->WireID().Wire;
217 mf::LogInfo(
"SpacePointAlg_TimeSort")
235 xyz[2] = (
coordinates_UV_z[vwire][uwire] + coordinates_UY_z[ywire][uwire]) * 0.5;
238 double t_val = (time_hitu + time_hitv_inner + time_hity_inner) / 3.;
239 double t_err = 0.5 * std::sqrt((time_hitu - t_val) * (time_hitu - t_val) +
240 (time_hitv_inner - t_val) * (time_hitv_inner - t_val) +
241 (time_hity_inner - t_val) * (time_hity_inner - t_val));
247 spptCollection->push_back(spt);
250 std::vector<art::Ptr<recob::Hit>> myhits = {*ihitu, *ihitv_inner, *ihity_inner};
251 spptAssociatedHits->push_back(myhits);
255 if (time_hitv_inner <= time_hity_inner) {
257 if (ihitv_inner == hitVec_V.end())
break;
258 time_hitv_inner = (*ihitv_inner)->PeakTime() +
TIME_OFFSET_V;
262 if (ihity_inner == hitVec_Y.end())
break;
263 time_hity_inner = (*ihity_inner)->PeakTime() +
TIME_OFFSET_Y;
270 MF_LOG_DEBUG(
"SpacePointAlg_TimeSort")
271 <<
"Finished with " << spptCollection->size() <<
" spacepoints.";
void sortHitsByTime(std::vector< art::Ptr< recob::Hit >> &hits_handle) const
float fYDiffMax
Maximum allowed time difference.
void setTimeOffsets(detinfo::DetectorPropertiesData const &detProp)
boost::multi_array< double, 2 > coordinates_UV_y
float fZDiffMax
Maximum allowed y-coordinate difference.
boost::multi_array< double, 2 > coordinates_UY_z
bool TIME_OFFSET_SET
Maximum allowed z-coordinate difference.
boost::multi_array< double, 2 > coordinates_UY_y
void fillCoordinatesArrays()
boost::multi_array< double, 2 > coordinates_UV_z