All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpDetBacktrackerPrinter.cc
Go to the documentation of this file.
1 /**
2  * \file OpDetBackTrackerPrinter.cc
3  *
4  *
5  * Author:
6  */
7 
8 #include <iostream>
9 #include <array>
10 
11 #include "canvas/Utilities/InputTag.h"
12 #include "core/SelectionBase.hh"
13 #include "core/Event.hh"
14 #include "core/Experiment.hh"
15 #include "core/ProviderManager.hh"
16 
20 #include "fhiclcpp/ParameterSet.h"
23 
24 #include "TH1D.h"
25 #include "TGraph.h"
26 
27 namespace ana {
28  namespace SBNOsc {
29 
30 /**
31  * \class OpDetBackTrackerPrinter
32  * \brief Electron neutrino event selection
33  */
35 public:
36  /** Constructor. */
38 
39  /**
40  * Initialization.
41  *
42  * \param config A configuration, as a FHiCL ParameterSet object
43  */
44  void Initialize(fhicl::ParameterSet* config=NULL) {
45  fSimPhotonTag = config ? config->get<std::string>("SimPhotonTag", "largeant") : "largeant";
46  event_ind = 0;
47  }
48 
49  /** Finalize and write objects to the output file. */
50  void Finalize() {
51  }
52 
53  /**
54  * Process one event.
55  *
56  * \param ev A single event, as a gallery::Event
57  * \param Reconstructed interactions
58  * \return True to keep event
59  */
60  bool ProcessEvent(const gallery::Event& ev, const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>& reco) {
61  std::cout << "New Event!\n";
62  const std::vector<sim::OpDetBacktrackerRecord> &records = *ev.getValidHandle<std::vector<sim::OpDetBacktrackerRecord>>(fSimPhotonTag);
63  for (const sim::OpDetBacktrackerRecord &record: records) {
64  record.Dump(std::cout, " ");
65  }
66  return false;
67  }
68 
69 protected:
70  std::string fSimPhotonTag;
71  unsigned event_ind;
72 };
73 
74  } // namespace SBNOsc
75 } // namespace ana
77 
Electron neutrino event selection.
process_name opflashCryoW ana
Energy deposited on a readout Optical Detector by simulated tracks.
bool ProcessEvent(const gallery::Event &ev, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
Simulation objects for optical detectors.
process_name standard_reco_uboone reco
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
void Initialize(fhicl::ParameterSet *config=NULL)
BEGIN_PROLOG could also be cout