]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/AliSignal.h
06-oct-2004 NvE Full support for data access via slotname specification introduced...
[u/mrichter/AliRoot.git] / RALICE / AliSignal.h
1 #ifndef ALISIGNAL_H
2 #define ALISIGNAL_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 "TObject.h"
9 #include "TArrayF.h"
10 #include "TH1.h"
11 #include "TObjArray.h"
12 #include "TArrayI.h"
13
14 #include "AliPosition.h"
15 #include "AliAttrib.h"
16 #include "AliObjMatrix.h"
17
18 class AliSignal : public TNamed,public AliPosition,public AliAttrib
19 {
20  public:
21   AliSignal();                                                  // Default constructor
22   virtual ~AliSignal();                                         // Destructor
23   AliSignal(const AliSignal& s);                                // Copy constructor
24   virtual TObject* Clone(const char* name="") const;            // Make a deep copy and provide its pointer
25   virtual void SetSignal(Double_t sig,Int_t j=1);               // Store signal value for the j-th slot
26   virtual void SetSignal(Double_t sig,TString name);            // Store signal value for the name-specified slot
27   virtual void AddSignal(Double_t sig,Int_t j=1);               // Add value to the signal of the j-th slot
28   virtual void AddSignal(Double_t sig,TString name);            // Add value to the signal of the name-specified slot
29   virtual Float_t GetSignal(Int_t j=1,Int_t mode=0) const;      // Provide j-th (corrected) signal value
30   virtual Float_t GetSignal(TString name,Int_t mode=0) const;   // Provide name-specified (corrected) signal value
31   virtual void SetSignalError(Double_t dsig,Int_t j=1);         // Store error on the signal of the j-th slot
32   virtual void SetSignalError(Double_t dsig,TString name);      // Store error on the signal of the name-specified slot
33   virtual Float_t GetSignalError(Int_t j=1) const;              // Provide error on the signal of the j-th slot
34   virtual Float_t GetSignalError(TString name) const;           // Provide err. on the sig. of the name-specified slot
35   virtual void ResetSignals(Int_t mode=0);                      // Selective reset of signal values and/or errors
36   virtual void DeleteSignals(Int_t mode=0);                     // Selectie delete of signal values and/or errors
37   virtual void Reset(Int_t mode=0);                             // Reset signal and position values and errors
38   virtual void Data(TString f="car") const;                     // Print all signal info for coord. frame f
39   virtual void List(Int_t j=0) const;                           // Print signal info for the j-th (all) slot(s)
40   virtual void List(TString name) const;                        // Print signal info for the name-specified slot
41   Int_t GetNvalues() const;                                     // Provide the number of signal values
42   Int_t GetNerrors() const;                                     // Provide the number of specified errors
43   Int_t GetNwaveforms() const;                                  // Provide the number of specified waveforms
44   void SetWaveform(TH1F* waveform,Int_t j=1);                   // Set the waveform histogram for the j-th slot
45   void SetWaveform(TH1F* waveform,TString name);                // Set the waveform histo for the name-specified slot
46   TH1F* GetWaveform(Int_t j=1) const;                           // Pointer to the waveform histo of the j-th slot
47   TH1F* GetWaveform(TString name) const;                        // Pointer to the waveform of the name-specified slot
48   void ResetWaveform(Int_t j=1);                                // Reset the waveform histo of the j-th slot
49   void ResetWaveform(TString name);                             // Reset the waveform histo of the name-specified slot
50   void DeleteWaveform(Int_t j=1);                               // Delete waveform histo of the j-th slot
51   void DeleteWaveform(TString name);                            // Delete waveform histo of the name-specified slot
52   Int_t GetNlinks(TObject* obj=0,Int_t j=0) const;              // Number of links for the specified object
53   Int_t GetNlinks(TObject* obj,TString name) const;             // Number of links for the specified object
54   void SetLink(TObject* obj,Int_t j=1,Int_t k=1);               // Link object to the j-th slot at position k
55   void SetLink(TObject* obj,TString name,Int_t k=1);            // Link object to the name-specified slot at pos. k
56   void AddLink(TObject* obj,Int_t j=1);                         // Link obj to the j-th slot at 1st free position
57   void AddLink(TObject* obj,TString name);                      // Link obj to the name-specified slot at 1st free pos.
58   TObject* GetLink(Int_t j=1,Int_t k=1) const;                  // Pointer of the object linked to the j-th slot
59   TObject* GetLink(TString name,Int_t k=1) const;               // Pointer of object linked to the name-specified slot
60   Int_t GetIndices(TObject* obj,TArrayI& js,TArrayI& ks) const; // Slot and pos. indices for linked objects
61   Int_t GetIndices(TObject* obj,Int_t j,TArrayI& ks) const;     // Pos. indices for linked objects of j-th slot 
62   Int_t GetIndices(TObject* obj,TString name,TArrayI& ks) const;// Pos. indices for linked objects of name-spec. slot 
63   Int_t GetIndices(TObject* obj,TArrayI& js,Int_t k) const;     // Slot indices for linked objects at pos. k 
64   void ResetLink(Int_t j=1,Int_t k=1);                          // Reset the link(s) of the j-th slot 
65   void ResetLink(TString name,Int_t k=1);                       // Reset the link(s) of the name-specified slot 
66   void ResetLinks(TObject* obj,Int_t j=0,Int_t k=0);            // Reset link(s) to object obj for j-th slot
67   void ResetLinks(TObject* obj,TString name,Int_t k=0);         // Reset link(s) to object obj for name-specified slot
68   void SetSwapMode(Int_t swap=1);                               // Set swapmode flag for the link storage
69   Int_t GetSwapMode() const;                                    // Provide swapmode flag for the link storage
70
71  protected:
72   TArrayF* fSignals;                           // Signal values
73   TArrayF* fDsignals;                          // Errors on signal values
74   TObjArray* fWaveforms;                       // The 1D histograms containing the signal waveforms
75   AliObjMatrix* fLinks;                        // Pointers of objects related to the various slots
76
77  ClassDef(AliSignal,12) // Generic handling of (extrapolated) detector signals.
78 };
79 #endif