AliRoot Core  edcc906 (edcc906)
AliFMDBoolMap.h
Go to the documentation of this file.
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$ */
15 //__________________________________________________________
16 //
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
20 //
21 #ifndef ALIFMDMAP_H
22 # include <AliFMDMap.h>
23 #endif
24 
29 class AliFMDBoolMap : public AliFMDMap
30 {
31 public:
34  AliFMDBoolMap(const AliFMDBoolMap& other);
38  AliFMDBoolMap();
44  AliFMDBoolMap(UShort_t maxDet,
45  UShort_t maxRing = 0,
46  UShort_t maxSec = 0,
47  UShort_t maxStr = 0);
49  virtual ~AliFMDBoolMap() { if (fData) delete [] fData; }
53  AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
56  virtual void Reset(const Bool_t& v=Bool_t());
63  virtual Bool_t& operator()(UShort_t det,
64  Char_t ring,
65  UShort_t sec,
66  UShort_t str);
73  virtual const Bool_t& operator()(UShort_t det,
74  Char_t ring,
75  UShort_t sec,
76  UShort_t str) const;
77  Bool_t* Data() const { return fData; }
78  Int_t Total() const { return fTotal; }
79  void* Ptr() const { return reinterpret_cast<void*>(fData); }
80 protected:
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
94 };
95 
96 #endif
97 //__________________________________________________________
98 //
99 // Local Variables:
100 // mode: C++
101 // End:
102 //
Bool_t * Data() const
Definition: AliFMDBoolMap.h:77
Int_t MaxIndex() const
Definition: AliFMDBoolMap.h:81
UShort_t & AtAsUShort(Int_t idx)
Definition: AliFMDBoolMap.h:90
Bool_t & AtAsBool(Int_t idx)
Definition: AliFMDBoolMap.h:83
virtual Int_t AtAsInt(Int_t idx) const
Definition: AliFMDMap.h:558
UShort_t AtAsUShort(Int_t idx) const
Definition: AliFMDBoolMap.h:87
virtual Float_t AtAsFloat(Int_t idx) const
Definition: AliFMDMap.h:547
Bool_t IsBool() const
Definition: AliFMDBoolMap.h:84
Int_t Total() const
Definition: AliFMDBoolMap.h:78
void * Ptr() const
Definition: AliFMDBoolMap.h:79
Base class for caches of per-strip information.This is used to index a strip. Data stored depends on ...
Definition: AliFMDMap.h:19
MAp of per strip boolean values.
Definition: AliFMDBoolMap.h:29
Int_t AtAsInt(Int_t idx) const
Definition: AliFMDBoolMap.h:85
Float_t & AtAsFloat(Int_t idx)
Definition: AliFMDBoolMap.h:89
Bool_t * fData
Definition: AliFMDBoolMap.h:92
virtual Bool_t & operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
Int_t & AtAsInt(Int_t idx)
Definition: AliFMDBoolMap.h:88
Float_t AtAsFloat(Int_t idx) const
Definition: AliFMDBoolMap.h:86
virtual ~AliFMDBoolMap()
Definition: AliFMDBoolMap.h:49
virtual UShort_t AtAsUShort(Int_t idx) const
Definition: AliFMDMap.h:569
AliFMDBoolMap & operator=(const AliFMDBoolMap &other)
virtual void Reset(const Bool_t &v=Bool_t())
Bool_t AtAsBool(Int_t idx) const
Definition: AliFMDBoolMap.h:82