Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ced.hh
Go to the documentation of this file.
1 /**********************************************************
2  * Package: ced Class Library
3  * File name: ced.hh
4  * Author: Gabriele Vedovato (vedovato@lnl.infn.it)
5  **********************************************************/
6 
7 
8 #ifndef CED_HH
9 #define CED_HH
10 
11 #include <TROOT.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 #include "watfun.hh"
15 #include "injection.hh"
16 #include "detector.hh"
17 #include "netcluster.hh"
18 #include "network.hh"
19 #include "netevent.hh"
20 
21 
22 using namespace std;
23 
24 namespace CWB {
25 
26 class ced {
27 
28 public:
29 
30  // rbasedirCED : plots are stored in the sbasedirCED directory
31  ced(network* NET, netevent* EVT, char* sbasedirCED) {
32  if(NET==NULL) {cout << "ced::ced Error : NET is NULL" << endl;exit(1);}
33  if(EVT==NULL) {cout << "ced::CED Error : EVT is NULL" << endl;exit(1);}
34  if(sbasedirCED==NULL) {cout << "ced::ced Error : sbasedirCED is NULL" << endl;exit(1);}
35  this->NET = NET;
36  this->EVT = EVT;
37  this->sbasedirCED = sbasedirCED;
38  this->rbasedirCED = NULL;
39  this->simulation=0;
40  this->rho=0;
41  this->inRate=0;
42  strcpy(this->gtype,"png");
43  this->paletteId=0;
44  strcpy(this->chName,"");
45  this->useSparse=false;
46  };
47 
48  // rbasedirCED : plots are stored in root file (opened externally)
49  ced(network* NET, netevent* EVT, TDirectory* rbasedirCED) {
50  if(NET==NULL) {cout << "ced::ced Error : NET is NULL" << endl;exit(1);}
51  if(EVT==NULL) {cout << "ced::ced Error : EVT is NULL" << endl;exit(1);}
52  if(rbasedirCED==NULL) {cout << "ced::ced Error : rbasedirCED is NULL" << endl;exit(1);}
53  this->NET = NET;
54  this->EVT = EVT;
55  this->sbasedirCED = NULL;
56  this->rbasedirCED = rbasedirCED;
57  this->simulation=0;
58  this->rho=0;
59  this->inRate=0;
60  strcpy(this->gtype,"png");
61  this->paletteId=0;
62  strcpy(this->chName,"");
63  this->useSparse=false;
64  };
65 
66  ~ced() {};
67 
68  void SetOptions(int simulation, double rho, double inRate, bool useSparse=false,
69  char* gtype=const_cast<char*>("png"), int paletteId=0) {
70  this->simulation=simulation; // 1/2 for simulation(hrss/snr), 0 for production
71  this->rho=rho; // ced is produced for events with rho >= this->rho threshold
72  this->inRate=inRate; // original data rate, used to rescale data when data are resampled
73  if(inRate<=0) {cout << "ced::SetOptions : Error - inrate must be > 0" << endl;exit(1);}
74  strcpy(this->gtype,gtype);
75  this->paletteId=paletteId;
76  this->useSparse=useSparse; // if true sparse map are used instead of TF
77  }
78 
79  void SetChannelName(char* chName) {strcpy(this->chName,chName);}
80  int Write(double factor, bool fullCED=true);
81 
82 private:
83 
84  void Write(double factor, size_t iID, int LAG, char* dirCED);
85 
86  // x : input array
87  // P : energy percentage
88  // bT,eT : begin,end time of the range which contains percentage P of the total energy E
89  double GetBoundaries(wavearray<double> x, double P, double& bT, double& eT);
90 
91  network* NET; //!
92  netevent* EVT; //!
93 
94  TDirectory* rbasedirCED; //!
95  char* sbasedirCED; //!
97  double rho;
98  double inRate;
99  char gtype[32];
100  int paletteId;
101  char chName[64];
102  bool useSparse;
103 
104  // used by THtml doc
105  ClassDef(ced,1)
106 };
107 
108 } // end namespace
109 
110 #endif
111 
double rho
double rho
Definition: ced.hh:97
Definition: ced.hh:24
double inRate
Definition: ced.hh:98
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
TDirectory * rbasedirCED
Definition: ced.hh:94
~ced()
Definition: ced.hh:66
netevent * EVT
Definition: ced.hh:92
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
char * sbasedirCED
Definition: ced.hh:95
TRandom3 P
Definition: compare_bkg.C:296
STL namespace.
void SetOptions(int simulation, double rho, double inRate, bool useSparse=false, char *gtype=const_cast< char * >("png"), int paletteId=0)
Definition: ced.hh:68
double GetBoundaries(wavearray< double > x, double P, double &bT, double &eT)
tlive_fix Write()
TString chName[NIFO_MAX]
double factor
int simulation
Definition: ced.hh:96
network NET
Definition: cwb_dump_inj.C:12
network * NET
Definition: ced.hh:91
void SetChannelName(char *chName)
Definition: ced.hh:79
ced(network *NET, netevent *EVT, char *sbasedirCED)
Definition: ced.hh:31
ced(network *NET, netevent *EVT, TDirectory *rbasedirCED)
Definition: ced.hh:49
netevent EVT(itree, nifo)
strcpy(RunLabel, RUN_LABEL)
bool useSparse
Definition: ced.hh:102
Definition: ced.hh:26
simulation
Definition: cwb_eced.C:9
exit(0)
int paletteId
Definition: ced.hh:100