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 // specific verbosity of this producer
58 int verbose_{0};
59
60 // expected arrival time of hits in the pad [ns]
61 double pad_time_{0.};
62
63 // maximum allowed delay for hits to be considered for clustering
64 double time_tolerance_{0.};
65
66 // input collection (hits)
67 std::string input_collection_;
68
69 // output collection (clusters)
70 std::string output_collection_;
71
72 // specific pass name to use for track making
73 std::string pass_name_{""};
74
75 // vertical bar start index
76 int vert_bar_start_idx_{52};
77
78 // cluster channel nb centroid (will be content weighted)
79 float centroid_{0.};
80
81 // cluster channel nb horizontal centroid (will be content weighted)
82 float centroid_x_{-1};
83
84 // cluster channel nb vertical centroid (will be content weighted)
85 float centroid_y_{-1};
86
87 // energy (edep), PE, or sth
88 float val_{0.};
89
90 // edep content, only; leave val_ for PE
91 float val_e_{0.};
92
93 // book keep which channels have already been added to the cluster at hand
94 std::vector<unsigned int> v_added_indices_;
95
96 // book keep which channels have already been added to any cluster
97 std::vector<unsigned int> v_used_indices_;
98
99 // fraction of cluster energy deposition associated with beam electron sim
100 // hits
101 float beam_e_{0.};
102
103 // cluster time (energy weighted based on hit time)
104 float time_{0.};
105
106 // empty map container
107 std::map<int, int> hit_channel_map_;
108};
109
110} // namespace trigscint
111
112#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:36
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.