66{
67
68
69
70
71
74 G4cout << this->GetName() << " DEBUG update_map: bad identifier: "
75 << l_identifier.
getString() <<
" skipping this hit." << G4endl;
76 }
77 return;
78 }
79
80 auto map_item =
m_hit_map.find(l_identifier);
83 new std::vector<ISF_FCS_Parametrization::FCS_StepInfo*>;
86 new ISF_FCS_Parametrization::FCS_StepInfo(l_vec, l_identifier, l_energy,
87 l_time, l_valid, l_detector));
88 } else {
89
90
92 m_calo_dd_man.get()->get_element(l_identifier)->getSampling();
93
94 double timeWindow =
m_config.m_maxTime;
95 const double distWinLong =
m_config.m_maxRadiusLongitudinal.at(layer);
96 const double distWinLat =
m_config.m_maxRadiusLateral.at(layer);
97
100 for (auto* map_it : *map_item->second) {
101
102 const double delta_t = std::fabs(map_it->time() - l_time);
103 if (delta_t >= tsame) {
104 continue;
105 }
106 if (delta_t >= timeWindow) {
107 continue;
108 }
109
110
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) {
117 continue;
118 }
119
120
121 double delta_lateral_2 = l_vec.mag2() - proj_longitudinal * proj_longitudinal;
122 if (delta_lateral_2 < 0) {
123 delta_lateral_2 = 0;
124 }
125 const double delta_lateral =
126 std::sqrt(delta_lateral_2);
127 if (delta_lateral >= distWinLat) {
128 continue;
129 }
130
131
132 const ISF_FCS_Parametrization::FCS_StepInfo my_info(
133 l_vec, l_identifier, l_energy, l_time, l_valid, l_detector);
134 *map_it += my_info;
136 break;
137 }
139 map_item->second->push_back(new ISF_FCS_Parametrization::FCS_StepInfo(
140 l_vec, l_identifier, l_energy, l_time, l_valid, l_detector));
141 }
142 }
143 return;
144}
CaloSampling::CaloSample CaloSample
double getMaxTime(const CaloCell_ID::CaloSample &layer) const
std::string getString() const
Provide a string form of the identifier - hexadecimal.
bool match(std::string s1, std::string s2)
match the individual directories of two strings