LDMX Software
HcalTPSelector.cxx
2
3namespace trigger {
4
6 // ideally, we would directly grab the TPs here instead of
7 // building them in the HCal energy sum collection
8 combined_quad_coll_name_ = ps.get<std::string>("combined_quad_coll_name");
9 pass_coll_name_ = ps.get<std::string>("pass_coll_name");
10 tp_coll_passname_ = ps.get<std::string>("tp_coll_pass_name");
11 tp_coll_event_passname_ = ps.get<std::string>("tp_coll_event_passname");
12}
13
15 if (!event.exists(combined_quad_coll_name_, tp_coll_event_passname_)) return;
16 auto hcal_t_ps{event.getObject<ldmx::CaloTrigPrimCollection>(
17 combined_quad_coll_name_, tp_coll_passname_)};
18
19 // Should move the TP building itself here
20 // In the meantime, create the "analysis object" hits
21
22 std::vector<TrigCaloHit> pass_trig_hits;
23 for (const auto& tp : hcal_t_ps) {
24 double x{0}, y{0}, z{0}; // todo
25 ldmx::HcalTriggerID combo_id(tp.getId());
26
27 int adc = tp.getPrimitive();
28 // mV/ADC: 1.2
29 // MeV/MIP: 4.66
30 // PE/MIP: 68 (summed over BOTH ends, based on 1808.05219, p38)
31 // mV/PE: 5
32 // mV/MeV: 72.961 (= 5*68/4.66)
33 double energy =
34 adc * 1.2 / 72.961; // ADC to MeV based on values just above
35 pass_trig_hits.emplace_back(x, y, z, energy);
36
37 pass_trig_hits.back().setLayer(combo_id.layer());
38 pass_trig_hits.back().setStrip(combo_id.superstrip());
39 pass_trig_hits.back().setSection(combo_id.section());
40 }
41
42 event.add(pass_coll_name_ + "Hits", pass_trig_hits);
43}
44
45} // namespace trigger
46
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Hcal clustering algorithm.
Implements an event buffer system for storing event data.
Definition Event.h:42
bool exists(const std::string &name, const std::string &passName, bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Definition Event.cxx:92
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78
Extension of DetectorID providing access to HCal trigger cell.
int superstrip() const
Get the value of the 'superstrip' field from the ID.
int layer() const
Get the value of the layer field from the ID.
virtual void produce(framework::Event &event)
Process the event and put new data products into it.
virtual void configure(framework::config::Parameters &ps)
Callback for the EventProcessor to configure itself from the given set of parameters.