20 }
else if (
mode_ == 1) {
27 const std::vector<ldmx::EcalHit> ecal_rec_hits =
31 const int n_electrons{
event.getElectronCount()};
48 double layer_e_sum_cut{0.};
57 ldmx_log(info) <<
"Got trigger energy cut " << layer_e_sum_cut <<
" for "
58 << n_electrons <<
" electrons counted in the event.";
60 std::vector<double> layer_digi_e(100, 0.0);
65 if (
id.layer() < layer_digi_e.size()) {
67 layer_digi_e[
id.layer()] += hit.getEnergy();
68 }
else if (
mode_ == 1) {
83 layer_sum += layer_digi_e[i_l];
86 pass = (layer_sum <= layer_e_sum_cut);
87 ldmx_log(info) <<
"Got trigger energy sum " << layer_sum
88 <<
"; and decision is pass = " << pass;
Class that defines an ECal detector ID with a cell number.
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that provides a trigger decision for recon using a TriggerResult object.
void setStorageHint(framework::StorageControl::Hint hint)
Mark the current event as having the given storage control hint from this module_.
Implements an event buffer system for storing event data.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Stores reconstructed hit information from the ECAL.
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
Represents the trigger decision (pass/fail) for reconstruction.
void set(const TString &name, bool pass, int nvar)
Set name and pass of trigger.
void setAlgoVar(int element, double value)
Set an algorithm variable.
Provides a trigger decision for recon using a TriggerResult object.
std::vector< double > layer_e_sum_cuts_
The energy sum to make cut on.
std::string input_coll_
The name of the input collection (the Ecal hits_).
TString algo_name_
The name of the trigger algorithm used.
int start_layer_
The first layer of layer sum.
double beam_energy_
The Beam energy [MeV].
void configure(framework::config::Parameters ¶meters) override
Configure the processor using the given user specified parameters.
int mode_
The trigger mode to run in.
int end_layer_
The endpoint layer of layer sum.
std::string output_coll_
The name of the output collection (the trigger decision).
void produce(framework::Event &event) override
Run the trigger algorithm and create a TriggerResult object to contain info about the trigger decisio...
std::string input_pass_
The pass name of the input (the Ecal hits_).
constexpr StorageControl::Hint HINT_SHOULD_DROP
storage control hint alias for backwards compatibility
constexpr StorageControl::Hint HINT_SHOULD_KEEP
storage control hint alias for backwards compatibility