AliRoot Core  edcc906 (edcc906)
AliFMDMap Class Referenceabstract

Base class for caches of per-strip information.This is used to index a strip. Data stored depends on derived class. More...

#include <AliFMDMap.h>

Inheritance diagram for AliFMDMap:

Classes

class  ForOne
 
class  Printer
 

Public Types

enum  { kMaxDetectors = 3, kMaxRings = 2, kMaxSectors = 40, kMaxStrips = 512 }
 
enum  { kInner = 0, kOuter }
 
enum  { kNStripOuter = 256, kNStripInner = 512 }
 
enum  { kNSectorInner = 20, kNSectorOuter = 40 }
 
enum  { kBaseInner = 0, kBaseOuter = kNSectorInner * kNStripInner }
 
enum  { kFMD1Base = 0, kFMD2Base = kNSectorInner * kNStripInner, kFMD3Base = (kBaseOuter + kNSectorOuter * kNStripOuter + kFMD2Base) }
 
enum  { kNeedUShort = 14 }
 

Public Member Functions

 AliFMDMap (UShort_t maxDet=0, UShort_t maxRing=0, UShort_t maxSec=0, UShort_t maxStr=0)
 
 AliFMDMap (const AliFMDMap &other)
 
virtual ~AliFMDMap ()
 
UShort_t MaxDetectors () const
 
UShort_t MaxRings () const
 
UShort_t MaxSectors () const
 
UShort_t MaxStrips () const
 
void CalcCoords (Int_t idx, UShort_t &det, Char_t &ring, UShort_t &sec, UShort_t &str) const
 
Int_t CalcIndex (UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 
Int_t CheckIndex (UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 
void CheckNeedUShort (TFile *file)
 
AliFMDMapoperator*= (const AliFMDMap &o)
 
AliFMDMapoperator/= (const AliFMDMap &o)
 
AliFMDMapoperator+= (const AliFMDMap &o)
 
AliFMDMapoperator-= (const AliFMDMap &o)
 
virtual Bool_t ForEach (ForOne &algo) const
 
virtual Int_t MaxIndex () const =0
 
virtual void Print (Option_t *option="") const
 
virtual Float_t AtAsFloat (Int_t idx) const
 
virtual Float_t & AtAsFloat (Int_t idx)
 
virtual Int_t AtAsInt (Int_t idx) const
 
virtual Int_t & AtAsInt (Int_t idx)
 
virtual UShort_t AtAsUShort (Int_t idx) const
 
virtual UShort_t & AtAsUShort (Int_t idx)
 
virtual Bool_t AtAsBool (Int_t idx) const
 
virtual Bool_t & AtAsBool (Int_t idx)
 
virtual Bool_t IsFloat () const
 
virtual Bool_t IsInt () const
 
virtual Bool_t IsUShort () const
 
virtual Bool_t IsBool () const
 
virtual void * Ptr () const =0
 

Protected Member Functions

Int_t Coords2Index (UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 
Int_t Coords2IndexOld (UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 
void Index2CoordsOld (Int_t idx, UShort_t &det, Char_t &ring, UShort_t &sec, UShort_t &str) const
 
void Index2Coords (Int_t idx, UShort_t &det, Char_t &ring, UShort_t &sec, UShort_t &str) const
 

Protected Attributes

UShort_t fMaxDetectors
 
UShort_t fMaxRings
 
UShort_t fMaxSectors
 
UShort_t fMaxStrips
 

Detailed Description

Base class for caches of per-strip information.

This is used to index a strip. Data stored depends on derived class.

Definition at line 19 of file AliFMDMap.h.

Member Enumeration Documentation

anonymous enum
Enumerator
kMaxDetectors 

Default maximum detector number

kMaxRings 

Default maximum number of rings

kMaxSectors 

Default maximum number of sectors

kMaxStrips 

Default maximum number of strips

Definition at line 22 of file AliFMDMap.h.

anonymous enum
Enumerator
kInner 

Number used for inner rings

kOuter 

Number used for outer rings

Definition at line 32 of file AliFMDMap.h.

anonymous enum
Enumerator
kNStripOuter 

Number of strips in outer rings

kNStripInner 

Number of strips in the inner rings

Definition at line 38 of file AliFMDMap.h.

anonymous enum
Enumerator
kNSectorInner 

Number of sectors in the inner rings

kNSectorOuter 

Number of sectorts in the outer rings

Definition at line 44 of file AliFMDMap.h.

anonymous enum
Enumerator
kBaseInner 

Base index for inner rings

kBaseOuter 

Base index for outer rings

Definition at line 50 of file AliFMDMap.h.

anonymous enum
Enumerator
kFMD1Base 

Base for FMD1 index

kFMD2Base 

Base for FMD2 index

kFMD3Base 

Base for FMD3 index

Definition at line 56 of file AliFMDMap.h.

anonymous enum
Enumerator
kNeedUShort 

In case of version 2 of this class, this bit should be set.

Definition at line 468 of file AliFMDMap.h.

Constructor & Destructor Documentation

AliFMDMap::AliFMDMap ( UShort_t  maxDet = 0,
UShort_t  maxRing = 0,
UShort_t  maxSec = 0,
UShort_t  maxStr = 0 
)

Constructor

Parameters
maxDetMaximum allowed detector number
maxRingMaximum number of rings
maxSecMaximum number of sectors
maxStrMaximum number of strips

Definition at line 41 of file AliFMDMap.cxx.

AliFMDMap::AliFMDMap ( const AliFMDMap other)

Copy constructor

Parameters
otherObject to construct from

Definition at line 61 of file AliFMDMap.cxx.

virtual AliFMDMap::~AliFMDMap ( )
inlinevirtual

Destructor

Definition at line 218 of file AliFMDMap.h.

Member Function Documentation

Bool_t AliFMDMap::AtAsBool ( Int_t  idx) const
inlinevirtual

Virtal function to get the value at index idx as an unsigned short integer

See also
Float_t AliFMDMap::AtAsFloat(Int_t) const
Parameters
idxIndex number
Returns
Value at index as an unsigned short integer

Reimplemented in AliFMDUShortMap, AliFMDEdepMap, and AliFMDBoolMap.

Definition at line 580 of file AliFMDMap.h.

Referenced by AliFMDEdepMap::AtAsBool(), AliFMDUShortMap::AtAsBool(), ForEach(), and MaxStrips().

Bool_t & AliFMDMap::AtAsBool ( Int_t  idx)
inlinevirtual

Virtal function to get the value at index idx as an unsigned short integer

See also
Float_t& AliFMDMap::AtAsFloat(Int_t)
Parameters
idxIndex number
Returns
Value at index as an unsigned short integer

Reimplemented in AliFMDUShortMap, AliFMDEdepMap, and AliFMDBoolMap.

Definition at line 585 of file AliFMDMap.h.

Float_t AliFMDMap::AtAsFloat ( Int_t  idx) const
inlinevirtual

Virtal function to get the value at index idx as a floating point number.

Note
Even if the map is not floating point valued the sub-class can define this member function to allow non l-value usage of the data in the map. That is, if a is a floating point valued map, and b is not, then if the class B of b implements this member function, expression like
*   a += b;
* 

multiplies each element of a (floating points) with each element of c according to the definition of B::AtAsFloat (const version).

Parameters
idxIndex number
Returns
Value at index as a floating point number

Reimplemented in AliFMDUShortMap, AliFMDBoolMap, AliFMDEdepMap, and AliFMDFloatMap.

Definition at line 547 of file AliFMDMap.h.

Referenced by AliFMDFloatMap::AliFMDFloatMap(), AliFMDBoolMap::AtAsFloat(), AliFMDUShortMap::AtAsFloat(), ForEach(), and MaxStrips().

Float_t & AliFMDMap::AtAsFloat ( Int_t  idx)
inlinevirtual

Virtal function to get the value at index idx as a floating point number.

This member function should only be defined if the map is a floating point valued, and can be assigned floating point valued values. That is, if the map's elements are anything but float then this member function should not be defined in the derived class. That will prevent expressions like

a += b;

where a is non-floating point valued, and b is floating point valued (only).

Parameters
idxIndex number
Returns
Value at index as a floating point number

Reimplemented in AliFMDUShortMap, AliFMDBoolMap, AliFMDEdepMap, and AliFMDFloatMap.

Definition at line 552 of file AliFMDMap.h.

Int_t AliFMDMap::AtAsInt ( Int_t  idx) const
inlinevirtual

Virtal function to get the value at index idx as an integer

See also
Float_t AliFMDMap::AtAsFloat(Int_t) const
Parameters
idxIndex number
Returns
Value at index as an integer

Reimplemented in AliFMDUShortMap, AliFMDBoolMap, and AliFMDEdepMap.

Definition at line 558 of file AliFMDMap.h.

Referenced by AliFMDEdepMap::AtAsInt(), AliFMDBoolMap::AtAsInt(), AliFMDUShortMap::AtAsInt(), ForEach(), and MaxStrips().

Int_t & AliFMDMap::AtAsInt ( Int_t  idx)
inlinevirtual

Virtal function to get the value at index idx as an integer

See also
Float_t& AliFMDMap::AtAsFloat(Int_t)
Parameters
idxIndex number
Returns
Value at index as an integer

Reimplemented in AliFMDUShortMap, AliFMDBoolMap, and AliFMDEdepMap.

Definition at line 563 of file AliFMDMap.h.

UShort_t AliFMDMap::AtAsUShort ( Int_t  idx) const
inlinevirtual

Virtal function to get the value at index idx as an boolean

See also
Float_t AliFMDMap::AtAsFloat(Int_t) const
Parameters
idxIndex number
Returns
Value at index as a boolean

Reimplemented in AliFMDEdepMap, AliFMDBoolMap, and AliFMDUShortMap.

Definition at line 569 of file AliFMDMap.h.

Referenced by AliFMDBoolMap::AtAsUShort(), ForEach(), and MaxStrips().

UShort_t & AliFMDMap::AtAsUShort ( Int_t  idx)
inlinevirtual

Virtal function to get the value at index idx as an boolean

See also
Float_t& AliFMDMap::AtAsFloat(Int_t)
Parameters
idxIndex number
Returns
Value at index as a boolean

Reimplemented in AliFMDBoolMap, AliFMDEdepMap, and AliFMDUShortMap.

Definition at line 574 of file AliFMDMap.h.

void AliFMDMap::CalcCoords ( Int_t  idx,
UShort_t &  det,
Char_t &  ring,
UShort_t &  sec,
UShort_t &  str 
) const

Calculate the detector coordinates for a given index number

Parameters
idxIndex to find cooresponding detector coordinates for
detOn return, contain the detector number
ringOn return, contain the ring identifier
secOn return, contain the sector number
strOn return, contain the strip number

Definition at line 118 of file AliFMDMap.cxx.

Referenced by ForEach(), MaxStrips(), and TestIndex().

Int_t AliFMDMap::CalcIndex ( UShort_t  det,
Char_t  ring,
UShort_t  sec,
UShort_t  str 
) const

Calculate index and return

Parameters
detDetector number
ringRing identifier
secSector number
strStrip number
Returns
Index (not checked)

Definition at line 192 of file AliFMDMap.cxx.

Referenced by MaxStrips(), AliFMDFloatMap::operator()(), AliFMDUShortMap::operator()(), AliFMDBoolMap::operator()(), AliFMDEdepMap::operator()(), and TestIndex().

Int_t AliFMDMap::CheckIndex ( UShort_t  det,
Char_t  ring,
UShort_t  sec,
UShort_t  str 
) const

Calculate index and return

Parameters
detDetector number
ringRing identifier
secSector number
strStrip number
Returns
Index or -1 if the coordinates are invalid

Definition at line 178 of file AliFMDMap.cxx.

Referenced by CalcIndex(), MaxStrips(), AliFMDCalibGain::Set(), AliFMDCalibPedestal::Set(), and TestMap().

void AliFMDMap::CheckNeedUShort ( TFile *  file)

Check if we need UShort_t hack

Parameters
fileFile this object was read from

Definition at line 73 of file AliFMDMap.cxx.

Referenced by AliESDFMD::CheckNeedUShort(), and MaxStrips().

Int_t AliFMDMap::Coords2Index ( UShort_t  det,
Char_t  ring,
UShort_t  sec,
UShort_t  str 
) const
protected

Calculate, check, and return index for strip. If the index is invalid, -1 is returned

This is only used when a full map is used, signalled by fMaxDetector = 0

Parameters
detDetector number
ringRing identifier
secSector number
strStrip number
Returns
Unique index, or -1 in case of errors

Definition at line 151 of file AliFMDMap.cxx.

Referenced by CheckIndex().

Int_t AliFMDMap::Coords2IndexOld ( UShort_t  det,
Char_t  ring,
UShort_t  sec,
UShort_t  str 
) const
protected

Calculate, check, and return index for strip. If the index is invalid, -1 is returned

This is for back-ward compatibility and for when a map does not cover all of the FMD strips

Parameters
detDetector number
ringRing identifier
secSector number
strStrip number
Returns
Unique index, or -1 in case of errors

Definition at line 134 of file AliFMDMap.cxx.

Referenced by CheckIndex().

Bool_t AliFMDMap::ForEach ( ForOne algo) const
virtual

For each element of the map, call the user defined overloaded ForOne::operator()

Parameters
algoAlgorithm to use
Returns
true on success, false if for any element, algo(d,r,s,t,v) returns false.

Definition at line 335 of file AliFMDMap.cxx.

Referenced by AccessOneByOne(), FillMap(), FillOne(), AliESDFMD::ForEach(), AliFMDCalibGain::MakeDeadMap(), AliFMDCalibPedestal::MakeDeadMap(), MaxStrips(), Print(), PrintMap(), and TestIndex().

void AliFMDMap::Index2Coords ( Int_t  idx,
UShort_t &  det,
Char_t &  ring,
UShort_t &  sec,
UShort_t &  str 
) const
protected

Calculate the detector coordinates from an array index.

This is used for a full map only, signalled by fMaxDetector = 0

Parameters
idxIndex to convert
detDetector number on return
ringRing identifier on return
secSector number on return
strStrip number on return

Definition at line 99 of file AliFMDMap.cxx.

Referenced by CalcCoords().

void AliFMDMap::Index2CoordsOld ( Int_t  idx,
UShort_t &  det,
Char_t &  ring,
UShort_t &  sec,
UShort_t &  str 
) const
protected

Calculate the detector coordinates from an array index.

This is used for backward compatibility and for when a map does not cover all of the FMD strips

Parameters
idxIndex to convert
detDetector number on return
ringRing identifier on return
secSector number on return
strStrip number on return

Definition at line 83 of file AliFMDMap.cxx.

Referenced by CalcCoords().

virtual Bool_t AliFMDMap::IsBool ( ) const
inlinevirtual

Whether this map is boolean valued - that is it can be assigned boolean values

Returns
true if the map is boolean valued

Reimplemented in AliFMDBoolMap.

Definition at line 461 of file AliFMDMap.h.

Referenced by ForEach().

virtual Bool_t AliFMDMap::IsFloat ( ) const
inlinevirtual

Whether this map is floating point valued - that is, it can be assigned floating point valued values.

Returns
true if the map is floating point valued

Reimplemented in AliFMDEdepMap, and AliFMDFloatMap.

Definition at line 440 of file AliFMDMap.h.

Referenced by AliFMDFloatMap::AliFMDFloatMap(), and ForEach().

virtual Bool_t AliFMDMap::IsInt ( ) const
inlinevirtual

Whether this map is floating point valued or integer valued - that is, it can be assigned integer valued values

Returns
true if the map is integer valued

Definition at line 447 of file AliFMDMap.h.

Referenced by ForEach().

virtual Bool_t AliFMDMap::IsUShort ( ) const
inlinevirtual

Whether this map is unsigned short integer valued - that is it can be assigned unsigned short integer values

Returns
true if the map is unsigned short integer valued

Reimplemented in AliFMDUShortMap, and AliFMDEdepMap.

Definition at line 454 of file AliFMDMap.h.

Referenced by ForEach().

UShort_t AliFMDMap::MaxDetectors ( ) const
inline
Returns
Maximum detector number

Definition at line 220 of file AliFMDMap.h.

Referenced by AliESDFMD::MaxDetectors(), and AliESDFMD::Print().

virtual Int_t AliFMDMap::MaxIndex ( ) const
pure virtual

Get the total size of the internal array - that is the maximum index possible plus one.

Returns
maximum index, plus 1

Implemented in AliFMDUShortMap, AliFMDBoolMap, AliFMDEdepMap, and AliFMDFloatMap.

Referenced by CheckMap(), ForEach(), MaxStrips(), operator*=(), operator+=(), operator-=(), and operator/=().

UShort_t AliFMDMap::MaxRings ( ) const
inline
Returns
Maximum number of rings

Definition at line 222 of file AliFMDMap.h.

Referenced by AliESDFMD::MaxRings(), and AliESDFMD::Print().

UShort_t AliFMDMap::MaxSectors ( ) const
inline
Returns
Maximum number of sectors

Definition at line 224 of file AliFMDMap.h.

Referenced by AliESDFMD::MaxSectors(), and AliESDFMD::Print().

UShort_t AliFMDMap::MaxStrips ( ) const
inline
Returns
Maximum number of strip

Definition at line 226 of file AliFMDMap.h.

Referenced by AliESDFMD::MaxStrips(), and AliESDFMD::Print().

AliFMDMap & AliFMDMap::operator*= ( const AliFMDMap o)

Right multiplication operator

Parameters
oOther map to multuiply with
Returns
Reference to this object

Definition at line 267 of file AliFMDMap.cxx.

Referenced by MaxStrips().

AliFMDMap & AliFMDMap::operator+= ( const AliFMDMap o)

Right addision operator

Parameters
oOther map to add to this
Returns
Reference to this object

Definition at line 301 of file AliFMDMap.cxx.

Referenced by MaxStrips().

AliFMDMap & AliFMDMap::operator-= ( const AliFMDMap o)

Right subtraction operator

Parameters
oOther map to substract from this
Returns
Reference to this object

Definition at line 318 of file AliFMDMap.cxx.

Referenced by MaxStrips().

AliFMDMap & AliFMDMap::operator/= ( const AliFMDMap o)

Right division operator

Parameters
oOther map to divide with
Returns
Reference to this object

Definition at line 284 of file AliFMDMap.cxx.

Referenced by MaxStrips().

void AliFMDMap::Print ( Option_t *  option = "") const
virtual

Print content of the map

Parameters
optionIf not null or empty string, print map

Reimplemented in AliFMDFloatMap.

Definition at line 362 of file AliFMDMap.cxx.

Referenced by AliFMDCalibFaker::MakeDeadMap(), MaxStrips(), and AliFMDFloatMap::Print().

virtual void* AliFMDMap::Ptr ( ) const
pure virtual

Get raw data pointer.

Returns
Raw data pointer

Implemented in AliFMDUShortMap, AliFMDBoolMap, AliFMDEdepMap, and AliFMDFloatMap.

Referenced by CheckMap(), and IsBool().

Member Data Documentation


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