34 const string myname =
"protoana::ProtoDUNEDPCRPGeo::GetCRPGeoInfo: ";
47 if( not tpc )
return crp_geo_info;
48 crp_geo_info.
crpid = tpc->ID().TPC;
51 int dcoord =
std::abs(tpc->DetectDriftDirection())-1;
66 cout<<myname<<
"Bad drift direction "<<dcoord<<
endl;
71 double xyz[3] = {pnt.X(), pnt.Y(), pnt.Z()};
72 crp_geo_info.
danode = tpc->PlaneLocation(0)[dcoord] - xyz[dcoord];
75 float planeX = xyz[ tcoord2 ] - tpc->PlaneLocation(0)[ tcoord2 ];
76 float planeY = xyz[ tcoord1 ] - tpc->PlaneLocation(0)[ tcoord1 ];
89 (activeHalfWidth -
std::abs(planeY)) );
90 if( crp_geo_info.
dedge < 0 || crp_geo_info.
dedge > activeHalfWidth ){
91 cout<<myname<<
"Bad distance to CRP edge "<<crp_geo_info.
dedge<<
endl;
97 int icol =
int(planeX / fLemWidth);
98 if( planeX < 0 ) icol += (LemsHalfRow - 1);
99 else icol += (LemsHalfRow);
101 int irow =
int(planeY / fLemWidth);
102 if( planeY < 0 ) irow += (LemsHalfRow - 1);
103 else irow += (LemsHalfRow);
108 cout<<myname<<
"Bad LEM index "<<crp_geo_info.
lemid<<
endl;
113 float lemX = (icol + 0.5) * fLemWidth - activeHalfWidth;
114 float lemY = (irow + 0.5) * fLemWidth - activeHalfWidth;
117 float inlemX = planeX - lemX;
118 float inlemY = planeY - lemY;
120 (0.5 * fLemWidth -
std::abs(inlemY)) );
126 if( crp_geo_info.
dlem < 0 || crp_geo_info.
dlem > 0.5*fLemWidth ){
127 cout<<myname<<
"Bad distance to LEM border "<<crp_geo_info.
dlem<<
endl;
131 crp_geo_info.
valid =
true;
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >> Point_t
Geometry information for a single TPC.
geo::TPCGeo const * PositionToTPCptr(geo::Point_t const &point) const
Returns the TPC at specified location.
crpgeoinfo GetCRPGeoInfo(geo::Point_t const &pnt) const
geo::Geometry const * fGeom
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
struct protoana::crpgeoinfo crpgeoinfo
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)