NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcAttrib.h
Go to the documentation of this file.
1#ifndef NcAttrib_h
2#define NcAttrib_h
3// Copyright(c) 2003 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include "TArrayF.h"
7#include "TArrayI.h"
8#include "TObjArray.h"
9#include "TObjString.h"
10#include "TString.h"
11#include "TF1.h"
12
14
16{
17 public:
18 NcAttrib(); // Default constructor
19 virtual ~NcAttrib(); // Destructor
20 NcAttrib(const NcAttrib& a); // Copy constructor
21 Int_t GetNgains() const; // Provide the number of specified gains
22 Int_t GetNoffsets() const; // Provide the number of specified offsets
23 Int_t GetNcalflags() const; // Provide the number of specified calib. flags
24 Int_t GetNnames() const; // Provide the maximum number of specified names
25 void SetGain(Double_t gain,Int_t j=1); // Set gain of the j-th attribute slot
26 void SetGain(Double_t gain,TString name); // Set gain of the name-specified attribute slot
27 Float_t GetGain(Int_t j=1) const; // Provide gain of the j-th attribute slot
28 Float_t GetGain(TString name) const; // Provide gain of the name-specified attribute slot
29 void SetOffset(Double_t off,Int_t j=1); // Set offset value of the j-th attribute slot
30 void SetOffset(Double_t off,TString name); // Set offset value of the name specified attribute slot
31 Float_t GetOffset(Int_t j=1) const; // Provide offset value of the j-th attribute slot
32 Float_t GetOffset(TString name) const; // Provide offset value of the name-specified attribute slot
33 Int_t GetGainFlag(Int_t j=1) const; // Provide gain flag of the j-th attribute slot
34 Int_t GetGainFlag(TString name) const; // Provide gain flag of the name-specified attribute slot
35 Int_t GetOffsetFlag(Int_t j=1) const; // Provide offset flag of the j-th attribute slot
36 Int_t GetOffsetFlag(TString name) const; // Provide offset flag of the name-specified attribute slot
37 Int_t GetCalWord(Int_t j=1) const; // Provide calib. word of the j-th attribute slot
38 Int_t GetCalWord(TString name) const; // Provide calib word of the name-specified attribute slot
39 void ResetGain(Int_t j=1); // Reset j-th gain value and flag
40 void ResetGain(TString name); // Reset name-specified gain value and flag
41 void ResetOffset(Int_t j=1); // Reset j-th offset value and flag
42 void ResetOffset(TString name); // Reset name-specified offset value and flag
43 void DeleteCalibrations(Int_t mode=0); // User selected delete of gains and/or offsets
44 void SetDead(Int_t j=1); // Indicate j-th attribute slot as 'dead'
45 void SetDead(TString name); // Indicate name-specified attribute slot as 'dead'
46 void SetAlive(Int_t j=1); // Indicate j-th attribute slot as 'active'
47 void SetAlive(TString name); // Indicate name-specified attribute slot as 'active'
48 Int_t GetDeadValue(Int_t j=1) const; // Return the 'dead flag' of the j-th attribute slot
49 Int_t GetDeadValue(TString name) const; // Return the 'dead flag' of the name-specified attribute slot
50 void Lock(Int_t j=1); // Indicate j-th attribute slot as 'locked'
51 void Lock(TString name); // Indicate name-specified attribute slot as 'locked'
52 void Unlock(Int_t j=1); // Indicate j-th attribute slot as 'unlocked'
53 void Unlock(TString name); // Indicate name-specified attribute slot as 'unlocked'
54 Int_t GetLockValue(Int_t j=1) const; // Return the 'lock flag' of the j-th attribute slot
55 Int_t GetLockValue(TString name) const; // Return the 'lock flag' of the name-specified attribute slot
56 void SetEdgeOn(Int_t j=1); // Indicate j-th slot as 'detector edge module'
57 void SetEdgeOn(TString name); // Indicate name-spcified slot as 'detector edge module'
58 void SetEdgeOff(Int_t j=1); // Indicate j-th slot as 'detector non-edge module'
59 void SetEdgeOff(TString name); // Indicate name-specified slot as 'detector non-edge module'
60 void IncreaseEdgeValue(Int_t j=1); // Increase the edge value of the j-th slot by 1
61 void IncreaseEdgeValue(TString name); // Increase the edge value of the name-specified slot by 1
62 void DecreaseEdgeValue(Int_t j=1); // Decrease the edge value of the j-th slot by 1
63 void DecreaseEdgeValue(TString name); // Decrease the edge value of the name-specified slot by 1
64 void SetEdgeValue(Int_t val,Int_t j=1); // Set a specific edge value for the j-th slot
65 void SetEdgeValue(Int_t val,TString name); // Set a specific edge value for the name-specified slot
66 Int_t GetEdgeValue(Int_t j=1) const; // Provide the edge value of the j-th slot
67 Int_t GetEdgeValue(TString name) const; // Provide the edge value of the name-specified slot
68 virtual void List(Int_t j=0) const; // Printout of attribute data
69 virtual void List(TString name) const; // Printout of name-specified attribute data
70 virtual void Load(NcAttrib& a,Int_t j=0); // Load j-th slot or all attributes of the input NcAttrib
71 virtual void Load(NcAttrib& a,TString name);// Load name-specified slot attributes of the input NcAttrib
72 void AddNamedSlot(TString s); // Add a new slot with the specified name
73 virtual Int_t GetNslots() const; // Provide the number of exising slots
74 void SetSlotName(TString s,Int_t j=1); // Set user defined name for the j-th slot
75 TString GetSlotName(Int_t j=1) const; // Provide user defined name for the j-th slot
76 Int_t GetSlotIndex(TString name,Int_t opt=0) const; // Provide the slot index of the matching name
77 void SetCalFunction(TF1* f,Int_t j=1); // Set calibration function of the j-th attribute slot
78 void SetCalFunction(TF1* f,TString name); // Set calibration function of the name-specified attribute slot
79 void SetDecalFunction(TF1* f,Int_t j=1); // Set de-calibration function of the j-th attribute slot
80 void SetDecalFunction(TF1* f,TString name); // Set de-calibration function of the name-specified attribute slot
81 TF1* GetCalFunction(Int_t j=1) const; // Get calibration function of the j-th attribute slot
82 TF1* GetCalFunction(TString name) const; // Get calibration function of the name-specified attribute slot
83 TF1* GetDecalFunction(Int_t j=1) const; // Get de-calibration function of the j-th attribute slot
84 TF1* GetDecalFunction(TString name) const; // Get de-calibration function of the name-specified attribute slot
85 Int_t GetNcalfuncs() const; // Provide the number of calibration functions
86 Int_t GetNdecalfuncs() const; // Provide the number of de-calibration functions
87
88 protected:
89 void SetCalFlags(Int_t gf,Int_t of,Int_t j); // Set flags for gain and/or offset settings
90 TArrayF* fGains; // Gain values
91 TArrayF* fOffsets; // Offset values
92 TArrayI* fCalflags; // Flags to mark dead, edge, and gain/offset calibrated signals
93 TObjArray* fNames; // User defined names for the various slots
94 TObjArray* fCalfuncs; // Explicit signal calibration functions
95 TObjArray* fDecalfuncs; // Explicit signal de-calibration functions
96
97 ClassDef(NcAttrib,2) // Generic handling of detector signal (calibration) attributes.
98};
99#endif
Int_t GetNdecalfuncs() const
TString GetSlotName(Int_t j=1) const
Float_t GetGain(Int_t j=1) const
Definition NcAttrib.cxx:576
Int_t GetNcalflags() const
Definition NcAttrib.cxx:229
void SetCalFunction(TF1 *f, Int_t j=1)
void DecreaseEdgeValue(Int_t j=1)
TArrayF * fOffsets
Definition NcAttrib.h:91
void SetCalFlags(Int_t gf, Int_t of, Int_t j)
Definition NcAttrib.cxx:377
Int_t GetNgains() const
Definition NcAttrib.cxx:191
void SetAlive(Int_t j=1)
Definition NcAttrib.cxx:946
TObjArray * fDecalfuncs
Definition NcAttrib.h:95
void SetEdgeOn(Int_t j=1)
TObjArray * fCalfuncs
Definition NcAttrib.h:94
void AddNamedSlot(TString s)
void Lock(Int_t j=1)
Definition NcAttrib.cxx:995
virtual Int_t GetNslots() const
Int_t GetGainFlag(Int_t j=1) const
Definition NcAttrib.cxx:417
void SetDecalFunction(TF1 *f, Int_t j=1)
virtual ~NcAttrib()
Definition NcAttrib.cxx:88
Int_t GetDeadValue(Int_t j=1) const
void SetOffset(Double_t off, Int_t j=1)
Definition NcAttrib.cxx:322
Int_t GetCalWord(Int_t j=1) const
Definition NcAttrib.cxx:529
Int_t GetSlotIndex(TString name, Int_t opt=0) const
Float_t GetOffset(Int_t j=1) const
Definition NcAttrib.cxx:624
void SetEdgeOff(Int_t j=1)
void SetSlotName(TString s, Int_t j=1)
void SetEdgeValue(Int_t val, Int_t j=1)
void DeleteCalibrations(Int_t mode=0)
Definition NcAttrib.cxx:786
void ResetGain(Int_t j=1)
Definition NcAttrib.cxx:672
TF1 * GetCalFunction(Int_t j=1) const
Int_t GetOffsetFlag(Int_t j=1) const
Definition NcAttrib.cxx:473
Int_t GetLockValue(Int_t j=1) const
virtual void Load(NcAttrib &a, Int_t j=0)
Int_t GetNcalfuncs() const
void IncreaseEdgeValue(Int_t j=1)
TArrayF * fGains
Definition NcAttrib.h:90
virtual void List(Int_t j=0) const
void SetGain(Double_t gain, Int_t j=1)
Definition NcAttrib.cxx:267
void SetDead(Int_t j=1)
Definition NcAttrib.cxx:886
TObjArray * fNames
Definition NcAttrib.h:93
Int_t GetEdgeValue(Int_t j=1) const
Int_t GetNoffsets() const
Definition NcAttrib.cxx:210
TArrayI * fCalflags
Definition NcAttrib.h:92
TF1 * GetDecalFunction(Int_t j=1) const
void Unlock(Int_t j=1)
void ResetOffset(Int_t j=1)
Definition NcAttrib.cxx:729
Int_t GetNnames() const
Definition NcAttrib.cxx:248