NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcCalorimeter.h
Go to the documentation of this file.
1#ifndef NcCalorimeter_h
2#define NcCalorimeter_h
3// Copyright(c) 1997 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include <math.h>
7
8#include "TNamed.h"
9#include "TObjArray.h"
10#include "TH2.h"
11#include "TString.h"
12
13#include "NcDevice.h"
14#include "NcObjMatrix.h"
15#include "NcCalmodule.h"
16#include "NcCalcluster.h"
17#include "NcPositionObj.h"
18#include "NcAttribObj.h"
19
21
22class NcCalorimeter : public NcDevice
23{
24 public:
25 NcCalorimeter(); // Default constructor
26 NcCalorimeter(Int_t nrow,Int_t ncol); // Create a calorimeter matrix
27 virtual ~NcCalorimeter(); // Destructor
28 NcCalorimeter(const NcCalorimeter& 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
33 void SetSignal(Int_t row,Int_t col,Float_t s); // Set signal for a certain module
35 void AddSignal(Int_t row,Int_t col,Float_t s); // Add signal to a certain module
36 void AddSignal(NcCalmodule* 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
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
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
45 Float_t GetClusteredSignal(Int_t row,Int_t col); // Provide module signal after clustering
46 NcCalcluster* GetCluster(Int_t j) const; // Access to cluster number j
47 NcCalmodule* GetModule(Int_t j) const; // Access to 'fired' module number j
48 NcCalmodule* GetModule(Int_t row,Int_t col); // Access to module at (row,col)
50 void SetEdgeOn(Int_t row,Int_t col); // Indicate module as 'edge module'
52 void SetEdgeOff(Int_t row,Int_t col); // Indicate module as 'non-edge module'
54 Int_t GetEdgeValue(Int_t row,Int_t col); // Provide the edge flag of a module
56 void SetDead(Int_t row,Int_t col); // Indicate module as 'dead module'
58 void SetAlive(Int_t row,Int_t col); // Indicate module as 'active module'
60 Int_t GetDeadValue(Int_t row,Int_t col); // Provide the dead flag of a module
62 void SetGain(Int_t row,Int_t col,Float_t g); // Set the gain value for a module
64 void SetOffset(Int_t row,Int_t col,Float_t o); // Set the offset value for a module
66 Float_t GetGain(Int_t row,Int_t col); // Provide the gain value of a module
68 Int_t GetGainFlag(Int_t row,Int_t col); // Provide the gain flag value of a module
70 Float_t GetOffset(Int_t row,Int_t col); // Provide the offset value of a module
72 Int_t GetOffsetFlag(Int_t row,Int_t col); // Provide the offset flag value of a module
74 void SetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Set module position
75 void SetPosition(Int_t row,Int_t col,Nc3Vector& r); // Set module position
77 void GetPosition(Int_t row,Int_t col,Float_t* r,TString f); // Return module position
78 NcPosition* GetPosition(Int_t row,Int_t col); // Access to module position
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(NcSignal& s); // Associate (extrapolated) signal
83 NcSignal* GetVetoSignal(Int_t j) const; // Access to veto signal number j
84 Int_t GetNvetos() const; // Provide the number of veto signals
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
87
88 protected:
89 Int_t fNrows; // The number of rows
90 Int_t fNcolumns; // The number of columns
92 Int_t fSwap; // The swapmode for the module and position matrices
93 void SortM(); // Order the modules with decreasing signal (matrix search)
94 void SortA(); // Order the modules with decreasing signal (fired array search)
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
97 void Ungroup(); // Restore module matrix as before clustering
98 TH2F* fHmodules;
99 TH2F* fHclusters;
100 TObjArray* fVetos; // The array of associated (extrapolated) veto signals
101 TObjArray* fAttributes;
103 void LoadMatrix(); // Loading of matrix lookup table from the linear hit array
104
105 ClassDef(NcCalorimeter,1) // Description of a modular calorimeter system.
106};
107#endif
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
Float_t GetGain(Int_t j=1) const
Definition NcAttrib.cxx:576
void SetAlive(Int_t j=1)
Definition NcAttrib.cxx:946
void SetEdgeOn(Int_t j=1)
Int_t GetGainFlag(Int_t j=1) const
Definition NcAttrib.cxx:417
Int_t GetDeadValue(Int_t j=1) const
void SetOffset(Double_t off, Int_t j=1)
Definition NcAttrib.cxx:322
Float_t GetOffset(Int_t j=1) const
Definition NcAttrib.cxx:624
void SetEdgeOff(Int_t j=1)
Int_t GetOffsetFlag(Int_t j=1) const
Definition NcAttrib.cxx:473
void SetGain(Double_t gain, Int_t j=1)
Definition NcAttrib.cxx:267
void SetDead(Int_t j=1)
Definition NcAttrib.cxx:886
Int_t GetEdgeValue(Int_t j=1) const
Description of a cluster of calorimeter modules.
Description of a module in a calorimeter system.
Definition NcCalmodule.h:11
void SetAlive(Int_t row, Int_t col)
void AddVetoSignal(NcSignal *s)
TH2F * fHmodules
! The module 2-D histogram for event display
virtual ~NcCalorimeter()
void SetDead(Int_t row, Int_t col)
TH2F * fHclusters
! The cluster 2-D histogram for event display
Int_t GetNvetos() const
Float_t GetGain(Int_t row, Int_t col)
void SetEdgeOn(Int_t row, Int_t col)
void SetSignal(Int_t row, Int_t col, Float_t s)
void SetEdgeOff(Int_t row, Int_t col)
NcCalcluster * GetCluster(Int_t j) const
TH2F * DrawClusters(Float_t thresh=0.)
Int_t GetNclusters() const
Float_t GetClusteredSignal(Int_t row, Int_t col)
void SetMatrixSwapMode(Int_t swap=1)
TObjArray * fVetos
Float_t GetOffset(Int_t row, Int_t col)
void SetOffset(Int_t row, Int_t col, Float_t o)
Int_t GetNsignals() const
TH2F * DrawModules(Float_t thresh=0., Int_t mode=0)
TObjArray * fAttributes
! Matrix dbase with module attributes (e.g. gain, offset etc...)
TObjArray * fClusters
Int_t GetGainFlag(Int_t row, Int_t col)
NcCalmodule * GetModule(Int_t j) const
void SetGain(Int_t row, Int_t col, Float_t g)
void SetPosition(Int_t row, Int_t col, Float_t *r, TString f)
void AddVetoSignal(NcSignal &s)
Int_t GetOffsetFlag(Int_t row, Int_t col)
Int_t GetMatrixSwapMode() const
virtual Float_t GetSignal(Int_t row, Int_t col=0)
Int_t GetEdgeValue(Int_t row, Int_t col)
void AddSignal(Int_t row, Int_t col, Float_t s)
virtual TObject * Clone(const char *name="") const
void Group(Int_t n=1, Int_t mode=1)
NcObjMatrix * fPositions
! Matrix dbase of module position pointers
NcSignal * GetVetoSignal(Int_t j) const
void AddRing(Int_t row, Int_t col, Int_t n)
Int_t GetDeadValue(Int_t row, Int_t col)
NcObjMatrix * fMatrix
! Matrix lookup table of module pointers
void Reset(Int_t row, Int_t col)
NcDevice(const char *name="", const char *title="")
Definition NcDevice.cxx:109
Handling of a matrix structure of objects.
Definition NcObjMatrix.h:13
Handling of positions (with timestamps) in various reference frames.
Definition NcPosition.h:18
void GetPosition(Double_t *r, TString f, TString u="rad", Float_t s=-1) const
NcPosition & GetPosition()
void SetPosition(Double_t *r, TString f, TString u="rad")
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
virtual void SetSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:516
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Definition NcSignal.cxx:651
NcSignal(const char *name="", const char *title="")
Definition NcSignal.cxx:155
virtual void AddSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:583