]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/AliCalorimeter.h
Now the new installation scripts are added to the CVS repository.
[u/mrichter/AliRoot.git] / RALICE / AliCalorimeter.h
1 #ifndef ALICALORIMETER_H
2 #define ALICALORIMETER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 // $Id$
7
8 #include <math.h>
9  
10 #include "TNamed.h"
11 #include "TObjArray.h"
12 #include "TH2.h"
13 #include "TString.h"
14
15 #include "AliDevice.h"
16 #include "AliObjMatrix.h"
17 #include "AliCalmodule.h"
18 #include "AliCalcluster.h"
19 #include "AliPositionObj.h"
20 #include "AliAttribObj.h"
21  
22 class AliCalorimeter : public AliDevice
23 {
24  public:
25   AliCalorimeter();                                      // Default constructor
26   AliCalorimeter(Int_t nrow,Int_t ncol);                 // Create a calorimeter matrix
27   virtual ~AliCalorimeter();                             // Destructor
28   AliCalorimeter(const AliCalorimeter& c);               // Copy constructor
29   virtual TObject* Clone(const char* name="") const;     // Make a deep copy and provide pointer of the copy
30   Int_t GetNrows();                                      // Return number of rows of the matrix
31   Int_t GetNcolumns();                                   // Return number of columns of the matrix
32   using AliDevice::SetSignal;
33   void SetSignal(Int_t row,Int_t col,Float_t s);         // Set signal for a certain module
34   using AliDevice::AddSignal;
35   void AddSignal(Int_t row,Int_t col,Float_t s);         // Add signal to a certain module
36   void AddSignal(AliCalmodule* m);                       // Add module signal to current calorimeter
37   void Reset(Int_t row,Int_t col);                       // Reset signal for a certain module
38   virtual void Reset(Int_t mode=0);                      // Reset the complete calorimeter
39   virtual Float_t GetSignal(Int_t row,Int_t col=0) { return GetSignal(row,col,0); }
40   Float_t GetSignal(Int_t row,Int_t col,Int_t mode);     // Provide signal of a certain module
41   Int_t GetNsignals() const;                             // Return number of modules with a signal
42   void Group(Int_t n=1,Int_t mode=1);                    // Group modules into clusters (n rings)
43   Int_t GetNclusters() const;                            // Return number of clusters
44   Float_t GetClusteredSignal(Int_t row,Int_t col);       // Provide module signal after clustering
45   AliCalcluster* GetCluster(Int_t j) const;              // Access to cluster number j
46   AliCalmodule* GetModule(Int_t j) const;                // Access to 'fired' module number j
47   AliCalmodule* GetModule(Int_t row,Int_t col);          // Access to module at (row,col)
48   using AliDevice::SetEdgeOn;
49   void SetEdgeOn(Int_t row,Int_t col);                   // Indicate module as 'edge module'
50   using AliDevice::SetEdgeOff;
51   void SetEdgeOff(Int_t row,Int_t col);                  // Indicate module as 'non-edge module'
52   using AliDevice::GetEdgeValue;
53   Int_t GetEdgeValue(Int_t row,Int_t col);               // Provide the edge flag of a module
54   using AliDevice::SetDead;
55   void SetDead(Int_t row,Int_t col);                     // Indicate module as 'dead module'
56   using AliDevice::SetAlive;
57   void SetAlive(Int_t row,Int_t col);                    // Indicate module as 'active module'
58   using AliDevice::GetDeadValue;
59   Int_t GetDeadValue(Int_t row,Int_t col);               // Provide the dead flag of a module
60   using AliDevice::SetGain;
61   void SetGain(Int_t row,Int_t col,Float_t g);           // Set the gain value for a module
62   using AliDevice::SetOffset;
63   void SetOffset(Int_t row,Int_t col,Float_t o);         // Set the offset value for a module
64   using AliDevice::GetGain;
65   Float_t GetGain(Int_t row,Int_t col);                  // Provide the gain value of a module
66   using AliDevice::GetGainFlag;
67   Int_t GetGainFlag(Int_t row,Int_t col);                // Provide the gain flag value of a module
68   using AliDevice::GetOffset;
69   Float_t GetOffset(Int_t row,Int_t col);                // Provide the offset value of a module
70   using AliDevice::GetOffsetFlag;
71   Int_t GetOffsetFlag(Int_t row,Int_t col);              // Provide the offset flag value of a module
72   using AliDevice::SetPosition;
73   void SetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Set module position
74   void SetPosition(Int_t row,Int_t col,Ali3Vector& r);   // Set module position
75   using AliDevice::GetPosition;
76   void GetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Return module position
77   AliPosition* GetPosition(Int_t row,Int_t col);         // Access to module position
78   TH2F* DrawModules(Float_t thresh=0.,Int_t mode=0);     // Lego plot of module (corr.) signals above threshold
79   TH2F* DrawClusters(Float_t thresh=0.);                 // Lego plot of cluster signals above threshold
80   void AddVetoSignal(AliSignal& s);                      // Associate (extrapolated) signal
81   void AddVetoSignal(AliSignal* s) { AddVetoSignal(*s); }
82   AliSignal* GetVetoSignal(Int_t j) const;               // Access to veto signal number j
83   Int_t GetNvetos() const;                               // Provide the number of veto signals
84   void SetMatrixSwapMode(Int_t swap=1);                  // Set the swapmode for the storage of the matrices
85   Int_t GetMatrixSwapMode() const;                       // Provide the swapmode for the storage of the matrices
86  
87  protected:
88   Int_t fNrows;                              // The number of rows
89   Int_t fNcolumns;                           // The number of columns
90   AliObjMatrix* fMatrix;                     //! Matrix lookup table of module pointers
91   Int_t fSwap;                               // The swapmode for the module and position matrices
92   void SortM();                              // Order the modules with decreasing signal (matrix search)
93   void SortA();                              // Order the modules with decreasing signal (fired array search)
94   TObjArray* fClusters;                      // The array of clusters
95   void AddRing(Int_t row,Int_t col,Int_t n); // add signals of n rings around cluster center
96   void Ungroup();                            // Restore module matrix as before clustering
97   TH2F* fHmodules;                           //! The module 2-D histogram for event display
98   TH2F* fHclusters;                          //! The cluster 2-D histogram for event display
99   TObjArray* fVetos;                         // The array of associated (extrapolated) veto signals
100   TObjArray* fAttributes;                    //! Matrix dbase with module attributes (e.g. gain, offset etc...)
101   AliObjMatrix* fPositions;                  //! Matrix dbase of module position pointers
102   void LoadMatrix();                         // Loading of matrix lookup table from the linear hit array
103  
104  ClassDef(AliCalorimeter,10) // Description of a modular calorimeter system.
105 };
106 #endif