All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GetFV.cc
Go to the documentation of this file.
1 /**
2  * \file GetFV.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 
16 #include "TH1D.h"
17 #include "TDatabasePDG.h"
18 #include "TGraph.h"
19 
20 #include "nusimdata/SimulationBase/MCTruth.h"
22 
26 
27 #include "core/ProviderManager.hh"
28 
29 namespace ana {
30  namespace SBNOsc {
31 
32 /**
33  * \class GetFV
34  * \brief Electron neutrino event selection
35  */
36 class GetFV : public core::SelectionBase {
37 public:
38  /** Constructor. */
39  GetFV() {}
40 
41  /**
42  * Initialization.
43  *
44  * \param config A configuration, as a FHiCL ParameterSet object
45  */
46  void Initialize(fhicl::ParameterSet* config=NULL) {
50 
51  {
52  // print out SBND
53  int cryo_i = 0;
54  int tpc_i = 0;
55  std::cout << std::endl << "SBND" << std::endl;
56  for (auto const &cryo: _managerSBND->GetGeometryProvider()->IterateCryostats()) {
57  cryo_i ++;
59  tend = _managerSBND->GetGeometryProvider()->end_TPC(cryo.ID());
60  while (iTPC != tend) {
61  geo::TPCGeo const& TPC = *iTPC;
62  auto this_volume = TPC.ActiveBoundingBox();
63  std::cout << " { " << std::endl;
64  std::cout << " xmin: " << this_volume.MinX() + 8.25 << std::endl;
65  std::cout << " xmax: " << this_volume.MaxX() - 8.25 << std::endl;
66  std::cout << " ymin: " << this_volume.MinY() + 15 << std::endl;
67  std::cout << " ymax: " << this_volume.MaxY() - 15 << std::endl;
68  std::cout << " zmin: " << this_volume.MinZ() + 15 << std::endl;
69  std::cout << " zmax: " << this_volume.MaxZ() - 80 << std::endl;
70  std::cout << " }, " << std::endl;
71  tpc_i ++;
72  iTPC ++;
73  }
74  tpc_i = 0;
75  }
76  }
77 
78  {
79  // print out uBooNE
80  int cryo_i = 0;
81  int tpc_i = 0;
82  std::cout << std::endl << "uBooNE" << std::endl;
83  for (auto const &cryo: _managerUBOONE->GetGeometryProvider()->IterateCryostats()) {
84  cryo_i ++;
86  tend = _managerUBOONE->GetGeometryProvider()->end_TPC(cryo.ID());
87  while (iTPC != tend) {
88  geo::TPCGeo const& TPC = *iTPC;
89  auto this_volume = TPC.ActiveBoundingBox();
90  std::cout << " { " << std::endl;
91  std::cout << " xmin: " << this_volume.MinX() + 15 << std::endl;
92  std::cout << " xmax: " << this_volume.MaxX() - 15 << std::endl;
93  std::cout << " ymin: " << this_volume.MinY() + 15 << std::endl;
94  std::cout << " ymax: " << this_volume.MaxY() - 15 << std::endl;
95  std::cout << " zmin: " << this_volume.MinZ() + 15 << std::endl;
96  std::cout << " zmax: " << this_volume.MaxZ() - 80 << std::endl;
97  std::cout << " }, " << std::endl;
98  tpc_i ++;
99  iTPC ++;
100  }
101  tpc_i = 0;
102  }
103  }
104 
105  {
106  // print out ICARUS
107  int cryo_i = 0;
108  int tpc_i = 0;
109  std::cout << std::endl << "ICARUS" << std::endl;
110  std::cout << "NCHANNELS: " << _managerICARUS->GetGeometryProvider()->Nchannels() << std::endl;
111  for (auto const &planeID: _managerICARUS->GetGeometryProvider()->IteratePlaneIDs()) {
112  std::cout << "Plane ID: " << planeID.deepestIndex() << " type: " << _managerICARUS->GetGeometryProvider()->SignalType(planeID) << std::endl;
113  for (auto const &wireID: _managerICARUS->GetGeometryProvider()->IterateWireIDs(planeID)) {
115  }
116  std::cout << std::endl;
117  }
118 
119  for (auto const &cryo: _managerICARUS->GetGeometryProvider()->IterateCryostats()) {
120  cryo_i ++;
122  tend = _managerICARUS->GetGeometryProvider()->end_TPC(cryo.ID());
123  while (iTPC != tend) {
124  geo::TPCGeo const& TPC = *iTPC;
125  auto this_volume = TPC.ActiveBoundingBox();
126  std::cout << " { " << std::endl;
127  std::cout << " xmin: " << this_volume.MinX() + 8.25 << std::endl;
128  std::cout << " xmax: " << this_volume.MaxX() - 8.25 << std::endl;
129  std::cout << " ymin: " << this_volume.MinY() + 15 << std::endl;
130  std::cout << " ymax: " << this_volume.MaxY() - 15 << std::endl;
131  std::cout << " zmin: " << this_volume.MinZ() + 15 << std::endl;
132  std::cout << " zmax: " << this_volume.MaxZ() - 80 << std::endl;
133  std::cout << " }, " << std::endl;
134  tpc_i ++;
135  iTPC ++;
136  }
137  tpc_i = 0;
138  }
139  }
140  }
141 
142  /** Finalize and write objects to the output file. */
143  void Finalize() {}
144 
145  /**
146  * Process one event.
147  *
148  * \param ev A single event, as a gallery::Event
149  * \param Reconstructed interactions
150  * \return True to keep event
151  */
152  bool ProcessEvent(const gallery::Event& ev, const std::vector<event::Interaction> &truth, std::vector<event::RecoInteraction>& reco) {return false; }
153 
154 protected:
158 };
159 
160  } // namespace SBNOsc
161 } // namespace ana
163 
void Initialize(fhicl::ParameterSet *config=NULL)
Definition: GetFV.cc:46
Encapsulate the construction of a single cyostat.
Geometry information for a single TPC.
Definition: TPCGeo.h:38
core::ProviderManager * _managerICARUS
Definition: GetFV.cc:155
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
Definition: TPCGeo.h:320
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
process_name opflashCryoW ana
core::ProviderManager * _managerUBOONE
Definition: GetFV.cc:157
BEGIN_PROLOG TPC
const geo::GeometryCore * GetGeometryProvider() const
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
TPC_iterator begin_TPC() const
Returns an iterator pointing to the first TPC in the detector.
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
Access the description of detector geometry.
Interface to LArSoft services.
IteratorBox< wire_id_iterator,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs() const
Enables ranged-for loops on all wire IDs of the detector.
core::ProviderManager * _managerSBND
Definition: GetFV.cc:156
process_name standard_reco_uboone reco
Electron neutrino event selection.
Definition: GetFV.cc:36
#define DECLARE_SBN_PROCESSOR(classname)
Base class for event selections.
Class def header for mctrack data container.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
bool ProcessEvent(const gallery::Event &ev, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
Definition: GetFV.cc:152
Forward iterator browsing all geometry elements in the detector.
Definition: GeometryCore.h:727
void Finalize()
Definition: GetFV.cc:143
BEGIN_PROLOG could also be cout
TPC_iterator end_TPC() const
Returns an iterator pointing after the last TPC in the detector.
Encapsulate the construction of a single detector plane.