NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcDetectorUnit.h
Go to the documentation of this file.
1#ifndef NcDetectorUnit_h
2#define NcDetectorUnit_h
3
4// Copyright(c) 2021 NCFS/IIHE, All Rights Reserved.
5// See cxx source for full Copyright notice.
6
7#include <math.h>
8
9#include "TMath.h"
10
11#include "NcDevice.h"
12#include "NcSample.h"
13
15
17{
18 public:
19 NcDetectorUnit(const char* name="",const char* title=""); // Default constructor
20 virtual ~NcDetectorUnit(); // Default destructor
21 NcDetectorUnit(const NcDetectorUnit& q); // Copy constructor
22 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
23 virtual void SetOwner(Bool_t own=kTRUE); // Set ownership of all added objects
24 using NcDevice::Data;
25 virtual void Data(TString f="car",TString u="rad"); // Print the detector unit info within frame f and ang units u
26 void SetDevCopy(Int_t j); // (De)activate creation of private copies of the devices
27 Int_t GetDevCopy() const; // Provide DevCopy flag value
28 virtual void Reset(Int_t mode=0); // Reset registered devices, hits and NcSignal attributes
29 void AddDevice(NcDevice& d); // Add a device to the detector unit
30 void AddDevice(NcDevice* d) { if (d) AddDevice(*d); }
31 void RemoveDevice(NcDevice* d); // Remove the specified device from the detector unit
32 Int_t GetNdevices(Bool_t follow); // Provide the number of devices
33 Int_t GetNdevices(TString classname,Bool_t follow,TObjArray* hits=0); // Provide the number of selected devices
34 void ShowDevices(Int_t mode=1,Bool_t header=kTRUE); // Provide on overview of the available devices
35 void ShowDevices(TString classname,Int_t mode=1,Bool_t header=kTRUE); // Overview of selected devices
36 NcDevice* GetDevice(Int_t i) const; // Provide i-th device of the detector unit
37 NcDevice* GetDevice(TString name,Bool_t follow);// Provide the device with name "name"
38 NcDevice* GetIdDevice(Int_t id,Bool_t follow,TObjArray* devs=0); // Get device with identifier "id"
39 NcDevice* GetIdDevice(Int_t id,TString classname,Bool_t follow); // Get device with identifier "id" of specified class
40 TObjArray* GetDevices(TString classname,Bool_t follow,TObjArray* devices=0); // Provide references to the devices derived from the specified class
41 NcDetectorUnit* GetDetectorUnit(TString name,Bool_t follow);// Provide the detector unit with name "name"
42 NcDetectorUnit* GetIdDetectorUnit(Int_t id,Bool_t follow,TObjArray* devs=0); // Get detector unit with identifier "id"
43 NcDetectorUnit* GetIdDetectorUnit(Int_t id,TString classname,Bool_t follow); // Get detector unit with identifier "id" of specified class
44 Int_t GetNhitsDevices(TString classname,Bool_t follow,Bool_t inc); // Provide number of hits for the specified device class
45 TObjArray* GetHitsDevices(TString classname,Bool_t follow,Bool_t inc,TObjArray* hits=0,TString name="none",Int_t mode=0,Int_t opt=0); // Provide refs to all hits of the specified device class and selections
46 NcSignal* GetIdHit(Int_t id,TString classname,Bool_t follow,Bool_t inc); // Provide hit with unique "id" for the specified device class
47 void ShowHits(TString classname,Bool_t follow,Bool_t inc,Int_t mode=1,TString f="car",TString u="rad"); // Overview of all hits of selected devices
49 TObjArray* SortHits(TString classname,Bool_t follow,Bool_t inc,TString name,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort hits by named signal
50 TObjArray* SortHits(TString classname,Bool_t follow,Bool_t inc,Int_t idx=1,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort hits by indexed signal
51 void DisplayHits(TString classname,Bool_t follow,Bool_t inc,TString name,Float_t scale=-1,Int_t dp=0,Int_t mode=1,Int_t mcol=4);
52 void DisplayHits(TString classname,Bool_t follow,Bool_t inc,Int_t idx=1,Float_t scale=-1,Int_t dp=0,Int_t mode=1,Int_t mcol=4);
53 TObjArray* SortDevices(TString classname,Bool_t follow,Bool_t inc,TString name,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
54 TObjArray* SortDevices(TString classname,Bool_t follow,Bool_t inc,Int_t idx=1,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
55 TObjArray* SortDevices(TObjArray* hits,TString name,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
56 TObjArray* SortDevices(TObjArray* hits,Int_t idx=1,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
57
58 protected:
59 TObjArray* fDevices; // Array to hold the pointers to the various devices
60 Int_t fDevCopy; // Flag to denote creation of private copies of the devices
61 TObjArray* fDevs;
62 TObjArray* fThits;
63 TObjArray* fOrdered;
64 TObject* fDisplay;
65
66 void LoadHits(TString classname,Bool_t follow,Bool_t inc,TObjArray* hits=0,NcDetectorUnit* unit=0); // Load references to the hits registered to the specified device class
67 void LoadDevices(TString classname,Bool_t follow,TObjArray* hits=0,NcDetectorUnit* unit=0); // Load references to the devices derived from the specified device class
68 void ShowDevicesTree(TString classname,Int_t mode=1,NcDetectorUnit* unit=0); // Overview of selected devices
69
70 ClassDef(NcDetectorUnit,1) // Handling of a collection of generic devices
71};
72#endif
Handling of a collection of generic devices.
TObject * fDisplay
! Temp. pointer to hold objects which serve event displays
NcDetectorUnit(const char *name="", const char *title="")
void DisplayHits(TString classname, Bool_t follow, Bool_t inc, TString name, Float_t scale=-1, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
Int_t GetDevCopy() const
void ShowDevicesTree(TString classname, Int_t mode=1, NcDetectorUnit *unit=0)
Int_t GetNdevices(Bool_t follow)
void LoadHits(TString classname, Bool_t follow, Bool_t inc, TObjArray *hits=0, NcDetectorUnit *unit=0)
TObjArray * fThits
! Temp. array to hold references to the registered NcDevice hits
void AddDevice(NcDevice &d)
TObjArray * GetDevices(TString classname, Bool_t follow, TObjArray *devices=0)
Int_t GetNhitsDevices(TString classname, Bool_t follow, Bool_t inc)
virtual void Reset(Int_t mode=0)
void SetDevCopy(Int_t j)
NcDetectorUnit * GetIdDetectorUnit(Int_t id, Bool_t follow, TObjArray *devs=0)
void RemoveDevice(NcDevice *d)
TObjArray * SortDevices(TString classname, Bool_t follow, Bool_t inc, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
virtual TObject * Clone(const char *name="") const
TObjArray * GetHitsDevices(TString classname, Bool_t follow, Bool_t inc, TObjArray *hits=0, TString name="none", Int_t mode=0, Int_t opt=0)
virtual void SetOwner(Bool_t own=kTRUE)
virtual void Data(TString f="car", TString u="rad")
NcSignal * GetIdHit(Int_t id, TString classname, Bool_t follow, Bool_t inc)
TObjArray * fDevs
! Temp. array to hold references to user selected devices
TObjArray * fOrdered
! Temp. array to hold references to various ordered objects
TObjArray * SortHits(TString classname, Bool_t follow, Bool_t inc, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
void LoadDevices(TString classname, Bool_t follow, TObjArray *hits=0, NcDetectorUnit *unit=0)
void ShowHits(TString classname, Bool_t follow, Bool_t inc, Int_t mode=1, TString f="car", TString u="rad")
NcDetectorUnit * GetDetectorUnit(TString name, Bool_t follow)
NcDevice * GetIdDevice(Int_t id, Bool_t follow, TObjArray *devs=0)
TObjArray * fDevices
void ShowDevices(Int_t mode=1, Bool_t header=kTRUE)
virtual ~NcDetectorUnit()
void AddDevice(NcDevice *d)
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
virtual void Data(TString f="car", TString u="rad") const
Definition NcDevice.cxx:692
NcDevice(const char *name="", const char *title="")
Definition NcDevice.cxx:109
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
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
NcDevice * GetDevice() const