Skip to content

Commit

Permalink
Merge pull request #32 from TITUS-EVD/develop
Browse files Browse the repository at this point in the history
Geometry methods
  • Loading branch information
marcodeltutto authored May 4, 2023
2 parents 45932cb + 1f7721a commit a308b5a
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 177 deletions.
8 changes: 4 additions & 4 deletions UserDev/EventDisplay/RawViewer/DrawRawDigit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions UserDev/EventDisplay/RawViewer/DrawWire.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
2 changes: 2 additions & 0 deletions UserDev/EventDisplay/RecoViewer/DrawMCTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions UserDev/EventDisplay/RecoViewer/DrawShower.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions UserDev/EventDisplay/RecoViewer/RecoBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ RecoBase <DATA_TYPE>::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++;
Expand Down
2 changes: 1 addition & 1 deletion UserDev/EventDisplay/python/datatypes/mctrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions UserDev/EventDisplay/python/evdmanager/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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]
}

Expand Down
Loading

0 comments on commit a308b5a

Please sign in to comment.