Skip to content

Commit 2854ced

Browse files
committed
Fix 'top of module' discrepancy - thanks Andy & Rachel
1 parent 7797803 commit 2854ced

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

sbndcode/Geometry/GeometryWrappers/CRTGeoAlg.cc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,20 @@ namespace sbnd::crt {
122122

123123
// Find world coordinates
124124
geo::AuxDetSensitiveGeo::LocalPoint_t const sipm0XYZ{sipmX, sipm0Y, 0};
125+
geo::AuxDetGeo::LocalPoint_t const sipm0XYZNotSens{sipmX, sipm0Y, 0};
125126
auto const sipm0XYZWorld = auxDetSensitive.toWorldCoords(sipm0XYZ);
127+
auto const sipm0XYZWorldNotSens = auxDet.toWorldCoords(sipm0XYZNotSens);
128+
129+
if(ad_i == 40 && (ads_i == 7 || ads_i == 8))
130+
{
131+
std::cout << "Module: " << ad_i << " Strip: " << ads_i << '\n'
132+
<< "\tSiPM 0 - Local: " << sipm0XYZ.X() << ", " << sipm0XYZ.Y() << ", " << sipm0XYZ.Z() << '\n'
133+
<< "\t - Global (Sens): " << sipm0XYZWorld.X() << ", " << sipm0XYZWorld.Y() << ", " << sipm0XYZWorld.Z() << '\n'
134+
<< "\t - Global: " << sipm0XYZWorldNotSens.X() << ", " << sipm0XYZWorldNotSens.Y() << ", " << sipm0XYZWorldNotSens.Z() << '\n'
135+
<< std::endl;
136+
137+
FEBWorldPos(fModules.at(moduleName));
138+
}
126139

127140
geo::AuxDetSensitiveGeo::LocalPoint_t const sipm1XYZ{sipmX, sipm1Y, 0};
128141
auto const sipm1XYZWorld = auxDetSensitive.toWorldCoords(sipm1XYZ);
@@ -361,8 +374,8 @@ namespace sbnd::crt {
361374
const double halfWidth = auxDet.HalfWidth1();
362375
const double halfLength = auxDet.Length() / 2.;
363376

364-
geo::AuxDetGeo::LocalPoint_t limits { - halfWidth - 5, -15, -halfLength - 5};
365-
geo::AuxDetGeo::LocalPoint_t limits2{ - halfWidth, 15, -halfLength + 5};
377+
geo::AuxDetGeo::LocalPoint_t limits { halfWidth + 5, -15, -halfLength - 5};
378+
geo::AuxDetGeo::LocalPoint_t limits2{ halfWidth, 15, -halfLength + 5};
366379

367380
if(!module.top)
368381
{
@@ -373,6 +386,11 @@ namespace sbnd::crt {
373386
auto const limitsWorld = auxDet.toWorldCoords(limits);
374387
auto const limitsWorld2 = auxDet.toWorldCoords(limits2);
375388

389+
std::cout << "Module: " << module.adID << '\n'
390+
<< "\tLocal: " << limits.X() << ", " << limits.Y() << ", " << limits.Z() << '\n'
391+
<< "\tGlobal: " << limitsWorld.X() << ", " << limitsWorld.Y() << ", " << limitsWorld.Z() << '\n'
392+
<< std::endl;
393+
376394
const double minX = std::min(limitsWorld.X(), limitsWorld2.X());
377395
const double maxX = std::max(limitsWorld.X(), limitsWorld2.X());
378396
const double minY = std::min(limitsWorld.Y(), limitsWorld2.Y());

sbndcode/Geometry/GeometryWrappers/CRTGeoAlg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ namespace sbnd::crt {
174174
// Location of SiPMs
175175
if(CRTCommonUtils::GetTaggerEnum(taggerName) == kBottomTagger || CRTCommonUtils::GetTaggerEnum(taggerName) == kNorthTagger
176176
|| CRTCommonUtils::GetTaggerEnum(taggerName) == kWestTagger || CRTCommonUtils::GetTaggerEnum(taggerName) == kEastTagger)
177-
top = (orientation == 1) ? (modulePosMother[1] > 0) : (modulePosMother[0] < 0);
177+
top = (orientation == 1) ? (modulePosMother[1] < 0) : (modulePosMother[0] > 0);
178178
else
179-
top = (orientation == 0) ? (modulePosMother[1] > 0) : (modulePosMother[0] < 0);
179+
top = (orientation == 0) ? (modulePosMother[1] < 0) : (modulePosMother[0] > 0);
180180

181181
// Fill edges
182182
minX = std::min(limitsWorld.X(), limitsWorld2.X());

0 commit comments

Comments
 (0)