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