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

A Segmentation lets you find pads of a detection element and then inspect those pads. More...

#include <Segmentation.h>

Public Member Functions

 Segmentation (int deid)
 This ctor throws if deid is invalid.
 
void forEachDualSampa (std::function< void(int dualSampaId)> func) const
 Loop over dual sampas of this detection element.
 
bool operator== (const Segmentation &rhs) const
 
bool operator!= (const Segmentation &rhs) const
 
 Segmentation (const Segmentation &seg)
 
 Segmentation (const Segmentation &&seg)
 
Segmentationoperator= (Segmentation seg)
 
Some general characteristics of this segmentation.
int detElemId () const
 
int nofPads () const
 
int nofDualSampas () const
 
Pad finding.

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

bool findPadPairByPosition (double x, double y, int &bpad, int &nbpad) const
 
int findPadByFEE (int dualSampaId, int dualSampaChannel) const
 
Pad information retrieval.

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

double padPositionX (int dePadIndex) const
 
double padPositionY (int dePadIndex) const
 
double padSizeX (int dePadIndex) const
 
double padSizeY (int dePadIndex) const
 
int padDualSampaId (int dePadIndex) const
 
int padDualSampaChannel (int dePadIndex) const
 
bool isValid (int dePadIndex) const
 
bool isBendingPad (int dePadIndex) const
 
std::string padAsString (int dePadIndex) const
 
ForEach (pad) methods.

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

template<typename CALLABLE >
void forEachPad (CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachPadInDualSampa (int dualSampaId, CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachNeighbouringPad (int dePadIndex, CALLABLE &&func) const
 
template<typename CALLABLE >
void forEachPadInArea (double xmin, double ymin, double xmax, double ymax, CALLABLE &&func) const
 
Access to individual cathode segmentations.

Not needed in most cases.

const CathodeSegmentationbending () const
 
const CathodeSegmentationnonBending () const
 

Friends

void swap (Segmentation &a, Segmentation &b)
 

Detailed Description

A Segmentation lets you find pads of a detection element and then inspect those pads.

Note that this class is closely related to the CathodeSegmentation one which only deals with one of the two cathodes of a detection element.

Pads can be found by :

  • their position (x,y)
  • 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.

Warning
This integer reference (dePadIndex) is only valid within the realm of this Segmentation 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)

By convention, the pad references are contiguous (ranging from 0 to number of pads in the detection element), and the bending pads come first.

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 60 of file Segmentation.h.

Constructor & Destructor Documentation

◆ Segmentation() [1/3]

o2::mch::mapping::Segmentation::Segmentation ( int  deid)
inline

This ctor throws if deid is invalid.

Definition at line 19 of file Segmentation.inl.

◆ Segmentation() [2/3]

o2::mch::mapping::Segmentation::Segmentation ( const Segmentation seg)
inlinedefault

◆ Segmentation() [3/3]

o2::mch::mapping::Segmentation::Segmentation ( const Segmentation &&  seg)
inline

Definition at line 39 of file Segmentation.inl.

Member Function Documentation

◆ bending()

const CathodeSegmentation & o2::mch::mapping::Segmentation::bending ( ) const
inline

Definition at line 239 of file Segmentation.inl.

◆ detElemId()

int o2::mch::mapping::Segmentation::detElemId ( ) const
inline

Definition at line 235 of file Segmentation.inl.

◆ findPadByFEE()

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

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

Definition at line 49 of file Segmentation.inl.

◆ findPadPairByPosition()

bool o2::mch::mapping::Segmentation::findPadPairByPosition ( double  x,
double  y,
int bpad,
int nbpad 
) const
inline

Find the pads at position (x,y) (in cm). Returns true is the bpad and nbpad has been filled with a valid dePadIndex, false otherwise (if position is outside the segmentation area).

Parameters
bpadthe dePadIndex of the bending pad at position (x,y)
nbpadthe dePadIndex of the non-bending pad at position (x,y)

Definition at line 95 of file Segmentation.inl.

◆ forEachDualSampa()

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

Loop over dual sampas of this detection element.

Definition at line 164 of file Segmentation.inl.

◆ forEachNeighbouringPad()

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

Definition at line 149 of file Segmentation.inl.

◆ forEachPad()

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

Definition at line 115 of file Segmentation.inl.

◆ forEachPadInArea()

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

Definition at line 139 of file Segmentation.inl.

◆ forEachPadInDualSampa()

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

Definition at line 125 of file Segmentation.inl.

◆ isBendingPad()

bool o2::mch::mapping::Segmentation::isBendingPad ( int  dePadIndex) const
inline

Definition at line 104 of file Segmentation.h.

◆ isValid()

bool o2::mch::mapping::Segmentation::isValid ( int  dePadIndex) const
inline

Definition at line 67 of file Segmentation.inl.

◆ nofDualSampas()

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

Definition at line 237 of file Segmentation.inl.

◆ nofPads()

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

Definition at line 236 of file Segmentation.inl.

◆ nonBending()

const CathodeSegmentation & o2::mch::mapping::Segmentation::nonBending ( ) const
inline

Definition at line 240 of file Segmentation.inl.

◆ operator!=()

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

Definition at line 28 of file Segmentation.inl.

◆ operator=()

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

Definition at line 43 of file Segmentation.inl.

◆ operator==()

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

Definition at line 23 of file Segmentation.inl.

◆ padAsString()

std::string o2::mch::mapping::Segmentation::padAsString ( int  dePadIndex) const
inline

Definition at line 170 of file Segmentation.inl.

◆ padDualSampaChannel()

int o2::mch::mapping::Segmentation::padDualSampaChannel ( int  dePadIndex) const
inline

Definition at line 195 of file Segmentation.inl.

◆ padDualSampaId()

int o2::mch::mapping::Segmentation::padDualSampaId ( int  dePadIndex) const
inline

Definition at line 187 of file Segmentation.inl.

◆ padPositionX()

double o2::mch::mapping::Segmentation::padPositionX ( int  dePadIndex) const
inline

Definition at line 203 of file Segmentation.inl.

◆ padPositionY()

double o2::mch::mapping::Segmentation::padPositionY ( int  dePadIndex) const
inline

Definition at line 211 of file Segmentation.inl.

◆ padSizeX()

double o2::mch::mapping::Segmentation::padSizeX ( int  dePadIndex) const
inline

Definition at line 219 of file Segmentation.inl.

◆ padSizeY()

double o2::mch::mapping::Segmentation::padSizeY ( int  dePadIndex) const
inline

Definition at line 227 of file Segmentation.inl.

Friends And Related Symbol Documentation

◆ swap

void swap ( Segmentation a,
Segmentation b 
)
friend

Definition at line 30 of file Segmentation.inl.


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