2#include "Conditions/SimpleTableCondition.h"
3#include "DetDescr/HcalDigiID.h"
4#include "DetDescr/HcalElectronicsID.h"
12 std::string input_name_, input_pass_, pedestal_table_;
13 int ldmxsw_event_, version_, pf_event_, pf_ticks_, pf_spill_;
14 int raw_id_, adc_, raw_adc_, tot_, toa_, i_sample_;
15 int fpga_, link_, channel_, index_;
16 int section_, layer_, strip_, end_;
17 bool tot_prog_, tot_comp_, aligned_;
18 bool using_eid_, already_aligned_;
28 input_name_ = ps.getParameter<std::string>(
"input_name");
29 input_pass_ = ps.getParameter<std::string>(
"input_pass");
30 pedestal_table_ = ps.getParameter<std::string>(
"pedestal_table");
31 using_eid_ = ps.getParameter<
bool>(
"using_eid");
32 already_aligned_ = ps.getParameter<
bool>(
"already_aligned");
38 flat_tree_ =
new TTree(
"hgcroc",
"Ntuplized HGC ROC Digi Collection");
40 flat_tree_->Branch(
"raw_id", &raw_id_);
41 flat_tree_->Branch(
"adc", &adc_);
42 flat_tree_->Branch(
"tot", &tot_);
43 flat_tree_->Branch(
"toa", &toa_);
44 flat_tree_->Branch(
"good_link", &good_link_);
45 flat_tree_->Branch(
"raw_adc", &raw_adc_);
46 flat_tree_->Branch(
"i_sample", &i_sample_);
47 flat_tree_->Branch(
"ldmxsw_event", &ldmxsw_event_);
48 if (not already_aligned_) {
49 flat_tree_->Branch(
"pf_event", &pf_event_);
50 flat_tree_->Branch(
"pf_spill", &pf_spill_);
51 flat_tree_->Branch(
"pf_ticks", &pf_ticks_);
53 flat_tree_->Branch(
"tot_prog", &tot_prog_);
54 flat_tree_->Branch(
"tot_comp", &tot_comp_);
55 flat_tree_->Branch(
"aligned", &aligned_);
57 flat_tree_->Branch(
"fpga", &fpga_);
58 flat_tree_->Branch(
"link", &link_);
59 flat_tree_->Branch(
"channel", &channel_);
60 flat_tree_->Branch(
"index", &index_);
62 flat_tree_->Branch(
"section", §ion_);
63 flat_tree_->Branch(
"layer", &layer_);
64 flat_tree_->Branch(
"strip", &strip_);
65 flat_tree_->Branch(
"end", &end_);
75 getCondition<conditions::IntegerTableCondition>(pedestal_table_)};
76 auto detmap{getCondition<hcal::HcalDetectorMap>(
79 ldmxsw_event_ =
event.getEventNumber();
80 if (already_aligned_) {
81 aligned_ =
event.getObject<
bool>(input_name_ +
"Aligned", input_pass_);
84 version_ =
event.getObject<
int>(input_name_ +
"Version", input_pass_);
85 pf_event_ =
event.getObject<
int>(input_name_ +
"Number", input_pass_);
86 pf_ticks_ =
event.getObject<
int>(input_name_ +
"Ticks", input_pass_);
87 pf_spill_ =
event.getObject<
int>(input_name_ +
"Spill", input_pass_);
90 const auto& good_bxheader{
91 event.getCollection<
bool>(input_name_ +
"GoodLinkHeader", input_pass_)};
92 const auto& good_trailer{
93 event.getCollection<
bool>(input_name_ +
"GoodLinkTrailer", input_pass_)};
97 for (std::size_t i_digi{0}; i_digi < digis.size(); i_digi++) {
99 raw_id_ =
static_cast<int>(d.id());
104 good_link_ = (good_bxheader.at(link_) and good_trailer.at(link_));
106 index_ = eid.
index();
110 int link = eid.
elink();
111 good_link_ = (good_bxheader.at(link) and good_trailer.at(link));
113 layer_ = detid.
layer();
114 strip_ = detid.
strip();
118 for (i_sample_ = 0; i_sample_ < digis.getNumSamplesPerDigi(); i_sample_++) {
119 tot_prog_ = d.at(i_sample_).isTOTinProgress();
120 tot_comp_ = d.at(i_sample_).isTOTComplete();
121 tot_ = d.at(i_sample_).tot();
122 toa_ = d.at(i_sample_).toa();
123 int adc_t = d.at(i_sample_).adc_t();
125 adc_ = adc_t - pedestal_table.get(d.id(), 0);
Base classes for all user event processing components to extend.
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class which contains logic for how the detector items connect to and relate with the reconstruction c...
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
void onProcessStart() final override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
void configure(framework::config::Parameters &ps) final override
Callback for the EventProcessor to configure itself from the given set of parameters.
void analyze(const framework::Event &event) final override
Process the event and make histograms or summaries.
Base class for a module which does not produce a data product.
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
static constexpr const char * CONDITIONS_OBJECT_NAME
The name of the EID <-> DetID map for the ECal.
Extension of HcalAbstractID providing access to HCal digi information.
int strip() const
Get the value of the 'strip' field from the ID.
int section() const
Get the value of the 'section' field from the ID.
int layer() const
Get the value of the layer field from the ID.
int end() const
Get the value of the 'end' field from the ID.
Identifies a location in the Hcal readout chain.
unsigned int index() const
Get the compact index value.
int elink() const
Get the value of the elink from the ID.
int fiber() const
Get the value of the fiber from the ID.
int channel() const
Get the value of the channel from the ID.
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.