LArSoft  v09_90_00
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 
15 
17 
18 namespace larg4 {
19  //----------------------------------------------------------------------------
20  ISTPC::ISTPC(geo::GeometryCore const& geom) : fActiveVolumes{extractActiveLArVolume(geom)}
21  {
22  mf::LogTrace("IonAndScint") << "IonizationAndScintillation/ISTPC Initialize.\n"
23  << "Initializing the geometry of the detector.";
24 
25  {
26  auto log = mf::LogTrace("IonAndScint") << "IonAndScint: active volume boundaries from "
27  << fActiveVolumes.size() << " volumes:";
28  for (auto const& [iCryo, box] : util::enumerate(fActiveVolumes)) {
29  log << "\n - C:" << iCryo << ": " << box.Min() << " -- " << box.Max() << " cm";
30  }
31  } // local scope
32  }
33 
34  //----------------------------------------------------------------------------
35 
37  {
38  for (auto const& box : fActiveVolumes) {
39  if (box.ContainsPosition(ScintPoint)) { return true; }
40  }
41  return false;
42  }
43  //----------------------------------------------------------------------------
44 
45  std::vector<geo::BoxBoundedGeo> ISTPC::extractActiveLArVolume(geo::GeometryCore const& geom)
46  {
47  std::vector<geo::BoxBoundedGeo> activeVolumes;
48  activeVolumes.reserve(geom.Ncryostats());
49 
50  for (geo::CryostatGeo const& cryo : geom.Iterate<geo::CryostatGeo>()) {
51 
52  // can't use it default-constructed since it would always include origin
53 
54  geo::BoxBoundedGeo box{cryo.TPC(0).ActiveBoundingBox()};
55 
56  for (geo::TPCGeo const& TPC : cryo.IterateTPCs())
57  box.ExtendToInclude(TPC.ActiveBoundingBox());
58 
59  activeVolumes.push_back(std::move(box));
60 
61  } // for cryostats
62 
63  return activeVolumes;
64  }
65 
66 }
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
Definition: GeometryCore.h:541
static std::vector< geo::BoxBoundedGeo > extractActiveLArVolume(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:45
Utilities related to art service access.
Encapsulate the construction of a single cyostat.
Definition of util::enumerate().
Geometry information for a single TPC.
Definition: TPCGeo.h:36
ISTPC(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:20
Geant4 interface.
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:430
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:65
Access the description of detector geometry.
Test of util::counter and support utilities.
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
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:33
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:36
std::vector< geo::BoxBoundedGeo > fActiveVolumes
Definition: ISTPC.h:29