LDMX Software
|
Electron counting processor. More...
#include <BeamElectronLocator.h>
Public Member Functions | |
BeamElectronLocator (const std::string &name, framework::Process &process) | |
Constructor. | |
virtual | ~BeamElectronLocator () |
Destructor. | |
void | configure (framework::config::Parameters ¶meters) override |
Configure the processor using the given user specified parameters. | |
void | onProcessStart () override |
Prints the configuration to log in debug mode. | |
void | produce (framework::Event &event) override |
Process the event and put new data products into it. | |
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 | 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 Member Functions | |
int | bin (float coordinate, double binWidth, double min, double max) |
Bins coordinates according to some given granularity (passed as argument). | |
Private Attributes | |
std::string | inputColl_ |
The name of the input collection used for counting electrons. | |
std::string | inputPassName_ |
The pass name of the input collection used for counting electrons. | |
std::string | outputColl_ |
The name of the output collection used to save some electron counting variables. | |
double | minXmm_ |
The min value measured by the system (edge) in X, in mm. | |
double | maxXmm_ |
The max value measured by the system (edge) in X, in mm. | |
double | minYmm_ |
The min value measured by the system (edge) in Y, in mm. | |
double | maxYmm_ |
The max value measured by the system (edge) in Y, in mm. | |
double | granularityXmm_ |
The granularity of the detector (e.g. | |
double | granularityYmm_ |
The granularity of the detector (e.g. | |
double | tolerance_ |
The tolerance within which simhits are considered to belong to the same electron. | |
bool | verbose_ {false} |
Indicate verbose printout to log according to log level. | |
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. | |
Electron counting processor.
This processor uses calo simhits in e.g. the target to get truth info about beam electrons. The hits associated with beam electrons can already be isolated by the truth hit collection producer. However, the simhits have approximately infinite resolution. This processor's raison d'ĂȘtre is to run some sort of grouping, to ensure we have at most one reconstructed truth information object per electron.
Definition at line 26 of file BeamElectronLocator.h.
recon::BeamElectronLocator::BeamElectronLocator | ( | const std::string & | name, |
framework::Process & | process | ||
) |
Constructor.
name | Name for this instance of the class. |
process | The Process class associated with EventProcessor, provided by the framework. |
Definition at line 5 of file BeamElectronLocator.cxx.
|
virtual |
|
private |
Bins coordinates according to some given granularity (passed as argument).
Returns the lower bin edge. -1 for underflow (coordinate < min_in_mm); with a system of N bins, returns n = N if coordinate > max_in_mm.
TODO also implement a function that returns the grid of non-empty hit coordinates, which accounts for that we don't know the multiplicity at a location
Definition at line 103 of file BeamElectronLocator.cxx.
Referenced by produce().
|
overridevirtual |
Configure the processor using the given user specified parameters.
The user specified parameters that are available are defined in the python configuration class. Look at the beamElecronLocator.py in Recon/python for the python structure.
parameters | Set of parameters used to configure this processor. |
Reimplemented from framework::EventProcessor.
Definition at line 11 of file BeamElectronLocator.cxx.
References framework::config::Parameters::getParameter(), granularityXmm_, granularityYmm_, inputColl_, inputPassName_, maxXmm_, maxYmm_, minXmm_, minYmm_, outputColl_, tolerance_, and verbose_.
|
overridevirtual |
Prints the configuration to log in debug mode.
Reimplemented from framework::EventProcessor.
Definition at line 24 of file BeamElectronLocator.cxx.
References granularityXmm_, granularityYmm_, inputColl_, inputPassName_, maxXmm_, maxYmm_, minXmm_, minYmm_, outputColl_, tolerance_, and verbose_.
|
overridevirtual |
Process the event and put new data products into it.
event | The event to process. |
Implements framework::Producer.
Definition at line 39 of file BeamElectronLocator.cxx.
References bin(), framework::Event::exists(), ldmx::BeamElectronTruth::getBarX(), ldmx::BeamElectronTruth::getBarY(), granularityXmm_, granularityYmm_, inputColl_, inputPassName_, maxXmm_, maxYmm_, minXmm_, minYmm_, outputColl_, ldmx::BeamElectronTruth::setBarX(), ldmx::BeamElectronTruth::setBarY(), ldmx::BeamElectronTruth::setBinnedX(), ldmx::BeamElectronTruth::setBinnedY(), ldmx::BeamElectronTruth::setXYZ(), tolerance_, and verbose_.
|
private |
The granularity of the detector (e.g.
TS) in X, in mm
Definition at line 101 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The granularity of the detector (e.g.
TS) in Y, in mm
Definition at line 105 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The name of the input collection used for counting electrons.
Definition at line 67 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The pass name of the input collection used for counting electrons.
Definition at line 72 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The max value measured by the system (edge) in X, in mm.
Definition at line 87 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The max value measured by the system (edge) in Y, in mm.
Definition at line 96 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The min value measured by the system (edge) in X, in mm.
Definition at line 83 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The min value measured by the system (edge) in Y, in mm.
Definition at line 92 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The name of the output collection used to save some electron counting variables.
Definition at line 78 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
The tolerance within which simhits are considered to belong to the same electron.
Definition at line 111 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().
|
private |
Indicate verbose printout to log according to log level.
Definition at line 116 of file BeamElectronLocator.h.
Referenced by configure(), onProcessStart(), and produce().