LDMX Software
TrigElectronProducer.h
Go to the documentation of this file.
1
7#ifndef TRIGECALCLUSTERPRODUCER_H
8#define TRIGECALCLUSTERPRODUCER_H
9
10#include <optional>
11
12// LDMX Framework
13/* #include "Ecal/EcalTriggerGeometry.h" */
14#include "Framework/Configure/Parameters.h" // Needed to import parameters from configuration file
15#include "Framework/Event.h"
16#include "Framework/EventProcessor.h" //Needed to declare processor
17#include "TF1.h"
18#include "TProfile2D.h"
19/* #include "ap_fixed.h" */
20/* #include "ap_int.h" */
21
22namespace trigger {
23
29 public:
30 TrigElectronProducer(const std::string& name, framework::Process& process)
32
34
35 virtual void produce(framework::Event& event);
36
37 virtual void onProcessStart();
38
39 virtual void onProcessEnd();
40
41 void setupMaps(bool isX);
42 float getP(bool isX, float e, float d);
43 float getPx(float e, float d) { return getP(true, e, d); }
44 float getPy(float e, float d) { return getP(false, e, d); }
45
46 private:
47 // y [mm] of the target point from the lowest-residual TS track
48 std::optional<float> tsTargetY(const framework::Event& event);
49
50 // TrigScint tracks giving the target y
51 std::string ts_track_coll_name_;
52 std::string ts_passname_;
53 // y [mm] = ts_y0_ + ts_channel_pitch_ * centroid [channel]
54 float ts_y0_{0};
55 float ts_channel_pitch_{0};
56 bool warned_missing_ts_{false};
57
58 // name of collection for calo cluster inputs
59 std::string cluster_coll_name_;
60 // name of collection for electron outputs
61 std::string ele_coll_name_;
62
63 std::string cluster_coll_passname_;
64 std::string cluster_collname_events_passname_;
65
66 std::string prop_map_name_;
67 // z [mm] of the ECal face
68 double ecal_front_z_{0};
69 TProfile2D* prop_mapx_{nullptr};
70 TProfile2D* prop_mapy_{nullptr};
71 std::vector<TF1*> fits_x_{};
72 std::vector<TF1*> fits_y_{};
73
74 // From:
75 // Tools/python/HgcrocEmulator.py
76 // ECal/python/digi.py
77 // ECal/src/EcalRecProducer.cxx
78 /* float gain_ = 320. / 0.1 / 1024; //
79 * mV/ADC */
80 /* float mVtoMeV_ = 0.130 / (37000.0 * (0.162 / 1000.) * (1. / 0.1)); //
81 * MeV/mV */
82 /* std::vector<float> layerWeights = { */
83 /* 1.675, 2.724, 4.398, 6.039, 7.696, 9.077, 9.630, 9.630, 9.630,
84 */
85 /* 9.630, 9.630, 9.630, 9.630, 9.630, 9.630, 9.630, 9.630, 9.630,
86 */
87 /* 9.630, 9.630, 9.630, 9.630, 9.630, 13.497, 17.364, 17.364, 17.364,
88 */
89 /* 17.364, 17.364, 17.364, 17.364, 17.364, 17.364, 8.990}; */
90 /* float secondOrderEnergyCorrection_ = 4000. / 4010.; */
91 /* float mipSiEnergy_ = 0.130; */
92 /* int hgc_compression_factor_ = 8; */
93
94 // ClusterGeometry myGeo;
95};
96} // namespace trigger
97
98#endif /* TRIGECALCLUSTERPRODUCER_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.
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
virtual void onProcessStart()
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
virtual void produce(framework::Event &event)
Process the event and put new data products into it.
virtual void onProcessEnd()
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
virtual void configure(framework::config::Parameters &ps)
Callback for the EventProcessor to configure itself from the given set of parameters.