LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ISTPC.cxx
Go to the documentation of this file.
1 //Class: ISTPC
3 //File: ISTPC.h and ISTPC.cxx
4 //Description: Class including common functions needed for using the
5 //Hybrid Model for Photon Propagation
6 //UGR, 2021
8 
14 
16 
17 #include "range/v3/view/enumerate.hpp"
18 
19 namespace larg4 {
20  //----------------------------------------------------------------------------
21  ISTPC::ISTPC(geo::GeometryCore const& geom) : fActiveVolumes{extractActiveLArVolume(geom)}
22  {
23  mf::LogTrace("IonAndScint") << "IonizationAndScintillation/ISTPC Initialize.\n"
24  << "Initializing the geometry of the detector.";
25 
26  {
27  auto log = mf::LogTrace("IonAndScint") << "IonAndScint: active volume boundaries from "
28  << fActiveVolumes.size() << " volumes:";
29  for (auto const& [iCryo, box] : fActiveVolumes | ranges::views::enumerate) {
30  log << "\n - C:" << iCryo << ": " << box.Min() << " -- " << box.Max() << " cm";
31  }
32  } // local scope
33  }
34 
35  //----------------------------------------------------------------------------
36 
38  {
39  for (auto const& box : fActiveVolumes) {
40  if (box.ContainsPosition(ScintPoint)) { return true; }
41  }
42  return false;
43  }
44  //----------------------------------------------------------------------------
45 
46  std::vector<geo::BoxBoundedGeo> ISTPC::extractActiveLArVolume(geo::GeometryCore const& geom)
47  {
48  std::vector<geo::BoxBoundedGeo> activeVolumes;
49  activeVolumes.reserve(geom.Ncryostats());
50 
51  for (geo::CryostatGeo const& cryo : geom.Iterate<geo::CryostatGeo>()) {
52 
53  // can't use it default-constructed since it would always include origin
54 
55  geo::BoxBoundedGeo box{cryo.TPC(0).ActiveBoundingBox()};
56 
57  for (geo::TPCGeo const& TPC : cryo.IterateTPCs())
58  box.ExtendToInclude(TPC.ActiveBoundingBox());
59 
60  activeVolumes.push_back(std::move(box));
61 
62  } // for cryostats
63 
64  return activeVolumes;
65  }
66 
67 }
static std::vector< geo::BoxBoundedGeo > extractActiveLArVolume(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:46
Utilities related to art service access.
Encapsulate the construction of a single cyostat .
Geometry information for a single TPC.
Definition: TPCGeo.h:33
ISTPC(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:21
Geant4 interface.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:42
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:303
Access the description of the physical detector geometry.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:49
Test of util::counter and support utilities.
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:31
range_type< T > Iterate() const
Definition: Iterable.h:121
void ExtendToInclude(Coord_t x, Coord_t y, Coord_t z)
Extends the current box to also include the specified point.
MaybeLogger_< ELseverityLevel::ELsev_success, true > LogTrace
bool isScintInActiveVolume(geo::Point_t const &ScintPoint)
Definition: ISTPC.cxx:37
std::vector< geo::BoxBoundedGeo > fActiveVolumes
Definition: ISTPC.h:29