]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDUShortMap.h
Cleanup of collisions geometries and headers.
[u/mrichter/AliRoot.git] / FMD / AliFMDUShortMap.h
1 #ifndef ALIFMDUSHORTMAP_H
2 #define ALIFMDUSHORTMAP_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 /** @file    AliFMDUShortMap.h
9     @author  Christian Holm Christensen <cholm@nbi.dk>
10     @date    Mon Mar 27 12:48:18 2006
11     @brief   Per strip of unisgned shorts (16 bit) data 
12 */
13 // Map of an integer per strip
14 // This class stores one short unsigned integer (16 bits) per strip in
15 // the FMD detectors. 
16 #ifndef ALIFMDMAP_H
17 # include "AliFMDMap.h"
18 #endif 
19 //____________________________________________________________________
20 /** @class AliFMDUShortMap 
21     @brief Map of an integer per strip
22     @ingroup FMD_base
23  */
24 class AliFMDUShortMap : public AliFMDMap
25 {
26 public:
27   /** Copy constructor 
28       @param other Object to copy from.  */
29   AliFMDUShortMap(const AliFMDUShortMap& other);
30   /** Constructor */
31   AliFMDUShortMap();
32   /** Constructor 
33       @param maxDet  Number of detectors (3)
34       @param maxRing Number of rings (2)
35       @param maxSec  Number of sectors (40)
36       @param maxStr  Number of strips (20) */
37   AliFMDUShortMap(UShort_t maxDet,
38                   UShort_t maxRing= kMaxRings, 
39                   UShort_t maxSec = kMaxSectors, 
40                   UShort_t maxStr = kMaxStrips);
41   /** Destructor */
42   virtual ~AliFMDUShortMap() { delete [] fData; }
43   /** Assignment operator 
44       @param other Object to assign from 
45       @return reference to this object.  */
46   AliFMDUShortMap& operator=(const AliFMDUShortMap& other);
47   /** Reset to value 
48       @param val Value to reset from */
49   virtual void Reset(const UShort_t& val=UShort_t());
50   /** Access operator 
51       @param detector Detector 
52       @param ring     Ring 
53       @param sector   Sector  
54       @param strip    Strip
55       @return  reference value stored for the strip */
56   virtual UShort_t& operator()(UShort_t detector, 
57                                Char_t   ring, 
58                                UShort_t sector, 
59                                UShort_t strip);
60   /** Access operator 
61       @param detector Detector 
62       @param ring     Ring 
63       @param sector   Sector  
64       @param strip    Strip
65       @return  value stored for the strip */
66   virtual const UShort_t& operator()(UShort_t detector, 
67                                      Char_t   ring, 
68                                      UShort_t sector, 
69                                      UShort_t strip) const;
70  protected:
71   Int_t     MaxIndex()            const { return fTotal; }
72   UShort_t  AtAsUShort(Int_t idx) const { return fData[idx]; }
73   UShort_t& AtAsUShort(Int_t idx)       { return fData[idx]; }
74   Int_t     AtAsInt(Int_t idx)    const { return fData[idx]; }
75   Float_t   AtAsFloat(Int_t idx)  const { return fData[idx]; }
76   Bool_t    AtAsBool(Int_t idx)   const { return fData[idx]!=0?kTRUE:kFALSE; }
77   Int_t&    AtAsInt(Int_t idx)          { return AliFMDMap::AtAsInt(idx);    }
78   Float_t&  AtAsFloat(Int_t idx)        { return AliFMDMap::AtAsFloat(idx);  }
79   Bool_t&   AtAsBool(Int_t idx)         { return AliFMDMap::AtAsBool(idx); }
80   Bool_t    IsUShort()            const { return kTRUE; }  
81   Int_t     fTotal; // Total number of entries 
82   UShort_t* fData;  // [fTotal] The data 
83   ClassDef(AliFMDUShortMap, 3) // Cache of edep,hit information per strip
84 };
85
86 #endif 
87 //____________________________________________________________________
88 //
89 // Local Variables:
90 //   mode: C++
91 // End:
92 //
93 // EOF
94 //
95
96