]>
Commit | Line | Data |
---|---|---|
9da38871 | 1 | #ifndef ALIFMDMAP_H |
2 | #define ALIFMDMAP_H | |
3 | /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * See cxx source for full Copyright notice | |
7 | */ | |
8 | #ifndef ROOT_TObject | |
9 | # include <TObject.h> | |
10 | #endif | |
c05d076f | 11 | class TFile; |
12 | ||
9da38871 | 13 | //____________________________________________________________________ |
c05d076f | 14 | /** @class AliFMDMap |
15 | @brief Base class for caches of per-strip information. | |
16 | @ingroup FMD_data | |
17 | This is used to index a strip. Data stored depends on derived | |
18 | class. */ | |
9da38871 | 19 | class AliFMDMap : public TObject |
20 | { | |
21 | public: | |
22 | enum { | |
c05d076f | 23 | /** Default maximum detector number */ |
9da38871 | 24 | kMaxDetectors = 3, |
c05d076f | 25 | /** Default maximum number of rings */ |
9da38871 | 26 | kMaxRings = 2, |
c05d076f | 27 | /** Default maximum number of sectors */ |
9da38871 | 28 | kMaxSectors = 40, |
c05d076f | 29 | /** Default maximum number of strips */ |
9da38871 | 30 | kMaxStrips = 512 |
31 | }; | |
c05d076f | 32 | /** Constructor |
33 | @param maxDet Maximum allowed detector number | |
34 | @param maxRing Maximum number of rings | |
35 | @param maxSec Maximum number of sectors | |
36 | @param maxStr Maximum number of strips | |
37 | @return */ | |
9eeb02aa | 38 | AliFMDMap(UShort_t maxDet = kMaxDetectors, |
39 | UShort_t maxRing= kMaxRings, | |
40 | UShort_t maxSec = kMaxSectors, | |
41 | UShort_t maxStr = kMaxStrips); | |
c05d076f | 42 | /** Destructor */ |
9da38871 | 43 | virtual ~AliFMDMap() {} |
c05d076f | 44 | /** @return Maximum detector number */ |
9eeb02aa | 45 | UShort_t MaxDetectors() const { return fMaxDetectors; } |
c05d076f | 46 | /** @return Maximum number of rings */ |
9eeb02aa | 47 | UShort_t MaxRings() const { return fMaxRings; } |
c05d076f | 48 | /** @return Maximum number of sectors */ |
9eeb02aa | 49 | UShort_t MaxSectors() const { return fMaxSectors; } |
c05d076f | 50 | /** @return Maximum number of strip */ |
9eeb02aa | 51 | UShort_t MaxStrips() const { return fMaxStrips; } |
c05d076f | 52 | /** Calculate, check, and return index for strip. If the index is |
53 | invalid, -1 is returned | |
54 | @param det Detector number | |
55 | @param ring Ring identifier | |
56 | @param sec Sector number | |
57 | @param str Strip number | |
58 | @return Unique index, or -1 in case of errors */ | |
9eeb02aa | 59 | Int_t CheckIndex(UShort_t det, Char_t ring, |
60 | UShort_t sec, UShort_t str) const; | |
c05d076f | 61 | /** Check if we need UShort_t hack |
62 | @param file File this object was read from */ | |
63 | void CheckNeedUShort(TFile* file); | |
64 | enum { | |
65 | /** In case of version 2 of this class, this bit should be set. */ | |
66 | kNeedUShort = 14 | |
67 | }; | |
9da38871 | 68 | protected: |
c05d076f | 69 | /** Calculate index and return |
70 | @param det Detector number | |
71 | @param ring Ring identifier | |
72 | @param sec Sector number | |
73 | @param str Strip number | |
74 | @return Index (not checked) */ | |
5664d15a | 75 | Int_t CalcIndex(UShort_t det, Char_t ring, |
c05d076f | 76 | UShort_t sec, UShort_t str) const; |
9eeb02aa | 77 | UShort_t fMaxDetectors; // Maximum # of detectors |
78 | UShort_t fMaxRings; // Maximum # of rings | |
79 | UShort_t fMaxSectors; // Maximum # of sectors | |
80 | UShort_t fMaxStrips; // Maximum # of strips | |
9da38871 | 81 | |
c05d076f | 82 | ClassDef(AliFMDMap, 3) // Cache of per strip information |
9da38871 | 83 | }; |
84 | ||
9da38871 | 85 | #endif |
86 | //____________________________________________________________________ | |
87 | // | |
88 | // Local Variables: | |
89 | // mode: C++ | |
90 | // End: | |
91 | // | |
92 | // EOF | |
93 | // | |
94 | ||
95 |