NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcSignal.h
Go to the documentation of this file.
1#ifndef NcSignal_h
2#define NcSignal_h
3// Copyright(c) 1999 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include "TObject.h"
7#include "TArrayF.h"
8#include "TH1.h"
9#include "TObjArray.h"
10#include "TArrayI.h"
11
12#include "NcPosition.h"
13#include "NcAttrib.h"
14#include "NcObjMatrix.h"
15#include "NcSample.h"
16
17class NcDevice;
18class NcTrack;
19
21
22class NcSignal : public TNamed,public NcPosition,public NcAttrib
23{
24 public:
25 NcSignal(const char* name="",const char* title=""); // Default constructor
26 virtual ~NcSignal(); // Destructor
27 NcSignal(const NcSignal& s); // Copy constructor
28 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
29 virtual void SetSignal(Double_t sig,Int_t j=1); // Store signal value for the j-th slot
30 virtual void SetSignal(Double_t sig,TString name); // Store signal value for the name-specified slot
31 virtual void AddSignal(Double_t sig,Int_t j=1); // Add value to the signal of the j-th slot
32 virtual void AddSignal(Double_t sig,TString name); // Add value to the signal of the name-specified slot
33 virtual Float_t GetSignal(Int_t j=1,Int_t mode=0) const; // Provide j-th (corrected) signal value
34 virtual Float_t GetSignal(TString name,Int_t mode=0) const; // Provide name-specified (corrected) signal value
35 virtual void SetSignalError(Double_t dsig,Int_t j=1); // Store error on the signal of the j-th slot
36 virtual void SetSignalError(Double_t dsig,TString name); // Store error on the signal of the name-specified slot
37 virtual Float_t GetSignalError(Int_t j=1) const; // Provide error on the signal of the j-th slot
38 virtual Float_t GetSignalError(TString name) const; // Provide err. on the sig. of the name-specified slot
39 virtual void ResetSignals(Int_t mode=0); // Selective reset of signal values and/or errors
40 virtual void DeleteSignals(Int_t mode=0); // Selectie delete of signal values and/or errors
41 virtual void Reset(Int_t mode=0); // Reset signal and position values and errors
42 virtual void Data(TString f="car",TString u="rad") const; // Print all signal info for frame f and ang units u
43 virtual void List(Int_t j=0) const; // Print signal info for the j-th (all) slot(s)
44 virtual void List(TString name) const; // Print signal info for the name-specified slot
45 void ListWaveform(Int_t j=0) const; // Print info for the j-th (all) waveform(s)
46 void ListSample(Int_t j=0) const; // Print info for the j-th (all) sample(s)
47 void ListTrack(Int_t j=0) const; // Print info for the j-th (all) assoc. track(s)
48 Int_t GetNvalues() const; // Provide the number of signal values
49 Int_t GetNerrors() const; // Provide the number of specified errors
50 virtual Int_t GetNslots() const; // Provide the number of exising slots
51 Int_t GetNwaveforms() const; // Provide the number of specified waveforms
52 void SetWaveform(TH1F* waveform,Int_t j=1); // Set the histogram for the j-th waveform
53 TH1F* GetWaveform(Int_t j=1) const; // Pointer to the histo of the j-th waveform
54 TH1F* GetWaveform(TString name) const; // Pointer to the waveform with the specified name
55 Int_t GetWaveformIndex(TString name) const; // Index of the waveform with the specified name
56 void ResetWaveform(Int_t j=1); // Reset the histo of the j-th waveform
57 void ResetWaveform(TString name); // Reset the waveform histo with the specified name
58 void DeleteWaveform(Int_t j=1); // Delete histo of the j-th waveform
59 void DeleteWaveform(TString name); // Delete waveform histo with the specified name
60 Int_t GetNsamples() const; // Provide the number of specified samples
61 void SetSample(NcSample* sample,Int_t j=1); // Set the sample data for the j-th sample
62 NcSample* GetSample(Int_t j=1) const; // Pointer to the j-th sample
63 NcSample* GetSample(TString name) const; // Pointer to the sample with the specified name
64 Int_t GetSampleIndex(TString name) const; // Index of the sample with the specified name
65 void ResetSample(Int_t j=1); // Reset the data of the j-th sample
66 void ResetSample(TString name); // Reset the sample with the specified name
67 void DeleteSample(Int_t j=1); // Delete the j-th sample
68 void DeleteSample(TString name); // Delete te sample with the specified name
69 Int_t GetNlinks(TObject* obj=0,Int_t j=0) const; // Number of links for the specified object
70 Int_t GetNlinks(TObject* obj,TString name) const; // Number of links for the specified object
71 void SetLink(TObject* obj,Int_t j=1,Int_t k=1); // Link object to the j-th slot at position k
72 void SetLink(TObject* obj,TString name,Int_t k=1); // Link object to the name-specified slot at pos. k
73 void AddLink(TObject* obj,Int_t j=1); // Link obj to the j-th slot at 1st free position
74 void AddLink(TObject* obj,TString name); // Link obj to the name-specified slot at 1st free pos.
75 TObject* GetLink(Int_t j=1,Int_t k=1) const; // Pointer of the object linked to the j-th slot
76 TObject* GetLink(TString name,Int_t k=1) const; // Pointer of object linked to the name-specified slot
77 Int_t GetIndices(TObject* obj,TArrayI& js,TArrayI& ks) const; // Slot and pos. indices for linked objects
78 Int_t GetIndices(TObject* obj,Int_t j,TArrayI& ks) const; // Pos. indices for linked objects of j-th slot
79 Int_t GetIndices(TObject* obj,TString name,TArrayI& ks) const;// Pos. indices for linked objects of name-spec. slot
80 Int_t GetIndices(TObject* obj,TArrayI& js,Int_t k) const; // Slot indices for linked objects at pos. k
81 void ResetLink(Int_t j=1,Int_t k=1); // Reset the link(s) of the j-th slot
82 void ResetLink(TString name,Int_t k=1); // Reset the link(s) of the name-specified slot
83 void ResetLinks(TObject* obj,Int_t j=0,Int_t k=0); // Reset link(s) to object obj for j-th slot
84 void ResetLinks(TObject* obj,TString name,Int_t k=0); // Reset link(s) to object obj for name-specified slot
85 void SetSwapMode(Int_t swap=1); // Set swapmode flag for the link storage
86 Int_t GetSwapMode() const; // Provide swapmode flag for the link storage
87 NcDevice* GetDevice() const; // Provide pointer to the owning device
88 void AddTrack(NcTrack& t,Int_t mode=1); // Relate an NcTrack to this signal
89 void RemoveTrack(NcTrack& t,Int_t mode=1); // Remove related NcTrack from this signal
90 void RemoveTracks(Int_t mode=1); // Remove all related NcTracks from this signal
91 Int_t GetNtracks(NcTrack* t=0) const; // Provide number of related NcTracks
92 NcTrack* GetTrack(Int_t j) const; // Access to the related NcTrack number j
93 NcTrack* GetIdTrack(Int_t id) const; // Access to the related NcTrack with ID=id
94 Int_t GetSignalFlag(Int_t j=1) const; // Provide signal value flag of the j-th slot
95 Int_t GetSignalFlag(TString name) const; // Provide signal value flag of the name specified slot
96 Int_t GetErrorFlag(Int_t j=1) const; // Provide error value flag of the j-th slot
97 Int_t GetErrorFlag(TString name) const; // Provide error value flag of the name specified slot
98 NcSample* DisplaySample(Int_t j=1,Int_t i=1) const; // Display a graph of the selected variable of a sample
99 NcSample* DisplaySample(TString name,Int_t i=1) const; // Display a graph of the selected variable of a sample
100
101 // Facilities that may only be used internally by NcDevice (or derived) objects
102 void SetDevice(NcDevice* dev); // Store pointer to the device that owns this signal
103 Bool_t fDevset; // Flag to allow the setting of a device as owner (kTRUE) or not (kFALSE)
104
105 protected:
106 void SetSigFlags(Int_t is,Int_t ie,Int_t j); // Set flags for signal and/or error value settings
107 TArrayF* fSignals; // Signal values
108 TArrayF* fDsignals; // Errors on signal values
109 TArrayI* fSigflags; // Flags to mark setting of signal and/or error values
110 TObjArray* fWaveforms; // The 1D histograms containing the signal waveforms
111 TObjArray* fSamples; // The full data samples containing the recorded data series
112 NcObjMatrix* fLinks; // Pointers of objects related to the various slots
113 TObject* fDevice; // Pointer to a related device or the device that owns this signal
114 TObjArray* fTracks; // Pointers to associated tracks
115
116 ClassDef(NcSignal,5) // Generic handling of (extrapolated) detector signals.
117};
118#endif
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
Handling of a matrix structure of objects.
Definition NcObjMatrix.h:13
Sampling and statistics tools for various multi-dimensional data samples.
Definition NcSample.h:28
virtual void DeleteSignals(Int_t mode=0)
Definition NcSignal.cxx:449
void SetSigFlags(Int_t is, Int_t ie, Int_t j)
Int_t GetNwaveforms() const
virtual void ResetSignals(Int_t mode=0)
Definition NcSignal.cxx:396
virtual void Reset(Int_t mode=0)
Definition NcSignal.cxx:334
void DeleteWaveform(Int_t j=1)
virtual void List(Int_t j=0) const
Int_t GetNtracks(NcTrack *t=0) const
NcSample * DisplaySample(Int_t j=1, Int_t i=1) const
void ResetLink(Int_t j=1, Int_t k=1)
TH1F * GetWaveform(Int_t j=1) const
virtual void SetSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:516
Int_t GetSampleIndex(TString name) const
void SetSwapMode(Int_t swap=1)
TObject * fDevice
Definition NcSignal.h:113
NcObjMatrix * fLinks
Definition NcSignal.h:112
void RemoveTracks(Int_t mode=1)
NcDevice * GetDevice() const
TArrayI * fSigflags
Definition NcSignal.h:109
Int_t GetNlinks(TObject *obj=0, Int_t j=0) const
void ListWaveform(Int_t j=0) const
NcSample * GetSample(Int_t j=1) const
virtual TObject * Clone(const char *name="") const
void ListSample(Int_t j=0) const
Bool_t fDevset
Definition NcSignal.h:103
void RemoveTrack(NcTrack &t, Int_t mode=1)
NcTrack * GetIdTrack(Int_t id) const
Int_t GetIndices(TObject *obj, TArrayI &js, TArrayI &ks) const
void SetDevice(NcDevice *dev)
void SetWaveform(TH1F *waveform, Int_t j=1)
Int_t GetSwapMode() const
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 Int_t GetNslots() const
void SetSample(NcSample *sample, Int_t j=1)
TArrayF * fDsignals
Definition NcSignal.h:108
void AddTrack(NcTrack &t, Int_t mode=1)
void DeleteSample(Int_t j=1)
TObject * GetLink(Int_t j=1, Int_t k=1) const
void ResetSample(Int_t j=1)
virtual Float_t GetSignalError(Int_t j=1) const
Definition NcSignal.cxx:912
void ListTrack(Int_t j=0) const
Int_t GetNsamples() const
virtual void AddSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:583
TArrayF * fSignals
Definition NcSignal.h:107
TObjArray * fSamples
Definition NcSignal.h:111
virtual ~NcSignal()
Definition NcSignal.cxx:177
virtual void Data(TString f="car", TString u="rad") const
Definition NcSignal.cxx:959
virtual void SetSignalError(Double_t dsig, Int_t j=1)
Definition NcSignal.cxx:845
TObjArray * fWaveforms
Definition NcSignal.h:110
Int_t GetNvalues() const
void AddLink(TObject *obj, Int_t j=1)
Int_t GetSignalFlag(Int_t j=1) const
void ResetWaveform(Int_t j=1)
NcTrack * GetTrack(Int_t j) const
Int_t GetNerrors() const
Int_t GetErrorFlag(Int_t j=1) const
Int_t GetWaveformIndex(TString name) const
void SetLink(TObject *obj, Int_t j=1, Int_t k=1)
TObjArray * fTracks
Definition NcSignal.h:114
void ResetLinks(TObject *obj, Int_t j=0, Int_t k=0)
Handling of the attributes of a reconstructed particle track.
Definition NcTrack.h:19