LDMX Software
Public Member Functions | Private Attributes | List of all members
dqm::NtuplizeHgcrocDigiCollection Class Reference

Public Member Functions

 NtuplizeHgcrocDigiCollection (std::string const &n, framework::Process &p)
 
void configure (framework::config::Parameters &ps) final override
 Callback for the EventProcessor to configure itself from the given set of parameters.
 
void onProcessStart () final override
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
void analyze (const framework::Event &event) final override
 Process the event and make histograms or summaries.
 
- Public Member Functions inherited from framework::Analyzer
 Analyzer (const std::string &name, Process &process)
 Class constructor.
 
- Public Member Functions inherited from framework::EventProcessor
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()
 Class destructor.
 
virtual void onNewRun (const ldmx::RunHeader &runHeader)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &eventFile)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
virtual void onFileClose (EventFile &eventFile)
 Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
 
virtual void onProcessEnd ()
 Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
 
template<class T >
const T & getCondition (const std::string &condition_name)
 Access a conditions object for the current event.
 
TDirectory * getHistoDirectory ()
 Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples.
 
void setStorageHint (framework::StorageControl::Hint hint)
 Mark the current event as having the given storage control hint from this module.
 
void setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString)
 Mark the current event as having the given storage control hint from this module and the given purpose string.
 
int getLogFrequency () const
 Get the current logging frequency from the process.
 
int getRunNumber () const
 Get the run number from the process.
 
std::string getName () const
 Get the processor name.
 
void createHistograms (const std::vector< framework::config::Parameters > &histos)
 Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create.
 

Private Attributes

std::string input_name_
 
std::string input_pass_
 
std::string pedestal_table_
 
int ldmxsw_event_
 
int version_
 
int pf_event_
 
int pf_ticks_
 
int pf_spill_
 
int raw_id_
 
int adc_
 
int raw_adc_
 
int tot_
 
int toa_
 
int i_sample_
 
int fpga_
 
int link_
 
int channel_
 
int index_
 
int section_
 
int layer_
 
int strip_
 
int end_
 
bool tot_prog_
 
bool tot_comp_
 
bool aligned_
 
bool using_eid_
 
bool already_aligned_
 
bool good_link_
 
TTree * flat_tree_
 

Additional Inherited Members

- Static Public Member Functions inherited from framework::EventProcessor
static void declare (const std::string &classname, int classtype, EventProcessorMaker *)
 Internal function which is part of the PluginFactory machinery.
 
- Static Public Attributes inherited from framework::Analyzer
static const int CLASSTYPE {2}
 Constant used to track EventProcessor types by the PluginFactory.
 
- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramHelper histograms_
 Interface class for making and filling histograms.
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger theLog_
 The logger for this EventProcessor.
 

Detailed Description

Definition at line 11 of file NtuplizeHgcrocDigiCollection.cxx.

Constructor & Destructor Documentation

◆ NtuplizeHgcrocDigiCollection()

dqm::NtuplizeHgcrocDigiCollection::NtuplizeHgcrocDigiCollection ( std::string const &  n,
framework::Process p 
)
inline

Definition at line 23 of file NtuplizeHgcrocDigiCollection.cxx.

24 : framework::Analyzer(n, p) {}
Base class for a module which does not produce a data product.

◆ ~NtuplizeHgcrocDigiCollection()

dqm::NtuplizeHgcrocDigiCollection::~NtuplizeHgcrocDigiCollection ( )
inline

Definition at line 25 of file NtuplizeHgcrocDigiCollection.cxx.

25{}

Member Function Documentation

◆ analyze()

void dqm::NtuplizeHgcrocDigiCollection::analyze ( const framework::Event event)
finaloverridevirtual

Process the event and make histograms or summaries.

Parameters
eventThe Event to analyze

Implements framework::Analyzer.

Definition at line 72 of file NtuplizeHgcrocDigiCollection.cxx.

72 {
73 // get the reconstruction parameters
74 auto pedestal_table{
75 getCondition<conditions::IntegerTableCondition>(pedestal_table_)};
76 auto detmap{getCondition<hcal::HcalDetectorMap>(
78
79 ldmxsw_event_ = event.getEventNumber();
80 if (already_aligned_) {
81 aligned_ = event.getObject<bool>(input_name_ + "Aligned", input_pass_);
82 } else {
83 aligned_ = false;
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_);
88 }
89
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_)};
94
95 auto const& digis{
96 event.getObject<ldmx::HgcrocDigiCollection>(input_name_, input_pass_)};
97 for (std::size_t i_digi{0}; i_digi < digis.size(); i_digi++) {
98 auto d{digis.getDigi(i_digi)};
99 raw_id_ = static_cast<int>(d.id());
100 if (using_eid_) {
101 ldmx::HcalElectronicsID eid(d.id());
102 fpga_ = eid.fiber();
103 link_ = eid.elink();
104 good_link_ = (good_bxheader.at(link_) and good_trailer.at(link_));
105 channel_ = eid.channel();
106 index_ = eid.index();
107 } else {
108 ldmx::HcalDigiID detid(d.id());
109 ldmx::HcalElectronicsID eid = detmap.get(detid);
110 int link = eid.elink();
111 good_link_ = (good_bxheader.at(link) and good_trailer.at(link));
112 section_ = detid.section();
113 layer_ = detid.layer();
114 strip_ = detid.strip();
115 end_ = detid.end();
116 }
117
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();
124 raw_adc_ = adc_t;
125 adc_ = adc_t - pedestal_table.get(d.id(), 0);
126 flat_tree_->Fill();
127 }
128 }
129}
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.
Definition HcalDigiID.h:13
Identifies a location in the Hcal readout chain.
int elink() const
Get the value of the elink 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.

References ldmx::HcalElectronicsID::channel(), hcal::HcalDetectorMap::CONDITIONS_OBJECT_NAME, ldmx::HcalElectronicsID::elink(), ldmx::HcalDigiID::end(), ldmx::HcalElectronicsID::fiber(), ldmx::HgcrocDigiCollection::getDigi(), ldmx::HcalElectronicsID::index(), ldmx::HcalDigiID::layer(), ldmx::HcalDigiID::section(), and ldmx::HcalDigiID::strip().

◆ configure()

void dqm::NtuplizeHgcrocDigiCollection::configure ( framework::config::Parameters parameters)
inlinefinaloverridevirtual

Callback for the EventProcessor to configure itself from the given set of parameters.

The parameters a processor has access to are the member variables of the python class in the sequence that has className equal to the EventProcessor class name.

For an example, look at MyProcessor.

Parameters
parametersParameters for configuration.

Reimplemented from framework::EventProcessor.

Definition at line 27 of file NtuplizeHgcrocDigiCollection.cxx.

27 {
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");
33 }

◆ onProcessStart()

void dqm::NtuplizeHgcrocDigiCollection::onProcessStart ( )
inlinefinaloverridevirtual

Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.

Reimplemented from framework::EventProcessor.

Definition at line 35 of file NtuplizeHgcrocDigiCollection.cxx.

35 {
37 // cleaned up when histogram file is closed
38 flat_tree_ = new TTree("hgcroc", "Ntuplized HGC ROC Digi Collection");
39
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_);
52 }
53 flat_tree_->Branch("tot_prog", &tot_prog_);
54 flat_tree_->Branch("tot_comp", &tot_comp_);
55 flat_tree_->Branch("aligned", &aligned_);
56 if (using_eid_) {
57 flat_tree_->Branch("fpga", &fpga_);
58 flat_tree_->Branch("link", &link_);
59 flat_tree_->Branch("channel", &channel_);
60 flat_tree_->Branch("index", &index_);
61 } else {
62 flat_tree_->Branch("section", &section_);
63 flat_tree_->Branch("layer", &layer_);
64 flat_tree_->Branch("strip", &strip_);
65 flat_tree_->Branch("end", &end_);
66 }
67 }
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...

References framework::EventProcessor::getHistoDirectory().

Member Data Documentation

◆ adc_

int dqm::NtuplizeHgcrocDigiCollection::adc_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ aligned_

bool dqm::NtuplizeHgcrocDigiCollection::aligned_
private

Definition at line 17 of file NtuplizeHgcrocDigiCollection.cxx.

◆ already_aligned_

bool dqm::NtuplizeHgcrocDigiCollection::already_aligned_
private

Definition at line 18 of file NtuplizeHgcrocDigiCollection.cxx.

◆ channel_

int dqm::NtuplizeHgcrocDigiCollection::channel_
private

Definition at line 15 of file NtuplizeHgcrocDigiCollection.cxx.

◆ end_

int dqm::NtuplizeHgcrocDigiCollection::end_
private

Definition at line 16 of file NtuplizeHgcrocDigiCollection.cxx.

◆ flat_tree_

TTree* dqm::NtuplizeHgcrocDigiCollection::flat_tree_
private

Definition at line 20 of file NtuplizeHgcrocDigiCollection.cxx.

◆ fpga_

int dqm::NtuplizeHgcrocDigiCollection::fpga_
private

Definition at line 15 of file NtuplizeHgcrocDigiCollection.cxx.

◆ good_link_

bool dqm::NtuplizeHgcrocDigiCollection::good_link_
private

Definition at line 19 of file NtuplizeHgcrocDigiCollection.cxx.

◆ i_sample_

int dqm::NtuplizeHgcrocDigiCollection::i_sample_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ index_

int dqm::NtuplizeHgcrocDigiCollection::index_
private

Definition at line 15 of file NtuplizeHgcrocDigiCollection.cxx.

◆ input_name_

std::string dqm::NtuplizeHgcrocDigiCollection::input_name_
private

Definition at line 12 of file NtuplizeHgcrocDigiCollection.cxx.

◆ input_pass_

std::string dqm::NtuplizeHgcrocDigiCollection::input_pass_
private

Definition at line 12 of file NtuplizeHgcrocDigiCollection.cxx.

◆ layer_

int dqm::NtuplizeHgcrocDigiCollection::layer_
private

Definition at line 16 of file NtuplizeHgcrocDigiCollection.cxx.

◆ ldmxsw_event_

int dqm::NtuplizeHgcrocDigiCollection::ldmxsw_event_
private

Definition at line 13 of file NtuplizeHgcrocDigiCollection.cxx.

◆ link_

int dqm::NtuplizeHgcrocDigiCollection::link_
private

Definition at line 15 of file NtuplizeHgcrocDigiCollection.cxx.

◆ pedestal_table_

std::string dqm::NtuplizeHgcrocDigiCollection::pedestal_table_
private

Definition at line 12 of file NtuplizeHgcrocDigiCollection.cxx.

◆ pf_event_

int dqm::NtuplizeHgcrocDigiCollection::pf_event_
private

Definition at line 13 of file NtuplizeHgcrocDigiCollection.cxx.

◆ pf_spill_

int dqm::NtuplizeHgcrocDigiCollection::pf_spill_
private

Definition at line 13 of file NtuplizeHgcrocDigiCollection.cxx.

◆ pf_ticks_

int dqm::NtuplizeHgcrocDigiCollection::pf_ticks_
private

Definition at line 13 of file NtuplizeHgcrocDigiCollection.cxx.

◆ raw_adc_

int dqm::NtuplizeHgcrocDigiCollection::raw_adc_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ raw_id_

int dqm::NtuplizeHgcrocDigiCollection::raw_id_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ section_

int dqm::NtuplizeHgcrocDigiCollection::section_
private

Definition at line 16 of file NtuplizeHgcrocDigiCollection.cxx.

◆ strip_

int dqm::NtuplizeHgcrocDigiCollection::strip_
private

Definition at line 16 of file NtuplizeHgcrocDigiCollection.cxx.

◆ toa_

int dqm::NtuplizeHgcrocDigiCollection::toa_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ tot_

int dqm::NtuplizeHgcrocDigiCollection::tot_
private

Definition at line 14 of file NtuplizeHgcrocDigiCollection.cxx.

◆ tot_comp_

bool dqm::NtuplizeHgcrocDigiCollection::tot_comp_
private

Definition at line 17 of file NtuplizeHgcrocDigiCollection.cxx.

◆ tot_prog_

bool dqm::NtuplizeHgcrocDigiCollection::tot_prog_
private

Definition at line 17 of file NtuplizeHgcrocDigiCollection.cxx.

◆ using_eid_

bool dqm::NtuplizeHgcrocDigiCollection::using_eid_
private

Definition at line 18 of file NtuplizeHgcrocDigiCollection.cxx.

◆ version_

int dqm::NtuplizeHgcrocDigiCollection::version_
private

Definition at line 13 of file NtuplizeHgcrocDigiCollection.cxx.


The documentation for this class was generated from the following file: