#include <OpDetLookup.h>
Definition at line 44 of file OpDetLookup.h.
larg4::OpDetLookup::~OpDetLookup |
( |
| ) |
|
|
inline |
larg4::OpDetLookup::OpDetLookup |
( |
| ) |
|
|
protected |
void larg4::OpDetLookup::AddPhysicalVolume |
( |
G4VPhysicalVolume * |
volume | ) |
|
Definition at line 96 of file OpDetLookup.cxx.
101 std::stringstream VolName(
"");
107 VolName <<
volume->GetName() <<
"_" << NearestOpDet;
108 volume->SetName(VolName.str().c_str());
static const std::string volume[nvol]
std::map< std::string, int > fTheOpDetMap
int FindClosestOpDet(G4VPhysicalVolume *vol, double &Distance)
int larg4::OpDetLookup::FindClosestOpDet |
( |
G4VPhysicalVolume * |
vol, |
|
|
double & |
Distance |
|
) |
| |
Definition at line 57 of file OpDetLookup.cxx.
62 double MinDistance = UINT_MAX;
63 int ClosestOpDet = -1;
65 for(
size_t o=0; o!=geom->
NOpDets(); o++) {
69 CLHEP::Hep3Vector DetPos(xyz[0],xyz[1],xyz[2]);
70 CLHEP::Hep3Vector ThisVolPos = vol->GetTranslation();
77 double Distance = (DetPos-ThisVolPos).
mag();
78 if(Distance < MinDistance)
80 MinDistance = Distance;
87 throw cet::exception(
"OpDetLookup Error") <<
"No nearby OpDet found!\n";
static constexpr double cm
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
void GetCenter(double *xyz, double localz=0.0) const
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
unsigned int NOpDets() const
Number of OpDets in the whole detector.
cet::coded_exception< error, detail::translate > exception
int larg4::OpDetLookup::GetN |
( |
| ) |
|
int larg4::OpDetLookup::GetOpDet |
( |
G4VPhysicalVolume * |
TheVolume | ) |
|
int larg4::OpDetLookup::GetOpDet |
( |
std::string |
TheName | ) |
|
Definition at line 42 of file OpDetLookup.cxx.
std::map< std::string, int > fTheOpDetMap
std::map<std::string, int> larg4::OpDetLookup::fTheOpDetMap |
|
private |
int larg4::OpDetLookup::fTheTopOpDet |
|
private |
The documentation for this class was generated from the following files: