LDMX Software
EcalRecoilRemovalProcessor.h
Go to the documentation of this file.
1
8#ifndef EVENTPROC_ECALRECOILREMOVALPROCESSOR_H_
9#define EVENTPROC_ECALRECOILREMOVALPROCESSOR_H_
10
11// LDMX
13#include "DetDescr/EcalID.h"
14#include "DetDescr/SimSpecialID.h"
15#include "Ecal/EcalHelper.h"
16#include "Ecal/Event/EcalHit.h"
18#include "Framework/Configure/Parameters.h"
20#include "SimCore/Event/SimParticle.h"
22#include "Tools/AnalysisUtils.h"
23
24// C++
25#include <stdlib.h>
26
27#include <chrono>
28#include <fstream>
29#include <iomanip>
30#include <map>
31
32namespace ecal {
33
40 public:
41 using XYCoords = ldmx::XYCoords;
42
43 EcalRecoilRemovalProcessor(const std::string& name,
45 : Producer(name, process) {}
46
48
55 void onNewRun(const ldmx::RunHeader& rh) override;
56
60 void onProcessEnd() override;
61
67 void configure(framework::config::Parameters& parameters) override;
68
69 void produce(framework::Event& event) override;
70
71 private:
72 std::vector<XYCoords> getTrajectory(std::array<float, 3> momentum,
73 std::array<float, 3> position);
74
75 private:
76 int nevents_{0};
77 float processing_time_{0.};
78 std::map<std::string, float> profiling_map_;
79
80 // Number of electrons in the event; TODO: replace with ElectronCounter
81 int n_electrons_{1};
82
83 std::vector<float> ecal_layer_edep_raw_;
84 std::vector<float> ecal_layer_edep_readout_;
85 std::vector<float> ecal_layer_time_;
86
87 std::vector<std::vector<float>> rem_dist_values_;
88
89 // ldmx-sw pass parameters
90 float beam_energy_mev_{0.};
91 int num_ecal_layers_;
92 std::string rem_dist_file_name_;
93
94 // boolean parameters
95 bool recoil_from_tracking_;
96
97 // pass and collection names
98 std::string ecal_sim_pass_name_;
99 std::string ecal_sp_hits_pass_name_;
100 std::string rec_coll_name_;
101 std::string rec_pass_name_;
102 std::string track_coll_name_;
103 std::string track_pass_name_;
104
107 std::string collection_name_excluded_;
108
109 // handle to current geometry (to share with member functions)
110 const ldmx::EcalGeometry* geometry_;
111};
112
113} // namespace ecal
114
115#endif
Collection of utility functions useful for analysis.
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class that propagates tracks to the ECAL face.
Class that defines an ECal detector ID with a cell number.
Class that determines MIP tracking information using ECAL hit information.
Base classes for all user event processing components to extend.
Class which encapsulates information from a hit in a simulated tracking detector.
Discards Ecal reconstructed hits from the recoil electron for WAB event processing.
void configure(framework::config::Parameters &parameters) override
Configure the processor using the given user specified parameters.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void produce(framework::Event &event) override
Process the event and put new data products into it.
std::string collection_name_included_
Name of the collection which will containt the results.
void onNewRun(const ldmx::RunHeader &rh) override
onNewRun is the first function called for each processor after the conditions are fully configured an...
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:37
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
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:29
Translation between real-space positions and cell IDs within the ECal.
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:57