Public Member Functions | Private Member Functions | Private Attributes | List of all members
CRT::HardCodedGeometry Class Reference

#include <HardCodedGeometry.h>

Inheritance diagram for CRT::HardCodedGeometry:
CRT::Geometry

Public Member Functions

 HardCodedGeometry ()
 
virtual ~HardCodedGeometry ()=default
 
- Public Member Functions inherited from CRT::Geometry
 Geometry ()=default
 
virtual ~Geometry ()=default
 
CRT::ModuleID ModuleID (const size_t module) const
 
CRT::StripID StripID (const size_t module, const size_t channel) const
 

Private Member Functions

virtual CRT::ModuleID doModuleID (const size_t module) const override
 
virtual CRT::StripID doStripID (const CRT::ModuleID module, const size_t channel) const override
 

Private Attributes

const size_t fModulesPerPlane
 
const size_t fStripsPerLayer
 

Detailed Description

Definition at line 13 of file HardCodedGeometry.h.

Constructor & Destructor Documentation

CRT::HardCodedGeometry::HardCodedGeometry ( )

Definition at line 12 of file HardCodedGeometry.cpp.

13  {
14  }
virtual CRT::HardCodedGeometry::~HardCodedGeometry ( )
virtualdefault

Member Function Documentation

ModuleID CRT::HardCodedGeometry::doModuleID ( const size_t  module) const
overrideprivatevirtual

Implements CRT::Geometry.

Definition at line 16 of file HardCodedGeometry.cpp.

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  }
detail::Node< void, uint8_t > FrameID
Definition: CRTID.h:120
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
StripID CRT::HardCodedGeometry::doStripID ( const CRT::ModuleID  module,
const size_t  channel 
) const
overrideprivatevirtual

Implements CRT::Geometry.

Definition at line 30 of file HardCodedGeometry.cpp.

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  }
detail::Node< ModuleID, bool > LayerID
Definition: CRTID.h:140
uint8_t channel
Definition: CRTFragment.hh:201

Member Data Documentation

const size_t CRT::HardCodedGeometry::fModulesPerPlane
private

Definition at line 25 of file HardCodedGeometry.h.

const size_t CRT::HardCodedGeometry::fStripsPerLayer
private

Definition at line 26 of file HardCodedGeometry.h.


The documentation for this class was generated from the following files: