24 #include <Riostream.h> 45 AliAltroMapping(mappingFile),
73 AliFatal(
"Mapping file has not been opened !");
80 fMappingSize = 2*(fMaxHWAddress+1);
81 fMapping =
new Short_t[fMappingSize];
82 for (Int_t i = 0; i <= fMaxHWAddress; i++) {
86 for(Int_t i = 0; i < fNumberOfChannels ; i++) {
88 if (!(*fIn >> hwAddress)) {
89 AliFatal(
"Syntax of the mapping file is wrong !");
92 if (hwAddress > fMaxHWAddress) {
93 AliFatal(Form(
"Hardware (ALTRO) adress (%d) outside the range (0 -> %d) !",hwAddress,fMaxHWAddress));
97 if (!(*fIn >> padrow >> pad)) {
98 AliFatal(
"Syntax of the mapping file is wrong !");
123 AliWarning(
"Mapping array was not initalized correctly ! Impossible to create the inverse mapping !");
129 Int_t invMappingSize = nRows*nPads;
136 for(Int_t i = 0; i <= fMaxHWAddress; i++) {
139 if(padrow != -1 && pad != -1)
156 if (padrow < fMinPadRow || padrow >
fMaxPadRow) {
157 AliWarning(Form(
"Index of pad-row (%d) outside the range (%d -> %d) !",padrow,
fMinPadRow,fMaxPadRow));
166 AliWarning(Form(
"Hardware (ALTRO) adress is not defined for these pad-row (%d) and pad (%d) !",padrow,pad));
175 AliWarning(
"Mapping array was not initalized correctly !");
178 if (hwAddress > fMaxHWAddress) {
179 AliWarning(Form(
"Hardware (ALTRO) adress (%d) outside the range (0 -> %d) !",hwAddress,fMaxHWAddress));
182 Int_t padrow =
fMapping[2*hwAddress];
184 AliWarning(Form(
"Hardware (ALTRO) adress (%d) is not defined !",hwAddress));
193 AliWarning(
"Mapping array was not initalized correctly !");
196 if (hwAddress > fMaxHWAddress) {
197 AliWarning(Form(
"Hardware (ALTRO) adress (%d) outside the range (0 -> %d) !",hwAddress,fMaxHWAddress));
200 Int_t pad =
fMapping[2*hwAddress+1];
202 AliWarning(Form(
"Hardware (ALTRO) adress (%d) is not defined !",hwAddress));
210 AliWarning(
"Sector index is not contained in the TPC altro mapping !");
#define AliWarning(message)
Short_t * fInvMapping
! Inverse of fMapping
Int_t fMinPadRow
Minimum Index of pad-row.
virtual Bool_t CreateInvMapping()
AliCaloAltroMapping * fMapping[4]
#define AliFatal(message)
virtual Int_t GetPadRow(Int_t hwAddress) const
virtual Int_t GetSector(Int_t hwAddress) const
virtual Int_t GetPad(Int_t hwAddress) const
virtual ~AliTPCAltroMapping()
Int_t fMaxPadRow
Maximum Index of pad-row.
virtual Int_t GetHWAddress(Int_t padrow, Int_t pad, Int_t sector)
virtual Bool_t ReadMapping()
Int_t fMaxPad
Maximum Index of pad inside row.