| 1 | /////////////////////////////////////////////////////////////////
|
|---|
| 2 | //
|
|---|
| 3 | // COREvent
|
|---|
| 4 | //
|
|---|
| 5 | // Created: Tue Apr 28 16:14:05 1998
|
|---|
| 6 | // Author: Jose Carlos Gonzales
|
|---|
| 7 | // Purpose: Base class for Event-classes
|
|---|
| 8 | // Notes:
|
|---|
| 9 | //
|
|---|
| 10 | /////////////////////////////////////////////////////////////////
|
|---|
| 11 |
|
|---|
| 12 | #ifndef COREvent_Class
|
|---|
| 13 | #define COREvent_Class
|
|---|
| 14 |
|
|---|
| 15 | #ifdef __ROOT__
|
|---|
| 16 | #include "TROOT.h"
|
|---|
| 17 | #include "TObject.h"
|
|---|
| 18 | #else // not __ROOT__
|
|---|
| 19 | #include "Rtypes.h"
|
|---|
| 20 | #endif
|
|---|
| 21 |
|
|---|
| 22 | #include "COREventHeader.hxx"
|
|---|
| 23 |
|
|---|
| 24 | class COREvent {
|
|---|
| 25 |
|
|---|
| 26 | public:
|
|---|
| 27 | Int_t NCphotons;
|
|---|
| 28 | Float_t TimeBegin;
|
|---|
| 29 | Float_t TimeEnd;
|
|---|
| 30 | COREventHeader EvtHdr;
|
|---|
| 31 | UInt_t Flag;
|
|---|
| 32 |
|
|---|
| 33 | public:
|
|---|
| 34 | COREvent(void) {} // default constructor
|
|---|
| 35 | virtual ~COREvent(void) {} // default destructor
|
|---|
| 36 |
|
|---|
| 37 | // set number of Cphotons for this event
|
|---|
| 38 | inline void SetNCphotons( Int_t n ) { NCphotons = n; }
|
|---|
| 39 |
|
|---|
| 40 | // set flag with a number
|
|---|
| 41 | inline void SetFlag( UInt_t f ) { Flag = f; }
|
|---|
| 42 |
|
|---|
| 43 | // toggle flag bit number b
|
|---|
| 44 | inline void ToggleFlagBit( UInt_t b ) { }
|
|---|
| 45 |
|
|---|
| 46 | // get number of Cherenkov photons
|
|---|
| 47 | inline Int_t GetNCphotons() const { return NCphotons; }
|
|---|
| 48 |
|
|---|
| 49 | // get EventHeader pointer
|
|---|
| 50 | inline COREventHeader *GetHeader() { return &EvtHdr; }
|
|---|
| 51 |
|
|---|
| 52 | // Get flag value
|
|---|
| 53 | inline UInt_t GetFlag() const { return Flag; }
|
|---|
| 54 |
|
|---|
| 55 | // get status of flag bit number b
|
|---|
| 56 | inline UInt_t GetFlagBit( UInt_t b ) { return ( Flag && 1 << (b-1) ); }
|
|---|
| 57 |
|
|---|
| 58 | // set times for this event (first and last Cherenkov photons)
|
|---|
| 59 | void SetTimes( Float_t t1, Float_t t2 ) {
|
|---|
| 60 | TimeBegin = t1;
|
|---|
| 61 | TimeEnd = t2;
|
|---|
| 62 | }
|
|---|
| 63 |
|
|---|
| 64 | // get times of this event (first and last Cherenkov photons)
|
|---|
| 65 | Float_t GetTimes(Float_t *t1, Float_t *t2) const {
|
|---|
| 66 | *t1 = TimeBegin;
|
|---|
| 67 | *t2 = TimeEnd;
|
|---|
| 68 | return (TimeEnd - TimeBegin);
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 | };
|
|---|
| 72 |
|
|---|
| 73 | #endif // not defined COREvent_Class
|
|---|
| 74 |
|
|---|