31 class CosmicClusterTagger;
50 auto const& tpc = lar::providerFrom<geo::Geometry>()->TPC({0, 0});
58 const double driftVelocity = detp.DriftVelocity(detp.Efield(), detp.Temperature());
64 produces<std::vector<anab::CosmicTag>>();
65 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);
128 e.
put(std::move(cosmicTagClusterVector));
129 e.
put(std::move(assnOutCosmicTagCluster));
code to link reconstructed objects back to the MC truth information
std::string fClusterModuleLabel
Utilities related to art service access.
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.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
#define DEFINE_ART_MODULE(klass)
CosmicClusterTagger(fhicl::ParameterSet const &p)
Declaration of cluster object.
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
Provides recob::Track data product.
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.
float StartTick() const
Returns the tick coordinate of the start of the cluster.
art framework interface to geometry description