#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());
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.
59 art::ServiceHandle<geo::Geometry const> geom;
62 double MinDistance = UINT_MAX;
63 int ClosestOpDet = -1;
65 for(
size_t o=0; o!=geom->NOpDets(); o++) {
67 geom->OpDetGeoFromOpDet(o).GetCenter(xyz);
69 CLHEP::Hep3Vector DetPos(xyz[0],xyz[1],xyz[2]);
70 CLHEP::Hep3Vector ThisVolPos = vol->GetTranslation();
72 ThisVolPos/=CLHEP::cm;
77 double Distance = (DetPos-ThisVolPos).mag();
78 if(Distance < MinDistance)
80 MinDistance = Distance;
87 throw cet::exception(
"OpDetLookup Error") <<
"No nearby OpDet found!\n";
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
int larg4::OpDetLookup::GetN |
( |
| ) |
|
int larg4::OpDetLookup::GetOpDet |
( |
G4VPhysicalVolume * |
TheVolume | ) |
|
Definition at line 48 of file OpDetLookup.cxx.
50 std::string TheName = TheVolume->GetName();
int GetOpDet(G4VPhysicalVolume *)
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: