AliRoot Core  edcc906 (edcc906)
AliFMDFloatMap.h
Go to the documentation of this file.
1 #ifndef ALIFMDFLOATMAP_H
2 #define ALIFMDFLOATMAP_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 #ifndef ALIFMDMAP_H
9 # include "AliFMDMap.h"
10 #endif
11 //____________________________________________________________________
12 //
13 // Array of floats indexed by strip identifier.
14 // the floats are indexed by the coordinates
15 // DETECTOR # (1-3)
16 // RING ID ('I' or 'O', any case)
17 // SECTOR # (0-39)
18 // STRIP # (0-511)
19 //
20 class AliFMDFloatMap : public AliFMDMap
21 {
22 public:
24  AliFMDFloatMap(Int_t maxDet,
25  Int_t maxRing= 0,
26  Int_t maxSec = 0,
27  Int_t maxStr = 0);
28  AliFMDFloatMap(const AliFMDMap& o);
30  virtual ~AliFMDFloatMap() { delete [] fData;fData = 0; }
32  virtual void Reset(const Float_t& v=Float_t());
33  virtual Float_t& operator()(UShort_t det,
34  Char_t ring,
35  UShort_t sec,
36  UShort_t str);
37  virtual const Float_t& operator()(UShort_t det,
38  Char_t ring,
39  UShort_t sec,
40  UShort_t str) const;
41  Float_t* Data() const { return fData; }
42  void Print(Option_t* option="%8.4f") const { AliFMDMap::Print(option); }
43  void* Ptr() const { return reinterpret_cast<void*>(fData); }
44 protected:
45  Int_t MaxIndex() const { return fTotal; }
46  Float_t AtAsFloat(Int_t i) const { return fData[i]; }
47  Float_t& AtAsFloat(Int_t i) { return fData[i]; }
48  Bool_t IsFloat() const { return kTRUE; }
49 
50  Int_t fTotal; // Total number of entries
51  Float_t* fData; //[fTotal]
52  ClassDef(AliFMDFloatMap,3) // Map of floats
53 };
54 
55 inline AliFMDFloatMap
56 operator*(const AliFMDMap& lhs, const AliFMDMap& rhs)
57 {
58  AliFMDFloatMap r(lhs);
59  r *= rhs;
60  return r;
61 }
62 inline AliFMDFloatMap
63 operator/(const AliFMDMap& lhs, const AliFMDMap& rhs)
64 {
65  AliFMDFloatMap r(lhs);
66  r /= rhs;
67  return r;
68 }
69 inline AliFMDFloatMap
70 operator+(const AliFMDMap& lhs, const AliFMDMap& rhs)
71 {
72  AliFMDFloatMap r(lhs);
73  r += rhs;
74  return r;
75 }
76 inline AliFMDFloatMap
77 operator-(const AliFMDMap& lhs, const AliFMDMap& rhs)
78 {
79  AliFMDFloatMap r(lhs);
80  r -= rhs;
81  return r;
82 }
83 
84 #endif
85 //____________________________________________________________________
86 //
87 // Local Variables:
88 // mode: C++
89 // End:
90 //
91 
AliFMDFloatMap operator*(const AliFMDMap &lhs, const AliFMDMap &rhs)
virtual ~AliFMDFloatMap()
Float_t * Data() const
virtual void Print(Option_t *option="") const
Definition: AliFMDMap.cxx:362
void Print(Option_t *option="%8.4f") const
Base class for caches of per-strip information.This is used to index a strip. Data stored depends on ...
Definition: AliFMDMap.h:19
Int_t MaxIndex() const
virtual Float_t & operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str)
AliFMDFloatMap operator-(const AliFMDMap &lhs, const AliFMDMap &rhs)
Float_t AtAsFloat(Int_t i) const
Float_t & AtAsFloat(Int_t i)
virtual void Reset(const Float_t &v=Float_t())
AliFMDFloatMap operator/(const AliFMDMap &lhs, const AliFMDMap &rhs)
AliFMDFloatMap operator+(const AliFMDMap &lhs, const AliFMDMap &rhs)
Bool_t IsFloat() const
Float_t * fData
AliFMDFloatMap & operator=(const AliFMDFloatMap &o)
void * Ptr() const