All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeoDump_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: GeoDump
3 // Plugin Type: analyzer (art v3_01_01)
4 // File: GeoDump_module.cc
5 //
6 // Generated at Tue Feb 12 03:06:11 2019 by Kazuhiro Terao using cetskelgen
7 // from cetlib version v3_05_01.
8 ////////////////////////////////////////////////////////////////////////
9 
10 #include "art/Framework/Core/EDAnalyzer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
20 
21 class GeoDump;
22 
23 
24 class GeoDump : public art::EDAnalyzer {
25 public:
26  explicit GeoDump(fhicl::ParameterSet const& p);
27  // The compiler-generated destructor is fine for non-base
28  // classes without bare pointers or other resource use.
29 
30  // Plugins should not be copied or assigned.
31  GeoDump(GeoDump const&) = delete;
32  GeoDump(GeoDump&&) = delete;
33  GeoDump& operator=(GeoDump const&) = delete;
34  GeoDump& operator=(GeoDump&&) = delete;
35 
36  // Required functions.
37  void analyze(art::Event const& e) override;
38 
39 private:
40 
41  // Declare member data here.
42 
43 };
44 
45 
46 GeoDump::GeoDump(fhicl::ParameterSet const& p)
47  : EDAnalyzer{p} // ,
48  // More initializers here.
49 {
50  // Call appropriate consumes<>() for any products to be retrieved by this module.
51 }
52 
53 void GeoDump::analyze(art::Event const& e)
54 {
55  // Implementation of required member function here.
56  auto geop = lar::providerFrom<geo::Geometry>();
57 
58  std::cout << geop->Ncryostats() << " cryostats" << std::endl;
59  //for(auto const& cryostat : geop->Cryostats()) {
60  for(size_t c=0; c<geop->Ncryostats(); ++c) {
61  auto const& cryostat = geop->Cryostat(c);
62  std::cout<<"Cryostat " << cryostat.ID() << " ... " << cryostat.NTPC() << " TPCs and " << cryostat.NOpDet() << " opdets" << std::endl;
63  auto const& cryobox = cryostat.Boundaries();
64  std::cout<<" (" << cryobox.MinX() << "," << cryobox.MinY() << "," << cryobox.MinZ() << ")"
65  << " => ("
66  << cryobox.MaxX() << "," << cryobox.MaxY() << "," << cryobox.MaxZ() << ")" << std::endl;
67 
68  for(size_t t=0; t<geop->NTPC(); ++t) {
69  // Why there's no CryostatGeo::TPCs()?
70  if(!cryostat.HasTPC(t)) continue;
71  auto const& tpc = cryostat.TPC(t);
72  std::cout<<" TPC ID=" << t << " ... " << tpc.Nplanes() << " planes" << std::endl;
73  auto const& tpcbox = tpc.BoundingBox();
74  auto const& tpcabox = tpc.ActiveBoundingBox();
75  std::cout<<" BB (" << tpcbox.MinX() << "," << tpcbox.MinY() << "," << tpcbox.MinZ() << ")"
76  << " => ("
77  << tpcbox.MaxX() << "," << tpcbox.MaxY() << "," << tpcbox.MaxZ() << ")" << std::endl;
78  std::cout<<" Active BB (" << tpcabox.MinX() << "," << tpcabox.MinY() << "," << tpcabox.MinZ() << ")"
79  << " => ("
80  << tpcabox.MaxX() << "," << tpcabox.MaxY() << "," << tpcabox.MaxZ() << ")" << std::endl;
81 
82  for(size_t p=0; p<tpc.Nplanes(); ++p) {
83  auto const& plane = tpc.Plane(p);
84  std::cout<<" Plane ID=" << p << " ... " << plane.Nwires() << " wires, thetaZ=" << plane.ThetaZ() << std::endl;
85  }
86  }
87  for(size_t o=0; o<cryostat.NOpDet(); ++o) {
88  auto const& opdet = cryostat.OpDet(o);
89  std::cout << "OpDet ID="<<o<< " ... (" << opdet.GetCenter().x() << "," << opdet.GetCenter().y() << "," << opdet.GetCenter().z() << ")" << std::endl;
90  }
91  for(size_t opch=0; opch<geop->NOpChannels(); ++opch) {
92  std::cout << "OpChannel " << opch << " => OpDet " << geop->OpDetFromOpChannel(opch) << std::endl;
93  }
94  }
95  std::cout<<std::endl;
96 
97 }
98 
99 DEFINE_ART_MODULE(GeoDump)
GeoDump(fhicl::ParameterSet const &p)
pdgs p
Definition: selectors.fcl:22
void analyze(art::Event const &e) override
GeoDump & operator=(GeoDump const &)=delete
do i e
art framework interface to geometry description
BEGIN_PROLOG could also be cout