Ignore:
Timestamp:
03/29/04 21:55:47 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r3492 r3608  
    497497  const Int_t n = fEvents.GetSize();
    498498
    499   fGraphEvents = new TGraph(n,CreateXaxis(n),fEvents.GetArray()); 
     499  fGraphEvents = new TGraph(n,CreateEventXaxis(n),fEvents.GetArray()); 
    500500  fGraphEvents->SetTitle("Evolution of Events with time");
    501501  fGraphEvents->GetXaxis()->SetTitle((fEventFrequency) ? "Time [s]" : "Event Nr.");
     
    514514  const Int_t n = fPowerSpectrum->GetSize();
    515515
    516   fGraphPowerSpectrum = new TGraph(n,CreateXaxis(n),fPowerSpectrum->GetArray()); 
     516  fGraphPowerSpectrum = new TGraph(n,CreatePSDXaxis(n),fPowerSpectrum->GetArray()); 
    517517  fGraphPowerSpectrum->SetTitle("Power Spectrum Density");
    518518  fGraphPowerSpectrum->GetXaxis()->SetTitle((fEventFrequency) ? "Frequency [Hz]" : "Frequency");
     
    522522// -----------------------------------------------------------------------------
    523523//
    524 // Create the x-axis for the graph
    525 //
    526 Float_t *MHGausEvents::CreateXaxis(Int_t n)
     524// Create the x-axis for the event graph
     525//
     526Float_t *MHGausEvents::CreateEventXaxis(Int_t n)
    527527{
    528528
     
    535535    for (Int_t i=0;i<n;i++)
    536536      xaxis[i] = (Float_t)i;
     537
     538  return xaxis;
     539                 
     540}
     541
     542// -----------------------------------------------------------------------------
     543//
     544// Create the x-axis for the event graph
     545//
     546Float_t *MHGausEvents::CreatePSDXaxis(Int_t n)
     547{
     548
     549  Float_t *xaxis = new Float_t[n];
     550
     551  if (fEventFrequency)
     552    for (Int_t i=0;i<n;i++)
     553      xaxis[i] = 0.5*(Float_t)i*fEventFrequency/n;
     554  else
     555    for (Int_t i=0;i<n;i++)
     556      xaxis[i] = 0.5*(Float_t)i/n;
    537557
    538558  return xaxis;
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.h

    r3295 r3608  
    6565  void DrawPowerSpectrum(TVirtualPad &pad, Int_t i);  // Draw a graph of the array fPowerSpectrum and the hist fHPowerProbability
    6666 
    67   Float_t *CreateXaxis(Int_t n);      //   Create an x-axis for the TGraphs
     67  Float_t *CreateEventXaxis(Int_t n);              //   Create an x-axis for the Event TGraphs
     68  Float_t *CreatePSDXaxis(Int_t n);                //   Create an x-axis for the PSD TGraphs
    6869
    6970public:
Note: See TracChangeset for help on using the changeset viewer.