/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimG4Core/Notification/interface/TrackInformationExtractor.h
37 строк
1 KB
Vladimir
Updated Exceptions for SIM step
16 янв 2022, 16:00
16 янв 2022, 16:00
6beae48
Код
Авторство
О чём код?
#ifndef SimG4Core_TrackInformationExtractor_H #define SimG4Core_TrackInformationExtractor_H #include "SimG4Core/Notification/interface/TrackInformation.h" class G4Track; /** Provides safe access to the TrackInformation part of a G4Track. * If the G4Track pointer/reference is const, a const reference to * the TrackInformation is returned, else a non-const reference * is returned. * The TrackInformationExtractor checks for the existance of * TrackInformation and for the validity of the dynamic_cast; * It will throw an excepton if it is not possible to return * TrackInformation, but it will do it's best to satisfy the request * (in some cases it may even create the TrackInformation on-the-fly). */ class TrackInformationExtractor { public: /** for a const G4Track pointer/reference a const TrackInformation& * is returned. */ const TrackInformation& operator()(const G4Track& gtk) const; const TrackInformation& operator()(const G4Track* gtk) const { return operator()(*gtk); } /** for a non-const G4Track pointer/reference the TrackInformation& * is also non-const. */ TrackInformation& operator()(G4Track& gtk) const; TrackInformation& operator()(G4Track* gtk) const { return operator()(*gtk); } private: void missing(const G4Track& gtk) const; void wrongType() const; }; #endif