28 #include "artg4tk/pluginDetectors/gdml/PhotonHit.hh" 35 class PhotonHitConverter;
63 produces<std::vector<sim::SimPhotonsLite>>();
64 produces<std::vector<sim::SimPhotonsLite>>(
"Reflected");
67 produces<std::vector<sim::SimPhotons>>();
68 produces<std::vector<sim::SimPhotons>>(
"Reflected");
78 std::unique_ptr<std::vector<sim::SimPhotonsLite>> photLiteCol{
79 new std::vector<sim::SimPhotonsLite>{}};
80 std::unique_ptr<std::vector<sim::SimPhotonsLite>> photLiteCol_ref{
81 new std::vector<sim::SimPhotonsLite>{}};
82 auto& photonLiteCollection{*photLiteCol};
83 auto& photonLiteCollection_ref{*photLiteCol_ref};
85 std::unique_ptr<std::vector<sim::SimPhotons>> photCol{
new std::vector<sim::SimPhotons>{}};
86 std::unique_ptr<std::vector<sim::SimPhotons>> photCol_ref{
new std::vector<sim::SimPhotons>{}};
87 auto& photonCollection{*photCol};
88 auto& photonCollection_ref{*photCol_ref};
94 photonLiteCollection[i].OpChannel = i;
95 photonLiteCollection_ref[i].OpChannel = i;
102 photonCollection[i].fOpChannel = i;
103 photonCollection_ref[i].fOpChannel = i;
107 typedef std::vector<art::Handle<artg4tk::PhotonHitCollection>> HandleVector;
108 auto allSims = e.
getMany<artg4tk::PhotonHitCollection>();
110 const artg4tk::PhotonHitCollection& sims(**i);
112 const artg4tk::PhotonHit& photonHit = *j;
114 if (photonHit.GetEdep() > 6.19 * CLHEP::eV) {
115 auto time =
static_cast<int>(photonHit.GetTime());
116 auto channel =
static_cast<unsigned int>(photonHit.GetID());
117 ++photonLiteCollection[channel].DetectedPhotons[time];
120 auto time =
static_cast<int>(photonHit.GetTime());
121 auto channel =
static_cast<unsigned int>(photonHit.GetID());
122 ++photonLiteCollection_ref[channel].DetectedPhotons[time];
128 photon.
Energy = photonHit.GetEdep();
129 auto time = photonHit.GetTime();
131 auto channel =
static_cast<unsigned int>(photonHit.GetID());
132 if (photon.
Energy > 6.19 * CLHEP::eV) {
133 photonCollection[channel].insert(photonCollection[channel].
end(), 1, photon);
136 photonCollection_ref[channel].insert(photonCollection_ref[channel].
end(), 1, photon);
142 e.
put(std::move(photLiteCol));
143 e.
put(std::move(photLiteCol_ref),
"Reflected");
146 e.
put(std::move(photCol));
147 e.
put(std::move(photCol_ref),
"Reflected");
Utilities related to art service access.
EDProducer(fhicl::ParameterSet const &pset)
All information of a photon entering the sensitive optical detector volume.
PhotonHitConverter & operator=(PhotonHitConverter const &)=delete
const bool fUseLitePhotons
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
Description of geometry of one entire detector.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
Provides a base class aware of world box coordinates.
Encapsulate the geometry of an optical detector.
PhotonHitConverter(fhicl::ParameterSet const &p)
bool SetInSD
Whether the photon reaches the sensitive detector.
float Energy
Scintillation photon energy [GeV].
art framework interface to geometry description
void produce(art::Event &e) override
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const