9 #include "CaloDetDescr/CaloDetDescrElement.h"
17 #include "G4ThreeVector.hh"
22 : G4VSensitiveDetector(std::move(a_name)),
24 m_calo_dd_man(nullptr) {}
28 description <<
"ProcessHits: Base class method should not be called!!!";
29 G4Exception(
"FCS_StepInfoSD",
"FCSBadCall", FatalException,
description);
51 if (caloMgrKey.initialize().isFailure()) {
53 description <<
"Failed to get CaloDetDescrManager!";
54 G4Exception(
"FCS_StepInfoSD",
"FCSBadCall", FatalException,
description);
58 caloMgrKey, Gaudi::Hive::currentContext());
63 const Identifier& l_identifier,
double l_energy,
64 double l_time,
bool l_valid,
74 G4cout << this->GetName() <<
" DEBUG update_map: bad identifier: "
75 << l_identifier.
getString() <<
" skipping this hit." << G4endl;
80 auto map_item =
m_hit_map.find(l_identifier);
83 new std::vector<ISF_FCS_Parametrization::FCS_StepInfo*>;
87 l_time, l_valid, l_detector));
100 for (
auto* map_it : *map_item->second) {
102 const double delta_t = std::fabs(map_it->time() - l_time);
103 if (delta_t >= tsame) {
106 if (delta_t >= timeWindow) {
111 const CLHEP::Hep3Vector& currentPosition = map_it->position();
112 const double currentPosition_mag = currentPosition.mag();
113 const double proj_longitudinal =
114 currentPosition.dot(l_vec) / currentPosition_mag;
115 const double delta_longitudinal = currentPosition_mag - proj_longitudinal;
116 if (std::fabs(delta_longitudinal) >= distWinLong) {
121 double delta_lateral_2 = l_vec.mag2() - proj_longitudinal * proj_longitudinal;
122 if (delta_lateral_2 < 0) {
125 const double delta_lateral =
126 std::sqrt(delta_lateral_2);
127 if (delta_lateral >= distWinLat) {
133 l_vec, l_identifier, l_energy, l_time, l_valid, l_detector);
140 l_vec, l_identifier, l_energy, l_time, l_valid, l_detector));
150 for (
auto* a_s : *
it.second) {
159 G4cout << this->GetName()
160 <<
" DEBUG EndOfAthenaEvent: After initial cleanup, N="
161 << hitContainer->
size() << G4endl;