NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcDevice.h
Go to the documentation of this file.
1#ifndef NcDevice_h
2#define NcDevice_h
3// Copyright(c) 2004 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include "TPolyMarker3D.h"
7#include "TMath.h"
8
9#include "NcSignal.h"
10
12
13class NcDevice : public NcSignal
14{
15 public:
16 NcDevice(const char* name="",const char* title="");// Default constructor
17 virtual ~NcDevice(); // Default destructor
18 NcDevice(const NcDevice& dev); // Copy constructor
19 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
20 virtual void SetOwner(Bool_t own=kTRUE); // Set ownership of all added objects
21 void SetStatus(Int_t word); // Set the status word (user definable)
22 Int_t GetStatus() const; // Provide the status word
23 void SetHitCopy(Int_t j); // (De)activate creation of private copies of hits
24 Int_t GetHitCopy() const; // Provide HitCopy flag value
25 void AddHit(NcSignal& s); // Register an NcSignal object as a hit to this module
26 void AddHit(NcSignal* s) { if (s) AddHit(*s); }
27 void RemoveHit(NcSignal& s); // Remove NcSignal object as hit from this module
28 void RemoveHit(NcSignal* s) { if (s) RemoveHit(*s); }
29 void RemoveHits(); // Remove all NcSignals as hits from this module
30 Int_t GetNhits() const; // Provide number of registered hits
31 Int_t GetNhits(TString name,Int_t mode=0,Int_t opt=0) const; // Provide number of hits registered with the specified hit or slot name
32 NcSignal* GetHit(Int_t j) const; // Access to the NcSignal registered as hit number j
33 NcSignal* GetHit(TString name,Int_t mode=0,Int_t opt=0) const; // Provide the hit with the specified hit or slot name
34 NcSignal* GetIdHit(Int_t id) const; // Provide the hit with unique identifier "id"
35 TObjArray* GetHits(); // Provide the references to all the registered hits
36 void GetHits(TObjArray& selected,TString name,Int_t mode=0,Int_t opt=0,TObjArray* hits=0) const; // Provide the references to all the hits with the specified hit or slot name
37 virtual void Reset(Int_t mode=0); // Reset registered hits and NcSignal attributes
38 void ShowHit(Int_t j=0,TString f="car",TString u="rad") const; // Show data of the j-th hit (j=0 means all hits) for frame f and ang units u
39 virtual void Data(TString f="car",TString u="rad") const; // Print device/signal info for frame f and ang units u
40 void GetExtremes(Float_t& vmin,Float_t& vmax,Int_t idx=1,TObjArray* hits=0,Int_t mode=1,Int_t deadcheck=1) const; // min and max signal
41 void GetExtremes(Float_t& vmin,Float_t& vmax,TString name,TObjArray* hits=0,Int_t mode=1,Int_t deadcheck=1) const;// min and max signal
42 TObjArray* SortHits(TString name,Int_t mode=-1,TObjArray* hits=0,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0);// Sort hits by named signal value
43 TObjArray* SortHits(Int_t idx=1,Int_t mode=-1,TObjArray* hits=0,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort hits by indexed signal value
44 void DisplayHits(TString name,Float_t scale=-1,TObjArray* hits=0,Int_t dp=0,Int_t mode=1,Int_t mcol=4);// Hit disp.
45 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); // Hit disp.
46 Double_t SumSignals(Int_t idx,Int_t mode=1,TObjArray* hits=0); // Summation of selected signal values
47 Double_t SumSignals(TString name,Int_t mode=1,TObjArray* hits=0); // Summation of selected signal values
48 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; // Sliding window scan of signals
49 Nc3Vector GetHitPath(TObjArray* hits,Int_t pos=0) const; // Provide the average direction of specified hit pattern
50 NcPosition GetCOG(TObjArray* hits,Int_t pos=0,TString slotname="none",Int_t mode=0) const; // Provide the Center Of Gravity of the specified hits
51 Double_t GetCVAL(TObjArray* hits,TString obsname,TString weightname="none",Int_t mode=0,Int_t type=1) const; // Provide the Central Value of "obsname" of the specified hits
52
53 protected:
54 Int_t fStatus; // User definable status word
55 Int_t fHitCopy; // Flag to denote making private copies of added hits
56 TObjArray* fHits; // Array to hold the registered hits
57 TObjArray* fOrdered;
58 TObjArray* fMarkers;
59
60 ClassDef(NcDevice,13) // Signal (Hit) handling of a generic device.
61};
62#endif
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
void RemoveHit(NcSignal &s)
Definition NcDevice.cxx:388
void AddHit(NcSignal &s)
Definition NcDevice.cxx:336
TObjArray * GetHits()
Definition NcDevice.cxx:573
TObjArray * fMarkers
! Temp. array to hold the 3D markers for the hit display
Definition NcDevice.h:58
Double_t SumSignals(Int_t idx, Int_t mode=1, TObjArray *hits=0)
TObjArray * fHits
Definition NcDevice.h:56
void RemoveHits()
Definition NcDevice.cxx:412
NcPosition GetCOG(TObjArray *hits, Int_t pos=0, TString slotname="none", Int_t mode=0) const
virtual void Data(TString f="car", TString u="rad") const
Definition NcDevice.cxx:692
Nc3Vector GetHitPath(TObjArray *hits, Int_t pos=0) const
NcDevice(const char *name="", const char *title="")
Definition NcDevice.cxx:109
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 * fOrdered
! Temp. array to hold the ordered hits
Definition NcDevice.h:57
void SetHitCopy(Int_t j)
Definition NcDevice.cxx:237
Int_t GetHitCopy() const
Definition NcDevice.cxx:270
virtual TObject * Clone(const char *name="") const
Int_t fHitCopy
Definition NcDevice.h:55
void DisplayHits(TString name, Float_t scale=-1, TObjArray *hits=0, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
virtual ~NcDevice()
Definition NcDevice.cxx:128
void RemoveHit(NcSignal *s)
Definition NcDevice.h:28
void SetStatus(Int_t word)
Definition NcDevice.cxx:314
Int_t fStatus
Definition NcDevice.h:54
virtual void SetOwner(Bool_t own=kTRUE)
Definition NcDevice.cxx:283
NcSignal * GetIdHit(Int_t id) const
Definition NcDevice.cxx:549
Double_t GetCVAL(TObjArray *hits, TString obsname, TString weightname="none", Int_t mode=0, Int_t type=1) const
Int_t GetNhits() const
Definition NcDevice.cxx:437
NcSignal * GetHit(Int_t j) const
Definition NcDevice.cxx:489
void GetExtremes(Float_t &vmin, Float_t &vmax, Int_t idx=1, TObjArray *hits=0, Int_t mode=1, Int_t deadcheck=1) const
Definition NcDevice.cxx:721
void ShowHit(Int_t j=0, TString f="car", TString u="rad") const
Definition NcDevice.cxx:659
void AddHit(NcSignal *s)
Definition NcDevice.h:26
virtual void Reset(Int_t mode=0)
Definition NcDevice.cxx:222
Int_t GetStatus() const
Definition NcDevice.cxx:325
TObjArray * SortHits(TString name, Int_t mode=-1, TObjArray *hits=0, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
Definition NcDevice.cxx:984
Handling of positions (with timestamps) in various reference frames.
Definition NcPosition.h:18
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
NcSignal(const char *name="", const char *title="")
Definition NcSignal.cxx:155