HardCodedGeometry.cpp
Go to the documentation of this file.
1 //File: HardCodedGeometry.cpp
2 //Brief: Implementation of a mapping from CRT electronics identifiers to
3 // sorting criteria for adjacency. Uses hard-coded values from commissioning,
4 // so you should prefer something like an offline-geometry-based
5 // implementation.
6 //Author: Andrew Olivier aolivier@ur.rochester.edu
7 
8 #include "HardCodedGeometry.h" //Header
9 
10 namespace CRT
11 {
12  HardCodedGeometry::HardCodedGeometry(): fModulesPerPlane(2), fStripsPerLayer(32)
13  {
14  }
15 
16  ModuleID HardCodedGeometry::doModuleID(const size_t module) const
17  {
18  const size_t nOrientations = 2; //2 orientations: horizontal and vertical
19  const size_t modulesPerFrame = nOrientations*fModulesPerPlane;
20  const size_t frameNum = module/modulesPerFrame;
21  const FrameID frame(frameNum);
22  const bool frameOrientation = frameNum % nOrientations; //0 is horizontal, 1 is vertical
23  //TODO: Maybe an Orientation type by itself would be useful
24  const size_t frameLocal = module % modulesPerFrame;
25  const PlaneID plane(frame, frameOrientation?frameLocal/fModulesPerPlane:!(frameLocal/fModulesPerPlane)); //TODO: Is this just an and?
26  const CRT::ModuleID modID(plane, frameLocal % nOrientations);
27  return modID;
28  }
29 
30  StripID HardCodedGeometry::doStripID(const CRT::ModuleID module, const size_t channel) const
31  {
32  const LayerID layer(module, (channel > fStripsPerLayer));
33  const CRT::StripID strip(layer, channel % fStripsPerLayer); //Implicitly defining the 0-31 layer of strips as the one
34  //closest to the HV connect in data.
35  return strip;
36  }
37 }
virtual CRT::StripID doStripID(const CRT::ModuleID module, const size_t channel) const override
uint8_t channel
Definition: CRTFragment.hh:201
virtual CRT::ModuleID doModuleID(const size_t module) const override