103 std::vector<art::Ptr<recob::Hit>> hits;
115 std::map<eveLoc, std::vector<art::Ptr<recob::Hit>>> eveHitMap;
120 for (
auto const& itr : hits) {
125 for (
size_t e = 0;
e < eveides.size(); ++
e) {
129 if (eveides[
e].energyFrac < 0.1)
continue;
131 eveLoc el(eveides[
e].trackID, itr->WireID().planeID());
133 eveHitMap[el].push_back(itr);
140 std::unique_ptr<std::vector<recob::Cluster>> clustercol(
new std::vector<recob::Cluster>);
141 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> assn(
151 ClusterParamsImportWrapper<StandardClusterParamsAlg> ClusterParamAlgo;
153 for (
auto hitMapItr : eveHitMap) {
158 if (hitMapItr.second.size() <
fMinHits)
continue;
161 double xyz[3] = {0.};
162 double xyz2[3] = {0.};
163 double local[3] = {0.};
164 unsigned int cryostat = hitMapItr.first.planeID.Cryostat;
165 unsigned int tpc = hitMapItr.first.planeID.TPC;
166 unsigned int plane = hitMapItr.first.planeID.Plane;
170 <<
"make cluster for eveID: " << hitMapItr.first.eveID <<
" in cryostat: " << cryostat
171 <<
" tpc: " << tpc <<
" plane: " << plane <<
" view: " << hitMapItr.second.at(0)->View();
184 xyz2[1] = xyz[1] + 10. * part->
Py() / part->
P();
185 xyz2[2] = xyz[2] + 10. * part->
Pz() / part->
P();
195 w1 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
201 w2 = atoi(e.explain_self().substr(e.explain_self().find(
"#") + 1, 5).c_str());
206 std::sort(hitMapItr.second.rbegin(), hitMapItr.second.rend(),
sortHitsByWire);
208 std::sort(hitMapItr.second.begin(), hitMapItr.second.end(),
sortHitsByWire);
211 double startWire = hitMapItr.second.front()->WireID().Wire;
212 double startTime = hitMapItr.second.front()->PeakTimeMinusRMS();
213 double endWire = hitMapItr.second.back()->WireID().Wire;
214 double endTime = hitMapItr.second.back()->PeakTimePlusRMS();
221 (((hitMapItr.first.eveID) * 10 + planeID.
Plane) * 10 +
228 ClusterParamAlgo.ImportHits(gser, hitMapItr.second);
242 hitMapItr.second.at(0)->View(),
247 clustercol->emplace_back(
cluster.move());
252 mf::LogInfo(
"ClusterCheater") <<
"adding cluster: \n" 253 << clustercol->back() <<
"\nto collection.";
double Py(const int i=0) const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const simb::MCParticle * TrackIdToParticle_P(int id) const
void SetEveIdCalculator(sim::EveIdCalculator *ec)
The data type to uniquely identify a Plane.
CryostatID_t Cryostat
Index of cryostat.
Cluster finding and building.
unsigned int fMinHits
minimum number of hits to make a cluster
std::string fHitModuleLabel
label for module creating recob::Hit objects
static const SentryArgument_t Sentry
An instance of the sentry object.
bool sortHitsByWire(art::Ptr< recob::Hit > a, art::Ptr< recob::Hit > b)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
double P(const int i=0) const
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
PlaneID_t Plane
Index of the plane within its TPC.
const sim::ParticleList & ParticleList() const
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
std::vector< sim::TrackIDE > HitToEveTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
double Pz(const int i=0) const
double Vz(const int i=0) const
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
LArSoft geometry interface.
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
double Vy(const int i=0) const
int ID_t
Type of cluster ID.
cet::coded_exception< error, detail::translate > exception