All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AuxDetSimChannelPrinter.cc
Go to the documentation of this file.
1 /**
2  * \file AuxDetSimChannelPrinter.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 
17 #include "fhiclcpp/ParameterSet.h"
19 
20 namespace ana {
21  namespace SBNOsc {
22 
23 /**
24  * \class AuxDetSimChannelPrinter
25  * \brief Electron neutrino event selection
26  */
28 public:
29  /** Constructor. */
31 
32  /**
33  * Initialization.
34  *
35  * \param config A configuration, as a FHiCL ParameterSet object
36  */
37  void Initialize(fhicl::ParameterSet* config=NULL) {
38  fTag = config ? config->get<std::string>("Tag", "largeant") : "largeant";
39  event_ind = 0;
40  }
41 
42  /** Finalize and write objects to the output file. */
43  void Finalize() {
44  }
45 
46  /**
47  * Process one event.
48  *
49  * \param ev A single event, as a gallery::Event
50  * \param Reconstructed interactions
51  * \return True to keep event
52  */
53  bool ProcessEvent(const gallery::Event& ev, const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>& reco) {
54  const std::vector<sim::AuxDetSimChannel> &channels = *ev.getValidHandle<std::vector<sim::AuxDetSimChannel>>(fTag);
55  for (const sim::AuxDetSimChannel &ch: channels) {
56  std::cout << "Channel ID: " << ch.AuxDetID() << std::endl;
57  std::cout << "Sensative ID: " << ch.AuxDetSensitiveID() << std::endl;
58  std::cout << "NHits: " << ch.AuxDetIDEs().size() << std::endl << std::endl;
59  }
60  return false;
61  }
62 
63 protected:
64  std::string fTag;
65  unsigned event_ind;
66 };
67 
68  } // namespace SBNOsc
69 } // namespace ana
71 
bool ProcessEvent(const gallery::Event &ev, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
void Initialize(fhicl::ParameterSet *config=NULL)
process_name opflashCryoW ana
Collection of particles crossing one auxiliary detector cell.
object containing MC truth information necessary for making RawDigits and doing back tracking ...
process_name standard_reco_uboone reco
Electron neutrino event selection.
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
BEGIN_PROLOG could also be cout