27 using namespace fhicl;
36 Comment(
"data product with the SimPhotons to be dumped")};
39 Name(
"OutputCategory"),
40 Comment(
"name of the output stream (managed by the message facility)"),
59 struct OnePhotonSorter {
65 if (res < 0)
return true;
66 if (res > 0)
return false;
69 if (res < 0)
return true;
70 if (res > 0)
return false;
73 if (res < 0)
return true;
74 if (res > 0)
return false;
77 if (res < 0)
return true;
78 if (res > 0)
return false;
81 if (res < 0)
return true;
82 if (res > 0)
return false;
85 if (res < 0)
return true;
86 if (res > 0)
return false;
94 return operator()(*a, *b);
98 template <
typename T,
typename U>
99 static int cmp(T
const& a, U
const& b)
101 if (a < b)
return -1;
142 template <
typename Stream>
146 bool bIndentFirst =
true)
const;
149 template <
typename Stream>
169 template <
typename Stream>
172 out <<
"E=" << onephoton.
Energy <<
" t=" << onephoton.
Time <<
" from " 175 if (onephoton.
SetInSD) out <<
" [in SD]";
180 template <
typename Stream>
187 if (bIndentFirst) out <<
indent;
188 out <<
"channel=" << simphotons.
OpChannel() <<
" has ";
189 if (simphotons.empty()) { out << simphotons.size() <<
" no photons"; }
191 out << simphotons.size() <<
" photons:";
194 std::sort(sortedPhotonPtrs.begin(), sortedPhotonPtrs.end(), OnePhotonSorter());
196 for (
auto const* onephoton : sortedPhotonPtrs) {
197 out <<
"\n" << indent <<
" ";
212 <<
"Event " <<
event.id() <<
" : data product '" <<
fInputPhotons.
encode() <<
"' contains " 215 unsigned int iPhoton = 0;
220 log <<
"[#" << (iPhoton++) <<
"] ";
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
int OpChannel() const
Returns the optical channel number this object is associated to.
void DumpElement(Stream &&out, sim::SimPhotons const &simphotons, std::string indent="", bool bIndentFirst=true) const
Dumps the content of the specified SimPhotons in the output stream.
Silly utility to sort vectors indirectly.
All information of a photon entering the sensitive optical detector volume.
art::InputTag fInputPhotons
name of SimPhotons's data product
auto makePointerVector(Coll &coll)
Creates a STL vector with pointers to data from another collection.
EDAnalyzer(fhicl::ParameterSet const &pset)
geo::Point_t InitialPosition
Scintillation position in world coordinates [cm].
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
std::string indent(std::size_t const i)
std::string fOutputCategory
name of the stream for output
void DumpOnePhoton(Stream &&out, sim::OnePhoton const &photon) const
Dumps a sim::OnePhoton on a single line.
DumpSimPhotons & operator=(DumpSimPhotons const &)=delete
void analyze(art::Event const &event) override
DumpSimPhotons(Parameters const &config)
Configuration-checking constructor.
Collection of photons which recorded on one channel.
bool SetInSD
Whether the photon reaches the sensitive detector.
geo::OpticalPoint_t FinalLocalPosition
Where photon enters the optical detector in local coordinates [cm].
float Energy
Scintillation photon energy [GeV].
Event finding and building.
int MotherTrackID
ID of the GEANT4 track causing the scintillation.