1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //____________________________________________________________________
22 #include "AliFMDMap.h" // ALIFMDMAP_H
24 //____________________________________________________________________
27 //____________________________________________________________________
28 AliFMDMap::AliFMDMap(size_t maxDet,
32 : fMaxDetectors(maxDet),
40 // maxDet Maximum # of detectors
41 // maxRinf Maximum # of rings
42 // maxSec Maximum # of sectors
43 // maxStr Maximum # of strips
47 //____________________________________________________________________
49 AliFMDMap::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
51 // Calculate index into storage from arguments.
59 // Returns appropriate index into storage
61 size_t ringi = (ring == 'I' || ring == 'i' ? 0 : 1);
63 (det + fMaxDetectors * (ringi + fMaxRings * (sec + fMaxSectors * str)));
64 if (idx >= fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips) {
65 Fatal("CalcIndex", "Index (%d,'%c',%d,%d) out of bounds, "
66 "in particular the %s index",
68 (det >= fMaxDetectors ? "Detector" :
69 (ringi >= fMaxRings ? "Ring" :
70 (sec >= fMaxSectors ? "Sector" : "Strip"))));
77 //___________________________________________________________________