]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/AliCalorimeter.h
a494899295f9571b2c1e6ded8ecb990bb4a6393b
[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 <iostream.h>
9 #include <math.h>
10  
11 #include "TObject.h"
12 #include "TObjArray.h"
13 #include "TH2.h"
14 #include "TString.h"
15 #include "TMatrix.h"
16
17 #include "AliCalmodule.h"
18 #include "AliCalcluster.h"
19 #include "AliSignal.h"
20  
21 class AliCalorimeter : public TObject
22 {
23  public:
24   AliCalorimeter();                                // Default constructor
25   AliCalorimeter(Int_t nrow,Int_t ncol);           // Create a calorimeter matrix
26   ~AliCalorimeter();                               // Destructor
27   Int_t GetNrows();                                // Return number of rows of the matrix
28   Int_t GetNcolumns();                             // Return number of columns of the matrix
29   void SetSignal(Int_t row,Int_t col,Float_t s);   // Set signal for a certain module
30   void AddSignal(Int_t row,Int_t col,Float_t s);   // Add signal to a certain module
31   void AddSignal(AliCalmodule* m);                 // Add module signal to current calorimeter
32   void Reset(Int_t row,Int_t col);                 // Reset signal for a certain module
33   void Reset();                                    // Reset the complete calorimeter
34   Float_t GetSignal(Int_t row,Int_t col);          // Provide signal of a certain module
35   Int_t GetNsignals();                             // Return number of modules with a signal
36   void Group(Int_t n);                             // Group modules into clusters (n rings)
37   Int_t GetNclusters();                            // Return number of clusters
38   Float_t GetClusteredSignal(Int_t row,Int_t col); // Provide module signal after clustering
39   AliCalcluster* GetCluster(Int_t j);              // Access to cluster number j
40   AliCalmodule* GetModule(Int_t j);                // Access to 'fired' module number j
41   AliCalmodule* GetModule(Int_t row,Int_t col);    // Access to module at (row,col)
42   void SetEdgeOn(Int_t row,Int_t col);             // Indicate module as 'edge module'
43   void SetEdgeOff(Int_t row,Int_t col);            // Indicate module as 'non-edge module'
44   Int_t GetEdgeValue(Int_t row,Int_t col);         // Provide the edge flag of a module
45   void SetDead(Int_t row,Int_t col);               // Indicate module as 'dead module'
46   void SetAlive(Int_t row,Int_t col);              // Indicate module as 'active module'
47   Int_t GetDeadValue(Int_t row,Int_t col);         // Provide the dead flag of a module
48   void SetGain(Int_t row,Int_t col,Float_t g);     // Set the gain value for a module
49   Float_t GetGain(Int_t row,Int_t col);            // Provide the gain value of a module
50   void SetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Set module position
51   void SetPosition(Int_t row,Int_t col,Ali3Vector& r); // Set module position
52   void GetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Return module position
53   AliPosition* GetPosition(Int_t row,Int_t col);   // Access to module position
54   TH2F* DrawModules();                             // Draw lego plot of module signals
55   TH2F* DrawClusters();                            // Draw lego plot of cluster signals
56   void AddVetoSignal(Float_t* r,TString f,Float_t s=0); // Associate (extrapolated) signal
57   AliSignal* GetVetoSignal(Int_t j);               // Access to veto signal number j
58   Int_t GetNvetos();                               // Provide the number of veto signals
59  
60  protected:
61   Int_t fNrows;                              // The number of rows
62   Int_t fNcolumns;                           // The number of columns
63   Int_t fNsignals;                           // The number of modules with a signal
64   Int_t fNclusters;                          // The number of clusters
65   AliCalmodule ***fMatrix;                   //! The matrix of module pointers for internal use
66   void Sortm(AliCalmodule** a,Int_t& n);     // Order the modules with decreasing signal
67   TObjArray* fClusters;                      // The array of clusters
68   void AddRing(Int_t row,Int_t col,Int_t n); // add signals of n rings around cluster center
69   TObjArray* fModules;                       // The array of modules for output
70   void LoadMatrix();                         // Load calorimeter matrix data from input
71   void Ungroup();                            // Restore module matrix as before clustering
72   TH2F* fHmodules;                           //! The module 2-D histogram for event display
73   TH2F* fHclusters;                          //! The cluster 2-D histogram for event display
74   Int_t fNvetos;                             // The number of associated veto signals
75   TObjArray* fVetos;                         // The array of associated (extrapolated) veto signals
76   TMatrix* fAttributes;                      // Matrix with module attributes (dead+10*edge)
77   TMatrix* fGains;                           // Matrix with module gains
78   AliPosition ***fPositions;                 //! Matrix of module position pointers for internal use
79  
80  ClassDef(AliCalorimeter,1) // Description of a modular calorimeter system.
81 };
82 #endif