30 using namespace fhicl;
39 Comment(
"data product with the SimPhotons to be dumped")
43 Name(
"OutputCategory"),
44 Comment(
"name of the output stream (managed by the message facility)"),
64 struct OnePhotonSorter {
70 if (res < 0)
return true;
71 if (res > 0)
return false;
74 if (res < 0)
return true;
75 if (res > 0)
return false;
78 if (res < 0)
return true;
79 if (res > 0)
return false;
82 if (res < 0)
return true;
83 if (res > 0)
return false;
86 if (res < 0)
return true;
87 if (res > 0)
return false;
90 if (res < 0)
return true;
91 if (res > 0)
return false;
98 {
return operator() (*a, *b); }
102 template <
typename T,
typename U>
103 static int cmp(
T const& a, U
const& b)
105 if (a < b)
return -1;
106 if (a == b)
return 0;
147 template <
typename Stream>
154 template <
typename Stream>
177 template <
typename Stream>
181 out <<
"E=" << onephoton.
Energy <<
" t=" << onephoton.
Time 185 if (onephoton.
SetInSD) out <<
" [in SD]";
191 template <
typename Stream>
196 if (bIndentFirst) out <<
indent;
197 out <<
"channel=" << simphotons.
OpChannel() <<
" has ";
198 if (simphotons.empty()) {
199 out << simphotons.size() <<
" no photons";
202 out << simphotons.size() <<
" photons:";
206 (sortedPhotonPtrs.begin(), sortedPhotonPtrs.end(), OnePhotonSorter());
208 for (
auto const* onephoton: sortedPhotonPtrs) {
209 out <<
"\n" << indent <<
" ";
223 = *(
event.getValidHandle<std::vector<sim::SimPhotons>>(
fInputPhotons));
229 unsigned int iPhoton = 0;
234 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
ChannelGroupService::Name Name
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].
typename config_impl< T >::type Config
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
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
Code to link reconstructed objects back to the MC truth information.
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.