Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
livetime.hh
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////
2 // root tree class to store live time
3 // Sergey Klimenko, University of Florida
4 //////////////////////////////////////////////////////////
5 
6 
7 #ifndef livetime_h
8 #define livetime_h
9 
10 #include <TROOT.h>
11 #include <TChain.h>
12 #include <TFile.h>
13 #include <stdlib.h>
14 #include "wat.hh"
15 #include "network.hh"
16 
17 /* Structure of WaveBurst single IFO event */
18 
19 static vector<waveSegment> DEFAULT_WAVESEGMENT;
20 
21 class livetime {
22  public :
23 
24  TTree *fChain; //!pointer to the analyzed TTree or TChain
25  Int_t fCurrent; //!current Tree number in a TChain
26 
27 //Declaration of leaves types
28 // for arrays: ifo1 - first index, ifo2 - second index
29 
30  Int_t run; // run
31  Double_t gps; // gps start time segment of the first detector
32  Double_t live; // live time
33  Float_t* lag; //! time lag [sec]
34  Float_t* slag; //! time slag [sec]
35  Double_t* start; //! array of gps start time segment for each detector
36  Double_t* stop; //! array of gps stop time segment for each detector
37 
38 //List of branches
39 
40  TBranch *b_run; //!
41  TBranch *b_gps; //!
42  TBranch *b_live; //!
43  TBranch *b_lag; //!
44  TBranch *b_slag; //!
45  TBranch *b_start; //!
46  TBranch *b_stop; //!
47 
48  livetime() : lag(NULL), slag(NULL), start(NULL), stop(NULL) {allocate(); fChain=NULL;};
49  livetime(TTree *tree) : lag(NULL), slag(NULL), start(NULL), stop(NULL) {allocate(); if(tree) Init(tree);};
50  virtual ~livetime() {
51  if (lag) free(lag); // lag array
52  if (slag) free(slag); // slag array
53  if (start) free(start); // start array
54  if (stop) free(stop); // stop array
55  if (fChain) delete fChain->GetCurrentFile();
56  return;
57  };
58 
59  virtual livetime& operator=(livetime &);
60 
61  Int_t GetEntry(Int_t);
62  void Init(TTree *);
63  void allocate();
64  Bool_t Notify();
65  TTree* setTree();
66  void output(TTree* waveTree, network* net, float* slag=NULL,
67  vector<waveSegment> detSegs = DEFAULT_WAVESEGMENT);
68 
69 // void Loop();
70 // Int_t Cut(Int_t entry);
71 // Int_t LoadTree(Int_t entry);
72 
73  void Show(Int_t entry = -1);
74 
75  // used by THtml doc
76  ClassDef(livetime,2)
77 };
78 
79 #endif
80 
81 
82 
83 
TTree * tree
Definition: TimeSortTree.C:20
void Init(TTree *)
Definition: livetime.cc:29
TBranch * b_live
Definition: livetime.hh:42
Double_t * start
time slag [sec]
Definition: livetime.hh:35
Double_t gps
Definition: livetime.hh:31
TBranch * b_start
Definition: livetime.hh:45
livetime()
Definition: livetime.hh:48
network ** net
NOISE_MDC_SIMULATION.
virtual livetime & operator=(livetime &)
Definition: livetime.cc:8
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: livetime.hh:25
Double_t live
Definition: livetime.hh:32
Int_t run
current Tree number in a TChain
Definition: livetime.hh:30
TTree * fChain
Definition: livetime.hh:24
TBranch * b_gps
Definition: livetime.hh:41
Float_t * lag
Definition: livetime.hh:33
TBranch * b_lag
Definition: livetime.hh:43
void allocate()
Definition: livetime.cc:47
livetime(TTree *tree)
Definition: livetime.hh:49
void output(TTree *waveTree, network *net, float *slag=NULL, vector< waveSegment > detSegs=DEFAULT_WAVESEGMENT)
Definition: livetime.cc:91
double * entry
Definition: cwb_setcuts.C:206
Int_t GetEntry(Int_t)
Definition: livetime.cc:148
vector< waveSegment > detSegs
Definition: cwb_net.C:175
Bool_t Notify()
Definition: livetime.cc:134
Double_t * stop
array of gps start time segment for each detector
Definition: livetime.hh:36
Float_t * slag
time lag [sec]
Definition: livetime.hh:34
TTree * setTree()
Definition: livetime.cc:63
static vector< waveSegment > DEFAULT_WAVESEGMENT
Definition: livetime.hh:19
void Show(Int_t entry=-1)
Definition: livetime.cc:154
virtual ~livetime()
Definition: livetime.hh:50
TBranch * b_run
array of gps stop time segment for each detector
Definition: livetime.hh:40
TBranch * b_slag
Definition: livetime.hh:44
TBranch * b_stop
Definition: livetime.hh:46