]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/AliCalorimeter.h
c1d232e1dd61631efbb7cd93d61d2bacb004cd49
[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 "TObject.h"
11 #include "TObjArray.h"
12 #include "TH2.h"
13 #include "TString.h"
14 #include "TMatrix.h"
15
16 #include "AliCalmodule.h"
17 #include "AliCalcluster.h"
18 #include "AliSignal.h"
19  
20 class AliCalorimeter : public TObject
21 {
22  public:
23   AliCalorimeter();                                // Default constructor
24   AliCalorimeter(Int_t nrow,Int_t ncol);           // Create a calorimeter matrix
25   virtual ~AliCalorimeter();                       // Destructor
26   AliCalorimeter(AliCalorimeter& c);               // Copy constructor
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(Int_t mode=0);                        // 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(AliSignal& s);                // Associate (extrapolated) signal
57   void AddVetoSignal(AliSignal* s) { AddVetoSignal(*s); }
58   AliSignal* GetVetoSignal(Int_t j);               // Access to veto signal number j
59   Int_t GetNvetos();                               // Provide the number of veto signals
60   void SetName(TString name);                      // Set the name of the calorimeter system
61   TString GetName();                               // Provide the name of the calorimeter system
62  
63  protected:
64   Int_t fNrows;                              // The number of rows
65   Int_t fNcolumns;                           // The number of columns
66   Int_t fNsignals;                           // The number of modules with a signal
67   Int_t fNclusters;                          // The number of clusters
68   AliCalmodule ***fMatrix;                   //! The matrix of module pointers for internal use
69   void Sortm(AliCalmodule** a,Int_t& n);     // Order the modules with decreasing signal
70   TObjArray* fClusters;                      // The array of clusters
71   void AddRing(Int_t row,Int_t col,Int_t n); // add signals of n rings around cluster center
72   TObjArray* fModules;                       // The array of modules for output
73   void LoadMatrix();                         // Load calorimeter matrix data from input
74   void Ungroup();                            // Restore module matrix as before clustering
75   TH2F* fHmodules;                           //! The module 2-D histogram for event display
76   TH2F* fHclusters;                          //! The cluster 2-D histogram for event display
77   Int_t fNvetos;                             // The number of associated veto signals
78   TObjArray* fVetos;                         // The array of associated (extrapolated) veto signals
79   TMatrix* fAttributes;                      // Matrix with module attributes (dead+10*edge)
80   TMatrix* fGains;                           // Matrix with module gains
81   AliPosition ***fPositions;                 //! Matrix of module position pointers for internal use
82   TString fName;                             // Name of the calorimeter system
83  
84  ClassDef(AliCalorimeter,3) // Description of a modular calorimeter system.
85 };
86 #endif