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
16#include "TrigScint/Event/TrigScintCluster.h"
17#include "TrigScint/Event/TrigScintHit.h"
18
19namespace trigscint {
20
26 public:
27 TrigScintClusterProducer(const std::string& name, framework::Process& process)
28 : Producer(name, process) {}
29
31
32 void produce(framework::Event& event) override;
33
37 virtual void addHit(uint idx, ldmx::TrigScintHit hit);
38
39 void onProcessStart() override;
40
41 void onProcessEnd() override;
42
43 private:
44 // collection of clusters produced
45 std::vector<ldmx::TrigScintCluster> clusters_;
46
47 // cluster seeding threshold
48 double seed_{0.};
49
50 // min threshold for adding a hit to a cluster
51 double min_thr_{0.};
52
53 // max number of neighboring hits to combine when forming a cluster
54 int max_width_{2};
55
56 // PE-amplitude weighting for centroid values
57 bool ampl_weighting_{true};
58
59 // specific verbosity of this producer
60 int verbose_{0};
61
62 // expected arrival time of hits in the pad [ns]
63 double pad_time_{0.};
64
65 // maximum allowed delay for hits to be considered for clustering
66 double time_tolerance_{0.};
67
68 // input collection (hits)
69 std::string input_collection_;
70
71 // output collection (clusters)
72 std::string output_collection_;
73
74 // specific pass name to use for track making
75 std::string pass_name_{""};
76
77 // vertical bar start index
78 int vert_bar_start_idx_{52};
79
80 // cluster channel nb centroid (will be content weighted)
81 float centroid_{0.};
82
83 // cluster channel nb horizontal centroid (will be content weighted)
84 float centroid_x_{-1};
85
86 // cluster channel nb vertical centroid (will be content weighted)
87 float centroid_y_{-1};
88
89 // energy (edep), PE, or sth
90 float val_{0.};
91
92 // edep content, only; leave val_ for PE
93 float val_e_{0.};
94
95 // sum of hit cluster weights
96 float sumw_{0.};
97
98 // book keep which channels have already been added to the cluster at hand
99 std::vector<unsigned int> v_added_indices_;
100
101 // book keep which channels have already been added to any cluster
102 std::vector<unsigned int> v_used_indices_;
103
104 // fraction of cluster energy deposition associated with beam electron sim
105 // hits
106 float beam_e_{0.};
107
108 // cluster time (energy weighted based on hit time)
109 float time_{0.};
110
111 // empty map container
112 std::map<int, int> hit_channel_map_;
113};
114
115} // namespace trigscint
116
117#endif /* TRIGSCINT_TRIGSCINTCLUSTERPRODUCER_H */
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:40
Class which represents the process under execution.
Definition Process.h:34
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:26
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.