Ignore:
Timestamp:
09/14/04 13:37:28 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r4962 r4994  
    127127//
    128128MHGausEvents::MHGausEvents(const char *name, const char *title)
    129     : fHPowerProbability(NULL),
     129    : fEventFrequency(0),
     130      fHPowerProbability(NULL),
    130131      fPowerSpectrum(NULL),
    131132      fFGausFit(NULL), fFExpFit(NULL),
     
    173174  // delete histograms
    174175  if (fHPowerProbability)
    175     if (gROOT->FindObject(fHPowerProbability->GetName()))
    176       delete fHPowerProbability;
     176    delete fHPowerProbability;
    177177 
    178178  // delete fits
    179179  if (fFGausFit)
    180180    delete fFGausFit;
     181
    181182  if (fFExpFit)
    182183    delete fFExpFit;
     
    189190  if (fGraphEvents)
    190191    delete fGraphEvents;
     192
    191193  if (fGraphPowerSpectrum)
    192194    delete fGraphPowerSpectrum;
     195
    193196}
    194197     
     
    199202// Sets:
    200203// - all other pointers to NULL
    201 // - all variables to 0.
     204// - all variables to 0. and keep fEventFrequency
    202205// - all flags to kFALSE
    203206//
     
    223226  if (fHPowerProbability)
    224227    {
    225         if (gROOT->FindObject(fHPowerProbability->GetName()))
    226             delete fHPowerProbability;
    227         fHPowerProbability = NULL;
    228     }
    229  
     228      delete fHPowerProbability;
     229      fHPowerProbability = NULL;
     230    }
     231
    230232  // delete fits
    231233  if (fFGausFit)
     
    301303  pix.fHGausHist = fHGausHist;
    302304
     305  pix.fEventFrequency       = fEventFrequency;
    303306  pix.fLast      = fLast;
    304307  pix.fMean      = fMean;
     
    324327  Float_t *xaxis = new Float_t[n]; 
    325328
    326   for (Int_t i=0;i<n;i++)
    327     xaxis[i] = (Float_t)i;
     329  if (fEventFrequency)
     330    for (Int_t i=0;i<n;i++)
     331      xaxis[i] = (Float_t)i/fEventFrequency;
     332  else
     333    for (Int_t i=0;i<n;i++)
     334      xaxis[i] = (Float_t)i;
    328335 
    329336  return xaxis;
     
    432439  fGraphEvents = new TGraph(n,CreateEventXaxis(n),fEvents.GetArray()); 
    433440  fGraphEvents->SetTitle("Evolution of Events with time");
     441  fGraphEvents->GetXaxis()->SetTitle((fEventFrequency) ? "Time [s]" : "Event Nr.");
    434442  fGraphEvents->GetYaxis()->SetTitle(fHGausHist.GetXaxis()->GetTitle());
    435443  fGraphEvents->GetYaxis()->CenterTitle();
     
    450458  fGraphPowerSpectrum = new TGraph(n,CreatePSDXaxis(n),fPowerSpectrum->GetArray()); 
    451459  fGraphPowerSpectrum->SetTitle("Power Spectrum Density");
     460  fGraphPowerSpectrum->GetXaxis()->SetTitle((fEventFrequency) ? "Frequency [Hz]" : "Frequency");
    452461  fGraphPowerSpectrum->GetYaxis()->SetTitle("P(f)");
    453462  fGraphPowerSpectrum->GetYaxis()->CenterTitle();
     
    465474  Float_t *xaxis = new Float_t[n];
    466475
    467   for (Int_t i=0;i<n;i++)
     476  if (fEventFrequency)
     477    for (Int_t i=0;i<n;i++)
     478      xaxis[i] = 0.5*(Float_t)i*fEventFrequency/n;
     479  else
     480    for (Int_t i=0;i<n;i++)
    468481    xaxis[i] = 0.5*(Float_t)i/n;
    469482 
Note: See TracChangeset for help on using the changeset viewer.