00001
00002
00004 #ifndef __Omap__
00005 #define __Omap__
00006
00007 #include "CUtils.h"
00008 #include "TMath.h"
00009 #include "TH2D.h"
00010
00011 using namespace std;
00012
00019 class Omap: public TH2D {
00020
00021 public:
00022 friend class Otile;
00023 friend class Oqplane;
00024
00025 private:
00026
00027
00028 Omap();
00029 virtual ~Omap(void);
00030
00031 void SetBins(const double aQ,
00032 const double aFrequencyMin, const double aFrequencyMax,
00033 const int aTimeRange, const double aMismatchStep);
00034
00035 inline double GetTimeRange(void){
00036 return GetXaxis()->GetBinUpEdge(GetNbinsX())-GetXaxis()->GetBinLowEdge(1);
00037 };
00038 inline double GetTimeMin(void){
00039 return GetXaxis()->GetBinLowEdge(1);
00040 };
00041 inline double GetTimeMax(void){
00042 return GetXaxis()->GetBinUpEdge(GetNbinsX());
00043 };
00044 inline double GetFrequencyMin(void){
00045 return GetYaxis()->GetBinLowEdge(1);
00046 };
00047 inline double GetFrequencyMax(void){
00048 return GetYaxis()->GetBinUpEdge(GetNbinsY());
00049 };
00050 inline int GetNBands(void){
00051 return GetNbinsY();
00052 };
00053 inline long int GetNTiles(void){
00054 return Ntiles;
00055 };
00056 inline int GetBandIndex(const double aFrequency){
00057 return GetYaxis()->FindBin(aFrequency)-1;
00058 };
00059 inline double GetBandFrequency(const int aBandIndex){
00060 return GetYaxis()->GetBinCenterLog(aBandIndex+1);
00061 };
00062 inline double GetBandStart(const int aBandIndex){
00063 return GetYaxis()->GetBinLowEdge(aBandIndex+1);
00064 };
00065 inline double GetBandEnd(const int aBandIndex){
00066 return GetYaxis()->GetBinUpEdge(aBandIndex+1);
00067 };
00068 inline double GetBandWidth(const int aBandIndex){
00069 return GetYaxis()->GetBinWidth(aBandIndex+1);
00070 };
00071 inline double GetTileDuration(const int aBandIndex){
00072 return GetXaxis()->GetBinWidth(1)*bandMultiple[aBandIndex];
00073 };
00074 inline int GetBandNtiles(const int aBandIndex){
00075 return GetNbinsX()/bandMultiple[aBandIndex];
00076 };
00077 inline double GetTileContent(const int aTimeTileIndex, const int aBandIndex){
00078 return tilecontent[aBandIndex][aTimeTileIndex];
00079 };
00080 inline double GetTilePhase(const int aTimeTileIndex, const int aBandIndex){
00081 return tilephase[aBandIndex][aTimeTileIndex];
00082 };
00083 inline double GetTileTag(const int aTimeTileIndex, const int aBandIndex){
00084 return tiletag[aBandIndex][aTimeTileIndex];
00085 };
00086 inline double GetTileTimeStart(const int aTimeTileIndex, const int aBandIndex){
00087 return GetXaxis()->GetBinLowEdge(aTimeTileIndex*bandMultiple[aBandIndex]+1);
00088 };
00089 inline double GetTileTimeEnd(const int aTimeTileIndex, const int aBandIndex){
00090 return GetXaxis()->GetBinUpEdge((aTimeTileIndex+1)*bandMultiple[aBandIndex]);
00091 };
00092 inline double GetTileTime(const int aTimeTileIndex, const int aBandIndex){
00093 return (GetTileTimeStart(aTimeTileIndex,aBandIndex) + GetTileTimeEnd(aTimeTileIndex,aBandIndex)) / 2.0;
00094 };
00095 inline int GetTimeTileIndex(const int aBandIndex, const double aTime){
00096 return (int)floor((aTime-GetTimeMin())/GetTileDuration(aBandIndex));
00097 };
00098
00099
00100 inline void SetTileContent(const int aTimeTileIndex, const int aBandIndex, const double aContent, const double aPhase=-100.0, const bool aTag=true){
00101 tilecontent[aBandIndex][aTimeTileIndex]=aContent;
00102 tilephase[aBandIndex][aTimeTileIndex]=aPhase;
00103 tiletag[aBandIndex][aTimeTileIndex]=aTag;
00104 };
00105 inline void SetTileTag(const int aTimeTileIndex, const int aBandIndex, const bool aTag){ tiletag[aBandIndex][aTimeTileIndex]=aTag; };
00106
00107
00108 void MakeMapContent(void);
00109 void MakeMapPhase(void);
00110 void MakeMapDisplay(void);
00111
00112
00113 long int Ntiles;
00114 int *bandMultiple;
00115 double **tilecontent;
00116 double **tilephase;
00117 bool **tiletag;
00118
00119 ClassDef(Omap,0)
00120 };
00121
00122
00123 #endif
00124
00125