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

Signal (Hit) handling of a generic device. More...

#include "NcDevice.h"

Inheritance diagram for NcDevice:
NcSignal NcPosition NcAttrib Nc3Vector 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

Signal (Hit) handling of a generic device.


Copyright(c) 2004 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 NcDevice
// Signal (Hit) handling of a generic device.
// Basically this class provides a user interface to group and handle
// various instances of NcSignal objects, called generically "hits".
// By default private copies of the recorded hits will be made.
// This implies that by default the device will own the registered hits.
// See the SetHitCopy() memberfunction for further details.
// An NcDevice object itself has (in addition to hit storage) also the
// complete functionality of the class NcSignal.
//
// Example :
// =========
//
// NcDevice m;
// // Set user defined status word to indicate e.g. readout electronics version
// m.SetStatus(100201);
// m.SetHitCopy(1);
// m.SetName("OM123");
//
// Float_t pos[3]={1,2,3};
// m.SetPosition(pos,"car");
//
// NcSignal s;
//
// s.Reset(1);
// s.SetName("OM123 Hit 1");
// s.SetSlotName("ADC");
// s.SetSignal(10);
// s.SetSlotName("LE",2);
// s.SetSignal(-100,2);
// s.SetSlotName("TOT",3);
// s.SetSignal(-1000,3);
// m.AddHit(s);
//
// s.Reset(1);
// s.SetName("OM123 Hit 2");
// s.SetSlotName("ADC");
// s.SetSignal(11);
// s.SetSlotName("LE",2);
// s.SetSignal(-101,2);
// s.SetSlotName("TOT",3);
// s.SetSignal(1001,3);
// m.AddHit(s);
//
// s.Reset(1);
// s.SetName("OM123 Hit 3");
// s.SetSlotName("ADC");
// s.SetSignal(12);
// s.SetSlotName("LE",2);
// s.SetSignal(-102,2);
// s.SetSlotName("TOT",3);
// s.SetSignal(-1002,3);
// m.AddHit(s);
//
// TObjArray* ordered=m.SortHits("TOT");
// nhits=ordered->GetEntries();
// for (Int_t i=0; i<nhits; i++)
// {
// NcSignal* sx=(NcSignal*)ordered->At(i);
// if (sx) sx->Data();
// }
//
//--- Author: Nick van Eijndhoven 23-jun-2004 Utrecht University
//- Modified: Nick van Eijndhoven, IIHE-VUB, Brussel, July 1, 2021 09:27Z

Definition at line 13 of file NcDevice.h.

Public Member Functions

 NcDevice (const char *name="", const char *title="")
 
 NcDevice (const NcDevice &dev)
 
virtual ~NcDevice ()
 
void AddHit (NcSignal &s)
 
void AddHit (NcSignal *s)
 
virtual TObject * Clone (const char *name="") const
 
virtual void Data (TString f="car", TString u="rad") const
 
void DisplayHits (Int_t idx=1, Float_t scale=-1, TObjArray *hits=0, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
 
void DisplayHits (TString name, Float_t scale=-1, TObjArray *hits=0, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
 
NcPosition GetCOG (TObjArray *hits, Int_t pos=0, TString slotname="none", Int_t mode=0) const
 
Double_t GetCVAL (TObjArray *hits, TString obsname, TString weightname="none", Int_t mode=0, Int_t type=1) const
 
void GetExtremes (Float_t &vmin, Float_t &vmax, Int_t idx=1, TObjArray *hits=0, Int_t mode=1, Int_t deadcheck=1) const
 
void GetExtremes (Float_t &vmin, Float_t &vmax, TString name, TObjArray *hits=0, Int_t mode=1, Int_t deadcheck=1) const
 
NcSignalGetHit (Int_t j) const
 
NcSignalGetHit (TString name, Int_t mode=0, Int_t opt=0) const
 
Int_t GetHitCopy () const
 
Nc3Vector GetHitPath (TObjArray *hits, Int_t pos=0) const
 
TObjArray * GetHits ()
 
void GetHits (TObjArray &selected, TString name, Int_t mode=0, Int_t opt=0, TObjArray *hits=0) const
 
NcSignalGetIdHit (Int_t id) const
 
Int_t GetNhits () const
 
Int_t GetNhits (TString name, Int_t mode=0, Int_t opt=0) const
 
Int_t GetStatus () const
 
void RemoveHit (NcSignal &s)
 
void RemoveHit (NcSignal *s)
 
void RemoveHits ()
 
virtual void Reset (Int_t mode=0)
 
void SetHitCopy (Int_t j)
 
virtual void SetOwner (Bool_t own=kTRUE)
 
void SetStatus (Int_t word)
 
void ShowHit (Int_t j=0, TString f="car", TString u="rad") const
 
Double_t SlideWindow (TObjArray *hits, Double_t thres, Double_t swin, TString sname, Int_t smode=0, TString wname="none", Int_t wmode=0, Int_t *i1=0, Int_t *i2=0) const
 
TObjArray * SortHits (Int_t idx=1, Int_t mode=-1, TObjArray *hits=0, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
 
TObjArray * SortHits (TString name, Int_t mode=-1, TObjArray *hits=0, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
 
Double_t SumSignals (Int_t idx, Int_t mode=1, TObjArray *hits=0)
 
Double_t SumSignals (TString name, Int_t mode=1, TObjArray *hits=0)
 
- Public Member Functions inherited from NcSignal
 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)
 
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)
 
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)
 

Protected Attributes

Int_t fHitCopy
 
TObjArray * fHits
 
TObjArray * fMarkers
 ! Temp. array to hold the 3D markers for the hit display
 
TObjArray * fOrdered
 ! Temp. array to hold the ordered hits
 
Int_t fStatus
 
- Protected Attributes inherited from NcSignal
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
 

Additional Inherited Members

- Public Attributes inherited from NcSignal
Bool_t fDevset
 
- Protected Member Functions inherited from NcSignal
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)
 

Constructor & Destructor Documentation

◆ NcDevice() [1/2]

NcDevice::NcDevice ( const char * name = "",
const char * title = "" )
// Default constructor.
// The user definable status word is set to zero.
// By default private copies of the recorded hits will be made.
// This implies that by default the device will own the registered hits.
// See the SetHitCopy() memberfunction for further details.

Definition at line 109 of file NcDevice.cxx.

◆ ~NcDevice()

NcDevice::~NcDevice ( )
virtual
// Default destructor.

Definition at line 128 of file NcDevice.cxx.

◆ NcDevice() [2/2]

NcDevice::NcDevice ( const NcDevice & dev)
// Copy constructor.

Definition at line 167 of file NcDevice.cxx.

Member Function Documentation

◆ AddHit() [1/2]

void NcDevice::AddHit ( NcSignal & s)
// Register an NcSignal object as a hit to this device.
// Note : In case this device owns the NcSignal object, the pointer to
// this device will be stored in the special owning device
// pointer of the NcSignal object and all (backward) links to this device
// will be removed from the NcSignal object.
// In case this device does not own the NcSignal object, a (backward)
// link to this device is added to the first slot of the NcSignal
// if there was no link to this device already present.
// This (backward) link is essential to prevent pointers to non-existing
// NcSignal objects when the corresponding NcSignal object is deleted.

Definition at line 336 of file NcDevice.cxx.

◆ AddHit() [2/2]

void NcDevice::AddHit ( NcSignal * s)
inline

Definition at line 26 of file NcDevice.h.

◆ Clone()

TObject * NcDevice::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 like NcEvent when adding objects in case the
// container owns the objects. This feature allows e.g. NcEvent
// to store either NcDevice objects or objects derived from NcDevice
// via tha AddDevice memberfunction, provided these derived classes also have
// a proper Clone memberfunction.

Reimplemented from NcSignal.

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

Definition at line 1774 of file NcDevice.cxx.

◆ Data()

void NcDevice::Data ( TString f = "car",
TString u = "rad" ) const
virtual
// Print the device and all registered hit info according to the specified
// coordinate frame f.
//
// The string 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 NcSignal.

Reimplemented in NcDetectorUnit.

Definition at line 692 of file NcDevice.cxx.

◆ DisplayHits() [1/2]

void NcDevice::DisplayHits ( Int_t idx = 1,
Float_t scale = -1,
TObjArray * hits = 0,
Int_t dp = 0,
Int_t mode = 1,
Int_t mcol = 4 )
// 3D color display of an array hits.
// The user can specify the index (default=1) of the signal slot to perform the display for.
// The marker size will indicate the absolute value of the signal (specified by the slotindex)
// as a percentage of the input argument "scale".
// In case scale<0 the maximum absolute signal value encountered in the hit array will be used
// to define the 100% scale. The default is scale=-1.
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the input array is not modified.
// In case dp=1 the device position will be used, otherwise the hit position will
// be used in the display. The default is dp=0.
// Via the "mcol" argument the user can specify the marker color (see TAttMarker).
// The default is mcol=4 (blue).
// Signals which were declared as "Dead" will not be displayed.
// The gain etc... corrected signals will be used to determine the marker size.
// The gain correction is performed according to "mode" argument. The definition of this
// "mode" parameter corresponds to the description provided in the GetSignal
// memberfunction of class NcSignal.
// The default is mode=1 (for backward compatibility reasons).
//
// Note :
// ------
// Before any display activity, a TCanvas and a TView have to be initiated
// first by the user like for instance
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();

Definition at line 1119 of file NcDevice.cxx.

◆ DisplayHits() [2/2]

void NcDevice::DisplayHits ( TString name,
Float_t scale = -1,
TObjArray * hits = 0,
Int_t dp = 0,
Int_t mode = 1,
Int_t mcol = 4 )
// 3D color display of an array hits.
// The user can specify the name of the signal slot to perform the display for.
// The marker size will indicate the absolute value of the signal (specified by the slotname)
// as a percentage of the input argument "scale".
// In case scale<0 the maximum absolute signal value encountered in the hit array will be used
// to define the 100% scale. The default is scale=-1.
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the input array is not modified.
// In case dp=1 the device position will be used, otherwise the hit position will
// be used in the display. The default is dp=0.
// The marker size will indicate the percentage of the maximum encountered value
// of the absolute value of the name-specified input signal slots.
// Via the "mcol" argument the user can specify the marker color (see TAttMarker).
// The default is mcol=4 (blue).
// Signals which were declared as "Dead" will not be displayed.
// The gain etc... corrected signals will be used to determine the marker size.
// The gain correction is performed according to "mode" argument. The definition of this
// "mode" parameter corresponds to the description provided in the GetSignal
// memberfunction of class NcSignal.
// The default is mode=1 (for backward compatibility reasons).
//
// Note :
// ------
// Before any display activity, a TCanvas and a TView have to be initiated
// first by the user like for instance
//
// TCanvas* c1=new TCanvas("c1","c1");
// TView* view=new TView(1);
// view->SetRange(-1000,-1000,-1000,1000,1000,1000);
// view->ShowAxis();

Definition at line 1226 of file NcDevice.cxx.

◆ GetCOG()

NcPosition NcDevice::GetCOG ( TObjArray * hits,
Int_t pos = 0,
TString slotname = "none",
Int_t mode = 0 ) const
// Provide the Center Of Gravity of the hits contained in the array "hits".
// Each hit can be given a weight according to the absolute value of the signal
// contained in the slot with the name "slotname".
// In case slotname="none" each hit will obtain a weight equal to 1.
// The input argument "mode" has the same meaning as in the GetSignal() member function
// of the class NcSignal.
//
// pos = 0 ==> The position of the hit signal itself is used.
// 1 ==> The position of the parent device of the hit signal is used.
//
// The defaults are pos=0, slotname="none" and mode=0.
//
// Note : In case of inconsistent input a "zero vector" will be returned.

Definition at line 1637 of file NcDevice.cxx.

◆ GetCVAL()

Double_t NcDevice::GetCVAL ( TObjArray * hits,
TString obsname,
TString weightname = "none",
Int_t mode = 0,
Int_t type = 1 ) const
// Provide the Central Value of the observed signals contained in the slot with name "obsname"
// in the array "hits". Depending on the input argument "type" the central value represents
// either the median (type=1) or the mean (type=2).
// Each hit can be given a weight according to the absolute value of the signal
// contained in the slot with the name "weightname".
// In case weightname="none" each hit will obtain a weight equal to 1.
// The input argument "mode" has the same meaning as in the GetSignal() member function
// of the class NcSignal.
//
// The defaults are weightname="none", mode=0 and type=1.
//
// Note : In case of inconsistent input 0 will be returned.

Definition at line 1699 of file NcDevice.cxx.

◆ GetExtremes() [1/2]

void NcDevice::GetExtremes ( Float_t & vmin,
Float_t & vmax,
Int_t idx = 1,
TObjArray * hits = 0,
Int_t mode = 1,
Int_t deadcheck = 1 ) const
// Provide the min. and max. signal values of an array of hits.
//
// Note : The arguments "vmin" and "max" MUST be both of type Float_t, otherwise the
// returned values may be incorrect.
//
// The input argument "idx" denotes the index of the signal slots to be investigated.
// The default is idx=1;
// In case hits=0 (default), the registered hits of the current device are used.
// The gain etc... corrected signals will be used in the process as specified
// by the "mode" argument. The definition of this "mode" parameter corresponds to
// the description provided in the GetSignal memberfunction of class NcSignal.
// The default is mode=1 (for backward compatibility reasons).
// The argument "deadcheck" allows to reject signals which were declared as "Dead".
// If deadcheck=0 the dead signals will be treated in the same way as the other signals.
// To achieve an identical treatment of dead and alive signals, the setting of deadcheck=0
// will automatically set also mode=0 to retrieve the stored signal values "as is".
// The default is deadcheck=1 (for backward compatibility reasons).

Definition at line 721 of file NcDevice.cxx.

◆ GetExtremes() [2/2]

void NcDevice::GetExtremes ( Float_t & vmin,
Float_t & vmax,
TString name,
TObjArray * hits = 0,
Int_t mode = 1,
Int_t deadcheck = 1 ) const
// Provide the min. and max. signal values of an array of hits.
//
// Note : The arguments "vmin" and "max" MUST be both of type Float_t, otherwise the
// returned values may be incorrect.
//
// The input argument "name" denotes the name of the signal slots to be investigated.
// In case hits=0 (default), the registered hits of the current device are used.
// The gain etc... corrected signals will be used in the process as specified
// by the "mode" argument. The definition of this "mode" parameter corresponds to
// the description provided in the GetSignal memberfunction of class NcSignal.
// The default is mode=1 (for backward compatibility reasons).
// The argument "deadcheck" allows to reject signals which were declared as "Dead".
// If deadcheck=0 the dead signals will be treated in the same way as the other signals.
// To achieve an identical treatment of dead and alive signals, the setting of deadcheck=0
// will automatically set also mode=0 to retrieve the stored signal values "as is".
// The default is deadcheck=1 (for backward compatibility reasons).

Definition at line 785 of file NcDevice.cxx.

◆ GetHit() [1/2]

NcSignal * NcDevice::GetHit ( Int_t j) const
// Provide the NcSignal object registered as hit number j.
// Note : j=1 denotes the first hit.

Definition at line 489 of file NcDevice.cxx.

◆ GetHit() [2/2]

NcSignal * NcDevice::GetHit ( TString name,
Int_t mode = 0,
Int_t opt = 0 ) const
// Provide the NcSignal object registered as hit with the specified hit or slot name.
// Note : The first hit encountered with the specified name will be provided.
//
// mode = 0 --> Only hits with a matching hit name will be considered
// 1 --> Only hits with a matching slot name will be considered
// 2 --> Hits matching in either hit name or slot name will be considered
//
// opt = 0 --> The specified name has to match exactly the hit or slotname
// 1 --> The specified name string has to be contained in the hit or slotname
//
// The defaults are mode=0 and opt=0.

Definition at line 510 of file NcDevice.cxx.

◆ GetHitCopy()

Int_t NcDevice::GetHitCopy ( ) const
// Provide value of the HitCopy mode.
// 0 ==> No private copies are made; pointers of original hits are stored.
// 1 ==> Private copies of the hits are made and these pointers are stored.

Definition at line 270 of file NcDevice.cxx.

◆ GetHitPath()

Nc3Vector NcDevice::GetHitPath ( TObjArray * hits,
Int_t pos = 0 ) const
// Provide the average direction of the hit pattern contained in the array "hits".
// The direction is obtained by starting at the first hit in the array
// and then a summation of all the relative hit locations while jumping
// from one hit location to the other.
// Since the obtained direction is obviously depending on the order in which the
// hits appear, the user should take care of providing a correctly ordered hit array.
//
// pos = 0 ==> The position of the hit signal itself is used.
// 1 ==> The position of the parent device of the hit signal is used.
//
// The default is pos=0.
//
// Note : In case of inconsistent input a "zero vector" will be returned.

Definition at line 1573 of file NcDevice.cxx.

◆ GetHits() [1/2]

TObjArray * NcDevice::GetHits ( )
// Provide the references to all the registered hits.

Definition at line 573 of file NcDevice.cxx.

◆ GetHits() [2/2]

void NcDevice::GetHits ( TObjArray & selected,
TString name,
Int_t mode = 0,
Int_t opt = 0,
TObjArray * hits = 0 ) const
// Provide the references to selected hits by looping over the input array "hits"
// and checking for the specified hit or signal slot name.
// A "hit" represents an abstract object which is derived from NcSignal.
// The selected hits are returned via the user provided TObjArray "selected".
// In case hits=0 (default), all the registered hits of the current device are used in the search.
// Note that the input array "hits" (when provided) is not modified.
//
// selected : The user provided array which will hold all the references to the selected hits.
//
// name : The user provided hit or signal slot name to be used for the hit selection.
//
// mode = 0 --> Hits with a matching hit name will be selected
// 1 --> Hits with a matching signal slot name will be selected
// 2 --> Hits matching in either hit name or signal slot name will be selected
// -1 --> Hits with NO matching hit name will be selected
// -2 --> Hits with NO matching signal slot name will be selected
// -3 --> Hits with NO matching hit name nor signal slot name will be selected
//
// opt = 0 --> The specified name has to match exactly the hit or slotname
// 1 --> The specified name string has to be contained in the hit or slotname
//
// hits : Optional input array with NcSignal objects to be used for the search.
//
// The defaults are mode=0, opt=0 and hits=0.

Definition at line 584 of file NcDevice.cxx.

◆ GetIdHit()

NcSignal * NcDevice::GetIdHit ( Int_t id) const
// Return the hit with unique identifier "id".

Definition at line 549 of file NcDevice.cxx.

◆ GetNhits() [1/2]

Int_t NcDevice::GetNhits ( ) const
// Provide the number of registered hits for this device.

Definition at line 437 of file NcDevice.cxx.

◆ GetNhits() [2/2]

Int_t NcDevice::GetNhits ( TString name,
Int_t mode = 0,
Int_t opt = 0 ) const
// Provide the number of hits registered with the specified hit or slot name.
//
// mode = 0 --> Only hits with a matching hit name will be considered
// 1 --> Only hits with a matching slot name will be considered
// 2 --> Hits matching in either hit name or slot name will be considered
//
// opt = 0 --> The specified name has to match exactly the hit or slotname
// 1 --> The specified name string has to be contained in the hit or slotname
//
// The defaults are mode=0 and opt=0.

Definition at line 450 of file NcDevice.cxx.

◆ GetStatus()

Int_t NcDevice::GetStatus ( ) const
// Provide the user defined status word for this device.

Definition at line 325 of file NcDevice.cxx.

◆ RemoveHit() [1/2]

void NcDevice::RemoveHit ( NcSignal & s)
// Remove NcSignal object registered as a hit from this device.

Definition at line 388 of file NcDevice.cxx.

◆ RemoveHit() [2/2]

void NcDevice::RemoveHit ( NcSignal * s)
inline

Definition at line 28 of file NcDevice.h.

◆ RemoveHits()

void NcDevice::RemoveHits ( )
// Remove all NcSignal objects registered as hits from this device.

Definition at line 412 of file NcDevice.cxx.

◆ Reset()

void NcDevice::Reset ( Int_t mode = 0)
virtual
// Reset registered hits and NcSignal attributes.
// Note : The status word and HitCopy flag are NOT modified.
// Use SetStatus() and SetHitCopy() to modify these parameters.
// See NcSignal::Reset() for further details.

Reimplemented from NcSignal.

Reimplemented in NcCalorimeter, and NcDetectorUnit.

Definition at line 222 of file NcDevice.cxx.

◆ SetHitCopy()

void NcDevice::SetHitCopy ( Int_t j)
// (De)activate the creation of private copies of the NcSignals added as hits.
// j=0 ==> No private copies are made; pointers of original hits are stored.
// j=1 ==> Private copies of the hits are made and these pointers are stored.
//
// Note : Once the storage contains pointer(s) to hit(s) one cannot
// change the HitCopy mode anymore.
// To change the HitCopy mode for an existing NcDevice containing
// hits one first has to invoke either RemoveHits() or Reset().

Definition at line 237 of file NcDevice.cxx.

◆ SetOwner()

void NcDevice::SetOwner ( Bool_t own = kTRUE)
virtual
// Set ownership of all added objects.
// The default parameter is own=kTRUE.
//
// Invokation of this memberfunction also sets all the copy modes
// (i.e. HitCopy) according to the value of own.
//
// This function (with own=kTRUE) is particularly useful when reading data
// from a tree/file, since Reset() will then actually remove all the
// added objects from memory irrespective of the copy mode settings
// during the tree/file creation process. In this way it provides a nice way
// of preventing possible memory leaks in the reading/analysis process.
//
// In addition this memberfunction can also be used as a shortcut to set all
// copy modes in one go during a tree/file creation process.
// However, in this case the user has to take care to only set/change the
// ownership (and copy mode) for empty objects (e.g. newly created objects
// or after invokation of the Reset() memberfunction) otherwise it will
// very likely result in inconsistent destructor behaviour.

Reimplemented in NcDetectorUnit.

Definition at line 283 of file NcDevice.cxx.

◆ SetStatus()

void NcDevice::SetStatus ( Int_t word)
// Set a user defined status word for this device.

Definition at line 314 of file NcDevice.cxx.

◆ ShowHit()

void NcDevice::ShowHit ( Int_t j = 0,
TString f = "car",
TString u = "rad" ) const
// Show data of the registered j-th hit according to the specified
// coordinate frame f.
// If j=0 all associated hits will be shown.
//
// The string 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 j=0, f="car" and "u=rad".

Definition at line 659 of file NcDevice.cxx.

◆ SlideWindow()

Double_t NcDevice::SlideWindow ( TObjArray * hits,
Double_t thres,
Double_t swin,
TString sname,
Int_t smode = 0,
TString wname = "none",
Int_t wmode = 0,
Int_t * i1 = 0,
Int_t * i2 = 0 ) const
// Perform a sliding window scan of some cumulated signal by looping over the input array "hits".
// A "hit" represents an abstract object which is (derived from) NcSignal.
// Note that the input array "hits" is not modified.
//
// The input array "hits" will be scanned from the start by setting "v1" as the value
// of the observable "sname" at the starting hit. The scanning will continue with the
// subsequent "sname" values and a (weighted) sum of these values will be determined.
// Every time a new "sname" value is investigated a variable "v2" is set to that "sname" value,
// which defines the (growing) scan window [v1,v2].
// The scanning stops if either the (weighted) sum reaches (or exceeds) the threshold value "thres"
// or the absolute size of the scan window |v2-v1| exceeds the maximum size "swin".
// In the former case the value "v2" is returned, whereas in the latter case the scan
// will be repeated starting from the hit following the previous starting hit in the array "hits".
// In case none of the search windows could reach (or exceed) the threshold "thres", the value 0 will be returned.
//
// Input arguments :
// -----------------
// hits : Input array with NcSignal (derived) objects to be used for the search.
// thres : The threshold for the cumulative signal.
// swin : The maximum size of the search interval window for the observable "sname".
// sname : The signal slot name to be used as observable.
// smode : The signal retrieval mode as documented in NcSignal::GetSignal.
// wname : The signal slot name to be used as weight.
// wmode : The weight retrieval mode as documented in NcSignal::GetSignal.
// i1 : Optional retrieved index in the "hits" array of the NcSignal object for which "v1" was obtained.
// i2 : Optional retrieved index in the "hits" array of the NcSignal object for which "v2" was obtained.
// The values of i1 and/or i2 are only returned if the corresponding input argument was a valid,
// non-zero pointer value.
// In case no search window [v1,v2] satisfied the search criteria the values i1=-1 and i2=-1 will be returned.
//
// Return value :
// --------------
// The value "v2" of the observable "sname" for which the search window [v1,v2] satisfies
// the user defined search criteria, or 0 in all other cases.
//
// Notes :
// -------
// 1) If wname="none" no weighting will be performed (i.e. all weights are set to 1)
// 2) For the scanning procedure the "sname" values should appear in a consecutive order.
// This implies that the user should take care of correctly ordering the input array "hits",
// for instance by using the SortHits() member function.
// 3) Using the return values of "i1" and "i2" the user can investigate the complete resulting search window
// and define any signal value other than the returned "v2" as the observable of interest.
//
// The defaults are smode=0, wname="none", wmode=0, i1=0 and i2=0.
// This implies that by default the array indices of the NcSignal objects corresponding to "v1" and "v2" are not provided.
//
// Example :
// ---------
// Assume that an NcEvent has a device of (an NcDevice derived) class "MyTimer" with many hits of which each hit contains
// an individual hit time "T" (in ms) and amplitude "Amp" (in ADC counts).
// We would like to determine an event start time at which at least 5% of the total observed "MyTimer" amplitude is recorded
// within a time window of 6 ms.
// This event start time can be obtained as follows ("evt" is the pointer to the NcEvent structure) :
//
// TObjArray* hits=new TObjArray();
// evt->SortHits("MyTimer","T",1,8,1,hits); // Sort hits with increasing hit time
// NcDevice scanner;
// Int_t i1,i2;
// Double_t totamp=scanner.SumSignals("Amp",8,hits);
// Double_t thres=0.05*totamp;
// Double_t tstart=scanner.SlideWindow(hits,thres,6,"T",8,"Amp",8,&i1,&i2);
// // Investigate all the signals in the found time window
// for (Int_t i=i1; i<=i2; i++)
// {
// if (i<0) break;
// NcSignal* sx=(NcSignal*)hits->At(i);
// if (sx) sx->Data();
// }

Definition at line 1428 of file NcDevice.cxx.

◆ SortHits() [1/2]

TObjArray * NcDevice::SortHits ( Int_t idx = 1,
Int_t mode = -1,
TObjArray * hits = 0,
Int_t mcal = 1,
Int_t deadcheck = 1,
TObjArray * ordered = 0 )
// Order the references to an array of hits by looping over the input array "hits"
// and checking the signal value.
// The ordered array is returned as a TObjArray either via a user provided array "ordered"
// or as a returned pointer.
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the original hit array is not modified.
// A "hit" represents an abstract object which is derived from NcSignal.
// The user can specify the index of the signal slot to perform the sorting on.
// By default the slotindex will be 1.
// Via the "mode" argument the user can specify ordering in decreasing
// order (mode=-1) or ordering in increasing order (mode=1).
// The default is mode=-1.
// The gain etc... corrected signals will be used in the ordering process as
// specified by the "mcal" argument. The definition of this "mcal" parameter
// corresponds to the signal correction mode described in the GetSignal
// memberfunction of class NcSignal.
// The default is mcal=1 (for backward compatibility reasons).
// The argument "deadcheck" allows to reject signals which were declared as "Dead".
// If deadcheck=0 the dead signals will be treated in the same way as the other signals.
// To achieve an identical treatment of dead and alive signals, the setting of deadcheck=0
// will automatically set also mcal=0 to retrieve the stored signal values "as is".
// The default is deadcheck=1 (for backward compatibility reasons).
//
// Note :
// ------
// In case ordered=0 the ordered hit pointers are returned via a multi-purpose array,
// which may be overwritten by other memberfunctions (not restricted to hit ordering).
// It is recommended to provide a user defined array via the argument "ordered" to omit
// the danger of overwriting (or being overwritten by) other selections and to allow to use
// the ordered hit list amongst other selections.
// In case a user defined array "ordered" is provided, this memberfunction returns 0 for the
// return argument.
//
// The default is ordered=0.

Definition at line 855 of file NcDevice.cxx.

◆ SortHits() [2/2]

TObjArray * NcDevice::SortHits ( TString name,
Int_t mode = -1,
TObjArray * hits = 0,
Int_t mcal = 1,
Int_t deadcheck = 1,
TObjArray * ordered = 0 )
// Order the references to an array of hits by looping over the input array "hits"
// and checking the signal value.
// The ordered array is returned as a TObjArray either via a user provided array "ordered"
// or as a returned pointer.
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the input array is not modified.
// A "hit" represents an abstract object which is derived from NcSignal.
// The user can specify the name of the signal slot to perform the sorting on.
// In case no matching slotname is found, the signal will be skipped.
// Via the "mode" argument the user can specify ordering in decreasing
// order (mode=-1) or ordering in increasing order (mode=1).
// The default is mode=-1.
// The gain etc... corrected signals will be used in the ordering process as
// specified by the "mcal" argument. The definition of this "mcal" parameter
// corresponds to the signal correction mode described in the GetSignal
// memberfunction of class NcSignal.
// The default is mcal=1 (for backward compatibility reasons).
// The argument "deadcheck" allows to reject signals which were declared as "Dead".
// If deadcheck=0 the dead signals will be treated in the same way as the other signals.
// To achieve an identical treatment of dead and alive signals, the setting of deadcheck=0
// will automatically set also mcal=0 to retrieve the stored signal values "as is".
// The default is deadcheck=1 (for backward compatibility reasons).
//
// Note :
// ------
// In case ordered=0 the ordered hit pointers are returned via a multi-purpose array,
// which may be overwritten by other memberfunctions (not restricted to hit ordering).
// It is recommended to provide a user defined array via the argument "ordered" to omit
// the danger of overwriting (or being overwritten by) other selections and to allow to use
// the ordered hit list amongst other selections.
// In case a user defined array "ordered" is provided, this memberfunction returns 0 for the
// return argument.
//
// The default is ordered=0.

Definition at line 984 of file NcDevice.cxx.

◆ SumSignals() [1/2]

Double_t NcDevice::SumSignals ( Int_t idx,
Int_t mode = 1,
TObjArray * hits = 0 )
// Summation of selected signal values by looping over the input array "hits".
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the original hit array is not modified.
// A "hit" represents an abstract object which is derived from NcSignal.
// The user has to specify the index "idx" of the signal slot to perform the summation on.
// Note that idx=1 corresponds to the first signal slot.
// The gain etc... corrected signals may be used in the summation process as
// specified by the "mode" argument. The definition of this "mode" parameter
// corresponds to the signal correction mode described in the GetSignal
// memberfunction of class NcSignal.
// The default in the summation process is mode=1.

Definition at line 1338 of file NcDevice.cxx.

◆ SumSignals() [2/2]

Double_t NcDevice::SumSignals ( TString name,
Int_t mode = 1,
TObjArray * hits = 0 )
// Summation of selected signal values by looping over the input array "hits".
// In case hits=0 (default), the registered hits of the current device are used.
// Note that the original hit array is not modified.
// A "hit" represents an abstract object which is derived from NcSignal.
// The user has to specify the signal slot to perform the summation on via
// the input argument "name".
// The gain etc... corrected signals may be used in the summation process as
// specified by the "mode" argument. The definition of this "mode" parameter
// corresponds to the signal correction mode described in the GetSignal
// memberfunction of class NcSignal.
// The default in the summation process is mode=1.

Definition at line 1384 of file NcDevice.cxx.

Member Data Documentation

◆ fHitCopy

Int_t NcDevice::fHitCopy
protected

Definition at line 55 of file NcDevice.h.

◆ fHits

TObjArray* NcDevice::fHits
protected

Definition at line 56 of file NcDevice.h.

◆ fMarkers

TObjArray* NcDevice::fMarkers
protected

! Temp. array to hold the 3D markers for the hit display

Definition at line 58 of file NcDevice.h.

◆ fOrdered

TObjArray* NcDevice::fOrdered
protected

! Temp. array to hold the ordered hits

Definition at line 57 of file NcDevice.h.

◆ fStatus

Int_t NcDevice::fStatus
protected

Definition at line 54 of file NcDevice.h.


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