22 #ifndef ELECTRON_EVENT_SELECTION_ALG_H
23 #define ELECTRON_EVENT_SELECTION_ALG_H
25 #include "art/Framework/Principal/Event.h"
26 #include "art/Framework/Principal/Handle.h"
29 #include "art/Framework/Services/Registry/ServiceHandle.h"
30 #include "art/Framework/Services/Registry/ServiceHandle.h"
32 #include "canvas/Persistency/Common/FindOneP.h"
33 #include "canvas/Persistency/Common/FindManyP.h"
34 #include "canvas/Utilities/InputTag.h"
36 #include "lardataobj/RecoBase/PFParticle.h"
37 #include "lardataobj/RecoBase/Vertex.h"
38 #include "lardataobj/RecoBase/Track.h"
39 #include "lardataobj/RecoBase/Shower.h"
40 #include "lardataobj/RecoBase/SpacePoint.h"
42 #include "lardataobj/RecoBase/Hit.h"
43 #include "lardataobj/RecoBase/OpFlash.h"
46 #include "larevt/SpaceChargeServices/SpaceChargeService.h"
48 #include "fhiclcpp/ParameterSet.h"
49 #include "larcore/Geometry/Geometry.h"
50 #include "uboone/LLSelectionTool/OpT0Finder/Base/OpT0FinderTypes.h"
51 #include "uboone/LLSelectionTool/OpT0Finder/Algorithms/LightCharge.h"
52 #include "uboone/LLSelectionTool/OpT0Finder/Algorithms/PhotonLibHypothesis.h"
53 #include "uboone/LLSelectionTool/OpT0Finder/Base/FlashMatchManager.h"
55 #include "GeometryHelper.h"
56 #include "PandoraInterfaceHelper.h"
91 const std::map<size_t, int >
opticalfilter(
const art::Event & evt,
92 const std::vector<size_t> &pfplist,
93 const art::ValidHandle<std::vector<recob::PFParticle>> pfparticle_handle);
104 const std::vector<size_t> &pfplist,
105 const art::ValidHandle<std::vector<recob::PFParticle>> pfparticle_handle);
115 const flashana::QCluster_t
collect3DHits(
const art::Event &evt,
116 const std::vector<size_t> &pfplist);
175 const std::map<size_t, std::vector<size_t> > &
182 const std::map<size_t, std::vector<size_t> > &
188 const std::map<size_t, std::vector<size_t>> &
194 const std::vector<double> &
200 const std::vector<double> &
224 size_t _n_neutrino_candidates;
225 std::vector<size_t> _primary_indexes;
226 std::map<size_t, bool> _neutrino_candidate_passed;
227 std::map<size_t, int > _op_flash_indexes;
228 std::map<size_t, TVector3> _neutrino_vertex;
229 std::map<size_t, int> _n_showers;
230 std::map<size_t, std::vector < size_t > > _pfp_id_showers_from_primary;
231 std::map<size_t, int> _n_tracks;
232 std::map<size_t, std::vector < size_t > > _pfp_id_tracks_from_primary;
233 std::map<size_t, int> _n_showers_as_tracks;
234 std::map<size_t, std::vector < size_t > > _pfp_id_showers_as_tracks_from_primary;
235 std::vector<double> _flash_PE;
236 std::vector<double> _flash_time;
240 int _selection_result;
245 int kNoValidFlash = 4;
246 int kNoDataProducts = 5;
250 double m_fidvolXstart;
253 double m_fidvolYstart;
256 double m_fidvolZstart;
259 double m_fractionsigmaflashwidth;
260 double m_absoluteflashdist;
262 double m_startbeamtime;
263 double m_endbeamtime;
264 double m_PE_threshold;
268 double m_cut_sigzwidth;
270 double m_cut_sigywidth;
271 double m_charge_light_ratio;
273 bool m_flashmatching;
275 double m_isCosmicInTime;
276 bool m_showersAsTracks;
282 std::string m_pfp_producer;
284 std::string fOpticalFlashFinderLabel;
292 flashana::FlashMatchManager m_mgr;
293 art::ServiceHandle<geo::Geometry> m_geo;
298 #endif // ELECTRON_EVENT_SELECTION_ALG_H
void clear()
Reset internal variables.
Definition: ElectronEventSelectionAlg.cxx:9
const double & get_TPC_x() const
Return the position in x of the center of the collected charge.
Definition: ElectronEventSelectionAlg.h:211
bool eventSelected(const art::Event &evt)
Main Event Selection Function.
Definition: ElectronEventSelectionAlg.cxx:382
const std::map< size_t, TVector3 > & get_neutrino_vertex() const
Return the pandora calculated vertex indexed by pfparticle id number.
Definition: ElectronEventSelectionAlg.h:155
Definition: PandoraInterfaceHelper.h:55
const std::map< size_t, int > & get_n_showers() const
Return number of showers for this pfparticle.
Definition: ElectronEventSelectionAlg.h:160
Definition: ElectronEventSelectionAlg.h:61
TVector3 spaceChargeTrueToReco(const TVector3 &xyz)
Return the true coordinates corrected by the space-charge effect.
Definition: ElectronEventSelectionAlg.cxx:30
const std::map< size_t, std::vector< size_t > > & get_pfp_id_showers_as_tracks_from_primary() const
Return the list of pfparticle indexes that are tracks that are associated with primary pfparticle ind...
Definition: ElectronEventSelectionAlg.h:189
const double & get_flash_x() const
Return the position in x of the flash.
Definition: ElectronEventSelectionAlg.h:206
const int & get_selection_result() const
Return the selection failure mode.
Definition: ElectronEventSelectionAlg.h:216
void reconfigure(fhicl::ParameterSet const &p)
Configure all of the parameters of this class.
Definition: ElectronEventSelectionAlg.cxx:58
const std::vector< double > & get_flash_time() const
Return the list of times of the flashes.
Definition: ElectronEventSelectionAlg.h:201
const size_t & get_n_neutrino_candidates() const
Return the number of neutrino candidates.
Definition: ElectronEventSelectionAlg.h:139
const std::map< size_t, int > & get_n_showers_as_tracks() const
Return number of showers for this pfparticle, reconstructed as tracks;.
Definition: ElectronEventSelectionAlg.h:165
const std::map< size_t, std::vector< size_t > > & get_pfp_id_showers_from_primary() const
Return the list of pfparticle indexes that are showers that are associated with primary pfparticle in...
Definition: ElectronEventSelectionAlg.h:176
const std::map< size_t, int > flashBasedSelection(const art::Event &evt, const std::vector< size_t > &pfplist, const art::ValidHandle< std::vector< recob::PFParticle >> pfparticle_handle)
Checks if there is a flash within the flash_window_start - flash_window_end window with enough PE...
Definition: ElectronEventSelectionAlg.cxx:100
const std::map< size_t, int > & get_op_flash_indexes() const
Return the index of the flash matched with the pfparticle.
Definition: ElectronEventSelectionAlg.h:150
const std::vector< double > & get_flash_PE() const
Return the list of total PE of the flashes.
Definition: ElectronEventSelectionAlg.h:195
bool _do_opdet_swap
If true swaps reconstructed OpDets according to _opdet_swap_map.
Definition: ElectronEventSelectionAlg.h:277
const std::map< size_t, int > & get_n_tracks() const
Return number of tracks for pfparticle index.
Definition: ElectronEventSelectionAlg.h:170
const std::map< size_t, int > opticalfilter(const art::Event &evt, const std::vector< size_t > &pfplist, const art::ValidHandle< std::vector< recob::PFParticle >> pfparticle_handle)
Checks if there is a flash within the 3.2-4.8 ms window and compatible with the center of charge...
Definition: ElectronEventSelectionAlg.cxx:338
const std::vector< size_t > & get_primary_indexes() const
Return a list of the selected pfparticle top level neutrino candidate indexes.
Definition: ElectronEventSelectionAlg.h:134
const std::map< size_t, bool > & get_neutrino_candidate_passed() const
Inform whether a particular candidate passed or failed the algorithm.
Definition: ElectronEventSelectionAlg.h:145
Definition: GeometryHelper.h:40
const flashana::QCluster_t collect3DHits(const art::Event &evt, const std::vector< size_t > &pfplist)
Creates a photon cluster for a neutrino pfp hierarchy PFParticle.
Definition: ElectronEventSelectionAlg.cxx:288
const std::map< size_t, std::vector< size_t > > & get_pfp_id_tracks_from_primary() const
Return the list of pfparticle indexes that are tracks that are associated with primary pfparticle ind...
Definition: ElectronEventSelectionAlg.h:183
std::vector< int > _opdet_swap_map
The OpDet swap map for reco flashes.
Definition: ElectronEventSelectionAlg.h:278