1 #ifndef ALIFMDBOOLMAP_H
2 #define ALIFMDBOOLMAP_H
3 /* Copyright (c) 2004, ALICE Experiment @ CERN.
5 * See AliFMDBoolMap.cxx for full copyright notice
7 * Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
10 /** @file AliFMDBoolMap.h
11 @author Christian Holm Christensen <cholm@nbi.dk>
12 @date Sun Mar 26 18:28:59 2006
13 @brief Per strip boolean map
15 //__________________________________________________________
17 // Map of Bool_t for each FMD strip
18 // Used in calibration and the like classes.
19 // Used amoung other things for dead-channel map
22 # include <AliFMDMap.h>
25 /** @class AliFMDBoolMap
26 @brief MAp of per strip boolean values.
29 class AliFMDBoolMap : public AliFMDMap
33 @param other Object to copy from. */
34 AliFMDBoolMap(const AliFMDBoolMap& other);
40 @param maxDet Number of detectors (3)
41 @param maxRing Number of rings (2)
42 @param maxSec Number of sectors (40)
43 @param maxStr Number of strips (20) */
44 AliFMDBoolMap(UShort_t maxDet,
49 virtual ~AliFMDBoolMap() { if (fData) delete [] fData; }
50 /** Assignment operator
51 @param other Object to assign from
52 @return reference to this object. */
53 AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
55 @param v Value to reset from */
56 virtual void Reset(const Bool_t& v=Bool_t());
62 @return reference value stored for the strip */
63 virtual Bool_t& operator()(UShort_t det,
72 @return value stored for the strip */
73 virtual const Bool_t& operator()(UShort_t det,
77 Bool_t* Data() const { return fData; }
78 Int_t Total() const { return fTotal; }
79 void* Ptr() const { return reinterpret_cast<void*>(fData); }
81 Int_t MaxIndex() const { return fTotal; }
82 Bool_t AtAsBool(Int_t idx) const { return fData[idx]; }
83 Bool_t& AtAsBool(Int_t idx) { return fData[idx]; }
84 Bool_t IsBool() const { return kTRUE; }
85 Int_t AtAsInt(Int_t idx) const { return fData[idx] ? 1 : 0; }
86 Float_t AtAsFloat(Int_t idx) const { return fData[idx] ? 1.F : 0.F; }
87 UShort_t AtAsUShort(Int_t idx) const { return fData[idx] ? 1 : 0; }
88 Int_t& AtAsInt(Int_t idx) { return AliFMDMap::AtAsInt(idx); }
89 Float_t& AtAsFloat(Int_t idx) { return AliFMDMap::AtAsFloat(idx); }
90 UShort_t& AtAsUShort(Int_t idx) { return AliFMDMap::AtAsUShort(idx); }
91 Int_t fTotal; // Total number of entries
92 Bool_t* fData; // [fTotal] The Data
93 ClassDef(AliFMDBoolMap,3) // Map of Bool_t data per strip
97 //__________________________________________________________