16 #include "art_root_io/TFileService.h" 33 #include "RtypesCore.h" 34 #include "TLorentzVector.h" 77 InputModules = pset.get<std::vector<std::string>>(
"InputModules", {
"largeant"});
88 PhInf = tfs->make<TTree>(
"PhInf",
"PhInf");
89 PhInf->Branch(
"X", &(
pos[0]),
"X/D");
90 PhInf->Branch(
"Y", &(
pos[1]),
"Y/D");
91 PhInf->Branch(
"Z", &(
pos[2]),
"Z/D");
93 for (
int channel = 0; channel <
nOpChannels; ++channel) {
94 PhInf->Branch(Form(
"Channel_%03d_det", channel),
96 Form(
"Channel_%03d_det/I", channel));
97 PhInf->Branch(Form(
"Channel_%03d_ref", channel),
99 Form(
"Channel_%03d_ref/I", channel));
100 PhInf->Branch(Form(
"Channel_%03d_tot", channel),
102 Form(
"Channel_%03d_tot/I", channel));
137 auto photon_handles = evt.
getMany<std::vector<sim::SimPhotons>>();
138 if (photon_handles.empty()) {
140 <<
"sim SimPhotons retrieved and you requested them.";
144 for (
auto const& ph_handle : photon_handles) {
145 if (!ph_handle.isValid()) {
continue; }
146 if (ph_handle.provenance()->moduleLabel() != mod) {
continue; }
148 if (!ph_handle->empty()) {
149 for (
auto const& itOpDet : (*ph_handle)) {
165 pos[0] = Phot.InitialPosition.X() / 10.0;
166 pos[1] = Phot.InitialPosition.Y() / 10.0;
167 pos[2] = Phot.InitialPosition.Z() / 10.0;
182 for (
int channel = 0; channel <
nOpChannels; channel++) {
188 num_totph[channel] = 0;
196 std::cout <<
"Warning: No record for event " <<
EventID << std::endl;
PhotonInf(const fhicl::ParameterSet &)
std::vector< int > num_totph
Encapsulate the construction of a single cyostat.
All information of a photon entering the sensitive optical detector volume.
EDAnalyzer(fhicl::ParameterSet const &pset)
Simulation objects for optical detectors.
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
void analyze(art::Event const &)
Encapsulate the geometry of an optical detector.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< int > num_detph
Collection of photons which recorded on one channel.
std::vector< std::string > InputModules
IDNumber_t< Level::Event > EventNumber_t
EventNumber_t event() const
Particle list in DetSim contains Monte Carlo particle information.
Namespace collecting geometry-related classes utilities.
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
std::vector< int > num_refph
Event finding and building.
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const