20 }
else if (
mode_ == 1) {
27 const std::vector<ldmx::EcalHit> ecalRecHits =
31 const int nElectrons{
event.getElectronCount()};
48 double layerESumCut{0.};
56 ldmx_log(debug) <<
"Got trigger energy cut " << layerESumCut <<
" for "
57 << nElectrons <<
" electrons counted in the event.";
59 std::vector<double> layerDigiE(100, 0.0);
64 if (
id.layer() < layerDigiE.size()) {
66 layerDigiE[
id.layer()] += hit.getEnergy();
67 }
else if (
mode_ == 1) {
82 layerSum += layerDigiE[iL];
85 pass = (layerSum <= layerESumCut);
86 ldmx_log(debug) <<
"Got trigger energy sum " << layerSum
87 <<
"; and decision is pass = " << pass;
Class that defines an ECal detector ID with a cell number.
#define DECLARE_PRODUCER_NS(NS, 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.
T getParameter(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.
std::string inputPass_
The pass name of the input (the Ecal hits).
int startLayer_
The first layer of layer sum.
void configure(framework::config::Parameters ¶meters) override
Configure the processor using the given user specified parameters.
std::string outputColl_
The name of the output collection (the trigger decision).
int mode_
The trigger mode to run in.
std::string inputColl_
The name of the input collection (the Ecal hits).
void produce(framework::Event &event) override
Run the trigger algorithm and create a TriggerResult object to contain info about the trigger decisio...
std::vector< double > layerESumCuts_
The energy sum to make cut on.
TString algoName_
The name of the trigger algorithm used.
double beamEnergy_
The Beam energy [MeV].
int endLayer_
The endpoint layer of layer sum.
constexpr StorageControl::Hint hint_shouldKeep
storage control hint alias for backwards compatibility
constexpr StorageControl::Hint hint_shouldDrop
storage control hint alias for backwards compatibility