Project
Loading...
Searching...
No Matches
o2::mch::mapping::CathodeSegmentation Class Reference

A CathodeSegmentation lets you find pads on a given plane (cathode) of a detection element and then inspect those pads. More...

#include <CathodeSegmentation.h>

Public Member Functions

 CathodeSegmentation (int detElemId, bool isBendingPlane)
 This ctor throws if detElemId is invalid.
 
bool operator== (const CathodeSegmentation &rhs) const
 
bool operator!= (const CathodeSegmentation &rhs) const
 
 CathodeSegmentation (const CathodeSegmentation &seg)
 
CathodeSegmentationoperator= (CathodeSegmentation seg)
 
 ~CathodeSegmentation ()
 
void forEachDualSampa (std::function< void(int dualSampaId)> func) const
 Loop over dual sampas of this detection element.
 
Pad Unique Identifier

Pads are identified by a unique integer, catPadIndex.

Warning
This catPadIndex is only valid within the realm of this CathodeSegmentation object (to use the query methods padPosition, padSize, etc...). So do not rely on any given value it might take (as it might change between e.g. library version or underlying implementation)
bool isValid (int catPadIndex) const
 Not every integer is a valid catPadIndex. This method will tell if catPadIndex is a valid one.
 
Pad finding.

Methods to find a pad. In each case the returned integer represents either a catPadIndex if a pad is found or an integer representing an invalid catPadIndex otherwise. Validity of the returned value can be tested using isValid()

int findPadByPosition (double x, double y) const
 
int findPadByFEE (int dualSampaId, int dualSampaChannel) const
 
Pad information retrieval.

Given a valid catPadIndex those methods return information (position, size, fee) about that pad.

double padPositionX (int catPadIndex) const
 
double padPositionY (int catPadIndex) const
 
double padSizeX (int catPadIndex) const
 
double padSizeY (int catPadIndex) const
 
int padDualSampaId (int catPadIndex) const
 
int padDualSampaChannel (int catPadIndex) const
 
std::string padAsString (int catPadIndex) const
 
Some general characteristics of this segmentation.
bool isBendingPlane () const
 
int nofDualSampas () const
 
int nofPads () const
 
int dualSampaId (int dualSampaIndex) const
 
ForEach methods.

Those methods let you execute a function on each of the pads belonging to some group.

template<typename CALLABLE >
void forEachPadInDualSampa (int dualSampaId, CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachPadInArea (double xmin, double ymin, double xmax, double ymax, CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachPad (CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachNeighbouringPad (int catPadIndex, CALLABLE &&func) const
 

Friends

void swap (CathodeSegmentation &a, CathodeSegmentation &b)
 

Detailed Description

A CathodeSegmentation lets you find pads on a given plane (cathode) of a detection element and then inspect those pads.

Note that instead of CathodeSegmentation most users will prefer to use the Segmentation class which handles both cathodes of a detection element at once.

Pads can be found by :

  • their position (x,y) in the plane
  • their front-end electronics characteristics (which DualSampa chip, which chip channel)

What you get back from the find methods are not pad objects directly but a reference (integer) that can then be used to query the segmentation object about that pad. That reference integer (catPadIndex) is an index between 0 and nofPads()-1. The exact ordering of this index is implementation dependent though.

Pad information that can be retrieved :

  • position in x and y directions
  • size in x and y directions
  • dual sampa id
  • dual sampa channel

In addition, you can apply some function to a group of pads using one of the the forEach methods :

  • all the pads belonging to a given dual sampa
  • all the pads within a given area (box)
  • all the pads that are neighbours of a given pad

Definition at line 63 of file CathodeSegmentation.h.

Constructor & Destructor Documentation

◆ CathodeSegmentation() [1/2]

o2::mch::mapping::CathodeSegmentation::CathodeSegmentation ( int  detElemId,
bool  isBendingPlane 
)
inline

This ctor throws if detElemId is invalid.

Definition at line 67 of file CathodeSegmentation.h.

◆ CathodeSegmentation() [2/2]

o2::mch::mapping::CathodeSegmentation::CathodeSegmentation ( const CathodeSegmentation seg)
inline

Definition at line 114 of file CathodeSegmentation.h.

◆ ~CathodeSegmentation()

o2::mch::mapping::CathodeSegmentation::~CathodeSegmentation ( )
inline

Definition at line 129 of file CathodeSegmentation.h.

Member Function Documentation

◆ dualSampaId()

int o2::mch::mapping::CathodeSegmentation::dualSampaId ( int  dualSampaIndex) const
inline
Parameters
dualSampaIndexmust be in the range 0..nofDualSampas()-1
Returns
the DualSampa chip id for a given index

Definition at line 183 of file CathodeSegmentation.h.

◆ findPadByFEE()

int o2::mch::mapping::CathodeSegmentation::findPadByFEE ( int  dualSampaId,
int  dualSampaChannel 
) const
inline

Find the pad connected to the given channel of the given dual sampa.

Definition at line 154 of file CathodeSegmentation.h.

◆ findPadByPosition()

int o2::mch::mapping::CathodeSegmentation::findPadByPosition ( double  x,
double  y 
) const
inline

Find the pad at position (x,y) (in cm).

Definition at line 151 of file CathodeSegmentation.h.

◆ forEachDualSampa()

void o2::mch::mapping::CathodeSegmentation::forEachDualSampa ( std::function< void(int dualSampaId)>  func) const
inline

Loop over dual sampas of this detection element.

Definition at line 252 of file CathodeSegmentation.h.

◆ forEachNeighbouringPad()

template<typename CALLABLE >
void o2::mch::mapping::CathodeSegmentation::forEachNeighbouringPad ( int  catPadIndex,
CALLABLE &&  func 
) const

Definition at line 243 of file CathodeSegmentation.h.

◆ forEachPad()

template<typename CALLABLE >
void o2::mch::mapping::CathodeSegmentation::forEachPad ( CALLABLE &&  func) const

Definition at line 235 of file CathodeSegmentation.h.

◆ forEachPadInArea()

template<typename CALLABLE >
void o2::mch::mapping::CathodeSegmentation::forEachPadInArea ( double  xmin,
double  ymin,
double  xmax,
double  ymax,
CALLABLE &&  func 
) const

Definition at line 225 of file CathodeSegmentation.h.

◆ forEachPadInDualSampa()

template<typename CALLABLE >
void o2::mch::mapping::CathodeSegmentation::forEachPadInDualSampa ( int  dualSampaId,
CALLABLE &&  func 
) const

Definition at line 215 of file CathodeSegmentation.h.

◆ isBendingPlane()

bool o2::mch::mapping::CathodeSegmentation::isBendingPlane ( ) const
inline

Definition at line 178 of file CathodeSegmentation.h.

◆ isValid()

bool o2::mch::mapping::CathodeSegmentation::isValid ( int  catPadIndex) const
inline

Not every integer is a valid catPadIndex. This method will tell if catPadIndex is a valid one.

Definition at line 139 of file CathodeSegmentation.h.

◆ nofDualSampas()

int o2::mch::mapping::CathodeSegmentation::nofDualSampas ( ) const
inline

Definition at line 179 of file CathodeSegmentation.h.

◆ nofPads()

int o2::mch::mapping::CathodeSegmentation::nofPads ( ) const
inline

Definition at line 180 of file CathodeSegmentation.h.

◆ operator!=()

bool o2::mch::mapping::CathodeSegmentation::operator!= ( const CathodeSegmentation rhs) const
inline

Definition at line 101 of file CathodeSegmentation.h.

◆ operator=()

CathodeSegmentation & o2::mch::mapping::CathodeSegmentation::operator= ( CathodeSegmentation  seg)
inline

Definition at line 123 of file CathodeSegmentation.h.

◆ operator==()

bool o2::mch::mapping::CathodeSegmentation::operator== ( const CathodeSegmentation rhs) const
inline

Definition at line 96 of file CathodeSegmentation.h.

◆ padAsString()

std::string o2::mch::mapping::CathodeSegmentation::padAsString ( int  catPadIndex) const
inline

Convenience method to get a string representation of a pad.

Definition at line 284 of file CathodeSegmentation.h.

◆ padDualSampaChannel()

int o2::mch::mapping::CathodeSegmentation::padDualSampaChannel ( int  catPadIndex) const
inline

Definition at line 172 of file CathodeSegmentation.h.

◆ padDualSampaId()

int o2::mch::mapping::CathodeSegmentation::padDualSampaId ( int  catPadIndex) const
inline

Definition at line 171 of file CathodeSegmentation.h.

◆ padPositionX()

double o2::mch::mapping::CathodeSegmentation::padPositionX ( int  catPadIndex) const
inline

Definition at line 167 of file CathodeSegmentation.h.

◆ padPositionY()

double o2::mch::mapping::CathodeSegmentation::padPositionY ( int  catPadIndex) const
inline

Definition at line 168 of file CathodeSegmentation.h.

◆ padSizeX()

double o2::mch::mapping::CathodeSegmentation::padSizeX ( int  catPadIndex) const
inline

Definition at line 169 of file CathodeSegmentation.h.

◆ padSizeY()

double o2::mch::mapping::CathodeSegmentation::padSizeY ( int  catPadIndex) const
inline

Definition at line 170 of file CathodeSegmentation.h.

Friends And Related Symbol Documentation

◆ swap

void swap ( CathodeSegmentation a,
CathodeSegmentation b 
)
friend

Definition at line 103 of file CathodeSegmentation.h.


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