1#include "Hcal/HcalTrigPrimDigiProducer.h"
4#include "Hcal/HcalTriggerGeometry.h"
5#include "Recon/Event/CaloTrigPrim.h"
7#include "Recon/Event/HgcrocTrigDigi.h"
13 : Producer(name, process) {}
19 ps.
getParameter<std::string>(
"condObjName",
"HcalTrigPrimDigiConditions");
24 HcalTriggerGeometry::CONDITIONS_OBJECT_NAME);
31 getCondition<conditions::IntegerTableCondition>(
condObjName_);
37 for (
unsigned int ix = 0; ix < hcalDigis.
getNumDigis(); ix++) {
50 const float hgc_compress_factor = 2;
54 ldmx::HgcrocTrigDigiCollection tdigis;
58 for (
auto result : results) {
59 if (result.second > 0) {
69 for (
auto result : results) {
70 if (result.second > 0) {
72 const std::vector<ldmx::HcalDigiID> precisions_ids =
74 if (precisions_ids.size() == 0) {
75 std::cout <<
"Failing HcalTriggerID(" << quad_id.section() <<
','
77 << quad_id.
end() <<
')' << std::endl;
78 EXCEPTION_RAISE(
"TrigToPrecIDMismatch",
79 "Attempted to lookup a nonexistent HcalDigiID from an "
89 ptr->second += linear_charge;
96 ldmx::CaloTrigPrimCollection stq_digis;
98 if (result.second > 0) {
105 event.add(
"hcalTrigPrimDigiSTQs", stq_digis);
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that translates HCal ID into positions of strip hits.
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
Class that contains the Hgcroc Trigger algorithms, used for both Ecal and Hcal.
std::string getName() const
Get the processor name.
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
std::map< unsigned int, unsigned int > stq_tps
map of digis to the super trigger primitives
void produce(framework::Event &event) override
Produce HcalTrigPrimDigis and put them into the event bus using the HcalDigis as input.
std::string digiCollName_
Digi Collection Name to use as input.
std::string digiPassName_
Digi Pass Name to use as input.
void configure(framework::config::Parameters &) override
Grabs configure parameters from the python config file.
HcalTrigPrimDigiProducer(const std::string &name, framework::Process &process)
Constructor.
std::string condObjName_
Conditions object for the calibration information.
defines the relationship between HCal strips and CMB quad trigger primitives and provides geometry in...
ldmx::HcalTriggerID belongsToQuad(ldmx::HcalDigiID precisionCell) const
Returns which trigger cell this precision cell is associated with, or a null id if there is no such a...
std::vector< ldmx::HcalDigiID > contentsOfQuad(ldmx::HcalTriggerID triggerCell) const
Returns the set of precision (full-granularity/DAQ) cells which are associated with the given trigger...
Contains the trigger output for generic calo objects.
Extension of HcalAbstractID providing access to HCal digi information.
Extension of DetectorID providing access to HCal trigger cell.
int superstrip() const
Get the value of the 'superstrip' field from the ID.
int end() const
Get the value of the 'end' field from the ID.
int layer() const
Get the value of the layer field from the ID.
One DIGI signal coming from the HGC ROC.
unsigned int id() const
Get the ID for this DIGI.
HgcrocDigiCollection::Sample soi() const
Get the sample of interest from this DIGI.
int adc_t() const
Get the ADC measurement from this sample.
int tot() const
Get the TOT measurement from this sample.
bool isTOTComplete() const
Get the second flag from the sample checking if TOT is complete at this sample.
Represents a collection of the digi hits readout by an HGCROC.
const HgcrocDigi getDigi(unsigned int digiIndex) const
Get samples for the input digi index.
unsigned int getNumDigis() const
Get total number of digis.
Contains the trigger output for a single trigger hgcroc channel.
static uint32_t compressed2Linear(uint8_t comp)
Static conversion from compressed -> linear 18b.
Contains the core logic for the Hgcroc trigger calculations.
void addDigi(unsigned int id, unsigned int tid, int adc, int tot)
Determine the linear charge for the given channel, using the calibration information,...
const std::map< unsigned int, uint8_t > & compressedEnergies() const
Access the map of trigger ids to compressed energies.
void compressDigis(int cells_per_trig)
Convert the linear charges to compressed charges, with a division depending on the number of cells su...