98 cheat::BackTrackerCore
const*
bt = gar::providerFrom<cheat::BackTracker>();
101 std::vector< art::Ptr<gar::rec::CaloHit> > artHits;
104 std::map< eveLoc, std::vector< art::Ptr<gar::rec::CaloHit> > > eveCaloHitMap;
107 for(
auto const& itr : artHits ) {
109 std::vector<gar::cheat::CalIDE> eveides = bt->CaloHitToCalIDEs(itr);
111 for(
size_t ieve = 0; ieve < eveides.size(); ieve++) {
114 if( eveides[ieve].energyFrac < 0.1)
continue;
116 eveLoc el(eveides[ieve].trackID);
117 eveCaloHitMap[el].push_back(itr);
123 std::unique_ptr< std::vector<gar::rec::Cluster> > clustercol(
new std::vector<gar::rec::Cluster>);
126 for(
auto hitMapItr : eveCaloHitMap) {
129 <<
"Found cluster of " << hitMapItr.second.size() <<
" hits" 130 <<
" with eveid " << hitMapItr.first.GetEveID();
132 if(hitMapItr.second.size() <
fMinHits)
continue;
134 const simb::MCParticle *part = bt->TrackIDToParticle(hitMapItr.first.GetEveID());
137 <<
"Cannot find MCParticle for eveid: " << hitMapItr.first.GetEveID();
145 clustercol->emplace_back(cluster);
148 MF_LOG_DEBUG(
"CaloClusterCheater") <<
"adding cluster: \n" << clustercol->back() <<
"\nto collection.";
bool fIgnoreNeutrons
flag to ignore creating neutron clusters
gar::rec::Cluster CreateCluster(const simb::MCParticle *part, std::vector< art::Ptr< gar::rec::CaloHit > > hitVec)
Cluster finding and building.
void CollectHits(const art::Event &evt, const std::string &label, const std::string &instance, std::vector< art::Ptr< gar::rec::CaloHit > > &hitVector)
std::string fCaloHitModuleLabel
label for module creating rec::CaloHit objects
std::string fInstanceName
product instance name
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.
unsigned int fMinHits
minimum number of hits to make a cluster
#define MF_LOG_WARNING(category)