NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcSignal Class Reference

Generic handling of (extrapolated) detector signals. More...

#include "NcSignal.h"

Inheritance diagram for NcSignal:
NcPosition NcAttrib Nc3Vector NcCalcluster NcCalmodule NcDevice IceGOM NcCalorimeter NcDetectorUnit NcTagger NcVeto RnoGANT IceAOM IceDOM NcDetector RnoStation RnoString RnoDANT RnoSANT IceIDOM IceTDOM RnoDetector RnoHPOL RnoVPOL RnoLPDA IceDCDOM IceICDOM RnoDLPDA RnoULPDA

Detailed Description

Generic handling of (extrapolated) detector signals.


Copyright(c) 1999 NCFS/IIHE, All Rights Reserved. *
*
Authors: The Netherlands Center for Fundamental Studies (NCFS). *
The Inter-university Institute for High Energies (IIHE). *
Website : http://www.iihe.ac.be *
Contact : Nick van Eijndhoven (nickve.nl@gmail.com) *
*
Contributors are mentioned in the code where appropriate. *
*
No part of this software may be used, copied, modified or distributed *
by any means nor transmitted or translated into machine language for *
commercial purposes without written permission by the IIHE representative. *
Permission to use the software strictly for non-commercial purposes *
is hereby granted without fee, provided that the above copyright notice *
appears in all copies and that both the copyright notice and this *
permission notice appear in the supporting documentation. *
This software is provided "as is" without express or implied warranty. *
The authors make no claims that this software is free of error, or is *
consistent with any particular standard of merchantability, or that it *
will meet your requirements for any particular application, other than *
indicated in the corresponding documentation. *
This software should not be relied on for solving a problem whose *
incorrect solution could result in injury to a person or loss of property. *
If you do use this software in such a manner, it is at your own risk. *
The authors disclaim all liability for direct or consequential damage *
resulting from your use of this software. *

// Class NcSignal
// Generic handling of (extrapolated) detector signals.
//
// An NcSignal object may have several (named) slots to contain different signal values,
// as outlined in the example below.
//
// The user can decide to store either calibrated or uncalibrated signals.
// Via the specification of a gain and offset or/and an explicit
// (de)calibration function both calibrated and uncalibrated signals
// can always be obtained. For details see the documentation of the
// memberfunction GetSignal() and the class NcAttrib.
// The explicit specification of a (de)calibration function offers the
// maximum flexibility and also allows automatic indication whether
// calibrated or uncalibrated data has been stored.
// The latter can be achieved by only specifying a calibration function
// (and no de-calibration function) in case uncalibrated data is stored,
// whereas in case of stored calibrated data the user should only
// provide a de-calibration function (and no calibration function).
//
// The memberfunction SetSample() allows to store various NcSample objects.
// Basically this is intended to store the (raw) data directly obtained from a
// Data Acquisition System (DAQ), and offers very flexible storage c.q. retrieval
// of recorded (multi-dimensional) data.
// Via the memberfunction SetWaveform() various waveforms may (also) be stored
// in the form of TH1F histograms. These are intended to contain calibrated NcSample data
// from which the final hit information can be extracted by using for instance the
// TSpectrum facility.
// It should be noted, that in the case of large (multi-dimensional) recorded data samples,
// the storage in the form of waveform histograms is less memory demanding than the
// storage of the full NcSample entries (i.e. NcSample objects with StoreMode activated).
//
// Note :
// ------
// Signal positions (r) and reference frames (f) are specified via
// SetPosition(r,f) under the following conventions :
//
// f="car" ==> r is Cartesian (x,y,z)
// f="sph" ==> r is Spherical (r,theta,phi)
// f="cyl" ==> r is Cylindrical (rho,phi,z)
//
// The same holds for SetPositionErrors().
//
// All angles are in radians.
//
// Example :
// ---------
//
// NcSignal s;
// s.SetName("Start counter");
// Float_t pos[3]={-1,25,7};
// Float_t err[3]={0.03,0.7,0.18};
// Float_t signal=120.8;
// Float_t error=1.73;
// Float_t offset=-12.78;
// Float_t gain=250;
// s.SetPosition(pos,"car");
// s.SetPositionErrors(err,"car");
// s.SetSignal(signal);
// s.SetSignalError(error);
// s.SetOffset(offset);
// s.SetGain(gain);
// Float_t loc[3],dr[3],sigma;
// s.GetPosition(loc,"sph");
// s.GetPositionErrors(dr,"sph");
// Float_t adc=s.GetSignal();
// Float_t sigma=s.GetSignalError();
//
// NcSignal q; // In the example below a signal contains the
// // following data : timing, ADC and dE/dx
// q.SetNameTitle("Hybrid","Test for multiple signal data");
// q.SetPosition(pos,"car");
// q.SetPositionErrors(err,"car");
// signal=82.5; // e.g. Time of Flight (TOF) signal in ns
// error=2.01;
// offset=0.003;
// q.SetSlotName("TOF",1);
// q.SetSignal(signal,1);
// q.SetSignalError(error,1);
// q.SetOffset(offset,1);
// signal=268.1; // e.g. some corresponding ADC value
// error=3.75;
// gain=120.78;
// offset=1.5732;
// // Addressing via name specification instead of index
// q.SetSlotName("ADC",2);
// q.SetSignal(signal,"ADC");
// q.SetSignalError(error,"ADC");
// q.SetGain(gain,"ADC");
// q.SetOffset(offset,"ADC");
// signal=23.7; // e.g. corresponding dE/dx value
// error=0.48;
// TF1 f=("calib","[0]*pow(x,2)+[1]"); // dE/dx calib. function
// f.SetParameter(0,3.285);
// f.SetParameter(1,-18.67);
// q.AddNamedSlot("dE/dx");
// q.SetCalFunction(&f,"dE/dx");
// q.SetSignal(signal,"dE/dx");
// q.SetSignalError(error,"dE/dx");
//
// // Show an overview of all the stored data
// q.Data("sph","deg");
//
// // Signal retrieval with various (de)calibration modes
// Float_t tof=q.GetSignal("TOF");
// Float_t adc=q.GetSignal("ADC",1);
// Float_t dedx=q.GetSignal("dE/dx",3);
//
//--- Author: Nick van Eijndhoven 23-jan-1999 Utrecht University
//- Modified: Nick van Eijndhoven, IIHE-VUB, Brussel, July 11, 2021 14:06Z

Definition at line 22 of file NcSignal.h.

Public Member Functions

 NcSignal (const char *name="", const char *title="")
 
 NcSignal (const NcSignal &s)
 
virtual ~NcSignal ()
 
void AddLink (TObject *obj, Int_t j=1)
 
void AddLink (TObject *obj, TString name)
 
virtual void AddSignal (Double_t sig, Int_t j=1)
 
virtual void AddSignal (Double_t sig, TString name)
 
void AddTrack (NcTrack &t, Int_t mode=1)
 
virtual TObject * Clone (const char *name="") const
 
virtual void Data (TString f="car", TString u="rad") const
 
void DeleteSample (Int_t j=1)
 
void DeleteSample (TString name)
 
virtual void DeleteSignals (Int_t mode=0)
 
void DeleteWaveform (Int_t j=1)
 
void DeleteWaveform (TString name)
 
NcSampleDisplaySample (Int_t j=1, Int_t i=1) const
 
NcSampleDisplaySample (TString name, Int_t i=1) const
 
NcDeviceGetDevice () const
 
Int_t GetErrorFlag (Int_t j=1) const
 
Int_t GetErrorFlag (TString name) const
 
NcTrackGetIdTrack (Int_t id) const
 
Int_t GetIndices (TObject *obj, Int_t j, TArrayI &ks) const
 
Int_t GetIndices (TObject *obj, TArrayI &js, Int_t k) const
 
Int_t GetIndices (TObject *obj, TArrayI &js, TArrayI &ks) const
 
Int_t GetIndices (TObject *obj, TString name, TArrayI &ks) const
 
TObject * GetLink (Int_t j=1, Int_t k=1) const
 
TObject * GetLink (TString name, Int_t k=1) const
 
Int_t GetNerrors () const
 
Int_t GetNlinks (TObject *obj, TString name) const
 
Int_t GetNlinks (TObject *obj=0, Int_t j=0) const
 
Int_t GetNsamples () const
 
virtual Int_t GetNslots () const
 
Int_t GetNtracks (NcTrack *t=0) const
 
Int_t GetNvalues () const
 
Int_t GetNwaveforms () const
 
NcSampleGetSample (Int_t j=1) const
 
NcSampleGetSample (TString name) const
 
Int_t GetSampleIndex (TString name) const
 
virtual Float_t GetSignal (Int_t j=1, Int_t mode=0) const
 
virtual Float_t GetSignal (TString name, Int_t mode=0) const
 
virtual Float_t GetSignalError (Int_t j=1) const
 
virtual Float_t GetSignalError (TString name) const
 
Int_t GetSignalFlag (Int_t j=1) const
 
Int_t GetSignalFlag (TString name) const
 
Int_t GetSwapMode () const
 
NcTrackGetTrack (Int_t j) const
 
TH1F * GetWaveform (Int_t j=1) const
 
TH1F * GetWaveform (TString name) const
 
Int_t GetWaveformIndex (TString name) const
 
virtual void List (Int_t j=0) const
 
virtual void List (TString name) const
 
void ListSample (Int_t j=0) const
 
void ListTrack (Int_t j=0) const
 
void ListWaveform (Int_t j=0) const
 
void RemoveTrack (NcTrack &t, Int_t mode=1)
 
void RemoveTracks (Int_t mode=1)
 
virtual void Reset (Int_t mode=0)
 
void ResetLink (Int_t j=1, Int_t k=1)
 
void ResetLink (TString name, Int_t k=1)
 
void ResetLinks (TObject *obj, Int_t j=0, Int_t k=0)
 
void ResetLinks (TObject *obj, TString name, Int_t k=0)
 
void ResetSample (Int_t j=1)
 
void ResetSample (TString name)
 
virtual void ResetSignals (Int_t mode=0)
 
void ResetWaveform (Int_t j=1)
 
void ResetWaveform (TString name)
 
void SetDevice (NcDevice *dev)
 
void SetLink (TObject *obj, Int_t j=1, Int_t k=1)
 
void SetLink (TObject *obj, TString name, Int_t k=1)
 
void SetSample (NcSample *sample, Int_t j=1)
 
virtual void SetSignal (Double_t sig, Int_t j=1)
 
virtual void SetSignal (Double_t sig, TString name)
 
virtual void SetSignalError (Double_t dsig, Int_t j=1)
 
virtual void SetSignalError (Double_t dsig, TString name)
 
void SetSwapMode (Int_t swap=1)
 
void SetWaveform (TH1F *waveform, Int_t j=1)
 
- Public Member Functions inherited from NcPosition
 NcPosition ()
 
 NcPosition (const NcPosition &p)
 
virtual ~NcPosition ()
 
Double_t GetDistance (NcPosition &p, Float_t scale=-1)
 
Double_t GetDistance (NcPosition *p, Float_t scale=-1)
 
NcPositionGetPosition ()
 
void GetPosition (Double_t *r, TString f, TString u="rad", Float_t s=-1) const
 
void GetPosition (Float_t *r, TString f, TString u="rad", Float_t s=-1) const
 
void GetPositionErrors (Double_t *e, TString f, TString u="rad", Float_t s=-1) const
 
void GetPositionErrors (Float_t *e, TString f, TString u="rad", Float_t s=-1) const
 
NcTimestampGetTimestamp ()
 
Float_t GetUnitScale () const
 
void RemoveTimestamp ()
 
void ResetPosition ()
 
void SetPosition (Double_t *r, TString f, TString u="rad")
 
void SetPosition (Double_t r1, Double_t r2, Double_t r3, TString f, TString u="rad")
 
void SetPosition (Float_t *r, TString f, TString u="rad")
 
void SetPosition (Nc3Vector &r)
 
void SetPositionErrors (Double_t *e, TString f, TString u="rad")
 
void SetPositionErrors (Double_t e1, Double_t e2, Double_t e3, TString f, TString u="rad")
 
void SetPositionErrors (Float_t *e, TString f, TString u="rad")
 
void SetTimestamp (NcTimestamp &t)
 
void SetUnitScale (Float_t s)
 
- Public Member Functions inherited from Nc3Vector
 Nc3Vector ()
 
 Nc3Vector (const Nc3Vector &v)
 
virtual ~Nc3Vector ()
 
Double_t ConvertAngle (Double_t a, TString in, TString out) const
 
Nc3Vector Cross (Nc3Vector &q) const
 
Double_t Dot (Nc3Vector &q)
 
void GetErrors (Double_t *e, TString f, TString u="rad") const
 
void GetErrors (Float_t *e, TString f, TString u="rad") const
 
Double_t GetNorm ()
 
virtual Double_t GetOpeningAngle (Nc3Vector &q, TString u="rad")
 
Nc3Vector GetPrimed (TRotMatrix *m) const
 
Double_t GetPseudoRapidity ()
 
Double_t GetResultError () const
 
Nc3Vector GetUnprimed (TRotMatrix *m) const
 
Nc3Vector GetVecLong () const
 
void GetVector (Double_t *v, TString f, TString u="rad") const
 
void GetVector (Float_t *v, TString f, TString u="rad") const
 
Nc3Vector GetVecTrans () const
 
Double_t GetX (Int_t i, TString f, TString u="rad")
 
Int_t HasErrors () const
 
Int_t HasVector () const
 
virtual void Load (Nc3Vector &q)
 
Nc3Vector operator* (Double_t s) const
 
Nc3Vectoroperator*= (Double_t s)
 
Nc3Vector operator+ (Nc3Vector &q) const
 
Nc3Vectoroperator+= (Nc3Vector &q)
 
Nc3Vector operator- (Nc3Vector &q) const
 
Nc3Vectoroperator-= (Nc3Vector &q)
 
Nc3Vector operator/ (Double_t s) const
 
Nc3Vectoroperator/= (Double_t s)
 
Nc3Vectoroperator= (const Nc3Vector &q)
 
void PrintAngle (Double_t a, TString in, TString out, Int_t ndig=1, Bool_t align=kFALSE) const
 
void SetErrors (Double_t *e, TString f, TString u="rad")
 
void SetErrors (Double_t e1, Double_t e2, Double_t e3, TString f, TString u="rad")
 
void SetErrors (Float_t *e, TString f, TString u="rad")
 
void SetVector (Double_t *v, TString f, TString u="rad")
 
void SetVector (Double_t v1, Double_t v2, Double_t v3, TString f, TString u="rad")
 
void SetVector (Float_t *v, TString f, TString u="rad")
 
virtual void SetZero ()
 
- Public Member Functions inherited from NcAttrib
 NcAttrib ()
 
 NcAttrib (const NcAttrib &a)
 
virtual ~NcAttrib ()
 
void AddNamedSlot (TString s)
 
void DecreaseEdgeValue (Int_t j=1)
 
void DecreaseEdgeValue (TString name)
 
void DeleteCalibrations (Int_t mode=0)
 
TF1 * GetCalFunction (Int_t j=1) const
 
TF1 * GetCalFunction (TString name) const
 
Int_t GetCalWord (Int_t j=1) const
 
Int_t GetCalWord (TString name) const
 
Int_t GetDeadValue (Int_t j=1) const
 
Int_t GetDeadValue (TString name) const
 
TF1 * GetDecalFunction (Int_t j=1) const
 
TF1 * GetDecalFunction (TString name) const
 
Int_t GetEdgeValue (Int_t j=1) const
 
Int_t GetEdgeValue (TString name) const
 
Float_t GetGain (Int_t j=1) const
 
Float_t GetGain (TString name) const
 
Int_t GetGainFlag (Int_t j=1) const
 
Int_t GetGainFlag (TString name) const
 
Int_t GetLockValue (Int_t j=1) const
 
Int_t GetLockValue (TString name) const
 
Int_t GetNcalflags () const
 
Int_t GetNcalfuncs () const
 
Int_t GetNdecalfuncs () const
 
Int_t GetNgains () const
 
Int_t GetNnames () const
 
Int_t GetNoffsets () const
 
Float_t GetOffset (Int_t j=1) const
 
Float_t GetOffset (TString name) const
 
Int_t GetOffsetFlag (Int_t j=1) const
 
Int_t GetOffsetFlag (TString name) const
 
Int_t GetSlotIndex (TString name, Int_t opt=0) const
 
TString GetSlotName (Int_t j=1) const
 
void IncreaseEdgeValue (Int_t j=1)
 
void IncreaseEdgeValue (TString name)
 
virtual void Load (NcAttrib &a, Int_t j=0)
 
virtual void Load (NcAttrib &a, TString name)
 
void Lock (Int_t j=1)
 
void Lock (TString name)
 
void ResetGain (Int_t j=1)
 
void ResetGain (TString name)
 
void ResetOffset (Int_t j=1)
 
void ResetOffset (TString name)
 
void SetAlive (Int_t j=1)
 
void SetAlive (TString name)
 
void SetCalFunction (TF1 *f, Int_t j=1)
 
void SetCalFunction (TF1 *f, TString name)
 
void SetDead (Int_t j=1)
 
void SetDead (TString name)
 
void SetDecalFunction (TF1 *f, Int_t j=1)
 
void SetDecalFunction (TF1 *f, TString name)
 
void SetEdgeOff (Int_t j=1)
 
void SetEdgeOff (TString name)
 
void SetEdgeOn (Int_t j=1)
 
void SetEdgeOn (TString name)
 
void SetEdgeValue (Int_t val, Int_t j=1)
 
void SetEdgeValue (Int_t val, TString name)
 
void SetGain (Double_t gain, Int_t j=1)
 
void SetGain (Double_t gain, TString name)
 
void SetOffset (Double_t off, Int_t j=1)
 
void SetOffset (Double_t off, TString name)
 
void SetSlotName (TString s, Int_t j=1)
 
void Unlock (Int_t j=1)
 
void Unlock (TString name)
 

Public Attributes

Bool_t fDevset
 

Protected Member Functions

void SetSigFlags (Int_t is, Int_t ie, Int_t j)
 
- Protected Member Functions inherited from NcAttrib
void SetCalFlags (Int_t gf, Int_t of, Int_t j)
 

Protected Attributes

TObject * fDevice
 
TArrayF * fDsignals
 
NcObjMatrixfLinks
 
TObjArray * fSamples
 
TArrayI * fSigflags
 
TArrayF * fSignals
 
TObjArray * fTracks
 
TObjArray * fWaveforms
 
- Protected Attributes inherited from NcPosition
Float_t fScale
 
NcTimestampfTstamp
 
- Protected Attributes inherited from Nc3Vector
Double32_t fDresult
 ! Error on scalar result (e.g. norm or dotproduct)
 
Int_t fNv
 
Double32_t * fV
 
- Protected Attributes inherited from NcAttrib
TArrayI * fCalflags
 
TObjArray * fCalfuncs
 
TObjArray * fDecalfuncs
 
TArrayF * fGains
 
TObjArray * fNames
 
TArrayF * fOffsets
 

Constructor & Destructor Documentation

◆ NcSignal() [1/2]

NcSignal::NcSignal ( const char * name = "",
const char * title = "" )
// Creation of an NcSignal object and initialisation of parameters.
// Several signal values (with errors) can be stored in different slots.
// If needed, the storage for values (and errors) will be expanded automatically
// when entering values and/or errors.

Definition at line 155 of file NcSignal.cxx.

◆ ~NcSignal()

NcSignal::~NcSignal ( )
virtual
// Destructor to delete dynamically allocated memory.

Definition at line 177 of file NcSignal.cxx.

◆ NcSignal() [2/2]

NcSignal::NcSignal ( const NcSignal & s)
// Copy constructor.

Definition at line 246 of file NcSignal.cxx.

Member Function Documentation

◆ AddLink() [1/2]

void NcSignal::AddLink ( TObject * obj,
Int_t j = 1 )
// Introduce a link (=pointer) to an object for the j-th slot at the first
// free position.
// Only the pointer values are stored for (backward) reference, meaning
// that the objects of which the pointers are stored are NOT owned
// by the NcSignal object.
//
// Notes :
// The first slot is at j=1 and the first position is at k=1.
// j=1 is the default value.
//
// If needed, the storage area for the links is increased automatically.
//
// In case the pointer argument is zero, no link will be added.
//
// In principle any object derived from TObject can be referred to by this
// mechanism.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// Therefore, in case the input argument "obj" points to an NcTrack (or derived)
// object, the current signal is automatically related to this NcTrack
// (or derived) object.
// Also a global link to this NcTrack (or derived) object will be stored
// via the AddTrack() facility.
//
// IMPORTANT NOTE :
// ----------------
// In case one just wants to relate the current NcSignal to a certain NcTrack
// without a specific signal slot association, it is much more efficient
// (both memory and CPU wise) to use the memberfunction AddTrack() instead.
//
// Please also have a look at the docs of the memberfunction ResetLink()
// to prevent the situation of stored pointers to non-existent object.

Definition at line 2283 of file NcSignal.cxx.

◆ AddLink() [2/2]

void NcSignal::AddLink ( TObject * obj,
TString name )
// Introduce a link (=pointer) to an object for the name-spec slot at the first
// free position.
// Only the pointer values are stored for (backward) reference, meaning
// that the objects of which the pointers are stored are NOT owned
// by the NcSignal object.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().
//
// In case the pointer argument is zero, indeed a value of zero will be
// stored at the first free position of the specified slotname.
//
// In principle any object derived from TObject can be referred to by this
// mechanism.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// Therefore, in case the input argument "obj" points to an NcTrack (or derived)
// object, the current signal is automatically related to this NcTrack
// (or derived) object.
// Also a global link to this NcTrack (or derived) object will be stored
// via the AddTrack() facility.
//
// IMPORTANT NOTE :
// ----------------
// In case one just wants to relate the current NcSignal to a certain NcTrack
// without a specific signal slot association, it is much more efficient
// (both memory and CPU wise) to use the memberfunction AddTrack() instead.
//
// Please also have a look at the docs of the memberfunction ResetLink()
// to prevent the situation of stored pointers to non-existent object.

Definition at line 2340 of file NcSignal.cxx.

◆ AddSignal() [1/2]

void NcSignal::AddSignal ( Double_t sig,
Int_t j = 1 )
virtual
// Add value to the signal of the j-th (default j=1) slot.
// Notes :
// -------
// 1) The first signal slot is at j=1.
// 2) In case the 'lock' flag was set for the specified slot, the new
// signal value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal value.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal values, the number of reserved slots for the
// signal values is increased automatically.

Reimplemented in NcCalmodule.

Definition at line 583 of file NcSignal.cxx.

◆ AddSignal() [2/2]

void NcSignal::AddSignal ( Double_t sig,
TString name )
virtual
// Add value to the signal of the name-specified slot.
//
// Note :
// ------
// In case the 'lock' flag was set for the specified slot, the new
// signal value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal value.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Reimplemented in NcCalmodule.

Definition at line 623 of file NcSignal.cxx.

◆ AddTrack()

void NcSignal::AddTrack ( NcTrack & t,
Int_t mode = 1 )
// Relate an NcTrack object to this signal.
// Only the pointer values are stored for (backward) reference, meaning
// that the tracks of which the pointers are stored are NOT owned
// by the NcSignal object.
//
// mode = 0 : Only the reference to the specified track is stored in
// the current signal, without storing the (backward) reference
// to this signal into the NcTrack structure.
// 1 : The (backward) reference to the current signal is also automatically
// stored into the NcTrack (or derived) object specified in the
// input argument.
//
// The default is mode=1.

Definition at line 2761 of file NcSignal.cxx.

◆ Clone()

TObject * NcSignal::Clone ( const char * name = "") const
virtual
// Make a deep copy of the current object and provide the pointer to the copy.
// This memberfunction enables automatic creation of new objects of the
// correct type depending on the object type, a feature which may be very useful
// for containers when adding objects in case the container owns the objects.
// This feature allows e.g. NcTrack to store either NcSignal objects or
// objects derived from NcSignal via the AddSignal memberfunction, provided
// these derived classes also have a proper Clone memberfunction.

Reimplemented in IceAOM, IceDCDOM, IceDOM, IceGOM, IceICDOM, IceIDOM, IceTDOM, NcCalmodule, NcCalorimeter, NcDetector, NcDetectorUnit, NcDevice, NcTagger, NcVeto, RnoDANT, RnoDetector, RnoDLPDA, RnoGANT, RnoHPOL, RnoLPDA, RnoSANT, RnoStation, RnoString, RnoULPDA, and RnoVPOL.

Definition at line 2999 of file NcSignal.cxx.

◆ Data()

void NcSignal::Data ( TString f = "car",
TString u = "rad" ) const
virtual
// Provide all signal information within the coordinate frame f.
//
// f="car" ==> Cartesian (x,y,z)
// f="sph" ==> Spherical (r,theta,phi)
// f="cyl" ==> Cylindrical (rho,phi,z)
//
// The input argument "u" allows to choose between different angular units
// in case e.g. a spherical frame is selected.
//
// u = "rad" : angles provided in radians
// "deg" : angles provided in degrees
//
// The defaults are f="car" and u="rad".

Reimplemented from NcPosition.

Reimplemented in NcDetectorUnit, and NcDevice.

Definition at line 959 of file NcSignal.cxx.

◆ DeleteSample() [1/2]

void NcSignal::DeleteSample ( Int_t j = 1)
// Delete the sample data of the j-th (default j=1) sample.
// Notes : The first position is at j=1.
// j=0 ==> All samples will be deleted.

Definition at line 2045 of file NcSignal.cxx.

◆ DeleteSample() [2/2]

void NcSignal::DeleteSample ( TString name)
// Delete the sample with the specified name.

Definition at line 2083 of file NcSignal.cxx.

◆ DeleteSignals()

void NcSignal::DeleteSignals ( Int_t mode = 0)
virtual
// Delete storage arrays of various signal data according to user selection.
//
// mode = 0 Delete arrays of signal values, their errors, all waveform histos and samples.
// 1 Delete only signal values array, waveform histos and samples.
// 2 Delete only signal errors array, waveform histos and samples.
// -1 Delete only signal values array.
// -2 Delete only signal errors array.
//
// The default when invoking DeleteSignals() corresponds to mode=0.

Definition at line 449 of file NcSignal.cxx.

◆ DeleteWaveform() [1/2]

void NcSignal::DeleteWaveform ( Int_t j = 1)
// Delete the histogram of the j-th (default j=1) waveform.
// Notes : The first position is at j=1.
// j=0 ==> All waveforms will be deleted.

Definition at line 1792 of file NcSignal.cxx.

◆ DeleteWaveform() [2/2]

void NcSignal::DeleteWaveform ( TString name)
// Delete the waveform with the specified name.

Definition at line 1830 of file NcSignal.cxx.

◆ DisplaySample() [1/2]

NcSample * NcSignal::DisplaySample ( Int_t j = 1,
Int_t i = 1 ) const
// Display a TGraph of the j-th variable (1=first) of the i-th (1=first) stored NcSample.
// The graph will display the values of the j-th variable versus the sample entry number.
//
// Note :
// ------
// In case the user wants to display different graphs using the same graphics pad,
// he/she should first clear the corresponding graphics pad in order to have
// the correct graph title indicated. The graph itself is automatically updated.
//
// The returned argument is the pointer to the corresponding NcSample object.
// For more elaborate functionality, please refer to the docs of NcSample.
//
// The default value is i=1.

Definition at line 2929 of file NcSignal.cxx.

◆ DisplaySample() [2/2]

NcSample * NcSignal::DisplaySample ( TString name,
Int_t i = 1 ) const
// Display a TGraph of the variable with the specified name of the i-th (1=first) stored NcSample.
// The graph will display the values of the specified variable versus the sample entry number.
//
// Note :
// ------
// In case the user wants to display different graphs using the same graphics pad,
// he/she should first clear the corresponding graphics pad in order to have
// the correct graph title indicated. The graph itself is automatically updated.
//
// The returned argument is the pointer to the corresponding NcSample object.
// For more elaborate functionality, please refer to the docs of NcSample.
//
// The default value is i=1.

Definition at line 2967 of file NcSignal.cxx.

◆ GetDevice()

NcDevice * NcSignal::GetDevice ( ) const
// Provide the pointer to the device that owns this NcSignal (or derived) object.

Definition at line 2750 of file NcSignal.cxx.

◆ GetErrorFlag() [1/2]

Int_t NcSignal::GetErrorFlag ( Int_t j = 1) const
// Provide error value flag of the j-th (default j=1) slot.
//
// flag = 1 : Error value was set
// 0 : Error value was not set
//
// Note : The first attribute slot is at j=1.
// In case j is invalid, 0 is returned.

Definition at line 1508 of file NcSignal.cxx.

◆ GetErrorFlag() [2/2]

Int_t NcSignal::GetErrorFlag ( TString name) const
// Provide error value flag of the name-specified slot.
//
// flag = 1 : Error value was set
// 0 : Error value was not set
//
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 1539 of file NcSignal.cxx.

◆ GetIdTrack()

NcTrack * NcSignal::GetIdTrack ( Int_t id) const
// Return the track with user identifier "id" of this signal.

Definition at line 2910 of file NcSignal.cxx.

◆ GetIndices() [1/4]

Int_t NcSignal::GetIndices ( TObject * obj,
Int_t j,
TArrayI & ks ) const
// Provide the position indices of all the storage locations of the
// specified object in the j-th slot of this NcSignal.
// The position indices are returned in the TArrayI array.
// The integer return argument represents the number of storage locations which
// were encountered for the specified object in the j-th slot.
//
// If obj=0 no object selection is performed and all position indices
// of the stored references for all objects of the j-th slot are returned.
//
// If j=0 all slots will be scanned and all position indices matching the
// object selection are returned.
// Note that in this case multiple appearances of the same position index
// will only be recorded once in the returned TArrayI array.
//
// Notes :
// -------
// As usual the convention is that slot and position numbering starts at 1.
//
// This memberfunction always resets the TArrayI array at the start.
//
// This memberfunction can only be used to obtain the position indices
// of the object as stored via the SetLink() or AddLink() memberfunction.
// This means that in case the user has entered a TObjArray as object
// (to increase the dimension of the resulting structure), the position
// indices of that TObjArray are obtained and NOT the indices of the
// actual objects contained in that TObjArray structure.

Definition at line 2588 of file NcSignal.cxx.

◆ GetIndices() [2/4]

Int_t NcSignal::GetIndices ( TObject * obj,
TArrayI & js,
Int_t k ) const
// Provide the slot indices of all the storage locations of the
// specified object for the k-th position in this NcSignal.
// The slot indices are returned in the TArrayI array.
// The integer return argument represents the number of storage locations which
// were encountered for the specified object in the k-th position.
//
// If obj=0 no object selection is performed and all slot indices
// of the stored references for all objects in the k-th position are returned.
//
// If k=0 all positions will be scanned and all slot indices matching the
// object selection are returned.
// Note that in this case multiple appearances of the same slot index
// will only be recorded once in the returned TArrayI array.
//
// Notes :
// -------
// As usual the convention is that slot and position numbering starts at 1.
//
// This memberfunction always resets the TArrayI array at the start.
//
// This memberfunction can only be used to obtain the slot indices
// of the object as stored via the SetLink() or AddLink() memberfunction.
// This means that in case the user has entered a TObjArray as object
// (to increase the dimension of the resulting structure), the slot
// indices of that TObjArray are obtained and NOT the indices of the
// actual objects contained in that TObjArray structure.

Definition at line 2655 of file NcSignal.cxx.

◆ GetIndices() [3/4]

Int_t NcSignal::GetIndices ( TObject * obj,
TArrayI & js,
TArrayI & ks ) const
// Provide the slot and position indices of all the storage locations
// of the specified object.
// The slot (j) and pos. (k) indices are returned in the two separate TArrayI arrays
// from which the (j,k) pairs can be obtained from the corresponding
// array indices like (j,k)=(js.At(i),ks.At(i)).
// The integer return argument represents the number of (j,k) pairs which
// were encountered for the specified object.
//
// If obj=0 no object selection is performed and all (j,k) indices
// of the stored references for all objects are returned.
//
// Notes :
// -------
// As usual the convention is that slot and position numbering starts at 1.
//
// This memberfunction always resets the two TArrayI arrays at the start.
//
// This memberfunction can only be used to obtain the (j,k) indices
// of the object as stored via the SetLink() or AddLink() memberfunction.
// This means that in case the user has entered a TObjArray as object
// (to increase the dimension of the resulting structure), the (j,k)
// indices of that TObjArray are obtained and NOT the indices of the
// actual objects contained in that TObjArray structure.

Definition at line 2550 of file NcSignal.cxx.

◆ GetIndices() [4/4]

Int_t NcSignal::GetIndices ( TObject * obj,
TString name,
TArrayI & ks ) const
// Provide the position indices of all the storage locations of the
// specified object in the name-specified slot of this NcSignal.
// The position indices are returned in the TArrayI array.
// The integer return argument represents the number of storage locations which
// were encountered for the specified object in the j-th slot.
//
// If obj=0 no object selection is performed and all position indices
// of the stored references for all objects of the j-th slot are returned.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 2628 of file NcSignal.cxx.

◆ GetLink() [1/2]

TObject * NcSignal::GetLink ( Int_t j = 1,
Int_t k = 1 ) const
// Provide pointer of the object linked to the j-th slot at position k.

Definition at line 2149 of file NcSignal.cxx.

◆ GetLink() [2/2]

TObject * NcSignal::GetLink ( TString name,
Int_t k = 1 ) const
// Provide pointer of the object linked to the name-spec. slot at position k.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 2163 of file NcSignal.cxx.

◆ GetNerrors()

Int_t NcSignal::GetNerrors ( ) const
// Provide the number specified errors on the values for this signal.

Definition at line 1396 of file NcSignal.cxx.

◆ GetNlinks() [1/2]

Int_t NcSignal::GetNlinks ( TObject * obj,
TString name ) const
// Provide the number of links to the specified object for the name-spec. slot.
// If obj=0 all encountered objects for the specified slot will be counted.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 2128 of file NcSignal.cxx.

◆ GetNlinks() [2/2]

Int_t NcSignal::GetNlinks ( TObject * obj = 0,
Int_t j = 0 ) const
// Provide the number of links to the specified object for the j-th slot.
// If j=0 (default) all slots will be scanned for the specified object.
// If obj=0 (default) all encountered objects for the specified slot will be counted.
// So, invokation of the default GetNlinks() will return the total number of
// all references to all sorts of stored objects.

Definition at line 2095 of file NcSignal.cxx.

◆ GetNsamples()

Int_t NcSignal::GetNsamples ( ) const
// Provide the number of specified samples for this signal.
// Actually the return value is the highest index of the stored samples.
// This allows an index dependent meaning of sample info (e.g. samples
// with various gain values).
// So, when all samples are stored in consequetive positions (e.g. 1,2,3),
// this memberfunction returns 3, being both the highest filled position
// and the actual number of samples.
// In case only samples are stored at positions 1,2,5,7 this memberfunction
// returns a value 7 whereas only 4 actual samples are present.
// This implies that when looping over the various sample slots, one
// always has to check whether the returned pointer value is non-zero
// (which is a good practice anyhow).

Definition at line 1842 of file NcSignal.cxx.

◆ GetNslots()

Int_t NcSignal::GetNslots ( ) const
virtual
// Provide the number of existing slots.

Reimplemented from NcAttrib.

Definition at line 1565 of file NcSignal.cxx.

◆ GetNtracks()

Int_t NcSignal::GetNtracks ( NcTrack * t = 0) const
// Provide the number of related NcTracks.
// In case an NcTrack pointer is specified as input argument,
// the number returned will be the number of occurrences (i.e. 0 or 1)
// for that specified track.
// By default t=0, which implies that just the number of all associated
// tracks will be returned.

Definition at line 2859 of file NcSignal.cxx.

◆ GetNvalues()

Int_t NcSignal::GetNvalues ( ) const
// Provide the number of values for this signal.

Definition at line 1377 of file NcSignal.cxx.

◆ GetNwaveforms()

Int_t NcSignal::GetNwaveforms ( ) const
// Provide the number of specified waveforms for this signal.
// Actually the return value is the highest index of the stored waveforms.
// This allows an index dependent meaning of waveform info (e.g. waveforms
// with various gain values).
// So, when all waveforms are stored in consequetive positions (e.g. 1,2,3),
// this memberfunction returns 3, being both the highest filled position
// and the actual number of waveforms.
// In case only waveforms are stored at positions 1,2,5,7 this memberfunction
// returns a value 7 whereas only 4 actual waveforms are present.
// This implies that when looping over the various waveform slots, one
// always has to check whether the returned pointer value is non-zero
// (which is a good practice anyhow).

Definition at line 1588 of file NcSignal.cxx.

◆ GetSample() [1/2]

NcSample * NcSignal::GetSample ( Int_t j = 1) const
// Provide pointer to the j-th sample.

Definition at line 1866 of file NcSignal.cxx.

◆ GetSample() [2/2]

NcSample * NcSignal::GetSample ( TString name) const
// Provide pointer to the sample with the specified name.
//
// Note :
// ------
// In case the specified name matches a part of the full name of the sample,
// the pointer to the corresponding sample is returned.
// However, the name pattern should match exactly, i.e. it is case sensitive.
// As such the name matching can be regarded as using wildcards.
//
// In case no match is found, zero is returned.

Definition at line 1879 of file NcSignal.cxx.

◆ GetSampleIndex()

Int_t NcSignal::GetSampleIndex ( TString name) const
// Provide index to the sample with the specified name.
//
// Note :
// ------
// In case the specified name matches a part of the full name of the sample,
// the index to the corresponding sample is returned.
// However, the name pattern should match exactly, i.e. it is case sensitive.
// As such the name matching can be regarded as using wildcards.
//
// In case no match is found, zero is returned.

Definition at line 1910 of file NcSignal.cxx.

◆ GetSignal() [1/2]

Float_t NcSignal::GetSignal ( Int_t j = 1,
Int_t mode = 0 ) const
virtual
// Provide signal value of the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case no signal is present or the input argument "j" or "mode" is invalid,
// the value 0 is returned.
// The parameter "mode" allows for automatic (de)calibration of the signal
// (e.g. gain etc... correction or via explicit (de)calibration functions).
//
// mode = 0 : Just the j-th signal is returned.
// 1 : The j-th signal is corrected for the gain, offset, dead flag etc...
// In case the j-th slot was marked dead, 0 is returned.
// In case the gain value was not set, gain=1 will be assumed.
// In case the gain value was 0, a signal value of 0 is returned.
// In case the offset value was not set, offset=0 will be assumed.
// 2 : Same as mode=1 but gain, offset dead flag etc... are taken from
// the NcDevice which owns this NcSignal object.
// The corresponding NcDevice slot is obtained via matching of
// the slotnames. In case this fails, the slotindex "j" of the
// input argument will be used.
// In case this NcSignal object has no parent NcDevice, just
// the j-th signal is returned (like with mode=0).
// 3 : The j-th signal is corrected using the corresponding calibration
// function.
// In case the j-th slot was marked dead, 0 is returned.
// In case no calibration function is present, just the j-th signal
// is returned (like with mode=0).
// 4 : Same as mode=3 but the calibration function and dead flag are
// taken from the NcDevice which owns this NcSignal object.
// The corresponding NcDevice slot is obtained via matching of
// the slotnames. In case this fails, the slotindex "j" of the
// input argument will be used.
// 5 : Same as mode=2 but in case no parent NcDevice is present
// an automatic switch to mode=1 will be made.
// 6 : Same as mode=4 but in case no parent NcDevice is present
// an automatic switch to mode=3 will be made.
// 7 : Same as mode=3 but in case no calibration function is present
// an automatic switch to mode=4 will be made.
// 8 : Same as mode=7 but also the corresponding dead flag of the
// parent device (if any) will be checked.
// If either the dead flag of the requested signal slot of this
// NcSignal object or the corresponding parent device slot is
// set, 0 is returned.
//
// <0 : The corresponding de-correction or de-calibration is performed
//
// The corrected signal (sigc) is determined as follows :
//
// sigc=(signal/gain)-offset
//
// The de-corrected signal is determined as follows :
//
// signal=(sigc+offset)*gain
//
// The default is mode=0.

Definition at line 651 of file NcSignal.cxx.

◆ GetSignal() [2/2]

Float_t NcSignal::GetSignal ( TString name,
Int_t mode = 0 ) const
virtual
// Provide signal value of the name-specified slot.
// In case no signal is present, 0 is returned.
// The parameter "mode" allows for automatic (de)calibration of the signal
// (e.g. gain etc... correction or via explicit (de)calibration functions).
// For further details about the (de)calibration modes, please refer to the
// corresponding slot-index based memberfunction.
//
// The default is mode=0.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 816 of file NcSignal.cxx.

◆ GetSignalError() [1/2]

Float_t NcSignal::GetSignalError ( Int_t j = 1) const
virtual
// Provide error on the signal of the j-th (default j=1) slot.
// Note : The first signal slot is at j=1.
// In case no signal is present or the argument j is invalid, 0 is returned.

Definition at line 912 of file NcSignal.cxx.

◆ GetSignalError() [2/2]

Float_t NcSignal::GetSignalError ( TString name) const
virtual
// Provide error on the signal of the name-specified slot.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 937 of file NcSignal.cxx.

◆ GetSignalFlag() [1/2]

Int_t NcSignal::GetSignalFlag ( Int_t j = 1) const
// Provide signal value flag of the j-th (default j=1) slot.
//
// flag = 1 : Signal value was set
// 0 : Signal value was not set
//
// Note : The first attribute slot is at j=1.
// In case j is invalid, 0 is returned.

Definition at line 1451 of file NcSignal.cxx.

◆ GetSignalFlag() [2/2]

Int_t NcSignal::GetSignalFlag ( TString name) const
// Provide signal value flag of the name-specified slot.
//
// flag = 1 : Signal value was set
// 0 : Signal value was not set
//
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 1482 of file NcSignal.cxx.

◆ GetSwapMode()

Int_t NcSignal::GetSwapMode ( ) const
// Provide swapmode flag of the link storage.

Definition at line 2718 of file NcSignal.cxx.

◆ GetTrack()

NcTrack * NcSignal::GetTrack ( Int_t j) const
// Provide the related NcTrack number j.
// Note : j=1 denotes the first track.

Definition at line 2887 of file NcSignal.cxx.

◆ GetWaveform() [1/2]

TH1F * NcSignal::GetWaveform ( Int_t j = 1) const
// Provide pointer to the j-th waveform histogram.

Definition at line 1612 of file NcSignal.cxx.

◆ GetWaveform() [2/2]

TH1F * NcSignal::GetWaveform ( TString name) const
// Provide pointer to the waveform histogram with the specified name.
//
// Note :
// ------
// In case the specified name matches a part of the full name of the
// waveform histogram, the pointer to the corresponding histogram is returned.
// However, the name pattern should match exactly, i.e. it is case sensitive.
// As such the name matching can be regarded as using wildcards.
//
// In case no match is found, zero is returned.

Definition at line 1625 of file NcSignal.cxx.

◆ GetWaveformIndex()

Int_t NcSignal::GetWaveformIndex ( TString name) const
// Provide index to the waveform histogram with the specified name.
//
// Note :
// ------
// In case the specified name matches a part of the full name of the
// waveform histogram, the index to the corresponding histogram is returned.
// However, the name pattern should match exactly, i.e. it is case sensitive.
// As such the name matching can be regarded as using wildcards.
//
// In case no match is found, zero is returned.

Definition at line 1656 of file NcSignal.cxx.

◆ List() [1/2]

void NcSignal::List ( Int_t j = 0) const
virtual
// Provide signal information for the j-th slot.
// The first slot is at j=1.
// In case j=0 (default) the data of all slots will be listed.
// In case j=-1 the data of all slots will be listed, but the header
// information will be suppressed.

Reimplemented from NcAttrib.

Definition at line 1014 of file NcSignal.cxx.

◆ List() [2/2]

void NcSignal::List ( TString name) const
virtual
// Provide signal information for the name-specified slot.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Reimplemented from NcAttrib.

Definition at line 1134 of file NcSignal.cxx.

◆ ListSample()

void NcSignal::ListSample ( Int_t j = 0) const
// Provide information for the j-th sample.
// The first sample is at j=1.
// In case j=0 (default) the info of all samples will be listed.
// In case j=-1 the info of all samples will be listed, but the header
// information will be suppressed.

Definition at line 1227 of file NcSignal.cxx.

◆ ListTrack()

void NcSignal::ListTrack ( Int_t j = 0) const
// Provide information for the j-th associated track.
// The first associated track is at j=1.
// In case j=0 (default) the info of all associated tracks will be listed.
// In case j=-1 the info of all tracks will be listed, but the header
// information will be suppressed.

Definition at line 1302 of file NcSignal.cxx.

◆ ListWaveform()

void NcSignal::ListWaveform ( Int_t j = 0) const
// Provide information for the j-th waveform.
// The first waveform is at j=1.
// In case j=0 (default) the info of all waveforms will be listed.
// In case j=-1 the info of all waveforms will be listed, but the header
// information will be suppressed.

Definition at line 1152 of file NcSignal.cxx.

◆ RemoveTrack()

void NcSignal::RemoveTrack ( NcTrack & t,
Int_t mode = 1 )
// Remove related NcTrack object from this signal.
// Also all references (if any) to this track in the slot links area
// are removed.
//
// mode = 0 : All references to the specified track are removed from
// the current signal, without removing the (backward) reference
// to this signal from the NcTrack structure.
// 1 : The (backward) reference to the current signal is also automatically
// removed from the NcTrack (or derived) object specified in the
// input argument.
//
// The default is mode=1.

Definition at line 2794 of file NcSignal.cxx.

◆ RemoveTracks()

void NcSignal::RemoveTracks ( Int_t mode = 1)
// Remove all related NcTrack objects from this signal.
// Also all references (if any) to the related tracks in the slot links area
// are removed.
//
// mode = 0 : All track references are removed from the current signal,
// without removing the (backward) references to this signal from
// the corresponding NcTrack objects.
// 1 : The (backward) references to the current signal are also automatically
// removed from the corresponding NcTrack (or derived) objects.
//
// The default is mode=1.

Definition at line 2824 of file NcSignal.cxx.

◆ Reset()

void NcSignal::Reset ( Int_t mode = 0)
virtual
// Reset all signal and position values and errors to 0.
//
// mode = 0 Reset position and all signal values and their errors to 0.
// The waveform histograms and samples are reset, but the calibration
// constants (i.e. gains and offsets) are kept.
// 1 Reset position and delete the signal and error storage arrays.
// Also the waveform histograms, samples, gains and offset arrays are deleted.
//
// The default when invoking Reset() corresponds to mode=0.
//
// Note : In all cases the storage of the various links will be reset.
// The UniqueID, name and title will NOT be reset.
// Also the pointer to the owning device will not be reset if this
// NcSignal is owned by an NcDevice (or derived) object.
// In case the user wants to reset these attributes, this has to
// be done explicitly via the SET facilities.
//
// The usage of mode=0 allows to re-use the allocated memory for new
// signal (and error) values. This behaviour is preferable (i.e. faster)
// in case the various signals always contain the same number of values
// and have the same calibration constants.
// The usage of mode=1 is slower, but allows a more efficient memory
// occupation (and smaller output file size) in case the different
// signals have a variable number of values.
//
// For more specific actions see ResetPosition(), ResetSignals(),
// DeleteSignals(), ResetGain(), ResetOffset(), ResetLink(), ResetWaveform(),
// DeleteWaveform(), ResetSample(), DeleteSample() and DeleteCalibrations().

Reimplemented in NcCalorimeter, NcDetectorUnit, and NcDevice.

Definition at line 334 of file NcSignal.cxx.

◆ ResetLink() [1/2]

void NcSignal::ResetLink ( Int_t j = 1,
Int_t k = 1 )
// Reset the link of the j-th slot at position k.
//
// Notes :
// The first slot is at j=1 and the first position is at k=1.
// j=1 and k=1 are the default values.
//
// This memberfunction is intended to reset only 1 specified link location.
// For extended functionality, please refer to the memberfuction ResetLinks().
//
// In general the user should take care of properly clearing the corresponding
// pointer here when the referred object is deleted.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// As such, the NcTrack destructor already takes care of clearing the corresponding
// links from the various NcSignal slots for all the NcSignal objects that were
// related to that NcTrack.
// So, in case the link introduced via SetLink() is the pointer of an NcTrack object,
// the user doesn't have to worry about clearing the corresponding NcTrack link from
// the NcSignal object when the corresponding NcTrack object is deleted.

Definition at line 2385 of file NcSignal.cxx.

◆ ResetLink() [2/2]

void NcSignal::ResetLink ( TString name,
Int_t k = 1 )
// Reset the link of the name-specified slot at position k.
//
// This memberfunction is intended to reset only 1 specified link location.
// For extended functionality, please refer to the memberfuction ResetLinks().
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 2416 of file NcSignal.cxx.

◆ ResetLinks() [1/2]

void NcSignal::ResetLinks ( TObject * obj,
Int_t j = 0,
Int_t k = 0 )
// Reset single or multiple slot link(s) according to user specified selections.
//
// IMPORTANT NOTE :
// ----------------
// This facility only acts on the slot related links.
// The global track reference list will not be affected.
// To remove all references to NcTrack (or derived) objects, please
// use the RemoveTrack() of RemoveTracks() memberfunctions.
//
// A link is only reset if the stored reference matches the argument "obj".
// In case obj=0 no check on the matching of the stored reference is performed
// and the stored link is always reset in accordance with the other
// selection criteria.
//
// In case the slot argument "j" is specified, only the links from that
// specified slot will be deleted.
// In case j=0 (default) no checking on the slot index is performed.
//
// In case the position argument "k" is specified, only the links from that
// specified position will be deleted.
// In case k=0 (default) no checking on the position index is performed.
//
// So, invokation of ResetLinks(obj) will remove all references to the
// object "obj" from the total NcSignal, whereas ResetLinks(obj,j)
// will remove all references to the object "obj" only from slot "j".
//
// Notes :
// -------
// The first slot is indicated as j=1, whereas the first position is at k=1.
//
// Invokation of ResetLinks(0,row,col) is equivalent to invoking the
// memberfunction ResetLink(row,col).
// Invoking the latter directly is slightly faster.
//
// Invokation of ResetLinks(0) will reset all stored references in this NcSignal.
//
// In general the user should take care of properly clearing the corresponding
// pointer here when the referred object is deleted.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// As such, the NcTrack destructor already takes care of clearing the corresponding
// links from the various NcSignal slots for all the NcSignal objects that were
// related to that NcTrack.
// So, in case the link introduced via SetLink() is the pointer of an NcTrack object,
// the user doesn't have to worry about clearing the corresponding NcTrack link from
// the NcSignal object when the corresponding NcTrack object is deleted.

Definition at line 2437 of file NcSignal.cxx.

◆ ResetLinks() [2/2]

void NcSignal::ResetLinks ( TObject * obj,
TString name,
Int_t k = 0 )
// Reset single or multiple slot link(s) according to user specified selections.
//
// IMPORTANT NOTE :
// ----------------
// This facility only acts on the slot related links.
// The global track reference list will not be affected.
// To remove all references to NcTrack (or derived) objects, please
// use the RemoveTrack() of RemoveTracks() memberfunctions.
//
// A link is only reset if the stored reference matches the argument "obj".
// In case obj=0 no check on the matching of the stored reference is performed
// and the stored link is always reset in accordance with the other
// selection criteria.
//
// In case the position argument "k" is specified, only the links from that
// specified position will be deleted.
// In case k=0 (default) no checking on the position index is performed.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().
//
// In general the user should take care of properly clearing the corresponding
// pointer here when the referred object is deleted.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// As such, the NcTrack destructor already takes care of clearing the corresponding
// links from the various NcSignal slots for all the NcSignal objects that were
// related to that NcTrack.
// So, in case the link introduced via SetLink() is the pointer of an NcTrack object,
// the user doesn't have to worry about clearing the corresponding NcTrack link from
// the NcSignal object when the corresponding NcTrack object is deleted.

Definition at line 2504 of file NcSignal.cxx.

◆ ResetSample() [1/2]

void NcSignal::ResetSample ( Int_t j = 1)
// Reset the sample data of the j-th (default j=1) sample.
// This memberfunction invokes NcSample::Reset() for the corresponding sample(s).
// To actually delete the sample(s) from memory, use DeleteSample().
// Notes : The first position is at j=1.
// j=0 ==> All samples will be reset.

Definition at line 1994 of file NcSignal.cxx.

◆ ResetSample() [2/2]

void NcSignal::ResetSample ( TString name)
// Reset the sample with the specified name.

Definition at line 2033 of file NcSignal.cxx.

◆ ResetSignals()

void NcSignal::ResetSignals ( Int_t mode = 0)
virtual
// Reset various signal data according to user selection.
//
// mode = 0 Reset all signal values, their errors and all waveform histos and samples.
// 1 Reset only signal values, waveform histos and samples.
// 2 Reset only signal errors, waveform histos and samples.
// -1 Reset only signal values.
// -2 Reset only signal errors.
//
// The default when invoking ResetSignals() corresponds to mode=0.

Definition at line 396 of file NcSignal.cxx.

◆ ResetWaveform() [1/2]

void NcSignal::ResetWaveform ( Int_t j = 1)
// Reset the histogram of the j-th (default j=1) waveform.
// This memberfunction invokes TH1F::Reset() for the corresponding waveform(s).
// To actually delete the histograms from memory, use DeleteWaveform().
// Notes : The first position is at j=1.
// j=0 ==> All waveforms will be reset.

Definition at line 1741 of file NcSignal.cxx.

◆ ResetWaveform() [2/2]

void NcSignal::ResetWaveform ( TString name)
// Reset the waveform with the specified name.

Definition at line 1780 of file NcSignal.cxx.

◆ SetDevice()

void NcSignal::SetDevice ( NcDevice * dev)
// Store the pointer to the device that owns this NcSignal (or derived) object.
// This facility may only be used internally by NcDevice (or derived) objects.

Definition at line 2731 of file NcSignal.cxx.

◆ SetLink() [1/2]

void NcSignal::SetLink ( TObject * obj,
Int_t j = 1,
Int_t k = 1 )
// Introduce a link (=pointer) to an object for the j-th slot at position k.
// Only the pointer values are stored for (backward) reference, meaning
// that the objects of which the pointers are stored are NOT owned
// by the NcSignal object.
//
// Notes :
// The first slot is at j=1 and the first position is at k=1.
// j=1 and k=1 are the default values.
//
// If needed, the storage area for the links is increased automatically.
//
// In case the pointer argument is zero, indeed a value of zero will be
// stored at the specified position (k) for the specified slot (j).
//
// In principle any object derived from TObject can be referred to by this
// mechanism.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// Therefore, in case the input argument "obj" points to an NcTrack (or derived)
// object, the current signal is automatically related to this NcTrack
// (or derived) object.
// Also a global link to this NcTrack (or derived) object will be stored
// via the AddTrack() facility.
//
// IMPORTANT NOTE :
// ----------------
// In case one just wants to relate the current NcSignal to a certain NcTrack
// without a specific signal slot association, it is much more efficient
// (both memory and CPU wise) to use the memberfunction AddTrack() instead.
//
// Please also have a look at the docs of the memberfunction ResetLink()
// to prevent the situation of stored pointers to non-existent object.

Definition at line 2183 of file NcSignal.cxx.

◆ SetLink() [2/2]

void NcSignal::SetLink ( TObject * obj,
TString name,
Int_t k = 1 )
// Introduce a link (=pointer) to an object for the name-spec. slot at position k.
// Only the pointer values are stored for (backward) reference, meaning
// that the objects of which the pointers are stored are NOT owned
// by the NcSignal object.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().
//
// In case the pointer argument is zero, indeed a value of zero will be
// stored at the specified position (k) for the specified slotname.
//
// In principle any object derived from TObject can be referred to by this
// mechanism.
// However, this "linking back" facility was introduced to enable NcSignal slots
// to refer directly to the various NcTracks to which the NcSignal object itself
// is related (see NcTrack::AddSignal).
// Therefore, in case the input argument "obj" points to an NcTrack (or derived)
// object, the current signal is automatically related to this NcTrack
// (or derived) object.
// Also a global link to this NcTrack (or derived) object will be stored
// via the AddTrack() facility.
//
// IMPORTANT NOTE :
// ----------------
// In case one just wants to relate the current NcSignal to a certain NcTrack
// without a specific signal slot association, it is much more efficient
// (both memory and CPU wise) to use the memberfunction AddTrack() instead.
//
// Please also have a look at the docs of the memberfunction ResetLink()
// to prevent the situation of stored pointers to non-existent object.

Definition at line 2239 of file NcSignal.cxx.

◆ SetSample()

void NcSignal::SetSample ( NcSample * sample,
Int_t j = 1 )
// Set the sample data for the j-th sample.
//
// Notes :
// The first sample position at j=1.
// j=1 is the default value.
//
// In case the value of the index j exceeds the maximum number of reserved
// positions for the samples, the number of reserved positions for the samples
// is increased automatically.
//
// In case the sample pointer argument has the same value as the current sample
// pointer value, no action is taken since the user has already modified
// the actual sample.
//
// In case the sample pointer argument is zero, the current sample
// is deleted and the pointer set to zero.
//
// In all other cases the current sample is deleted and a new
// copy of the input sample is created which becomes the current sample.

Definition at line 1941 of file NcSignal.cxx.

◆ SetSigFlags()

void NcSignal::SetSigFlags ( Int_t is,
Int_t ie,
Int_t j )
protected
// Store signal and/or error value flags of the j-th (default j=1) slot.
// Note : The first slot is at j=1.
// In case the value of the index j exceeds the maximum number of reserved
// slots for the flags, the number of reserved slots for the flags is
// increased automatically.
// The value stored is : 10*signalflag + errorflag.

Definition at line 1415 of file NcSignal.cxx.

◆ SetSignal() [1/2]

void NcSignal::SetSignal ( Double_t sig,
Int_t j = 1 )
virtual
// Store signal value for the j-th (default j=1) slot.
// Notes :
// -------
// 1) The first signal slot is at j=1.
// 2) In case the 'lock' flag was set for the specified slot, the new
// signal value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal value.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal values, the number of reserved slots for the
// signal values is increased automatically.

Reimplemented in NcCalmodule.

Definition at line 516 of file NcSignal.cxx.

◆ SetSignal() [2/2]

void NcSignal::SetSignal ( Double_t sig,
TString name )
virtual
// Store signal value for the name-specified slot.
//
// Note :
// ------
// In case the 'lock' flag was set for the specified slot, the new
// signal value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal value.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Reimplemented in NcCalmodule.

Definition at line 555 of file NcSignal.cxx.

◆ SetSignalError() [1/2]

void NcSignal::SetSignalError ( Double_t dsig,
Int_t j = 1 )
virtual
// Store error on the signal for the j-th (default j=1) slot.
// Notes :
// -------
// 1) The first signal slot is at j=1.
// 2) In case the 'lock' flag was set for the specified slot, the new
// signal error value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal error value.
// In case the value of the index j exceeds the maximum number of reserved
// slots for signal error values, the number of reserved slots for the
// signal errors is increased automatically.

Definition at line 845 of file NcSignal.cxx.

◆ SetSignalError() [2/2]

void NcSignal::SetSignalError ( Double_t dsig,
TString name )
virtual
// Store error on the signal for the name-specified slot.
//
// Note :
// ------
// In case the 'lock' flag was set for the specified slot, the new
// signal error value will not be stored.
// One has to unlock the specified slot first in case one really wants
// to overwite the signal error value.
//
// This procedure involves a slot-index search based on the specified name
// at each invokation. This may become slow in case many slots have been
// defined and/or when this procedure is invoked many times.
// In such cases it is preferable to use indexed addressing in the user code
// either directly or via a few invokations of GetSlotIndex().

Definition at line 884 of file NcSignal.cxx.

◆ SetSwapMode()

void NcSignal::SetSwapMode ( Int_t swap = 1)
// Set swapmode flag for the internal link storage.
// In case for the stored links the maximum slot number differs considerably
// from the maximum position number, it might be more efficient
// (w.r.t. memory usage and/or output file size) to internally store the
// link reference matrix with the rows and colums swapped.
// This swapping is only related with the internal storage and as such
// is completely hidden for the user.
// At invokation of this memberfunction the default argument is swap=1.
//
// Note : The swap mode can only be set as long as no links are
// stored in the NcSignal (i.e. a new instance of NcSignal
// or after invokation of the Reset() or ResetLinks() function).

Definition at line 2695 of file NcSignal.cxx.

◆ SetWaveform()

void NcSignal::SetWaveform ( TH1F * waveform,
Int_t j = 1 )
// Set the 1D waveform histogram for the j-th waveform.
//
// Notes :
// The first waveform position at j=1.
// j=1 is the default value.
//
// In case the value of the index j exceeds the maximum number of reserved
// positions for the waveforms, the number of reserved positions for the waveforms
// is increased automatically.
//
// In case the histo pointer argument has the same value as the current waveform
// histogram pointer value, no action is taken since the user has already
// modified the actual histogram.
//
// In case the histo pointer argument is zero, the current waveform histogram
// is deleted and the pointer set to zero.
//
// In all other cases the current waveform histogram is deleted and a new
// copy of the input histogram is created which becomes the current waveform
// histogram.

Definition at line 1687 of file NcSignal.cxx.

Member Data Documentation

◆ fDevice

TObject* NcSignal::fDevice
protected

Definition at line 113 of file NcSignal.h.

◆ fDevset

Bool_t NcSignal::fDevset

Definition at line 103 of file NcSignal.h.

◆ fDsignals

TArrayF* NcSignal::fDsignals
protected

Definition at line 108 of file NcSignal.h.

◆ fLinks

NcObjMatrix* NcSignal::fLinks
protected

Definition at line 112 of file NcSignal.h.

◆ fSamples

TObjArray* NcSignal::fSamples
protected

Definition at line 111 of file NcSignal.h.

◆ fSigflags

TArrayI* NcSignal::fSigflags
protected

Definition at line 109 of file NcSignal.h.

◆ fSignals

TArrayF* NcSignal::fSignals
protected

Definition at line 107 of file NcSignal.h.

◆ fTracks

TObjArray* NcSignal::fTracks
protected

Definition at line 114 of file NcSignal.h.

◆ fWaveforms

TObjArray* NcSignal::fWaveforms
protected

Definition at line 110 of file NcSignal.h.


The documentation for this class was generated from the following files: