17 : TGraph(),fNewCanvas(0),fNumInAverage(1)
20 this->SetEditable(kFALSE);
27 : TGraph(N,x,y),fNewCanvas(0),fNumInAverage(1)
29 this->SetEditable(kFALSE);
34 : TGraph(N,x,y),fNewCanvas(0),fNumInAverage(1)
36 this->SetEditable(kFALSE);
41 : TGraph(N,x,y),fNewCanvas(0),fNumInAverage(1)
43 this->SetEditable(kFALSE);
51 void FFTGraph::ExecuteEvent(Int_t event, Int_t px, Int_t py)
58 case kButtonDoubleClick:
65 if(!fNewCanvas) drawInNewCanvas();
66 else this->TGraph::ExecuteEvent(event,px,py);
70 this->TGraph::ExecuteEvent(event,px,py);
75 void FFTGraph::drawInNewCanvas()
78 gStyle->SetTitleH(0.1);
79 gStyle->SetOptTitle(1);
80 gStyle->SetPadLeftMargin(0.15);
81 gStyle->SetPadRightMargin(0.1);
82 gStyle->SetPadTopMargin(0.1);
83 gStyle->SetPadBottomMargin(0.1);
84 gStyle->SetCanvasDefW(600);
85 gStyle->SetCanvasDefH(400);
88 thisCopy->GetXaxis()->SetLabelSize(0.06);
89 thisCopy->GetXaxis()->SetTitleSize(0.06);
90 thisCopy->GetYaxis()->SetLabelSize(0.06);
91 thisCopy->GetYaxis()->SetTitleSize(0.06);
92 thisCopy->GetXaxis()->SetTitle(
"Frequency (MHz)");
93 thisCopy->GetYaxis()->SetTitle(
"dB (m maybe)");
95 sprintf(graphTitle,
"Ant %d%c%c (%s Ring -- Phi %d -- SURF %d -- Chan %d)",
97 thisCopy->SetTitle(graphTitle);
98 TCanvas *can =
new TCanvas();
99 can->SetLeftMargin(0.15);
100 can->SetBottomMargin(0.15);
101 can->SetTopMargin(0.1);
102 can->SetRightMargin(0.1);
103 thisCopy->Draw(
"al");
111 if(otherGraph->GetN()!=this->GetN()) {
112 std::cerr <<
"Trying to add FFTGraph with different number of points " << otherGraph->GetN() <<
" instead of " << this->GetN() <<
"\n";
115 Double_t *newY=otherGraph->GetY();
116 for(
int bin=0;bin<fNpoints;bin++) {
117 fY[bin]=(fY[bin]*fNumInAverage + newY[bin])/Double_t(fNumInAverage+1);
120 return fNumInAverage;
char ringAsChar(AnitaRing::AnitaRing_t ring)
Returns the ring as a character string.
const char * ringAsString(AnitaRing::AnitaRing_t ring)
Returns the ring as a character string.
The PSD display graph class that inherits from ROOT's TGraph.
char polAsChar(AnitaPol::AnitaPol_t pol)
Returns the polarisation as a character string.
int AddFFT(FFTGraph *otherGraph)
Adds an FFT to an average.
virtual ~FFTGraph()
Destructor.