15 #ifndef MCTOOLS_SIMULATED_DATA_H 16 #define MCTOOLS_SIMULATED_DATA_H 1 25 #include <boost/serialization/access.hpp> 26 #include <boost/cstdint.hpp> 158 const std::string & prefix_ =
"")
const;
187 step_hits_dict_type::iterator found
188 = _step_hits_dict_.find(category_);
191 "No collection of hits with category '" << category_ <<
"' !");
193 found->second.push_back(hh);
194 h = dynamic_cast<Hit*>(&found->second.back().grab());
196 DT_THROW(std::logic_error,
"Unsupported method for plain hit collection!");
201 bool has_hit(
const std::string & category_,
const int index_)
const;
204 bool is_hit(
const std::string & category_,
const int index_)
const 207 step_hits_dict_type::const_iterator found = _step_hits_dict_.find(category_);
210 "No collection of handles of hits with category '" << category_ <<
"' !");
211 DT_THROW_IF(index_ < 0 || index_ >=(
int)found->second.size(),
213 "Invalid hit index in category '" << category_ <<
"' !");
216 "Null handle at index " << index_ <<
" in category '" << category_ <<
"' !");
220 if (dynamic_cast<const Hit *>(bsh) ==
nullptr) {
227 const Hit &
get_hit(
const std::string & category_,
const int index_)
const 230 step_hits_dict_type::const_iterator found = _step_hits_dict_.find(category_);
233 "No collection of hits with category '" << category_ <<
"' !");
234 DT_THROW_IF(index_ < 0 || index_ >=(
int)found->second.size(),
236 "Invalid hit index in category '" << category_ <<
"' !");
239 "Null handle at index " << index_ <<
" in category '" << category_ <<
"' !");
243 const Hit * h = dynamic_cast<const Hit*>(bsh);
245 DT_THROW(std::logic_error,
"Invalid type for hit #" << index_ <<
" in category '" << category_ <<
"'!");
278 virtual void clear();
281 virtual void tree_dump(std::ostream & out_ = std::clog,
282 const std::string & title_ =
"",
283 const std::string & indent_ =
"",
284 bool inherit_ =
false)
const;
297 void print_tree(std::ostream & out_ = std::clog,
313 int8_t _collection_type_;
320 #if MCTOOLS_WITH_REFLECTION == 1 329 #include <boost/serialization/export.hpp> 332 #if MCTOOLS_WITH_REFLECTION == 1 335 #endif // MCTOOLS_WITH_REFLECTION 337 #include <boost/serialization/version.hpp> 340 #endif // MCTOOLS_SIMULATED_DATA_H
#define DR_CLASS_INIT(Introspectable)
Inform Camp that class Introspectable exists and trigger the automatic registration of dedicated refl...
Definition: reflection_interface.h:149
#define DT_THROW(ExceptionType, Message)
Definition: exception.h:121
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition: i_serializable.h:266
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
#define DR_CLASS_RTTI()
Declare Camp RTTI within class declaration.
Definition: reflection_interface.h:46