11 #include "canvas/Utilities/InputTag.h"
21 #include "fhiclcpp/ParameterSet.h"
23 #include "nusimdata/SimulationBase/MCParticle.h"
25 #include "canvas/Persistency/Common/FindManyP.h"
26 #include "nusimdata/SimulationBase/MCTruth.h"
50 fMCParticleTag = config ? config->get<std::string>(
"MCParticleTag",
"largeant") :
"largeant";
52 fCosmicEnterTimesPE =
new TH2D(
"cosmic_enter_v_pe",
"cosmic_enter_v_pe", 700, -60., 10., 100, 0, 10000);
70 bool ProcessEvent(
const gallery::Event& event,
const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>&
reco) {
72 auto const &intime =
event.getValidHandle<std::vector<simb::MCTruth>>({
"GenInTimeSorter",
"intime"});
75 art::FindManyP<simb::MCParticle, sim::GeneratedParticleInfo> intime_to_particles(intime, event,
fMCParticleTag);
78 double in_time_photon_energy = 0.;
79 unsigned in_time_photons = 0;
80 const std::vector<sim::SimPhotons> &photon_list = *
event.getValidHandle<std::vector<sim::SimPhotons>>(
"larg4intime");
84 in_time_photon_energy +=
photon.Energy;
89 gallery::Handle<std::vector<sim::SimPhotons>> reflected;
90 event.getByLabel({
"larg4intime",
"Reflected"}, reflected);
91 if (reflected.isValid()) {
93 const std::vector<sim::SimPhotons> &photon_list = *
event.getValidHandle<std::vector<sim::SimPhotons>>({
"larg4intime",
"Reflected"});
97 in_time_photon_energy +=
photon.Energy;
104 for (
const art::Ptr<simb::MCParticle> part: intime_to_particles.at(0)) {
105 if (
abs(part->PdgCode()) != 13)
continue;
106 unsigned n_traj = part->NumberTrajectoryPoints();
108 for (
unsigned i = 0; i < n_traj; i++) {
110 if (vol.ContainsPosition(part->Position(i).Vect())) {
process_name can override from command line with o or output photon
std::string fMCParticleTag
All information of a photon entering the sensitive optical detector volume.
TFile * fOutputFile
The output ROOT file.
Contains data associated to particles from detector simulation.
std::vector< geo::BoxBoundedGeo > fActiveVolumes
List of active volumes in configured detector.
process_name opflashCryoW ana
Simulation objects for optical detectors.
process_name standard_reco_uboone reco
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
Provides a base class aware of world box coordinates.
bool ProcessEvent(const gallery::Event &event, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
Collection of photons which recorded on one channel.
Electron neutrino event selection.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
TH2D * fCosmicEnterTimesPE
BEGIN_PROLOG could also be cout
void Initialize(fhicl::ParameterSet *config=NULL)