LDMX Software
TrigScintClusterProducer.h
Go to the documentation of this file.
1
7#ifndef TRIGSCINT_TRIGSCINTCLUSTERPRODUCER_H
8#define TRIGSCINT_TRIGSCINTCLUSTERPRODUCER_H
9
10// LDMX Framework
11#include <map>
12
13#include "Framework/Configure/Parameters.h" // Needed to import parameters from configuration file
14#include "Framework/Event.h"
15#include "Framework/EventProcessor.h" //Needed to declare processor
17#include "TrigScint/Event/TrigScintCluster.h"
18#include "TrigScint/Event/TrigScintHit.h"
19
20namespace trigscint {
21
27 public:
28 TrigScintClusterProducer(const std::string& name, framework::Process& process)
29 : Producer(name, process) {}
30
32
33 void produce(framework::Event& event) override;
34
38 virtual void addHit(uint idx, ldmx::TrigScintHit hit);
39
40 void onProcessStart() override;
41
42 void onProcessEnd() override;
43
44 private:
45 // collection of clusters produced
46 std::vector<ldmx::TrigScintCluster> clusters_;
47
48 // cluster seeding threshold
49 double seed_{0.};
50
51 // min threshold for adding a hit to a cluster
52 double min_thr_{0.};
53
54 // max number of neighboring hits to combine when forming a cluster
55 int max_width_{2};
56
57 // PE-amplitude weighting for centroid values
58 bool ampl_weighting_{true};
59
60 // specific verbosity of this producer
61 int verbose_{0};
62
63 // expected arrival time of hits in the pad [ns]
64 double pad_time_{0.};
65
66 // maximum allowed delay for hits to be considered for clustering
67 double time_tolerance_{0.};
68
69 // input collection (hits)
70 std::string input_collection_;
71
72 // output collection (clusters)
73 std::string output_collection_;
74
75 // specific pass name to use for track making
76 std::string pass_name_{""};
77
78 // vertical bar start index
79 int vert_bar_start_idx_{52};
80
81 // cluster channel nb centroid (will be content weighted)
82 float centroid_{0.};
83
84 // cluster channel nb horizontal centroid (will be content weighted)
85 float centroid_x_{-1};
86
87 // cluster channel nb vertical centroid (will be content weighted)
88 float centroid_y_{-1};
89
90 // energy (edep), PE, or sth
91 float val_{0.};
92
93 // edep content, only; leave val_ for PE
94 float val_e_{0.};
95
96 // sum of hit cluster weights
97 float sumw_{0.};
98
99 // book keep which channels have already been added to the cluster at hand
100 std::vector<unsigned int> v_added_indices_;
101
102 // book keep which channels have already been added to any cluster
103 std::vector<unsigned int> v_used_indices_;
104
105 // fraction of cluster energy deposition associated with beam electron sim
106 // hits
107 float beam_e_{0.};
108
109 // cluster time (energy weighted based on hit time)
110 float time_{0.};
111
112 // empty map container
113 std::map<int, int> hit_channel_map_;
114};
115
116} // namespace trigscint
117
118#endif /* TRIGSCINT_TRIGSCINTCLUSTERPRODUCER_H */
Class providing string constants for the event model.
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:37
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
void produce(framework::Event &event) override
Process the event and put new data products into it.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
virtual void addHit(uint idx, ldmx::TrigScintHit hit)
add a hit at index idx to a cluster
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.