31 class CosmicClusterTagger;
50 auto const*
geo = lar::providerFrom<geo::Geometry>();
58 const double driftVelocity = detp.DriftVelocity(detp.Efield(), detp.Temperature());
61 2 *
geo->DetHalfWidth() / (driftVelocity * samplingRate / 1000);
65 produces<std::vector<anab::CosmicTag>>();
66 produces<art::Assns<recob::Cluster, anab::CosmicTag>>();
71 std::unique_ptr<std::vector<anab::CosmicTag>> cosmicTagClusterVector(
72 new std::vector<anab::CosmicTag>);
73 std::unique_ptr<art::Assns<recob::Cluster, anab::CosmicTag>> assnOutCosmicTagCluster(
78 std::vector<art::Ptr<recob::Cluster>> ClusterVec;
85 for (
unsigned int iCluster = 0; iCluster < Cluster_h->size(); iCluster++) {
87 float cosmicScore = 0;
93 std::vector<float> endPt1;
94 std::vector<float> endPt2;
97 bool failClusterTickCheck =
false;
101 failClusterTickCheck =
true;
104 failClusterTickCheck =
true;
107 if (failClusterTickCheck) {
112 if (endPt1.size() < 1) {
113 for (
int s = 0; s < 3; s++) {
114 endPt1.push_back(-999);
115 endPt2.push_back(-999);
120 cosmicTagClusterVector->emplace_back(endPt1, endPt2, cosmicScore, tag_id);
122 util::CreateAssn(e, *cosmicTagClusterVector, tCluster, *assnOutCosmicTagCluster);
129 e.
put(std::move(cosmicTagClusterVector));
130 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)
Provides recob::Track data product.
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.
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.
Namespace collecting geometry-related classes utilities.
float StartTick() const
Returns the tick coordinate of the start of the cluster.
art framework interface to geometry description