1 #ifndef ALIFMDUSHORTMAP_H
2 #define ALIFMDUSHORTMAP_H
3 /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
6 * See cxx source for full Copyright notice
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
13 // Map of an integer per strip
14 // This class stores one short unsigned integer (16 bits) per strip in
17 # include "AliFMDMap.h"
19 //____________________________________________________________________
20 /** @class AliFMDUShortMap
21 @brief Map of an integer per strip
24 class AliFMDUShortMap : public AliFMDMap
28 @param other Object to copy from. */
29 AliFMDUShortMap(const AliFMDUShortMap& other);
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);
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);
48 @param val Value to reset from */
49 virtual void Reset(const UShort_t& val=UShort_t());
51 @param detector Detector
55 @return reference value stored for the strip */
56 virtual UShort_t& operator()(UShort_t detector,
61 @param detector Detector
65 @return value stored for the strip */
66 virtual const UShort_t& operator()(UShort_t detector,
69 UShort_t strip) const;
71 * Get the raw data pointer.
73 * @return Pointer to the data
75 UShort_t* Data() const { return fData; }
77 * The total number of entries in the data array
79 * @return Total number of entries in the data array
81 Int_t Total() const { return fTotal; }
82 void* Ptr() const { return reinterpret_cast<void*>(fData); }
83 Int_t MaxIndex() const { return fTotal; }
85 UShort_t AtAsUShort(Int_t idx) const { return fData[idx]; }
86 UShort_t& AtAsUShort(Int_t idx) { return fData[idx]; }
87 Int_t AtAsInt(Int_t idx) const { return fData[idx]; }
88 Float_t AtAsFloat(Int_t idx) const { return fData[idx]; }
89 Bool_t AtAsBool(Int_t idx) const { return fData[idx]!=0?kTRUE:kFALSE; }
90 Int_t& AtAsInt(Int_t idx) { return AliFMDMap::AtAsInt(idx); }
91 Float_t& AtAsFloat(Int_t idx) { return AliFMDMap::AtAsFloat(idx); }
92 Bool_t& AtAsBool(Int_t idx) { return AliFMDMap::AtAsBool(idx); }
93 Bool_t IsUShort() const { return kTRUE; }
94 Int_t fTotal; // Total number of entries
95 UShort_t* fData; // [fTotal] The data
96 ClassDef(AliFMDUShortMap, 3) // Cache of edep,hit information per strip
100 //____________________________________________________________________