60 ,
fGeometry(*lar::providerFrom<geo::Geometry>())
76 std::cerr <<
"Voxel size must be strictly greater than zero." << std::endl;
80 double min_x = std::numeric_limits<double>::max();
81 double min_y = std::numeric_limits<double>::max();
82 double min_z = std::numeric_limits<double>::max();
84 auto const& tpcabox = tpc.ActiveBoundingBox();
85 min_x = std::min(min_x, tpcabox.MinX());
86 min_y = std::min(min_y, tpcabox.MinY());
87 min_z = std::min(min_z, tpcabox.MinZ());
98 produces<std::vector<sim::SimEnergyDepositLite>>();
101 consumes<std::vector<sim::SimEnergyDeposit>>(
fSedLabel);
110 if (!handle.isValid()) {
112 std::cerr <<
"SimEnergyDeposit not found" << std::endl;
119 if (lhs.
X() < rhs.
X())
return true;
120 if (lhs.
X() > rhs.
X())
return false;
121 if (lhs.
Y() < rhs.
Y())
return true;
122 if (lhs.
Y() > rhs.
Y())
return false;
123 if (lhs.
Z() < rhs.
Z())
return true;
124 if (lhs.
Z() > rhs.
Z())
return false;
128 std::set<sim::SimEnergyDepositLite, comp> sedlite_v2;
132 auto const& sed_v = *handle;
140 for (
size_t idx = 0; idx < sed_v.size(); ++idx) {
141 auto const& sed = sed_v[idx];
155 auto it = sedlite_v2.find(sed_lite);
158 if (it != sedlite_v2.end()) {
159 double new_energy = sed_lite.
E() + it->
E();
160 double new_time = std::min(sed_lite.
T(), it->
T());
161 sedlite_v2.erase(it);
170 sedlite_v2.insert(new_sed_lite);
173 sedlite_v2.insert(std::move(sed_lite));
188 std::unique_ptr<std::vector<sim::SimEnergyDepositLite>> sedlite_v(
189 new std::vector<sim::SimEnergyDepositLite>(sedlite_v2.begin(), sedlite_v2.end()));
192 e.
put(std::move(sedlite_v));
Utilities related to art service access.
art::InputTag fSedLabel
module making the SimEnergyDeposit
EDProducer(fhicl::ParameterSet const &pset)
void produce(art::Event &e) override
Geometry information for a single TPC.
const geo::GeometryCore & fGeometry
double fMinZ
bottom left coordinate of union of all TPC active volumes
G4InfoReducer & operator=(G4InfoReducer const &)=delete
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Access the description of the physical detector geometry.
double fElectronDriftVel
electron drift velocity (cm/us)
double fVoxelSizeZ
size of a voxel (cm)
#define DEFINE_ART_MODULE(klass)
contains information for a single step in the detector simulation (pared down in size to the essentia...
Description of the physical geometry of one entire detector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Energy deposition in the active material (lite version).
contains information for a single step in the detector simulation
range_type< T > Iterate() const
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
G4InfoReducer(fhicl::ParameterSet const &p)