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"
34 typedef std::pair<ldmx::EcalID, float> CellEnergyPair;
36 typedef std::pair<float, float> XYCoords;
60 void clearProcessor();
64 const std::vector<ldmx::EcalHit>& ecalRecHits,
double& showerRMS);
67 void fillHitMap(
const std::vector<ldmx::EcalHit>& ecalRecHits,
68 std::map<ldmx::EcalID, float>& cellMap_);
71 void fillIsolatedHitMap(
const std::vector<ldmx::EcalHit>& ecalRecHits,
73 std::map<ldmx::EcalID, float>& cellMap,
74 std::map<ldmx::EcalID, float>& cellMapIso,
75 bool doTight =
false);
77 std::vector<XYCoords> getTrajectory(std::vector<double> momentum,
78 std::vector<float> position);
93 float distTwoLines(TVector3 v1, TVector3 v2, TVector3 w1, TVector3 w2);
103 float distPtToLine(TVector3 h1, TVector3 p1, TVector3 p2);
106 std::map<ldmx::EcalID, float> cellMap_;
107 std::map<ldmx::EcalID, float> cellMapTightIso_;
109 std::vector<float> ecalLayerEdepRaw_;
110 std::vector<float> ecalLayerEdepReadout_;
111 std::vector<float> ecalLayerTime_;
113 std::vector<std::vector<double>> roc_range_values_;
116 int nReadoutHits_{0};
117 int deepestLayerHit_{0};
119 double summedDet_{0};
120 double summedTightIso_{0};
121 double maxCellDep_{0};
122 double showerRMS_{0};
125 double avgLayerHit_{0};
126 double stdLayerHit_{0};
127 double ecalBackEnergy_{0};
148 double bdtCutVal_{0};
150 double beamEnergyMeV_{0};
152 bool verbose_{
false};
154 std::string bdtFileName_;
155 std::string rocFileName_;
156 std::vector<float> bdtFeatures_;
157 std::string featureListName_;
159 std::string rec_pass_name_;
160 std::string rec_coll_name_;
165 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.
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.