29 class CosmicClusterTagger;
48 auto const*
geo = lar::providerFrom<geo::Geometry>();
56 const double driftVelocity = detp.DriftVelocity(detp.Efield(), detp.Temperature());
59 2 *
geo->DetHalfWidth() / (driftVelocity * samplingRate / 1000);
63 produces<std::vector<anab::CosmicTag>>();
64 produces<art::Assns<recob::Cluster, anab::CosmicTag>>();
70 std::unique_ptr<std::vector<anab::CosmicTag>> cosmicTagClusterVector(
71 new std::vector<anab::CosmicTag>);
72 std::unique_ptr<art::Assns<recob::Cluster, anab::CosmicTag>> assnOutCosmicTagCluster(
77 std::vector<art::Ptr<recob::Cluster>>
ClusterVec;
84 for (
unsigned int iCluster = 0; iCluster < Cluster_h->size(); iCluster++) {
86 float cosmicScore = 0;
92 std::vector<float> endPt1;
93 std::vector<float> endPt2;
96 bool failClusterTickCheck =
false;
100 failClusterTickCheck =
true;
103 failClusterTickCheck =
true;
106 if (failClusterTickCheck) {
111 if (endPt1.size() < 1) {
112 for (
int s = 0;
s < 3;
s++) {
113 endPt1.push_back(-999);
114 endPt2.push_back(-999);
119 cosmicTagClusterVector->emplace_back(endPt1, endPt2, cosmicScore, tag_id);
121 util::CreateAssn(e, *cosmicTagClusterVector, tCluster, *assnOutCosmicTagCluster);
code to link reconstructed objects back to the MC truth information
std::string fClusterModuleLabel
void produce(art::Event &e) override
std::pair< float, float > minmax(const float a, const float b)
minmax
enum anab::cosmic_tag_id CosmicTagID_t
EDProducer(fhicl::ParameterSet const &pset)
float EndTick() const
Returns the tick coordinate of the end of the cluster.
art framework interface to geometry description
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
CosmicClusterTagger(fhicl::ParameterSet const &p)
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.
Provides recob::Track data product.
std::vector< gar::rec::Cluster * > ClusterVec
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
LArSoft geometry interface.
float StartTick() const
Returns the tick coordinate of the start of the cluster.