LDMX Software
|
Create a track seed using truth information extracted from the corresponding SimParticle or SimTrackerHit. More...
#include <TruthSeedProcessor.h>
Public Member Functions | |
TruthSeedProcessor (const std::string &name, framework::Process &process) | |
Constructor. | |
~TruthSeedProcessor ()=default | |
Destructor. | |
void | configure (framework::config::Parameters ¶meters) override |
Callback for the EventProcessor to configure itself from the given set of parameters. | |
void | onProcessStart () override |
Callback for the EventProcessor to take any necessary action when the processing of events starts. | |
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 | produce (framework::Event &event) override |
Main loop that creates the seed tracks for both the tagger and recoil tracker. | |
Public Member Functions inherited from tracking::reco::TrackingGeometryUser | |
TrackingGeometryUser (const std::string &name, framework::Process &p) | |
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 | 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 | |
void | makeHitCountMap (const std::vector< ldmx::SimTrackerHit > &sim_hits, std::map< int, std::vector< int > > &hit_count_map) |
Create a mapping from the selected scoring plane hit objects to the number of hits they associated particle creates in the tracker. | |
void | createTruthTrack (const ldmx::SimParticle &particle, ldmx::Track &trk, const std::shared_ptr< Acts::Surface > &target_surface) |
Use the vertex position of the SimParticle to extract (x, y, z, px, py, pz, q) and create a track seed. | |
void | createTruthTrack (const ldmx::SimParticle &particle, const ldmx::SimTrackerHit &hit, ldmx::Track &trk, const std::shared_ptr< Acts::Surface > &target_surface) |
Use the scoring plane hit at the target to extract (x, y, z, px, py, pz) and create a track seed. | |
void | createTruthTrack (const std::vector< double > &pos_vec, const std::vector< double > &p_vec, int charge, ldmx::Track &trk, const std::shared_ptr< Acts::Surface > &target_surface) |
Create a seed track from the given position, momentum and charge. | |
bool | scoringPlaneHitFilter (const ldmx::SimTrackerHit &hit, const std::vector< ldmx::SimTrackerHit > &ecal_sp_hits) |
Filter that checks if a scoring plane passes specified momentum cuts as well as if the associated SimParticle hits the ECal. | |
ldmx::Track | seedFromTruth (const ldmx::Track &tt, bool seed_smearing) |
Create a track seed from a truth track applying a smearing to the truth parameters as well as an inflation to the covariance matrix. | |
ldmx::Track | RecoilFullSeed (const ldmx::SimParticle &particle, const int trackID, const ldmx::SimTrackerHit &hit, const ldmx::SimTrackerHit &ecal_hit, const std::map< int, std::vector< int > > &hit_count_map, const std::shared_ptr< Acts::Surface > &origin_surface, const std::shared_ptr< Acts::Surface > &target_surface, const std::shared_ptr< Acts::Surface > &ecal_surface) |
ldmx::Track | TaggerFullSeed (const ldmx::SimParticle &beam_electron, const int trackID, const ldmx::SimTrackerHit &hit, const std::map< int, std::vector< int > > &hit_count_map, const std::shared_ptr< Acts::Surface > &origin_surface, const std::shared_ptr< Acts::Surface > &target_surface) |
This method retrieves the beam electron and forms a full seed The seed parameters are the truth parameters from the beam electron stored at the beam origin Additionally, the foolowing track states are stored ts_smeared : the truth smeared perigee state at the beam origin ts_truth_target : the truth on-surface state at the target Linear extrapolations are done from the origin of the particle to the reference surfaces This track also contains the list of hits belonging to the beam electron on the sensitive surfaces on the tagger tracker, for acceptance studies. | |
Private Attributes | |
Acts::GeometryContext | gctx_ |
The ACTS geometry context properly. | |
std::vector< int > | pdg_ids_ {11} |
pdg_ids of the particles we want to select for the seeds | |
std::string | scoring_hits_coll_name_ {"TargetScoringPlaneHits"} |
Which scoring plane hits to use for the truth seeds generation. | |
std::string | tagger_sim_hits_coll_name_ {"TaggerSimHits"} |
Sim hits to check if the truth seed is findable. | |
std::string | recoil_sim_hits_coll_name_ {"RecoilSimHits"} |
Sim hits to check if the truth seed is findable. | |
int | n_min_hits_tagger_ {7} |
Minimum number of hits left in the recoil tracker to consider the seed as findable. | |
int | n_min_hits_recoil_ {7} |
Minimum number of hits left in the recoil tracker to consider the seed as findable. | |
float | z_min_ {-999} |
Min cut on the z of the scoring hit. | |
int | track_id_ {-999} |
Only select a particular trackID. | |
double | pz_cut_ {-9999} |
Ask for a minimum pz for the seeds. | |
double | p_cut_ {0.} |
Ask for a minimum p for the seeds. | |
double | p_cut_max_ {100000.} |
Ask for a maximum p for the seeds. | |
double | p_cut_ecal_ {-1.} |
bool | recoil_sp_ {true} |
bool | target_sp_ {true} |
bool | skip_tagger_ {false} |
bool | skip_recoil_ {false} |
int | max_track_id_ {5} |
std::shared_ptr< LinPropagator > | linpropagator_ |
std::shared_ptr< tracking::reco::TrackExtrapolatorTool< LinPropagator > > | trk_extrap_ |
std::default_random_engine | generator_ |
std::shared_ptr< std::normal_distribution< float > > | normal_ |
bool | seedSmearing_ {false} |
std::vector< double > | d0smear_ |
std::vector< double > | z0smear_ |
double | phismear_ |
double | thetasmear_ |
double | relpsmear_ |
std::vector< double > | rel_smearfactors_ |
std::vector< double > | inflate_factors_ |
std::vector< double > | beamOrigin_ {-880.1, -44., 0.} |
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 tracking::reco::TrackingGeometryUser | |
const Acts::GeometryContext & | geometry_context () |
const Acts::MagneticFieldContext & | magnetic_field_context () |
const Acts::CalibrationContext & | calibration_context () |
const geo::TrackersTrackingGeometry & | geometry () |
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. | |
Create a track seed using truth information extracted from the corresponding SimParticle or SimTrackerHit.
When creating seeds in the Tagger tracker, the SimParticle associated with the incident electron (trackID == 1) is used to create the seed from the parameters (x, y, z, px, py, pz, q) at the vertex. For the Recoil tracker, since the electron is produced upstream, the SimParticle can't be used to get any parameters at the target. In this case, the target scoring plane hits are used to extract the parameters above.
Definition at line 42 of file TruthSeedProcessor.h.
tracking::reco::TruthSeedProcessor::TruthSeedProcessor | ( | 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 7 of file TruthSeedProcessor.cxx.
|
overridevirtual |
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.
parameters | Parameters for configuration. |
Reimplemented from framework::EventProcessor.
Definition at line 24 of file TruthSeedProcessor.cxx.
References framework::config::Parameters::getParameter(), n_min_hits_recoil_, n_min_hits_tagger_, p_cut_, p_cut_max_, pdg_ids_, pz_cut_, recoil_sim_hits_coll_name_, scoring_hits_coll_name_, tagger_sim_hits_coll_name_, track_id_, and z_min_.
|
private |
Use the scoring plane hit at the target to extract (x, y, z, px, py, pz) and create a track seed.
In this case, the SimParticle is used to extract the charge of the particle.
particle | The SimParticle to extract the charge from. |
hit | The SimTrackerHit used to create the seed. |
Definition at line 75 of file TruthSeedProcessor.cxx.
References createTruthTrack(), ldmx::SimParticle::getCharge(), ldmx::SimTrackerHit::getMomentum(), ldmx::SimTrackerHit::getPdgID(), ldmx::SimTrackerHit::getPosition(), and ldmx::SimTrackerHit::getTrackID().
|
private |
Use the vertex position of the SimParticle to extract (x, y, z, px, py, pz, q) and create a track seed.
particle | The SimParticle to make a seed from. |
Definition at line 88 of file TruthSeedProcessor.cxx.
References createTruthTrack(), ldmx::SimParticle::getCharge(), ldmx::SimParticle::getMomentum(), ldmx::SimParticle::getPdgID(), and ldmx::SimParticle::getVertex().
Referenced by createTruthTrack(), createTruthTrack(), and TaggerFullSeed().
|
private |
Create a seed track from the given position, momentum and charge.
pos | The position at which the particle was created. |
p | The momentum of the particle at the point of creation. |
charge | The charge of the particle. |
target_surface | the surface to where to express the truth track |
Definition at line 97 of file TruthSeedProcessor.cxx.
References gctx_, and ldmx::Track::setPerigeeParameters().
|
private |
Create a mapping from the selected scoring plane hit objects to the number of hits they associated particle creates in the tracker.
sim_hits | vector |
hit_count_map | filled with the hits lefts by each track |
Definition at line 432 of file TruthSeedProcessor.cxx.
Referenced by produce().
|
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 11 of file TruthSeedProcessor.cxx.
References gctx_.
|
inlineoverridevirtual |
Callback for the EventProcessor to take any necessary action when the processing of events starts.
For this class, the callback is used to retrieve the GeometryContext from ACTS.
Reimplemented from framework::EventProcessor.
Definition at line 73 of file TruthSeedProcessor.h.
|
overridevirtual |
Main loop that creates the seed tracks for both the tagger and recoil tracker.
event | The event containing the collections to process. |
Implements framework::Producer.
Definition at line 520 of file TruthSeedProcessor.cxx.
References ldmx::SimTrackerHit::getMomentum(), ldmx::SimTrackerHit::getPosition(), ldmx::SimTrackerHit::getTrackID(), makeHitCountMap(), p_cut_, recoil_sim_hits_coll_name_, scoring_hits_coll_name_, and tagger_sim_hits_coll_name_.
|
private |
Definition at line 183 of file TruthSeedProcessor.cxx.
|
private |
Filter that checks if a scoring plane passes specified momentum cuts as well as if the associated SimParticle hits the ECal.
hit | The target scoring plane hit to check. |
ecal_sp_hits | The ECal scoring plane hit used to check if the associated particle hits the ECal. |
Definition at line 466 of file TruthSeedProcessor.cxx.
References ldmx::SimTrackerHit::getMomentum(), ldmx::SimTrackerHit::getPdgID(), ldmx::SimTrackerHit::getPosition(), ldmx::SimTrackerHit::getTrackID(), p_cut_, p_cut_max_, pdg_ids_, pz_cut_, track_id_, and z_min_.
|
private |
Create a track seed from a truth track applying a smearing to the truth parameters as well as an inflation to the covariance matrix.
tt | TruthTrack to be used to form a seed |
Definition at line 316 of file TruthSeedProcessor.cxx.
References ldmx::Track::setPerigeeParameters().
Referenced by TaggerFullSeed().
|
private |
This method retrieves the beam electron and forms a full seed The seed parameters are the truth parameters from the beam electron stored at the beam origin Additionally, the foolowing track states are stored ts_smeared : the truth smeared perigee state at the beam origin ts_truth_target : the truth on-surface state at the target Linear extrapolations are done from the origin of the particle to the reference surfaces This track also contains the list of hits belonging to the beam electron on the sensitive surfaces on the tagger tracker, for acceptance studies.
beam_electron | : the beam electron particle |
hit | : the scoring hit at the target from the beam electron particle survived |
hit_count_map | : the sim hit on track map |
origin_surface | : where to express the track origin parameters. Can be perigee, plane... |
target_surface | : the target surface for the truth target state |
Definition at line 239 of file TruthSeedProcessor.cxx.
References createTruthTrack(), and seedFromTruth().
|
private |
Definition at line 274 of file TruthSeedProcessor.h.
|
private |
Definition at line 267 of file TruthSeedProcessor.h.
|
private |
The ACTS geometry context properly.
Definition at line 192 of file TruthSeedProcessor.h.
Referenced by createTruthTrack(), and onNewRun().
|
private |
Definition at line 262 of file TruthSeedProcessor.h.
|
private |
Definition at line 273 of file TruthSeedProcessor.h.
|
private |
Definition at line 254 of file TruthSeedProcessor.h.
|
private |
Definition at line 252 of file TruthSeedProcessor.h.
|
private |
Minimum number of hits left in the recoil tracker to consider the seed as findable.
Definition at line 216 of file TruthSeedProcessor.h.
Referenced by configure().
|
private |
Minimum number of hits left in the recoil tracker to consider the seed as findable.
Definition at line 210 of file TruthSeedProcessor.h.
Referenced by configure().
|
private |
Definition at line 263 of file TruthSeedProcessor.h.
|
private |
Ask for a minimum p for the seeds.
Definition at line 231 of file TruthSeedProcessor.h.
Referenced by configure(), produce(), and scoringPlaneHitFilter().
|
private |
Definition at line 237 of file TruthSeedProcessor.h.
|
private |
Ask for a maximum p for the seeds.
Definition at line 234 of file TruthSeedProcessor.h.
Referenced by configure(), and scoringPlaneHitFilter().
|
private |
pdg_ids of the particles we want to select for the seeds
Definition at line 195 of file TruthSeedProcessor.h.
Referenced by configure(), and scoringPlaneHitFilter().
|
private |
Definition at line 269 of file TruthSeedProcessor.h.
|
private |
Ask for a minimum pz for the seeds.
Definition at line 228 of file TruthSeedProcessor.h.
Referenced by configure(), and scoringPlaneHitFilter().
|
private |
Sim hits to check if the truth seed is findable.
Definition at line 204 of file TruthSeedProcessor.h.
Referenced by configure(), and produce().
|
private |
Definition at line 240 of file TruthSeedProcessor.h.
|
private |
Definition at line 272 of file TruthSeedProcessor.h.
|
private |
Definition at line 271 of file TruthSeedProcessor.h.
|
private |
Which scoring plane hits to use for the truth seeds generation.
Definition at line 198 of file TruthSeedProcessor.h.
Referenced by configure(), and produce().
|
private |
Definition at line 265 of file TruthSeedProcessor.h.
|
private |
Definition at line 249 of file TruthSeedProcessor.h.
|
private |
Definition at line 246 of file TruthSeedProcessor.h.
|
private |
Sim hits to check if the truth seed is findable.
Definition at line 201 of file TruthSeedProcessor.h.
Referenced by configure(), and produce().
|
private |
Definition at line 243 of file TruthSeedProcessor.h.
|
private |
Definition at line 270 of file TruthSeedProcessor.h.
|
private |
Only select a particular trackID.
Definition at line 225 of file TruthSeedProcessor.h.
Referenced by configure(), and scoringPlaneHitFilter().
|
private |
Definition at line 258 of file TruthSeedProcessor.h.
|
private |
Definition at line 268 of file TruthSeedProcessor.h.
|
private |
Min cut on the z of the scoring hit.
It could be used to clean the scoring hits if desired.
Definition at line 222 of file TruthSeedProcessor.h.
Referenced by configure(), and scoringPlaneHitFilter().