diff --git a/UserDev/EventDisplay/RawViewer/DrawRawDigit.cxx b/UserDev/EventDisplay/RawViewer/DrawRawDigit.cxx index a4dfe9e..653a753 100644 --- a/UserDev/EventDisplay/RawViewer/DrawRawDigit.cxx +++ b/UserDev/EventDisplay/RawViewer/DrawRawDigit.cxx @@ -32,9 +32,9 @@ bool DrawRawDigit::initialize() { _padding_by_plane.resize(_geo_service.Nplanes() * _geo_service.NTPC() * _geo_service.Ncryostats()); int counter = 0; for (unsigned int c = 0; c < _geo_service.Ncryostats(); c++) { - for (unsigned int t = 0; t < _geo_service.NTPC(c); t++) { - for (unsigned int p = 0; p < _geo_service.Nplanes(t); p++) { - setXDimension(_geo_service.Nwires(p, t, c), counter); + for (unsigned int t = 0; t < _geo_service.NTPC(geo::CryostatID(c)); t++) { + for (unsigned int p = 0; p < _geo_service.Nplanes(geo::TPCID(c, t)); p++) { + setXDimension(_geo_service.Nwires(geo::PlaneID(c, t, p)), counter); setYDimension(_det_prop.ReadOutWindowSize(), counter); counter++; } @@ -142,7 +142,7 @@ bool DrawRawDigit::analyze(const gallery::Event &ev) { // std::cout << "RawDigit ch " << ch << ", wire " << wire << ", plane " << plane << ", tpc " << tpc << ", cryo " << cryo << std::endl; - if (wire > _geo_service.Nwires(plane, tpc, cryo)) continue; + if (wire > _geo_service.Nwires(geo::PlaneID(cryo, tpc, plane))) continue; if (_geo_service.DetectorName() == "microboone" && ch >= 8254) continue; diff --git a/UserDev/EventDisplay/RawViewer/DrawWire.cxx b/UserDev/EventDisplay/RawViewer/DrawWire.cxx index 60a450d..176cfc4 100644 --- a/UserDev/EventDisplay/RawViewer/DrawWire.cxx +++ b/UserDev/EventDisplay/RawViewer/DrawWire.cxx @@ -33,9 +33,9 @@ bool DrawWire::initialize() { _padding_by_plane.resize(_geo_service.Nplanes() * _geo_service.NTPC() * _geo_service.Ncryostats()); int counter = 0; for (unsigned int c = 0; c < _geo_service.Ncryostats(); c++) { - for (unsigned int t = 0; t < _geo_service.NTPC(); t++) { - for (unsigned int p = 0; p < _geo_service.Nplanes(t); p++) { - setXDimension(_geo_service.Nwires(p, t, c), counter); + for (unsigned int t = 0; t < _geo_service.NTPC(geo::CryostatID(c)); t++) { + for (unsigned int p = 0; p < _geo_service.Nplanes(geo::TPCID(c, t)); p++) { + setXDimension(_geo_service.Nwires(geo::PlaneID(c, t, p)), counter); setYDimension(_det_prop.ReadOutWindowSize(), counter); counter++; } diff --git a/UserDev/EventDisplay/RecoViewer/DrawMCTrack.cxx b/UserDev/EventDisplay/RecoViewer/DrawMCTrack.cxx index 721448b..d4fcf54 100644 --- a/UserDev/EventDisplay/RecoViewer/DrawMCTrack.cxx +++ b/UserDev/EventDisplay/RecoViewer/DrawMCTrack.cxx @@ -10,6 +10,8 @@ MCTrack2D DrawMCTrack::getMCTrack2D(sim::MCTrack track, unsigned int plane) { MCTrack2D result; result._track.reserve(track.size()); + std::cout << "[DrawMCTrack] track.size() " << track.size() << std::endl; + for (unsigned int i = 0; i < track.size(); i++) { // project a point into 2D: auto point = geo_helper.Point_3Dto2D(track[i].X(), track[i].Y(), track[i].Z(), plane); diff --git a/UserDev/EventDisplay/RecoViewer/DrawShower.cxx b/UserDev/EventDisplay/RecoViewer/DrawShower.cxx index 984f452..b1fb853 100644 --- a/UserDev/EventDisplay/RecoViewer/DrawShower.cxx +++ b/UserDev/EventDisplay/RecoViewer/DrawShower.cxx @@ -74,8 +74,7 @@ bool DrawShower::analyze(const gallery::Event & ev) { shower_cryo = hits.at(0)->WireID().Cryostat; } - - for (unsigned int p = 0; p < _geo_service.Nplanes(shower_tpc); p++) { + for (unsigned int p = 0; p < _geo_service.Nplanes(geo::TPCID(shower_cryo, shower_tpc)); p++) { int plane = p + shower_tpc * _geo_service.Nplanes(); plane += shower_cryo * _geo_service.Nplanes() * _geo_service.NTPC(); diff --git a/UserDev/EventDisplay/RecoViewer/RecoBase.h b/UserDev/EventDisplay/RecoViewer/RecoBase.h index 577eb7e..001452a 100644 --- a/UserDev/EventDisplay/RecoViewer/RecoBase.h +++ b/UserDev/EventDisplay/RecoViewer/RecoBase.h @@ -119,10 +119,10 @@ RecoBase ::RecoBase(const geo::GeometryCore& geometry, size_t counter = 0; for (unsigned int c = 0; c < _geo_service.Ncryostats(); c++) { - for (unsigned int t = 0; t < _geo_service.NTPC(c); t++) { - for (unsigned int p = 0; p < _geo_service.Nplanes(t); p++) { + for (unsigned int t = 0; t < _geo_service.NTPC(geo::CryostatID(c)); t++) { + for (unsigned int p = 0; p < _geo_service.Nplanes(geo::TPCID(c, t)); p++) { _wireRange.at(counter).first = 0; - _wireRange.at(counter).second = _geo_service.Nwires(p, t, c); + _wireRange.at(counter).second = _geo_service.Nwires(geo::PlaneID(c, t, p)); _timeRange.at(counter).first = 0; _timeRange.at(counter).second = _det_prop.ReadOutWindowSize(); counter++; diff --git a/UserDev/EventDisplay/python/datatypes/mctrack.py b/UserDev/EventDisplay/python/datatypes/mctrack.py index 58605d6..1a95414 100644 --- a/UserDev/EventDisplay/python/datatypes/mctrack.py +++ b/UserDev/EventDisplay/python/datatypes/mctrack.py @@ -31,7 +31,7 @@ def drawObjects(self, view_manager, on_both_tpcs=False): x = pair.first / geom.wire2cm() y = pair.second / geom.time2cm() - # If odd TPC, shit this piece of the track up + # If odd TPC, shift this piece of the track up if track.tpc()[i] % 2: y += 2 * geom.triggerOffset() y += geom.cathodeGap() diff --git a/UserDev/EventDisplay/python/evdmanager/geometry.py b/UserDev/EventDisplay/python/evdmanager/geometry.py index 89e49c7..2ec5d16 100644 --- a/UserDev/EventDisplay/python/evdmanager/geometry.py +++ b/UserDev/EventDisplay/python/evdmanager/geometry.py @@ -292,7 +292,7 @@ def configure(self): self._wRange = [] self._offset = [] for v in range(0, self._nViews): - self._wRange.append(larutil.Geometry.GetME().Nwires(v)) + self._wRange.append(larutil.Geometry.GetME().Nwires(ROOT.geo.PlaneID(0, 0, v))) self._opdet_x = [] self._opdet_y = [] @@ -342,7 +342,7 @@ def configure(self, geometryCore, detProperties, detClocks, lar_properties): self._wRange = [] self._offset = [] for v in range(0, self._nViews): - self._wRange.append(geometryCore.Nwires(v)) + self._wRange.append(geometryCore.Nwires(ROOT.geo.PlaneID(0, 0, v))) self._opdet_x = [] self._opdet_y = [] @@ -457,7 +457,7 @@ def __init__(self, geometryCore=None, detProperties=None, detClocks=None, lar_pr self._colorScheme['grayscale'] = color_scheme self._n_optical_frames = 3 - self._n_optical_offset = 1250 + self._n_optical_offset = 1501 # 1250 self._offset = [] for v in range(0, self._nViews): @@ -486,8 +486,8 @@ def __init__(self, geometryCore=None, detProperties=None, detClocks=None, lar_pr } self._planeid_to_other_planes = { - 0: [3], - 1: [4], + 0: [4], + 1: [3], 2: [5] } diff --git a/core/LArUtil/SimpleGeometryHelper.cxx b/core/LArUtil/SimpleGeometryHelper.cxx index 820e2c1..e58e939 100644 --- a/core/LArUtil/SimpleGeometryHelper.cxx +++ b/core/LArUtil/SimpleGeometryHelper.cxx @@ -22,12 +22,12 @@ void SimpleGeometryHelper::Reconfigure() { fNPlanes = geom.Nplanes(); - vertangle.resize(fNPlanes); - for (UInt_t ip = 0; ip < fNPlanes; ip++) - vertangle[ip] = geom.WireAngleToVertical(geom.View(ip)) - TMath::Pi() / 2; // wire angle + // vertangle.resize(fNPlanes); + // for (UInt_t ip = 0; ip < fNPlanes; ip++) + // vertangle[ip] = geom.WireAngleToVertical(geom.View(ip)) - TMath::Pi() / 2; // wire angle - fWireToCm = geom.WirePitch(0, 1, 0); + fWireToCm = geom.WirePitch(geo::PlaneID(0, 1, 0)); fTimeToCm = sampling_rate(clocks) / 1.e3 * detp.DriftVelocity(detp.Efield(), detp.Temperature()); } @@ -46,7 +46,7 @@ Point2D SimpleGeometryHelper::Point_3Dto2D(const TVector3 & _3D_position, unsign unsigned int cryo = geom.PositionToCryostatID(loc).Cryostat; // Make a check on the plane: - if (cryo >= geom.Ncryostats() || tpc >= geom.NTPC(cryo) || plane >= geom.Nplanes(tpc, cryo)) { + if (cryo >= geom.Ncryostats() || tpc >= geom.NTPC(geo::CryostatID(cryo)) || plane >= geom.Nplanes(geo::TPCID(tpc, cryo))) { returnPoint.w = -9999; returnPoint.t = -9999; return returnPoint; @@ -59,7 +59,7 @@ Point2D SimpleGeometryHelper::Point_3Dto2D(const TVector3 & _3D_position, unsign // Previously used nearest wire functions, but they are // slightly inaccurate // If you want the nearest wire, use the nearest wire function! - const geo::PlaneGeo& planeGeo = geom.Plane(plane, tpc, cryo); + const geo::PlaneGeo& planeGeo = geom.Plane(geo::PlaneID(plane, tpc, cryo)); returnPoint.w = planeGeo.WireCoordinate(loc) * fWireToCm; @@ -407,8 +407,8 @@ double SimpleGeometryHelper::CalculatePitch(UInt_t pl, double phi, double theta) double pitch = -1.; - if (geom.View(pl) == geo::View_t::kUnknown || - geom.View(pl) == geo::View_t::k3D) { + if (geom.View(geo::PlaneID(0, 0, pl)) == geo::View_t::kUnknown || + geom.View(geo::PlaneID(0, 0, pl)) == geo::View_t::k3D) { galleryfmwk::Message::send(galleryfmwk::msg::kERROR, __FUNCTION__, Form("Warning : no Pitch foreseen for view %d", geom.View(pl))); return pitch; } @@ -421,8 +421,8 @@ double SimpleGeometryHelper::CalculatePitch(UInt_t pl, double phi, double theta) double pi = TMath::Pi(); double fTheta = pi / 2 - theta; double fPhi = -(phi + pi / 2); - double wirePitch = geom.WirePitch(0, 1, pl); - double angleToVert = 0.5 * TMath::Pi() - geom.WireAngleToVertical(geom.View(pl)); + double wirePitch = geom.WirePitch(geo::PlaneID(0, 1, pl)); + double angleToVert = 0.5 * TMath::Pi() - geom.WireAngleToVertical(geom.View(geo::PlaneID(0, 0, pl)), geo::TPCID(0, 0)); double cosgamma = TMath::Abs(TMath::Sin(angleToVert) * TMath::Cos(fTheta) + TMath::Cos(angleToVert) * TMath::Sin(fTheta) * TMath::Sin(fPhi)); @@ -443,8 +443,8 @@ double SimpleGeometryHelper::PitchInView(UInt_t plane, double phi, double theta) Double_t wirePitch = 0.; Double_t angleToVert = 0.; - wirePitch = geom.WirePitch(0, 1, plane); - angleToVert = geom.WireAngleToVertical(geom.View(plane)) - 0.5 * TMath::Pi(); + wirePitch = geom.WirePitch(geo::PlaneID(0, 1, plane)); + angleToVert = geom.WireAngleToVertical(geom.View(geo::PlaneID(0, 0, plane)), geo::TPCID(0, 0)) - 0.5 * TMath::Pi(); //(sin(angleToVert),std::cos(angleToVert)) is the direction perpendicular to wire //fDir.front() is the direction of the track at the beginning of its trajectory @@ -565,7 +565,7 @@ void SimpleGeometryHelper::SelectPolygonHitList(const std::vector &inputH // Loop over hits and find corner points in the plane view // Also fill corner edge points std::vector edges(4, Point2D(plane, 0, 0)); - double wire_max = geom.Nwires(plane) * fWireToCm; + double wire_max = geom.Nwires(geo::PlaneID(0, 0, plane)) * fWireToCm; double time_max = (detp.NumberTimeSamples()) * fTimeToCm; for (size_t index = 0; index < ordered_hits.size(); ++index) { @@ -852,139 +852,139 @@ std::vector SimpleGeometryHelper::SelectLocalPointList( const std: return returnIndexes; } -int SimpleGeometryHelper::Get3DAxisN(const int& iplane0, const int& iplane1, - const double& omega0, const double& omega1, - double& phi, double& theta) const { - - // prepare vertical angle information for the various planes - std::vector vertangle; - vertangle.resize(geom.Nplanes()); - for (UInt_t ip = 0; ip < geom.Nplanes(); ip++) - vertangle[ip] = geom.WireAngleToVertical(geom.View(ip)) - TMath::Pi() / 2; // wire angle - - // y, z, x coordinates - Double_t ln(0), mn(0), nn(0); - Double_t phis(0), thetan(0); - - // Pretend collection and induction planes. - // "Collection" is the plane with the vertical angle equal to zero. - // If both are non-zero, collection is the one with the negative angle. - UInt_t Cplane = 0, Iplane = 1; - - // angleC and angleI are the respective angles to vertical in C/I - // planes and slopeC, slopeI are the tangents of the track. - Double_t angleC, angleI, slopeC, slopeI, omegaC, omegaI; - omegaC = galleryfmwk::data::kINVALID_DOUBLE; - omegaI = galleryfmwk::data::kINVALID_DOUBLE; - - // Don't know how to reconstruct these yet, so exit with error. - // In - if (omega0 == 0 || omega1 == 0) { - phi = 0; - theta = -999; - return -1; - } - - //////insert check for existence of planes. - - //check if backwards going track - //Double_t backwards=0; - Double_t alt_backwards = 0; - - if (fabs(omega0) > (TMath::Pi() / 2.0) || fabs(omega1) > (TMath::Pi() / 2.0) ) { - alt_backwards = 1; - } - - if (vertangle[iplane0] == 0) { - // first plane is at 0 degrees - Cplane = iplane0; - Iplane = iplane1; - omegaC = omega0; - omegaI = omega1; - } - else if (vertangle[iplane1] == 0) { - // second plane is at 0 degrees - Cplane = iplane1; - Iplane = iplane0; - omegaC = omega1; - omegaI = omega0; - } - else if (vertangle[iplane0] != 0 && vertangle[iplane1] != 0) { - //both planes are at non zero degree - find the one with deg<0 - if (vertangle[iplane1] < vertangle[iplane0]) { - Cplane = iplane1; - Iplane = iplane0; - omegaC = omega1; - omegaI = omega0; - } - else if (vertangle[iplane1] > vertangle[iplane0]) { - Cplane = iplane0; - Iplane = iplane1; - omegaC = omega0; - omegaI = omega1; - } - else { - //throw error - same plane. - return -1; - } - - } - - slopeC = tan(omegaC); - slopeI = tan(omegaI); - angleC = vertangle[Cplane]; - angleI = vertangle[Iplane]; - - - //0 -1 factor depending on if one of the planes is vertical. - bool nfact = !(vertangle[Cplane]); - - //ln represents y, omega is 2d angle -- in first 2 quadrants y is positive. - if (omegaC < TMath::Pi() && omegaC > 0 ) - ln = 1; - else - ln = -1; - - //calculate x and z using y ( ln ) - mn = (ln / (2 * sin(angleI))) * ((cos(angleI) / (slopeC * cos(angleC))) - (1 / slopeI) - + nfact * ( cos(angleI) / (cos(angleC) * slopeC) - 1 / slopeI ) ); - - nn = (ln / (2 * cos(angleC))) * ((1 / slopeC) + (1 / slopeI) + nfact * ((1 / slopeC) - (1 / slopeI))); - - // Direction angles - if (fabs(omegaC) > 0.01) // catch numeric error values - { - //phi=atan(ln/nn); - phis = asin(ln / TMath::Sqrt(ln * ln + nn * nn)); - - if (fabs(slopeC + slopeI) < 0.001) - phis = 0; - else if ( fabs(omegaI) > 0.01 && (omegaI / fabs(omegaI) == -omegaC / fabs(omegaC) ) - && ( fabs(omegaC) < 1 * TMath::Pi() / 180 || fabs(omegaC) > 179 * TMath::Pi() / 180 ) ) // angles have - phis = (fabs(omegaC) > TMath::Pi() / 2) ? TMath::Pi() : 0; //angles are - - - if (nn < 0 && phis > 0 && !(!alt_backwards && fabs(phis) < TMath::Pi() / 4 ) ) // do not go back if track looks forward and phi is forward - phis = (TMath::Pi()) - phis; - else if (nn < 0 && phis < 0 && !(!alt_backwards && fabs(phis) < TMath::Pi() / 4 ) ) - phis = (-TMath::Pi()) - phis; - - - phi = phis; - - } - //If plane2 (collection), phi = 2d angle (omegaC in this case) - else - { - phis = omegaC; - phi = omegaC; - } - - thetan = -asin ( mn / (sqrt(pow(ln, 2) + pow(mn, 2) + pow(nn, 2)) ) ) ; - theta = thetan; - - return 0; -} +// int SimpleGeometryHelper::Get3DAxisN(const int& iplane0, const int& iplane1, +// const double& omega0, const double& omega1, +// double& phi, double& theta) const { + +// // prepare vertical angle information for the various planes +// std::vector vertangle; +// vertangle.resize(geom.Nplanes()); +// for (UInt_t ip = 0; ip < geom.Nplanes(); ip++) +// vertangle[ip] = geom.WireAngleToVertical(geom.View(ip)) - TMath::Pi() / 2; // wire angle + +// // y, z, x coordinates +// Double_t ln(0), mn(0), nn(0); +// Double_t phis(0), thetan(0); + +// // Pretend collection and induction planes. +// // "Collection" is the plane with the vertical angle equal to zero. +// // If both are non-zero, collection is the one with the negative angle. +// UInt_t Cplane = 0, Iplane = 1; + +// // angleC and angleI are the respective angles to vertical in C/I +// // planes and slopeC, slopeI are the tangents of the track. +// Double_t angleC, angleI, slopeC, slopeI, omegaC, omegaI; +// omegaC = galleryfmwk::data::kINVALID_DOUBLE; +// omegaI = galleryfmwk::data::kINVALID_DOUBLE; + +// // Don't know how to reconstruct these yet, so exit with error. +// // In +// if (omega0 == 0 || omega1 == 0) { +// phi = 0; +// theta = -999; +// return -1; +// } + +// //////insert check for existence of planes. + +// //check if backwards going track +// //Double_t backwards=0; +// Double_t alt_backwards = 0; + +// if (fabs(omega0) > (TMath::Pi() / 2.0) || fabs(omega1) > (TMath::Pi() / 2.0) ) { +// alt_backwards = 1; +// } + +// if (vertangle[iplane0] == 0) { +// // first plane is at 0 degrees +// Cplane = iplane0; +// Iplane = iplane1; +// omegaC = omega0; +// omegaI = omega1; +// } +// else if (vertangle[iplane1] == 0) { +// // second plane is at 0 degrees +// Cplane = iplane1; +// Iplane = iplane0; +// omegaC = omega1; +// omegaI = omega0; +// } +// else if (vertangle[iplane0] != 0 && vertangle[iplane1] != 0) { +// //both planes are at non zero degree - find the one with deg<0 +// if (vertangle[iplane1] < vertangle[iplane0]) { +// Cplane = iplane1; +// Iplane = iplane0; +// omegaC = omega1; +// omegaI = omega0; +// } +// else if (vertangle[iplane1] > vertangle[iplane0]) { +// Cplane = iplane0; +// Iplane = iplane1; +// omegaC = omega0; +// omegaI = omega1; +// } +// else { +// //throw error - same plane. +// return -1; +// } + +// } + +// slopeC = tan(omegaC); +// slopeI = tan(omegaI); +// angleC = vertangle[Cplane]; +// angleI = vertangle[Iplane]; + + +// //0 -1 factor depending on if one of the planes is vertical. +// bool nfact = !(vertangle[Cplane]); + +// //ln represents y, omega is 2d angle -- in first 2 quadrants y is positive. +// if (omegaC < TMath::Pi() && omegaC > 0 ) +// ln = 1; +// else +// ln = -1; + +// //calculate x and z using y ( ln ) +// mn = (ln / (2 * sin(angleI))) * ((cos(angleI) / (slopeC * cos(angleC))) - (1 / slopeI) +// + nfact * ( cos(angleI) / (cos(angleC) * slopeC) - 1 / slopeI ) ); + +// nn = (ln / (2 * cos(angleC))) * ((1 / slopeC) + (1 / slopeI) + nfact * ((1 / slopeC) - (1 / slopeI))); + +// // Direction angles +// if (fabs(omegaC) > 0.01) // catch numeric error values +// { +// //phi=atan(ln/nn); +// phis = asin(ln / TMath::Sqrt(ln * ln + nn * nn)); + +// if (fabs(slopeC + slopeI) < 0.001) +// phis = 0; +// else if ( fabs(omegaI) > 0.01 && (omegaI / fabs(omegaI) == -omegaC / fabs(omegaC) ) +// && ( fabs(omegaC) < 1 * TMath::Pi() / 180 || fabs(omegaC) > 179 * TMath::Pi() / 180 ) ) // angles have +// phis = (fabs(omegaC) > TMath::Pi() / 2) ? TMath::Pi() : 0; //angles are + + +// if (nn < 0 && phis > 0 && !(!alt_backwards && fabs(phis) < TMath::Pi() / 4 ) ) // do not go back if track looks forward and phi is forward +// phis = (TMath::Pi()) - phis; +// else if (nn < 0 && phis < 0 && !(!alt_backwards && fabs(phis) < TMath::Pi() / 4 ) ) +// phis = (-TMath::Pi()) - phis; + + +// phi = phis; + +// } +// //If plane2 (collection), phi = 2d angle (omegaC in this case) +// else +// { +// phis = omegaC; +// phi = omegaC; +// } + +// thetan = -asin ( mn / (sqrt(pow(ln, 2) + pow(mn, 2) + pow(nn, 2)) ) ) ; +// theta = thetan; + +// return 0; +// } int SimpleGeometryHelper::GetXYZ(const Point2D *p0, const Point2D *p1, Double_t* xyz) const @@ -993,7 +993,7 @@ int SimpleGeometryHelper::GetXYZ(const Point2D *p0, const Point2D *p1, Double_t* Double_t pos[3] = {0.}; // geom.PlaneOriginVtx(p0->plane, pos); int tpc = 0; - auto plane_center = geom.Plane(p0->plane, tpc).GetCenter(); + auto plane_center = geom.Plane(geo::PlaneID(0, tpc, p0->plane)).GetCenter(); pos[0] = plane_center.X(); pos[1] = plane_center.Y(); pos[2] = plane_center.Z(); @@ -1026,12 +1026,12 @@ int SimpleGeometryHelper::GetYZ(const Point2D *p0, const Point2D *p1, Double_t* << "\033[93mWarning ends...\033[00m" << std::endl; z0 = 0; } - else if (z0 >= (int)(geom.Nwires(p0->plane))) { + else if (z0 >= (int)(geom.Nwires(geo::PlaneID(0, 0, p0->plane)))) { std::cout << "\033[93mWarning\033[00m \033[95m<>\033[00m" << std::endl - << " 2D wire position " << p0->w << " [cm] exceeds max wire number " << (geom.Nwires(p0->plane) - 1) << std::endl + << " 2D wire position " << p0->w << " [cm] exceeds max wire number " << (geom.Nwires(geo::PlaneID(0, 0, p0->plane)) - 1) << std::endl << " Forcing it to the max wire number..." << std::endl << "\033[93mWarning ends...\033[00m" << std::endl; - z0 = geom.Nwires(p0->plane) - 1; + z0 = geom.Nwires(geo::PlaneID(0, 0, p0->plane)) - 1; } if (z1 < 0) { std::cout << "\033[93mWarning\033[00m \033[95m<>\033[00m" << std::endl @@ -1040,16 +1040,16 @@ int SimpleGeometryHelper::GetYZ(const Point2D *p0, const Point2D *p1, Double_t* << "\033[93mWarning ends...\033[00m" << std::endl; z1 = 0; } - if (z1 >= (int)(geom.Nwires(p1->plane))) { + if (z1 >= (int)(geom.Nwires(geo::PlaneID(0, 0, p1->plane)))) { std::cout << "\033[93mWarning\033[00m \033[95m<>\033[00m" << std::endl - << " 2D wire position " << p1->w << " [cm] exceeds max wire number " << (geom.Nwires(p0->plane) - 1) << std::endl + << " 2D wire position " << p1->w << " [cm] exceeds max wire number " << (geom.Nwires(geo::PlaneID(0, 0, p0->plane)) - 1) << std::endl << " Forcing it to the max wire number..." << std::endl << "\033[93mWarning ends...\033[00m" << std::endl; - z1 = geom.Nwires(p1->plane) - 1; + z1 = geom.Nwires(geo::PlaneID(0, 0, p1->plane)) - 1; } - UInt_t chan1 = geom.PlaneWireToChannel(p0->plane, z0); - UInt_t chan2 = geom.PlaneWireToChannel(p1->plane, z1); + UInt_t chan1 = geom.PlaneWireToChannel(geo::WireID(0, 0, p0->plane, z0)); + UInt_t chan2 = geom.PlaneWireToChannel(geo::WireID(0, 0, p1->plane, z1)); if (! geom.ChannelsIntersect(chan1, chan2, y, z) ) return -1; diff --git a/core/LArUtil/SimpleGeometryHelper.h b/core/LArUtil/SimpleGeometryHelper.h index 360076a..507598b 100644 --- a/core/LArUtil/SimpleGeometryHelper.h +++ b/core/LArUtil/SimpleGeometryHelper.h @@ -448,9 +448,9 @@ class SimpleGeometryHelper { @brief given 2 2D angles on 2 planes, get the corresponding 3D angle in 3 dimensions. */ - int Get3DAxisN(const int& iplane0, const int& iplane1, - const double& omega0, const double& omega1, - double& phi, double& theta) const; + // int Get3DAxisN(const int& iplane0, const int& iplane1, + // const double& omega0, const double& omega1, + // double& phi, double& theta) const; /** * @brief given 2 2D points on two planes, find the XYZ coordinate they correspond to @@ -512,7 +512,7 @@ class SimpleGeometryHelper { // number of planes in the geometry UInt_t fNPlanes; // angle w.r.t. veritcal per plane - std::vector vertangle; + // std::vector vertangle; };