7#ifndef EVENTPROC_ECALVETOPROCESSOR_H_
8#define EVENTPROC_ECALVETOPROCESSOR_H_
13#include "Ecal/Event/EcalHit.h"
15#include "Framework/Configure/Parameters.h"
17#include "Tools/ONNXRuntime.h"
23#include "Tracking/Event/Track.h"
37 typedef std::pair<ldmx::EcalID, float> CellEnergyPair;
39 typedef std::pair<float, float> XYCoords;
63 void clearProcessor();
67 const std::vector<ldmx::EcalHit>& ecalRecHits,
double& showerRMS);
70 void fillHitMap(
const std::vector<ldmx::EcalHit>& ecalRecHits,
71 std::map<ldmx::EcalID, float>& cellMap_);
74 void fillIsolatedHitMap(
const std::vector<ldmx::EcalHit>& ecalRecHits,
76 std::map<ldmx::EcalID, float>& cellMap,
77 std::map<ldmx::EcalID, float>& cellMapIso,
78 bool doTight =
false);
80 std::vector<XYCoords> getTrajectory(std::vector<double> momentum,
81 std::vector<float> position);
96 float distTwoLines(TVector3 v1, TVector3 v2, TVector3 w1, TVector3 w2);
106 float distPtToLine(TVector3 h1, TVector3 p1, TVector3 p2);
115 std::vector<float>
trackProp(
const ldmx::Tracks& tracks,
116 ldmx::TrackStateType ts_type,
117 const std::string& ts_title);
120 std::map<ldmx::EcalID, float> cellMap_;
121 std::map<ldmx::EcalID, float> cellMapTightIso_;
123 std::vector<float> ecalLayerEdepRaw_;
124 std::vector<float> ecalLayerEdepReadout_;
125 std::vector<float> ecalLayerTime_;
127 std::vector<std::vector<double>> roc_range_values_;
130 int nReadoutHits_{0};
131 int deepestLayerHit_{0};
133 double summedDet_{0};
134 double summedTightIso_{0};
135 double maxCellDep_{0};
136 double showerRMS_{0};
139 double avgLayerHit_{0};
140 double stdLayerHit_{0};
141 double ecalBackEnergy_{0};
162 double bdtCutVal_{0};
164 double beamEnergyMeV_{0};
165 double linreg_radius_{0};
167 bool verbose_{
false};
169 std::string bdtFileName_;
170 std::string rocFileName_;
171 std::vector<float> bdtFeatures_;
172 std::string featureListName_;
174 std::string rec_pass_name_;
175 std::string rec_coll_name_;
176 bool recoil_from_tracking_;
177 std::string track_collection_;
178 bool inverse_skim_{
false};
183 std::unique_ptr<ldmx::Ort::ONNXRuntime> rt_;
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class that defines an ECal detector ID with a cell number.
Class used to encapsulate the results obtained from EcalVetoProcessor.
Base classes for all user event processing components to extend.
Determines if event is vetoable using ECAL hit information.
std::vector< float > trackProp(const ldmx::Tracks &tracks, ldmx::TrackStateType ts_type, const std::string &ts_title)
Return a vector of parameters for a propagated recoil track.
float epSep_
Distance between the projected photon and electron trajectories at the ECal face.
float distTwoLines(TVector3 v1, TVector3 v2, TVector3 w1, TVector3 w2)
Returns the distance between the lines v and w, with v defined to pass through the points (v1,...
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.
void buildBDTFeatureVector(const ldmx::EcalVetoResult &result)
int photonTerritoryHits_
Number of hits in the photon territory.
float epAng_
Angular separation between the projected photon and electron trajectories (currently unused)
int nStraightTracks_
Number of "straight" tracks found in the event.
int nLinregTracks_
Number of "linreg" tracks found in the event.
int firstNearPhLayer_
First ECal layer in which a hit is found near the photon.
float epDot_
Dot product of the photon and electron momenta unit vectors.
float distPtToLine(TVector3 h1, TVector3 p1, TVector3 p2)
Return the minimum distance between the point h1 and the line passing through points p1 and p2.
std::string collectionName_
Name of the collection which will containt the results.
void fillHitMap(const std::vector< ldmx::EcalHit > &ecalRecHits, std::map< ldmx::EcalID, float > &cellMap_)
Function to load up empty vector of hit maps.
int nNearPhHits_
Number of hits near the photon trajectory.
const ldmx::EcalGeometry * geometry_
handle to current geometry (to share with member functions)
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
Class encapsulating parameters for configuring a processor.
Translation between real-space positions and cell IDs within the ECal.
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.