00001
00002
00004 #ifndef __EventMap__
00005 #define __EventMap__
00006
00007 #include "GwollumPlot.h"
00008 #include "ReadTriggers.h"
00009 #include "TriggerSelect.h"
00010 #include "TH2.h"
00011
00012 using namespace std;
00013
00019 class EventMap: public GwollumPlot, public ReadTriggers {
00020
00021 public:
00022
00035 EventMap(const int aNmaps, const string aPattern, const string aDirectory="", const int aVerbose=0);
00036
00040 virtual ~EventMap(void);
00052 bool BuildMap(const int aMapIndex, const double aTime);
00053
00062 bool BuildClusterMap(const int aMapIndex, const int aCl, const double aTimeCenter=0.0);
00063
00068 bool PrintMap(const int aMapIndex);
00069
00075 bool PrintMapNext(const double aTimeFraction=0.25);
00076
00084 bool PrintMapLive(const double aDuration, const string aOutFile="none");
00085
00089 inline void SetMapAmplitudeContent(void){ MapContentType=true; ResetAll(); };
00090
00094 inline void SetMapSNRContent(void){ MapContentType=false; ResetAll(); };
00095
00101 bool SetMapTimeRange(const int aMapIndex, const double aTimeRange);
00102
00109 bool SetMapFrequencyRange(const int aMapIndex, const double aFreqMin, const double aFreqMax);
00110
00117 bool SetMapQRange(const int aMapIndex, const double aQMin, const double aQMax);
00118
00126 bool SetMapResolution(const int aMapIndex, const int aTresolution, const int aFresolution);
00127
00133 double GetMapLoudestSNR(const int aMapIndex);
00134
00140 double GetMapLoudestTime(const int aMapIndex);
00141
00147 double GetMapLoudestFrequency(const int aMapIndex);
00148
00153 bool NormalizeMap(const int aMapIndex);
00154
00159 bool NormalizeMapLoudest(const int aMapIndex);
00160
00171 double GetMapMatch(double &aTimeShift, double &aMatchSumw2, const int aMapIndex1, const int aMapIndex2, const double aTimeJitter=0.0);
00172
00184 double GetMapMatch(double &aTimeShift, double &aMatchSumw2, const int aMapIndex, EventMap *aExtMap, const int aExtMapIndex, const double aTimeJitter=0.0);
00185
00190 inline int GetMapTimeResolution(const int aMapIndex){
00191 if(aMapIndex>=0&&aMapIndex<Nmaps) return Map[aMapIndex]->GetNbinsX();
00192 return -1;
00193 }
00194
00199 inline int GetMapFrequencyResolution(const int aMapIndex){
00200 if(aMapIndex>=0&&aMapIndex<Nmaps) return Map[aMapIndex]->GetNbinsY();
00201 return -1;
00202 }
00203
00208 inline int GetMapTimeRange(const int aMapIndex){
00209 if(aMapIndex>=0&&aMapIndex<Nmaps) return MapParam[aMapIndex]->GetTimeRange();
00210 return -1;
00211 }
00212
00217 inline int GetMapFrequencyMin(const int aMapIndex){
00218 if(aMapIndex>=0&&aMapIndex<Nmaps) return MapParam[aMapIndex]->GetFrequencyMin();
00219 return -1;
00220 }
00221
00226 inline int GetMapFrequencyMax(const int aMapIndex){
00227 if(aMapIndex>=0&&aMapIndex<Nmaps) return MapParam[aMapIndex]->GetFrequencyMax();
00228 return -1;
00229 }
00230
00231 private:
00232
00233 void ResetMap(const int aMapIndex);
00234 void ResetMapContent(const int aMapIndex);
00235 inline void ResetAll(void){
00236 for(int m=0; m<Nmaps; m++) ResetMap(m);
00237 };
00238
00239 int Nmaps;
00240 TH2D **Map;
00241 double ***MapSNR;
00242 double **MapNoiseAmp;
00243 TriggerSelect **MapParam;
00244 double *MapCentralTime;
00245 int *MapLoudestBin;
00246 double **MapLoudestSNR_bf;
00247 int MapPrinted;
00248 bool MapContentType;
00249 int *MapBinXmin,
00250 *MapBinXmax,
00251 *MapBinYmin,
00252 *MapBinYmax;
00253
00254 double GetMatch(double &aTimeShift,
00255 double &aSumw2,
00256 EventMap *aEMap1, const int aMapIndex1,
00257 EventMap *aEMap2, const int aMapIndex2,
00258 const double aTimeJitter);
00259
00260 ClassDef(EventMap,0)
00261 };
00262
00263 #endif
00264
00265