NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcEvent.h
Go to the documentation of this file.
1#ifndef NcEvent_h
2#define NcEvent_h
3// Copyright(c) 2001 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include "TDatime.h"
7
8#include "NcVertex.h"
9#include "NcTimestamp.h"
10#include "NcDetector.h"
11
13
14class NcEvent : public NcVertex,public NcTimestamp
15{
16 public:
17 NcEvent(); // Default constructor
18 NcEvent(Int_t n); // Create an event to hold initially n tracks
19 virtual ~NcEvent(); // Default destructor
20 NcEvent(const NcEvent& evt); // Copy constructor
21 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
22 virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
23 void SetDayTime(TTimeStamp& stamp); // (Obsolete, see docs) Set date/time exactly as specified (1ns accuracy)
24 void SetDayTime(TDatime& stamp); // (Obsolete, see docs) Set date/time interpreted as local time (1s accuracy)
25 void SetRunNumber(Int_t run); // Set the run number
26 void SetEventNumber(Int_t evt); // Set the event number
27 void SetProjectile(Int_t a,Int_t z,Double_t pnuc,Int_t id=0); // Set projectile A, Z, momentum per nucleon and id
28 void SetProjectile(Int_t a,Int_t z,Nc3Vector& p,Int_t id=0); // Set projectile A, Z, 3-momentum per nucleon and id
29 Int_t GetProjectileA() const; // Provide A value of the projectile
30 Int_t GetProjectileZ() const; // Provide Z value of the projectile
31 Double_t GetProjectilePnuc() const; // Provide the projectile momentum value per nucleon
32 Int_t GetProjectileId() const; // Provide the user defined particle ID of the projectile
33 void SetTarget(Int_t a,Int_t z,Double_t pnuc,Int_t id=0); // Set target A, Z, momentum per nucleon and id
34 void SetTarget(Int_t a,Int_t z,Nc3Vector& p,Int_t id=0); // Set target A, Z, 3-momentum per nucleon and id
35 Int_t GetTargetA() const; // Provide A value of the target
36 Int_t GetTargetZ() const; // Provide Z value of the target
37 Double_t GetTargetPnuc() const; // Provide the target momentum value per nucleon
38 Int_t GetTargetId() const; // Provide the user defined particle ID of the target
39 virtual void Reset(); // Reset all values
40 TTimeStamp GetDayTime() const; // (Obsolete, see docs) Provide the date and time stamp
41 Int_t GetRunNumber() const; // Provide the run number
42 Int_t GetEventNumber() const; // Provide the event number
43 virtual void HeaderData(); // Print the event header information
44 using NcVertex::Data;
45 virtual void Data(TString f="car",TString u="rad"); // Print the event info within frame f and ang units u
46 void SetDevCopy(Int_t j); // (De)activate creation of private copies of the devices
47 Int_t GetDevCopy() const; // Provide DevCopy flag value
48 void AddDevice(NcDevice& d); // Add a device to the event
49 void AddDevice(NcDevice* d) { if (d) AddDevice(*d); }
50 void RemoveDevice(NcDevice* d); // Remove the specified device from the event
51 void SetDetector(NcDetector d); // Store the detector structure
52 void SetDetector(NcDetector* d) { if (d) SetDetector(*d); }
53 NcDetector* GetDetector() const; // Provide the pointer to the (top level) detector structure
54 Int_t GetNdevices() const; // Provide the number of devices
55 Int_t GetNdevices(TString classname,TObjArray* hits=0) const; // Provide the number of selected devices
56 void ShowDevices(Int_t mode=1,Bool_t header=kTRUE) const; // Provide on overview of the available devices
57 void ShowDevices(TString classname,Int_t mode=1,Bool_t header=kTRUE) const; // Overview of selected devices
58 TObjArray* GetDevices(TString classname,TObjArray* devices=0); // Provide references to the devices derived from the specified class
59 NcDevice* GetDevice(Int_t i) const; // Provide i-th device of the event
60 NcDevice* GetDevice(TString name) const;// Provide the device with name "name"
61 NcDevice* GetIdDevice(Int_t id,TObjArray* devs=0) const; // Get device with identifier "id"
62 NcDevice* GetIdDevice(Int_t id,TString classname) const; // Get device with identifier "id" of specified class
63 Int_t GetNhits(TString classname); // Provide number of hits for the specified device class
64 TObjArray* GetHits(TString classname,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
65 NcSignal* GetIdHit(Int_t id,TString classname); // Provide hit with unique "id" for the specified device class
66 TObjArray* SortHits(TString classname,TString name,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort hits by named signal
67 TObjArray* SortHits(TString classname,Int_t idx=1,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort hits by indexed signal
68 Nc3Vector GetHitPath(TObjArray* hits,Int_t pos=0) const; // Provide the average direction of specified hit pattern
69 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
70 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
71 void GetExtremes(TString classname,Float_t& vmin,Float_t& vmax,Int_t idx=1,Int_t mode=1,Int_t deadcheck=1); // min and max signal
72 void GetExtremes(TString classname,Float_t& vmin,Float_t& vmax,TString name,Int_t mode=1,Int_t deadcheck=1);// min and max signal
73 void DisplayHits(TString classname,TString name,Float_t scale=-1,Int_t dp=0,Int_t mode=1,Int_t mcol=4);
74 void DisplayHits(TString classname,Int_t idx=1,Float_t scale=-1,Int_t dp=0,Int_t mode=1,Int_t mcol=4);
75 void ShowHits(TString classname,Int_t mode=1,TString f="car",TString u="rad"); // Overview of all hits of selected devices
76 TObjArray* SortDevices(TString classname,TString name,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
77 TObjArray* SortDevices(TString classname,Int_t idx=1,Int_t mode=-1,Int_t mcal=1,Int_t deadcheck=1,TObjArray* ordered=0); // Sort devices by signal
78 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
79 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
80 void SetWeight(Double_t weight); // Set the event weight
81 Double_t GetWeight() const; // Provide the event weight
82 void SetSelectLevel(Int_t level); // Set the event selection level
83 Int_t GetSelectLevel() const; // Provide the event selection level
84
85 protected:
86 Int_t fRun; // The run number
87 Int_t fEvent; // The event number
88 Double_t fWeight; // The event weight
89 Int_t fSelectLevel; // The event selection level (<0:reject 0:undecided >0:accept)
90 NcDetector* fDetector; // Pointer to the (top level) detector structure
91 TObjArray* fDevices; // Array to hold the pointers to the various devices
92 Int_t fDevCopy; // Flag to denote creation of private copies of the devices
93 TObjArray* fHits;
94 TObjArray* fOrdered;
95 TObject* fDisplay;
96 TObjArray* fDevs;
97
98 void LoadHits(TString classname,TObjArray* hits=0); // Load references to the hits registered to the specified device class
99 void CreateDetector(); // Create a default detector structure
100
101 ClassDef(NcEvent,12) // Creation and investigation of an NCFS generic event structure.
102};
103#endif
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
Creation and investigation of an NCFS generic detector structure.
Definition NcDetector.h:12
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
NcPosition GetCOG(TObjArray *hits, Int_t pos=0, TString slotname="none", Int_t mode=0) const
Definition NcEvent.cxx:2116
Int_t GetProjectileId() const
Definition NcEvent.cxx:819
TObjArray * fDevs
! Temp. array to hold references to user selected devices
Definition NcEvent.h:96
NcDetector * fDetector
Definition NcEvent.h:90
NcDevice * GetIdDevice(Int_t id, TObjArray *devs=0) const
Definition NcEvent.cxx:1451
TObjArray * SortDevices(TString classname, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
Definition NcEvent.cxx:2403
TObjArray * SortHits(TString classname, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
Definition NcEvent.cxx:2016
void SetProjectile(Int_t a, Int_t z, Double_t pnuc, Int_t id=0)
Definition NcEvent.cxx:670
Double_t fWeight
Definition NcEvent.h:88
Double_t GetTargetPnuc() const
Definition NcEvent.cxx:968
virtual void Reset()
Definition NcEvent.cxx:436
Int_t GetDevCopy() const
Definition NcEvent.cxx:1357
void AddDevice(NcDevice &d)
Definition NcEvent.cxx:1210
void LoadHits(TString classname, TObjArray *hits=0)
Definition NcEvent.cxx:1881
void AddDevice(NcDevice *d)
Definition NcEvent.h:49
TObject * fDisplay
! Temp. pointer to hold objects which serve event displays
Definition NcEvent.h:95
Int_t GetEventNumber() const
Definition NcEvent.cxx:637
void GetExtremes(TString classname, Float_t &vmin, Float_t &vmax, Int_t idx=1, Int_t mode=1, Int_t deadcheck=1)
Definition NcEvent.cxx:2169
Int_t fSelectLevel
Definition NcEvent.h:89
Int_t fDevCopy
Definition NcEvent.h:92
TObjArray * fHits
! Temp. array to hold references to the registered NcDevice hits
Definition NcEvent.h:93
void SetEventNumber(Int_t evt)
Definition NcEvent.cxx:573
Int_t GetRunNumber() const
Definition NcEvent.cxx:626
Double_t GetWeight() const
Definition NcEvent.cxx:648
virtual TObject * Clone(const char *name="") const
Definition NcEvent.cxx:2737
void RemoveDevice(NcDevice *d)
Definition NcEvent.cxx:1286
void ShowDevices(Int_t mode=1, Bool_t header=kTRUE) const
Definition NcEvent.cxx:1526
TObjArray * fDevices
Definition NcEvent.h:91
void SetDetector(NcDetector *d)
Definition NcEvent.h:52
NcDetector * GetDetector() const
Definition NcEvent.cxx:1075
virtual void HeaderData()
Definition NcEvent.cxx:996
void SetDevCopy(Int_t j)
Definition NcEvent.cxx:1313
Int_t GetSelectLevel() const
Definition NcEvent.cxx:659
virtual void Data(TString f="car", TString u="rad")
Definition NcEvent.cxx:1017
void SetSelectLevel(Int_t level)
Definition NcEvent.cxx:596
void SetDayTime(TTimeStamp &stamp)
Definition NcEvent.cxx:524
Double_t GetCVAL(TObjArray *hits, TString obsname, TString weightname="none", Int_t mode=0, Int_t type=1) const
Definition NcEvent.cxx:2142
void SetTarget(Int_t a, Int_t z, Double_t pnuc, Int_t id=0)
Definition NcEvent.cxx:833
Int_t GetProjectileA() const
Definition NcEvent.cxx:777
TObjArray * fOrdered
! Temp. array to hold references to various ordered objects
Definition NcEvent.h:94
Int_t fEvent
Definition NcEvent.h:87
Int_t GetProjectileZ() const
Definition NcEvent.cxx:791
NcSignal * GetIdHit(Int_t id, TString classname)
Definition NcEvent.cxx:1837
Int_t GetNdevices() const
Definition NcEvent.cxx:1103
NcDevice * GetDevice(Int_t i) const
Definition NcEvent.cxx:1380
void DisplayHits(TString classname, TString name, Float_t scale=-1, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
Definition NcEvent.cxx:2291
void SetWeight(Double_t weight)
Definition NcEvent.cxx:584
virtual ~NcEvent()
Definition NcEvent.cxx:337
Int_t GetNhits(TString classname)
Definition NcEvent.cxx:1731
TObjArray * GetDevices(TString classname, TObjArray *devices=0)
Definition NcEvent.cxx:1656
TTimeStamp GetDayTime() const
Definition NcEvent.cxx:608
void SetDetector(NcDetector d)
Definition NcEvent.cxx:1036
virtual void SetOwner(Bool_t own=kTRUE)
Definition NcEvent.cxx:490
Double_t GetProjectilePnuc() const
Definition NcEvent.cxx:805
Int_t fRun
Definition NcEvent.h:86
Int_t GetTargetId() const
Definition NcEvent.cxx:982
void SetRunNumber(Int_t run)
Definition NcEvent.cxx:562
Int_t GetTargetA() const
Definition NcEvent.cxx:940
TObjArray * GetHits(TString classname, TObjArray *hits=0, TString name="none", Int_t mode=0, Int_t opt=0)
Definition NcEvent.cxx:1763
Int_t GetTargetZ() const
Definition NcEvent.cxx:954
void CreateDetector()
Definition NcEvent.cxx:1086
void ShowHits(TString classname, Int_t mode=1, TString f="car", TString u="rad")
Definition NcEvent.cxx:2346
Nc3Vector GetHitPath(TObjArray *hits, Int_t pos=0) const
Definition NcEvent.cxx:2090
Handling of positions (with timestamps) in various reference frames.
Definition NcPosition.h:18
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
virtual void Data(TString f="car", TString u="rad")
Definition NcVertex.cxx:637