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. | |
Public Member Functions inherited from framework::Producer | |
Producer (const std::string &name, Process &process) | |
Class constructor. | |
virtual void | beforeNewRun (ldmx::RunHeader &header) |
Handle allowing producers to modify run headers before the run begins. | |
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 | 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 | inputCollName_ |
input hit collection name | |
std::string | inputPassName_ |
input pass name | |
std::string | digiCollName_ |
output hit collection name | |
double | clockCycle_ |
Time interval for chip clock in ns. | |
int | nADCs_ |
Depth of ADC buffer. | |
int | iSOI_ |
Index for the Sample Of Interest in the list of digi samples. | |
double | MeV_ |
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. | |
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. | |
std::unique_ptr< ldmx::NoiseGenerator > | noiseGenerator_ |
Generates noise hits based off of number of cells that are not hit. | |
std::unique_ptr< TRandom3 > | noiseInjector_ |
Generates Gaussian noise on top of real hits. | |
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::Producer | |
static const int | CLASSTYPE {1} |
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. | |
NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
Manager for any ntuples. | |
logging::logger | theLog_ |
The logger for this EventProcessor. | |
Performs basic HCal digitization.
Definition at line 29 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 15 of file HcalDigiProducer.cxx.
References noiseGenerator_.
|
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 28 of file HcalDigiProducer.cxx.
References attlength_, clockCycle_, digiCollName_, framework::config::Parameters::getParameter(), hgcroc_, inputCollName_, inputPassName_, iSOI_, MeV_, nADCs_, noise_, noiseGenerator_, and ns_.
|
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 64 of file HcalDigiProducer.cxx.
References ldmx::HgcrocDigiCollection::addDigi(), attlength_, clockCycle_, ldmx::HcalGeometry::CONDITIONS_OBJECT_NAME, framework::RandomNumberSeedService::CONDITIONS_OBJECT_NAME, digiCollName_, ldmx::SimCalorimeterHit::Contrib::edep, ldmx::SimCalorimeterHit::getContrib(), ldmx::SimCalorimeterHit::getID(), ldmx::SimCalorimeterHit::getNumberOfContribs(), ldmx::HgcrocDigiCollection::getNumDigis(), ldmx::SimCalorimeterHit::getPosition(), hgcroc_, inputCollName_, inputPassName_, iSOI_, ldmx::HcalID::layer(), MeV_, nADCs_, noise_, noiseGenerator_, noiseInjector_, ldmx::DetectorID::raw(), ldmx::HgcrocDigiCollection::setNumSamplesPerDigi(), ldmx::HgcrocDigiCollection::setSampleOfInterestIndex(), ldmx::HcalID::strip(), and ldmx::SimCalorimeterHit::Contrib::time.
|
private |
Strip attenuation length [m].
Definition at line 78 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Time interval for chip clock in ns.
Definition at line 66 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
output hit collection name
Definition at line 63 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Hgcroc Emulator to digitize analog voltage signals.
Definition at line 88 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
input hit collection name
Definition at line 57 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
input pass name
Definition at line 60 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Index for the Sample Of Interest in the list of digi samples.
Definition at line 72 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Conversion from energy in MeV to voltage in mV.
Definition at line 75 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Depth of ADC buffer.
Definition at line 69 of file HcalDigiProducer.h.
Referenced by configure(), and produce().
|
private |
Put noise into empty channels, not configurable, only helpful in development.
Definition at line 85 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 94 of file HcalDigiProducer.h.
Referenced by configure(), HcalDigiProducer(), and produce().
|
private |
Generates Gaussian noise on top of real hits.
Definition at line 97 of file HcalDigiProducer.h.
Referenced by produce().
|
private |
Conversion from time in ns to ticks of the internal clock.
Definition at line 91 of file HcalDigiProducer.h.
Referenced by configure().