Changeset 4925
- Timestamp:
- 09/10/04 15:31:34 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.cc
r4923 r4925 28 28 // MHEffectiveOnTime 29 29 // 30 // Fills a 2-D histogram Time-difference vs. Theta 30 // Filling this you will get the effective on-time versus theta and 31 // observation time. 31 32 // 32 33 // From this histogram the effective on-time is determined by a fit. … … 34 35 // are stored in corresponding histograms 35 36 // 37 // To determin the efective on time a poisson fit is done. For more details 38 // please have a look into the source code of FitH() it should be simple 39 // to understand. In this function a Delta-T distribution is fitted, while 40 // Delta-T is the time between two consecutive events. 41 // 42 // The fit is done for projections of a 2D histogram in Theta and Delta T. 43 // So you get the effective on time versus theta. 44 // 45 // To get the effective on-time versus time a histogram is filled with 46 // the Delta-T distribution of a number of events set by SetNumEvents(). 47 // The default is 12000 (roughly 1min at 200Hz) 48 // 49 // For each "time-bin" the histogram is fitted and the resulting effective 50 // on-time is stored in the fHEffOnTime histogram. Each entry in this 51 // histogram is the effective observation time between the upper and 52 // lower edges of the bins. 53 // 54 // In addition the calculated effective on time is stored in a 55 // "MEffectiveOnTime [MParameterDerr]" and the corresponding time-stamp 56 // (the upper edge of the bin) "MTimeEffectiveOnTime [MTime]" 57 // 58 // The class takes two binnings from the Parameter list; if these binnings 59 // are not available the defaultbinning is used: 60 // MBinning("BinningDeltaT"); // Units of seconds 61 // MBinning("BinningTheta"); // Units of degrees 62 // 63 // 64 // Usage: 65 // ------ 66 // MFillH fill("MHEffectiveOnTime", "MTime"); 67 // tlist.AddToList(&fill); 68 // 69 // 70 // Input Container: 71 // MPointingPos 72 // 73 // Output Container: 74 // MEffectiveOnTime [MParameterDerr] 75 // MTimeEffectiveOnTime [MTime] 76 // 36 77 ////////////////////////////////////////////////////////////////////////////// 37 38 78 #include "MHEffectiveOnTime.h" 39 79 … … 73 113 // 74 114 fName = name ? name : "MHEffectiveOnTime"; 75 fTitle = title ? title : " 2-D histogram in Theta and time difference";115 fTitle = title ? title : "Histogram to determin effective On-Time vs Time and Zenith Angle"; 76 116 77 117 // Main histogram … … 264 304 h->Fit(&func, "0IRQ"); 265 305 266 const Double_t chi2 267 const Int_t NDF 306 const Double_t chi2 = func.GetChisquare(); 307 const Int_t NDF = func.GetNDF(); 268 308 269 309 // was fit successful ? … … 293 333 gMinuit->mnemat((Double_t*)emat, 2); 294 334 295 const Double_t dldl 335 const Double_t dldl = emat[0][0]; 296 336 //const Double_t dN0dN0 = emat[1][1]; 297 337 298 const Double_t teff = Nm/lambda; 299 const Double_t dteff = teff * TMath::Sqrt(dldl/(lambda*lambda) + 1.0/Nm); 300 301 const Double_t dl = TMath::Sqrt(dldl); 338 const Double_t teff = Nm/lambda; 339 const Double_t dteff = teff * TMath::Sqrt(dldl/(lambda*lambda) + 1.0/Nm); 340 const Double_t dl = TMath::Sqrt(dldl); 302 341 303 342 //const Double_t kappa = Nm/N0; -
trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.h
r4920 r4925 24 24 { 25 25 private: 26 MPointingPos *fPointPos; //!27 MTime fLastTime; //!26 MPointingPos *fPointPos; //! Container to get the zenith angle from 27 MTime fLastTime; //! Time-Stamp of last event 28 28 29 MTime *fTime; //!30 MParameterDerr *fParam; //!29 MTime *fTime; //! Time-Stamp of "effective on-time" event 30 MParameterDerr *fParam; //! Output container for effective on-time 31 31 32 TH2D fH2DeltaT; 33 TH1D fH1DeltaT; 32 TH2D fH2DeltaT; // Counts vs Delta T and Theta 33 TH1D fH1DeltaT; //! Counts vs Delta T (for a time interval) 34 34 35 TH1D fHEffOnTheta; 36 TH1D fHEffOnTime; 35 TH1D fHEffOnTheta; // Effective On time versus Theta 36 TH1D fHEffOnTime; // Effective On time versus Time 37 37 38 TH1D fHProbTheta; 39 TH1D fHProbTime; 38 TH1D fHProbTheta; // Chisq prob fit of Effective On time versus Theta 39 TH1D fHProbTime; // Chisq prob fit of Effective On time versus Time 40 40 41 41 TH1D fHN0; 42 42 TH1D fHLambda; 43 43 44 Bool_t fIsFinalized; 44 Bool_t fIsFinalized; // Flag telling you whether fHEffOnTheta is the final result 45 45 46 Int_t fNumEvents; 46 Int_t fNumEvents; // Number of events to be used for a bin in time 47 47 48 const TString fNameProjDeltaT; 49 const TString fNameProjTheta; 48 const TString fNameProjDeltaT; //! This should make sure, that gROOT doen't confuse the projection with something else 49 const TString fNameProjTheta; //! This should make sure, that gROOT doen't confuse the projection with something else 50 50 51 51 Bool_t FitH(TH1D *h, Double_t *res, Bool_t paint=kFALSE) const; … … 63 63 Bool_t Finalize(); 64 64 65 const TH1D &GetHEffOnTheta() const { return fHEffOnTheta; } 66 const TH1D &GetHEffOnTime() const { return fHEffOnTime; } 67 65 68 void Draw(Option_t *option=""); 66 69 void Paint(Option_t *opt=""); 67 70 68 ClassDef(MHEffectiveOnTime, 1) // 2D-histogram to determin effective on-time vs. theta71 ClassDef(MHEffectiveOnTime, 1) // Histogram to determin effective On-Time vs Time and Zenith Angle 69 72 }; 70 73
Note:
See TracChangeset
for help on using the changeset viewer.