]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDBoolMap.h
New method Invert() for changing alpha by pi (forbiden operation via Rotate())
[u/mrichter/AliRoot.git] / FMD / AliFMDBoolMap.h
CommitLineData
56b1929b 1#ifndef ALIFMDBOOLMAP_H
2#define ALIFMDBOOLMAP_H
3/* Copyright (c) 2004, ALICE Experiment @ CERN.
4 * All rights reserved
5 * See AliFMDBoolMap.cxx for full copyright notice
6 *
7 * Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
8 */
9/* $Id$ */
c2fc1258 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
14*/
56b1929b 15//__________________________________________________________
16//
17// Map of Bool_t for each FMD strip
088f8e79 18// Used in calibration and the like classes.
19// Used amoung other things for dead-channel map
56b1929b 20//
21#ifndef ALIFMDMAP_H
22# include <AliFMDMap.h>
23#endif
24
9f662337 25/** @class AliFMDBoolMap
26 @brief MAp of per strip boolean values.
27 @ingroup FMD_base
28 */
56b1929b 29class AliFMDBoolMap : public AliFMDMap
30{
31public:
9f662337 32 /** Copy constructor
33 @param other Object to copy from. */
56b1929b 34 AliFMDBoolMap(const AliFMDBoolMap& other);
021f1396 35 /**
36 * Constructor
37 */
38 AliFMDBoolMap();
9f662337 39 /** Constructor
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) */
021f1396 44 AliFMDBoolMap(UShort_t maxDet,
45 UShort_t maxRing = 0,
46 UShort_t maxSec = 0,
47 UShort_t maxStr = 0);
9f662337 48 /** Destructor */
021f1396 49 virtual ~AliFMDBoolMap() { if (fData) delete [] fData; }
9f662337 50 /** Assignment operator
51 @param other Object to assign from
52 @return reference to this object. */
56b1929b 53 AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
9f662337 54 /** Reset to value
55 @param v Value to reset from */
69b696b9 56 virtual void Reset(const Bool_t& v=Bool_t());
9f662337 57 /** Access operator
58 @param det Detector
59 @param ring Ring
60 @param sec Sector
61 @param str Strip
62 @return reference value stored for the strip */
56b1929b 63 virtual Bool_t& operator()(UShort_t det,
69b696b9 64 Char_t ring,
65 UShort_t sec,
66 UShort_t str);
9f662337 67 /** Access operator
68 @param det Detector
69 @param ring Ring
70 @param sec Sector
71 @param str Strip
72 @return value stored for the strip */
56b1929b 73 virtual const Bool_t& operator()(UShort_t det,
69b696b9 74 Char_t ring,
75 UShort_t sec,
76 UShort_t str) const;
75609cab 77 Bool_t* Data() const { return fData; }
78 Int_t Total() const { return fTotal; }
045a97a7 79 void* Ptr() const { return reinterpret_cast<void*>(fData); }
56b1929b 80protected:
021f1396 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); }
0ed9abeb 91 Int_t fTotal; // Total number of entries
bfdc7f5d 92 Bool_t* fData; // [fTotal] The Data
0ed9abeb 93 ClassDef(AliFMDBoolMap,3) // Map of Bool_t data per strip
56b1929b 94};
95
96#endif
97//__________________________________________________________
98//
99// Local Variables:
100// mode: C++
101// End:
102//