LDMX Software
ParticleFlow.h
Go to the documentation of this file.
1
7#ifndef PARTICLEFLOW_H
8#define PARTICLEFLOW_H
9
10// LDMX Framework
11#include "Framework/Configure/Parameters.h" // Needed to import parameters from configuration file
12#include "Framework/Event.h"
13#include "Framework/EventProcessor.h" //Needed to declare processor
17#include "Tracking/Event/Track.h"
18
19namespace recon {
20
26 public:
27 ParticleFlow(const std::string& name, framework::Process& process)
29
31
32 virtual void produce(framework::Event& event);
33
34 virtual void onProcessEnd();
35
36 void fillCandTrack(ldmx::PFCandidate& cand, const ldmx::Track& tk,
37 const std::vector<ldmx::SimTrackerHit>& sp_hits);
38 void fillCandEMCalo(ldmx::PFCandidate& cand, const ldmx::CaloCluster& em);
39 void fillCandHadCalo(ldmx::PFCandidate& cand, const ldmx::CaloCluster& had);
40 void identifyCharged(ldmx::PFCandidate& cand) const;
41 static ldmx::CaloCluster mergeClusters(
42 const std::vector<ldmx::CaloCluster>& clusters, int root,
43 const std::vector<int>& members);
44 std::vector<ldmx::CaloCluster> linkHcalClusters(
45 const std::vector<ldmx::CaloCluster>& clusters) const;
46 double ecalDepth(const ldmx::CaloCluster& cl) const;
47 double ecalWidth(const ldmx::CaloCluster& cl, const ldmx::Track& tk) const;
48 void absorbHadronShower(ldmx::PFCandidate& cand, const ldmx::Track& tk,
49 const std::vector<ldmx::CaloCluster>& ecal,
50 std::vector<bool>& ecal_used,
51 const std::vector<ldmx::CaloCluster>& hcal,
52 std::vector<bool>& hcal_used) const;
53 int linkTrackHcal(const ldmx::Track& tk,
54 const std::vector<ldmx::CaloCluster>& clusters,
55 const std::vector<bool>& used) const;
56 void recoverEcal(ldmx::PFCandidate& cand, const ldmx::Track& tk,
57 const std::vector<ldmx::CaloCluster>& clusters,
58 std::vector<bool>& used) const;
59 double trackClusterDist(const std::vector<double>& xyz,
60 const std::vector<double>& pxyz,
61 const ldmx::CaloCluster& cl) const;
62 std::vector<ldmx::CaloCluster> linkEcalClusters(
63 const std::vector<ldmx::CaloCluster>& clusters,
64 const std::vector<ldmx::Track>& tracks) const;
65
66 private:
67 const std::vector<ldmx::CaloCluster> getEcalClusters(
68 framework::Event& event, std::string inputClusterCollName,
69 std::string inputClusterPassName);
70
71 static double correction(const std::vector<double>& energies,
72 const std::vector<double>& factors, double energy);
73
74 // energy correction tables: raw energy [MeV] and factor
75 std::vector<double> ecal_corr_energies_;
76 std::vector<double> ecal_corr_factors_;
77 std::vector<double> hcal_corr_energies_;
78 std::vector<double> hcal_corr_factors_;
79
80 // name of collection for PF inputs to be passed
81 std::string input_ecal_coll_name_;
82 std::string input_hcal_coll_name_;
83 std::string input_track_coll_name_;
84 std::string input_ecal_passname_;
85 std::string input_hcal_passname_;
86 std::string input_tracks_passname_;
87 // Ecal scoring plane hits used for candidate truth info
88 std::string truth_sp_coll_name_;
89 std::string truth_sp_passname_;
90 // bool to toggle using pre-existing clusters instead of making new
91 bool use_existing_ecal_clusters_;
92 // name of collection for PF outputs
93 std::string output_coll_name_;
94 // configuration
95 bool single_particle_;
96 // dE/dx estimates made on the input tracks, empty name disables
97 std::string input_mass_coll_name_;
98 std::string input_mass_passname_;
99 // max RMS-normalized track to Ecal cluster distance
100 double link_max_dist_{};
101 // floor on the cluster RMS used to normalize the link distance [mm]
102 double link_min_rms_{};
103 // linked Ecal E/p above which a track is an electron
104 double electron_ep_min_{};
105 // linked Ecal E/p above which the excess becomes a photon
106 double excess_ep_{};
107 // dE/dx mass squared windows [MeV^2] and their momentum limits [MeV] for
108 // the p and K mass hypotheses of charged hadrons
109 double proton_min_mass2_{};
110 double kaon_min_mass2_{};
111 double proton_max_p_{};
112 double kaon_max_p_{};
113 // low E/p tracks absorb unlinked clusters within this radius [mm]
114 // until E/p reaches recovery_stop_ep, 0 disables
115 double recovery_radius_{};
116 double recovery_stop_ep_{};
117 // Hcal to Hcal linking cone seen from the target [deg], 0 disables
118 double hcal_merge_angle_{};
119 // track to Hcal link cone from the track at the Ecal face [deg], 0 disables
120 double hcal_track_angle_{};
121 // charged hadrons absorb free Ecal clusters within this radius [mm] and
122 // Hcal clusters in their cone while calo E < absorb_ep * p, 0 disables
123 double hadron_ecal_radius_{};
124 double hadron_absorb_ep_{};
125 // neutral candidates below this energy are dropped [MeV]
126 double min_neutral_e_{};
127 // electrons need an energy-weighted Ecal depth [mm] below max_depth at
128 // 1 GeV, growing by depth_slope per doubling of momentum
129 double ecal_front_z_{};
130 double electron_max_depth_{};
131 double electron_depth_slope_{};
132 // Ecal to Ecal linking, radius 0 disables [mm]
133 double ecal_link_radius_{};
134 double ecal_link_ratio_{};
135 int ecal_link_min_layers_{};
136 // soft clusters kept as photons: min E [MeV], isolation and start z [mm]
137 double photon_keep_min_e_{};
138 double photon_keep_min_dist_{};
139 double photon_keep_max_zstart_{};
140 int dedx_min_hits_{};
141};
142} // namespace recon
143
144#endif /* PARTICLEFLOW_H */
Class that stores calorimeter cluster information.
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Class that represents a reconstructed particle candidate.
Class which encapsulates information from a hit in a simulated tracking detector.
Implements an event buffer system for storing event data.
Definition Event.h:40
Class which represents the process under execution.
Definition Process.h:34
Base class for a module which produces a data product.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Stores cluster information from the ECal.
Definition CaloCluster.h:25
Represents a reconstructed particle.
Definition PFCandidate.h:21
Implementation of a track object.
Definition Track.h:54
virtual void produce(framework::Event &event)
Process the event and put new data products into it.
virtual void onProcessEnd()
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
virtual void configure(framework::config::Parameters &ps)
Callback for the EventProcessor to configure itself from the given set of parameters.