All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ISTPC.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //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
7 ////////////////////////////////////////////////////////////////////////
8 
9 
10 
17 
18 #include "messagefacility/MessageLogger/MessageLogger.h"
19 
20 
21 namespace larg4 {
22  //----------------------------------------------------------------------------
24  : fActiveVolumes{extractActiveLArVolume(geom)}
25  {
26  mf::LogTrace("IonAndScint") << "IonizationAndScintillation/ISTPC Initialize.\n"
27  << "Initializing the geometry of the detector.";
28 
29  {
30  auto log = mf::LogTrace("IonAndScint") << "IonAndScint: active volume boundaries from "
31  << fActiveVolumes.size() << " volumes:";
32  for (auto const& [iCryo, box] : util::enumerate(fActiveVolumes)) {
33  log << "\n - C:" << iCryo << ": " << box.Min() << " -- " << box.Max() << " cm";
34  }
35  } // local scope
36  }
37 
38 
39  //----------------------------------------------------------------------------
40 
41 
42  bool
44  {
45  return fActiveVolumes[0].ContainsPosition(ScintPoint);
46  }
47  //----------------------------------------------------------------------------
48 
49 
50 std::vector<geo::BoxBoundedGeo>
52 {
53  std::vector<geo::BoxBoundedGeo> activeVolumes;
54  activeVolumes.reserve(geom.Ncryostats());
55 
56  for (geo::CryostatGeo const& cryo : geom.IterateCryostats()) {
57 
58  // can't use it default-constructed since it would always include origin
59 
60  geo::BoxBoundedGeo box{cryo.TPC(0).ActiveBoundingBox()};
61 
62  for (geo::TPCGeo const& TPC : cryo.IterateTPCs())
63  box.ExtendToInclude(TPC.ActiveBoundingBox());
64 
65  activeVolumes.push_back(std::move(box));
66 
67  } // for cryostats
68 
69  return activeVolumes;
70 }
71 
72 }
static std::vector< geo::BoxBoundedGeo > extractActiveLArVolume(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:51
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:38
ISTPC(geo::GeometryCore const &geom)
Definition: ISTPC.cxx:23
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
BEGIN_PROLOG TPC
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
Definition: enumerate.h:69
Access the description of detector geometry.
Test of util::counter and support utilities.
Description of geometry of one entire detector.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
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.
bool isScintInActiveVolume(geo::Point_t const &ScintPoint)
Definition: ISTPC.cxx:43
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:184
std::vector< geo::BoxBoundedGeo > fActiveVolumes
Definition: ISTPC.h:31