]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveITSScaledModule.h
Using the new altro raw-data format. Removing some obsolete macros.
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveITSScaledModule.h
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #ifndef AliEveITSScaledModule_H
11 #define AliEveITSScaledModule_H
12
13 #include <TEveUtil.h>
14 #include <EveDet/AliEveITSModule.h>
15
16 #include <TQObject.h>
17
18
19 /******************************************************************************/
20 // AliEveDigitScaleInfo
21 /******************************************************************************/
22
23 class AliEveDigitScaleInfo : public TQObject, public TEveRefBackPtr
24 {
25 public:
26   enum StatType_e { kSTOccup, kSTAverage, kSTRms };
27
28   AliEveDigitScaleInfo();
29   virtual ~AliEveDigitScaleInfo() {}
30
31   Int_t  GetScale() const { return fScale; }
32   void   ScaleChanged(Int_t s);
33
34   Int_t  GetStatType() const { return fStatType; }
35   void   StatTypeChanged(Int_t t);
36
37   Bool_t GetSyncPalette() const   { return fSyncPalette; }
38   void   SetSyncPalette(Bool_t x) { fSyncPalette = x; }
39
40 protected:
41   Int_t            fScale;        // Current scale.
42   Int_t            fStatType;     // Digit scaling algorithm, see StatType_e.
43
44   Bool_t           fSyncPalette;  // Synchronize palette on next usage.
45
46 private:
47   AliEveDigitScaleInfo(const AliEveDigitScaleInfo&);            // Not implemented
48   AliEveDigitScaleInfo& operator=(const AliEveDigitScaleInfo&); // Not implemented
49
50   ClassDef(AliEveDigitScaleInfo, 0);
51 };
52
53 /******************************************************************************/
54 // ScaledDigit
55 /******************************************************************************/
56
57 /******************************************************************************/
58 // AliEveITSScaledModule
59 /******************************************************************************/
60
61 class AliEveITSScaledModule : public AliEveITSModule
62 {
63   friend class ITSSDSubEditor;
64
65 public:
66   AliEveITSScaledModule(Int_t gid, AliEveITSDigitsInfo* info, AliEveDigitScaleInfo* si );
67   virtual ~AliEveITSScaledModule();
68
69   virtual void DigitSelected(Int_t idx);
70
71   virtual void LoadQuads();
72   void         SetQuadValues();
73
74   void         SyncPalette();
75
76   void         GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total) const;
77   AliEveDigitScaleInfo*  GetScaleInfo() { return fScaleInfo; }
78
79
80   // --- Inner structs
81
82   struct ScaledDigit_t : public TObject
83   {
84   public:
85     Int_t   fN;
86     Float_t fSum;
87     Float_t fSqrSum;
88     Int_t   fMinI, fMinJ;
89     Int_t   fMaxI, fMaxJ;
90
91     ScaledDigit_t();
92     ScaledDigit_t(Int_t di, Int_t dj);
93
94     void Dump() const;
95   };
96
97 protected:
98   Int_t       fNx;   // per module
99   Int_t       fNz;
100
101   Int_t       fNCx;  // per cell
102   Int_t       fNCz;
103
104   AliEveDigitScaleInfo* fScaleInfo;
105
106 private:
107   std::map<Int_t, ScaledDigit_t> fDigitsMap;
108
109   AliEveITSScaledModule(const AliEveITSScaledModule&);            // Not implemented
110   AliEveITSScaledModule& operator=(const AliEveITSScaledModule&); // Not implemented
111
112   ClassDef(AliEveITSScaledModule, 0); // Visualization of an ITS module with digits aggregated on a grid of pre-defined size.
113 };
114
115 #endif