|
LDMX Software
|
Performs basic HCal digitization. More...
#include <HcalDigiProducer.h>
Public Member Functions | |
| HcalDigiProducer (const std::string &name, framework::Process &process) | |
| Constructor Makes unique noise generator and injector for this class. | |
| virtual | ~HcalDigiProducer ()=default |
| Default destructor. | |
| void | configure (framework::config::Parameters &) override |
| Configure this producer from the python configuration. | |
| void | produce (framework::Event &event) override |
| Simulates measurement of pulse and creates digi collection for input event. | |
| virtual void | onNewRun (const ldmx::RunHeader &runHeader) override |
| Random number generation. | |
Public Member Functions inherited from framework::Producer | |
| Producer (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual void | process (Event &event) final |
| Processing an event for a Producer is calling produce. | |
Public Member Functions inherited from framework::EventProcessor | |
| DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &) | |
| declare that we have a factory for this class | |
| EventProcessor (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual | ~EventProcessor ()=default |
| Class destructor. | |
| virtual void | beforeNewRun (ldmx::RunHeader &run_header) |
| Callback for Producers to add parameters to the run header before conditions are initialized. | |
| virtual void | onFileOpen (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened. | |
| virtual void | onFileClose (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed. | |
| virtual void | onProcessStart () |
| Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms. | |
| 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_coll_name_ |
| input hit collection name | |
| std::string | input_pass_name_ |
| input pass name | |
| std::string | digi_coll_name_ |
| output hit collection name | |
| std::string | pulse_truth_coll_name_ |
| output pulse truth collection name | |
| double | clock_cycle_ |
| Time interval for chip clock in ns. | |
| int | n_ad_cs_ |
| Depth of ADC buffer. | |
| int | i_soi_ |
| Index for the Sample Of Interest in the list of digi samples. | |
| double | me_v_ |
| Conversion from energy in MeV to voltage in mV. | |
| double | attlength_ |
| Strip attenuation length [m]. | |
| bool | noise_ {true} |
| Put noise into empty channels, not configurable, only helpful in development. | |
| bool | save_pulse_truth_info_ {false} |
| If true, save the "analog" composite pulse shape in the HGCROC emulator before it gets digitized. | |
| bool | zero_suppression_ {true} |
| If false, save digis from all channels, even pure noise in empty bars Helpful when comparing with test beam data. | |
| std::unique_ptr< ldmx::HgcrocEmulator > | hgcroc_ |
| Hgcroc Emulator to digitize analog voltage signals. | |
| double | ns_ |
| Conversion from time in ns to ticks of the internal clock. | |
| double | readout_threshold_ |
| Read out threshold. | |
| double | pedestal_ |
| Read out pedestal. | |
| double | gain_ |
| Read out gain. | |
| double | noise_rms_ |
| Noise RMS. | |
| std::unique_ptr< ldmx::NoiseGenerator > | noise_generator_ |
| Generates noise hits based off of number of cells that are not hit. | |
| std::mt19937 | rng_ |
| Generates Gaussian noise on top of real hits_. | |
Additional Inherited Members | |
Protected Member Functions inherited from framework::EventProcessor | |
| void | abortEvent () |
| Abort the event immediately. | |
Protected Attributes inherited from framework::EventProcessor | |
| HistogramPool | histograms_ |
| helper object for making and filling histograms | |
| NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
| Manager for any ntuples. | |
| logging::logger | the_log_ |
| The logger for this EventProcessor. | |
Performs basic HCal digitization.
Definition at line 32 of file HcalDigiProducer.h.
| hcal::HcalDigiProducer::HcalDigiProducer | ( | const std::string & | name, |
| framework::Process & | process ) |
Constructor Makes unique noise generator and injector for this class.
Definition at line 14 of file HcalDigiProducer.cxx.
References noise_generator_.
|
overridevirtual |
Configure this producer from the python configuration.
Sets event constants and configures the noise generator, noise injector, and pulse function. Creates digi collection
Reimplemented from framework::EventProcessor.
Definition at line 27 of file HcalDigiProducer.cxx.
References attlength_, clock_cycle_, digi_coll_name_, gain_, framework::config::Parameters::get(), hgcroc_, i_soi_, input_coll_name_, input_pass_name_, me_v_, n_ad_cs_, noise_, noise_rms_, ns_, pedestal_, pulse_truth_coll_name_, readout_threshold_, save_pulse_truth_info_, and zero_suppression_.
|
overridevirtual |
Random number generation.
Reimplemented from framework::EventProcessor.
Definition at line 66 of file HcalDigiProducer.cxx.
References framework::RandomNumberSeedService::CONDITIONS_OBJECT_NAME, gain_, framework::EventProcessor::getCondition(), hgcroc_, noise_generator_, noise_rms_, pedestal_, readout_threshold_, and rng_.
|
overridevirtual |
Simulates measurement of pulse and creates digi collection for input event.
Define two pulses: with positive and negative ends. For this we need to: (1) Find the position along the bar: For back Hcal: x (y) for horizontal (vertical) layers. For side Hcal: x (top,bottom) and y (left,right).
(2) Define the end of the bar: The end of an HcalDigiID is based on its distance (x,y) along the bar.
(3) Find the distance to each end (positive and negative) from the origin. For the back Hcal, the half point of the bar coincides with the coordinates of the origin. For the side Hcal, the length of the bar from the origin is:
Now we have all the sub-hits_ from all the simhits Digitize: For back Hcal return two digis. For side Hcal we choose which pulse to readout based on the position of the hit and the sub-section. For Top and Left we read the positive end digi. For Bottom and Right we read the negative end digi.
Implements framework::Producer.
Definition at line 86 of file HcalDigiProducer.cxx.
References ldmx::HgcrocDigiCollection::addDigi(), attlength_, clock_cycle_, ldmx::HcalGeometry::CONDITIONS_OBJECT_NAME, digi_coll_name_, ldmx::SimCalorimeterHit::Contrib::edep_, framework::EventProcessor::getCondition(), ldmx::SimCalorimeterHit::getContrib(), ldmx::SimCalorimeterHit::getNumberOfContribs(), ldmx::HgcrocDigiCollection::getNumDigis(), ldmx::SimCalorimeterHit::getPosition(), hgcroc_, i_soi_, input_coll_name_, input_pass_name_, ldmx::HcalID::layer(), me_v_, n_ad_cs_, noise_, noise_generator_, pulse_truth_coll_name_, ldmx::DetectorID::raw(), rng_, save_pulse_truth_info_, ldmx::HgcrocDigiCollection::setNumSamplesPerDigi(), ldmx::HgcrocDigiCollection::setSampleOfInterestIndex(), ldmx::HcalID::strip(), ldmx::SimCalorimeterHit::Contrib::time_, and zero_suppression_.
|
private |
Strip attenuation length [m].
Definition at line 89 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Time interval for chip clock in ns.
Definition at line 77 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
output hit collection name
Definition at line 71 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Read out gain.
Definition at line 117 of file HcalDigiProducer.h.
Referenced by configure(), and onNewRun().
|
private |
Hgcroc Emulator to digitize analog voltage signals.
Definition at line 107 of file HcalDigiProducer.h.
Referenced by configure(), onNewRun(), and produce().
|
private |
Index for the Sample Of Interest in the list of digi samples.
Definition at line 83 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
input hit collection name
Definition at line 65 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
input pass name
Definition at line 68 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Conversion from energy in MeV to voltage in mV.
Definition at line 86 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Depth of ADC buffer.
Definition at line 80 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Put noise into empty channels, not configurable, only helpful in development.
Definition at line 96 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Generates noise hits based off of number of cells that are not hit.
Definition at line 122 of file HcalDigiProducer.h.
Referenced by HcalDigiProducer(), onNewRun(), and produce().
|
private |
Noise RMS.
Definition at line 119 of file HcalDigiProducer.h.
Referenced by configure(), and onNewRun().
|
private |
Conversion from time in ns to ticks of the internal clock.
Definition at line 110 of file HcalDigiProducer.h.
Referenced by configure().
|
private |
Read out pedestal.
Definition at line 115 of file HcalDigiProducer.h.
Referenced by configure(), and onNewRun().
|
private |
output pulse truth collection name
Definition at line 74 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Read out threshold.
Definition at line 113 of file HcalDigiProducer.h.
Referenced by configure(), and onNewRun().
|
private |
Generates Gaussian noise on top of real hits_.
Definition at line 125 of file HcalDigiProducer.h.
Referenced by onNewRun(), and produce().
|
private |
If true, save the "analog" composite pulse shape in the HGCROC emulator before it gets digitized.
Definition at line 100 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
If false, save digis from all channels, even pure noise in empty bars Helpful when comparing with test beam data.
Definition at line 104 of file HcalDigiProducer.h.
Referenced by configure(), and produce().