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