Changeset 4994 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 09/14/04 13:37:28 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.h
r4962 r4994 15 15 protected: 16 16 17 Float_t fEventFrequency; // Event frequency in Hertz (to be set)18 19 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs20 Float_t *CreatePSDXaxis (Int_t n); // Create an x-axis for the PSD TGraphs21 22 17 Float_t fBlackoutLimit; // Lower nr sigmas from mean until event is considered blackout 23 18 Int_t fSaturated; // Number of events classified as saturated … … 34 29 // TObject *Clone(const char* name="") const; 35 30 36 void CreateGraphEvents(); // Create the TGraph fGraphEvents of fEvents37 void CreateGraphPowerSpectrum(); // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum38 39 31 // Getters 40 32 const Double_t GetBlackout () const; 41 const Float_t GetEventFrequency () const { return fEventFrequency; }42 33 const Double_t GetPickup () const; 43 34 const Int_t GetPixId () const { return fPixId; } … … 51 42 void AddSaturated ( const Int_t i ) { fSaturated += i; } 52 43 void SetBlackoutLimit ( const Float_t lim=fgBlackoutLimit ) { fBlackoutLimit = lim; } 53 void SetEventFrequency ( const Float_t f ) { fEventFrequency = f; }54 44 void SetPickupLimit ( const Float_t lim=fgPickupLimit ) { fPickupLimit = lim; } 55 45 void SetPixId ( const Int_t i ) { fPixId = i; } -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
r4962 r4994 127 127 // 128 128 MHGausEvents::MHGausEvents(const char *name, const char *title) 129 : fHPowerProbability(NULL), 129 : fEventFrequency(0), 130 fHPowerProbability(NULL), 130 131 fPowerSpectrum(NULL), 131 132 fFGausFit(NULL), fFExpFit(NULL), … … 173 174 // delete histograms 174 175 if (fHPowerProbability) 175 if (gROOT->FindObject(fHPowerProbability->GetName())) 176 delete fHPowerProbability; 176 delete fHPowerProbability; 177 177 178 178 // delete fits 179 179 if (fFGausFit) 180 180 delete fFGausFit; 181 181 182 if (fFExpFit) 182 183 delete fFExpFit; … … 189 190 if (fGraphEvents) 190 191 delete fGraphEvents; 192 191 193 if (fGraphPowerSpectrum) 192 194 delete fGraphPowerSpectrum; 195 193 196 } 194 197 … … 199 202 // Sets: 200 203 // - all other pointers to NULL 201 // - all variables to 0. 204 // - all variables to 0. and keep fEventFrequency 202 205 // - all flags to kFALSE 203 206 // … … 223 226 if (fHPowerProbability) 224 227 { 225 if (gROOT->FindObject(fHPowerProbability->GetName())) 226 delete fHPowerProbability; 227 fHPowerProbability = NULL; 228 } 229 228 delete fHPowerProbability; 229 fHPowerProbability = NULL; 230 } 231 230 232 // delete fits 231 233 if (fFGausFit) … … 301 303 pix.fHGausHist = fHGausHist; 302 304 305 pix.fEventFrequency = fEventFrequency; 303 306 pix.fLast = fLast; 304 307 pix.fMean = fMean; … … 324 327 Float_t *xaxis = new Float_t[n]; 325 328 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; 328 335 329 336 return xaxis; … … 432 439 fGraphEvents = new TGraph(n,CreateEventXaxis(n),fEvents.GetArray()); 433 440 fGraphEvents->SetTitle("Evolution of Events with time"); 441 fGraphEvents->GetXaxis()->SetTitle((fEventFrequency) ? "Time [s]" : "Event Nr."); 434 442 fGraphEvents->GetYaxis()->SetTitle(fHGausHist.GetXaxis()->GetTitle()); 435 443 fGraphEvents->GetYaxis()->CenterTitle(); … … 450 458 fGraphPowerSpectrum = new TGraph(n,CreatePSDXaxis(n),fPowerSpectrum->GetArray()); 451 459 fGraphPowerSpectrum->SetTitle("Power Spectrum Density"); 460 fGraphPowerSpectrum->GetXaxis()->SetTitle((fEventFrequency) ? "Frequency [Hz]" : "Frequency"); 452 461 fGraphPowerSpectrum->GetYaxis()->SetTitle("P(f)"); 453 462 fGraphPowerSpectrum->GetYaxis()->CenterTitle(); … … 465 474 Float_t *xaxis = new Float_t[n]; 466 475 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++) 468 481 xaxis[i] = 0.5*(Float_t)i/n; 469 482 -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
r4962 r4994 27 27 const static Float_t fgProbLimit; //! Default for fProbLimit (now set to: 0.001) 28 28 const static Int_t fgPowerProbabilityBins; //! Default for fPowerProbabilityBins (now set to: 20) 29 30 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs 31 Float_t *CreatePSDXaxis(Int_t n); // Create an x-axis for the PSD TGraphs 29 32 30 33 protected: 34 35 Float_t fEventFrequency; // Event frequency in Hertz (to be set) 31 36 32 37 Int_t fBinsAfterStripping; // Bins for the Gauss Histogram after stripping off the zeros at both ends … … 60 65 Float_t fProbLimit; // Probability limit for judgement if fit is OK 61 66 62 virtual Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs63 virtual Float_t *CreatePSDXaxis(Int_t n); // Create an x-axis for the PSD TGraphs64 65 67 void DrawPowerSpectrum(TVirtualPad &pad, Int_t i); // Draw graph of fPowerSpectrum and fHPowerProbability 66 68 … … 93 95 MArrayF *GetEvents() { return &fEvents; } 94 96 const MArrayF *GetEvents() const { return &fEvents; } 95 TF1 *GetFExpFit() { return fFExpFit; } 97 const Float_t GetEventFrequency () const { return fEventFrequency; } 98 TF1 *GetFExpFit() { return fFExpFit; } 96 99 const TF1 *GetFExpFit() const { return fFExpFit; } 97 100 TF1 *GetFGausFit() { return fFGausFit; } … … 141 144 142 145 // Setters 146 void SetEventFrequency ( const Float_t f ) { fEventFrequency = f; } 143 147 void SetExcluded ( const Bool_t b=kTRUE ); 144 148 void SetExpFitOK ( const Bool_t b=kTRUE ); … … 157 161 158 162 void CreateFourierSpectrum(); // Create the fourier spectrum out of fEvents 159 v irtual voidCreateGraphEvents(); // Create the TGraph fGraphEvents of fEvents160 v irtual voidCreateGraphPowerSpectrum(); // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum163 void CreateGraphEvents(); // Create the TGraph fGraphEvents of fEvents 164 void CreateGraphPowerSpectrum(); // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum 161 165 162 166 ClassDef(MHGausEvents, 1) // Base class for events with Gaussian distributed values
Note:
See TracChangeset
for help on using the changeset viewer.