LDMX Software
|
Minimal example of a processor. More...
#include <GreedyAmbiguitySolver.h>
Classes | |
struct | State |
Public Member Functions | |
GreedyAmbiguitySolver (const std::string &name, framework::Process &process) | |
Constructor. | |
virtual | ~GreedyAmbiguitySolver ()=default |
Destructor. | |
void | onNewRun (const ldmx::RunHeader &rh) override |
onNewRun is the first function called for each processor after the conditions are fully configured and accessible. | |
void | configure (framework::config::Parameters ¶meters) override |
Configure the processor using the given user specified parameters. | |
void | produce (framework::Event &event) override |
Process the event and put new data products into it. | |
![]() | |
TrackingGeometryUser (const std::string &name, framework::Process &p) | |
![]() | |
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. | |
![]() | |
EventProcessor (const std::string &name, Process &process) | |
Class constructor. | |
virtual | ~EventProcessor () |
Class destructor. | |
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 Member Functions | |
template<typename geometry_t , typename source_link_hash_t , typename source_link_equality_t > | |
void | computeInitialState (std::vector< ldmx::Track > tracks, std::vector< ldmx::Measurement > measurements, State &state, geometry_t &tg, source_link_hash_t &&sourceLinkHash, source_link_equality_t &&sourceLinkEquality) const |
void | resolve (State &state) |
Updates the state iteratively by evicting one track after the other until the final state conditions are met. | |
void | removeTrack (State &state, std::size_t iTrack) const |
Private Attributes | |
std::uint32_t | maximum_shared_hits_ {1} |
Maximum amount of shared hits per track. | |
std::uint32_t | maximum_iterations_ {1000} |
Maximum number of iterations. | |
std::size_t | n_meas_min_ {7} |
Minimum number of measurement to form a track. | |
std::string | out_trk_collection_ {"TaggerTracksClean"} |
std::string | track_collection_ {"TaggerTracks"} |
std::string | meas_collection_ {"DigiTaggerSimHits"} |
std::string | input_pass_name_ {""} |
Additional Inherited Members | |
![]() | |
static void | declare (const std::string &classname, int classtype, EventProcessorMaker *) |
Internal function which is part of the PluginFactory machinery. | |
![]() | |
static const int | CLASSTYPE {1} |
Constant used to track EventProcessor types by the PluginFactory. | |
![]() | |
const Acts::GeometryContext & | geometry_context () |
const Acts::MagneticFieldContext & | magnetic_field_context () |
const Acts::CalibrationContext & | calibration_context () |
const geo::TrackersTrackingGeometry & | geometry () |
![]() | |
void | abortEvent () |
Abort the event immediately. | |
![]() | |
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. | |
Minimal example of a processor.
This processor will loop over all of the ECal hits in an event and print out their details.
Definition at line 49 of file GreedyAmbiguitySolver.h.
tracking::reco::GreedyAmbiguitySolver::GreedyAmbiguitySolver | ( | 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 11 of file GreedyAmbiguitySolver.cxx.
|
private |
tracks | The input track container. |
state | An empty state object which is expected to be default constructed. |
sourceLinkHash | A functor to acquire a hash from a given source link. |
sourceLinkEquality | A functor to check equality of two source links. |
Definition at line 43 of file GreedyAmbiguitySolver.cxx.
References n_meas_min_.
Referenced by produce().
|
overridevirtual |
Configure the processor using the given user specified parameters.
The user specified parameters that are availabed are defined in the python configuration class. Look at the my_processor.py module of the EventProc python for the python structure.
parameters | Set of parameters used to configure this processor. |
Reimplemented from framework::EventProcessor.
Definition at line 164 of file GreedyAmbiguitySolver.cxx.
References maximum_shared_hits_, and n_meas_min_.
|
overridevirtual |
onNewRun is the first function called for each processor after the conditions are fully configured and accessible.
This is where you could create single-processors, multi-event calculation objects.
Reimplemented from framework::EventProcessor.
Definition at line 162 of file GreedyAmbiguitySolver.cxx.
|
overridevirtual |
Process the event and put new data products into it.
event | The event to process. |
Implements framework::Producer.
Definition at line 180 of file GreedyAmbiguitySolver.cxx.
References computeInitialState(), framework::Event::exists(), n_meas_min_, and resolve().
|
private |
state | A state object that was previously filled by the initialization. |
iTrack |
Definition at line 29 of file GreedyAmbiguitySolver.cxx.
Referenced by resolve().
|
private |
Updates the state iteratively by evicting one track after the other until the final state conditions are met.
state | A state object that was previously filled by the initialization. |
Compares two tracks based on the number of shared measurements in order to decide if we already met the final state.
Compares two tracks in order to find the one which should be evicted. First we compare the relative amount of shared measurements. If that is indecisive we use the chi2.
Helper to calculate the relative amount of shared measurements.
Definition at line 103 of file GreedyAmbiguitySolver.cxx.
References maximum_iterations_, maximum_shared_hits_, and removeTrack().
Referenced by produce().
|
private |
Definition at line 104 of file GreedyAmbiguitySolver.h.
|
private |
Maximum number of iterations.
Definition at line 93 of file GreedyAmbiguitySolver.h.
Referenced by resolve().
|
private |
Maximum amount of shared hits per track.
Definition at line 91 of file GreedyAmbiguitySolver.h.
Referenced by configure(), and resolve().
|
private |
Definition at line 102 of file GreedyAmbiguitySolver.h.
|
private |
Minimum number of measurement to form a track.
Definition at line 96 of file GreedyAmbiguitySolver.h.
Referenced by computeInitialState(), configure(), and produce().
|
private |
Definition at line 98 of file GreedyAmbiguitySolver.h.
|
private |
Definition at line 100 of file GreedyAmbiguitySolver.h.