Changeset 8279 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 01/30/07 14:16:45 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r7832 r8279 90 90 // 91 91 MHCamEvent::MHCamEvent(const char *name, const char *title) 92 : fSum(NULL), fEvt(NULL), fType(0), f Threshold(0), fUseThreshold(0)92 : fSum(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0) 93 93 { 94 94 Init(name, title); … … 100 100 // 101 101 MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title) 102 : fSum(NULL), fEvt(NULL), fType(type), f Threshold(0), fUseThreshold(0)102 : fSum(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0) 103 103 { 104 104 Init(name, title); … … 156 156 fSum->SetYTitle("a.u."); 157 157 fSum->SetBit(MHCamera::kProfile); 158 if (!fErrorSpread) 159 fSum->SetBit(MHCamera::kErrorMean); 158 160 159 161 fSum->SetXTitle("Pixel Idx"); … … 282 284 MHCamera *cam = new MHCamera(*fSum->GetGeometry()); 283 285 cam->SetName(Form("%s;err", fName.Data())); 284 cam->SetTitle( "Sqrt(Variance)");286 cam->SetTitle(fErrorSpread?"Sqrt(Variance)":"Sqrt(Variance)/Sqrt(n_{i})"); 285 287 cam->SetYTitle(fSum->GetYaxis()->GetTitle()); 286 288 cam->SetCamContent(*fSum, 1); -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r7035 r8279 23 23 24 24 Int_t fType; // Type to used for calling GetPixelContent 25 Bool_t fErrorSpread; // kFALSE==mean, kTRUE==spread 25 26 26 27 Float_t fThreshold; // Count pixel above/below this threshold … … 51 52 52 53 void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; } 54 void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; } 53 55 54 ClassDef(MHCamEvent, 1) // Histogram to sum camera events56 ClassDef(MHCamEvent, 2) // Histogram to sum camera events 55 57 }; 56 58 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r8106 r8279 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.9 5 2006-10-17 17:16:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.96 2007-01-30 14:16:45 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 1333 1333 } 1334 1334 1335 // ------------------------------------------------------------------------ 1336 // 1337 // In the case the kProfile flag is set the spread of the bin is returned. 1338 // If you want to have the mean error instead set the kErrorMean bit via 1339 // SetBit(kErrorMean) first. 1340 // 1335 1341 Stat_t MHCamera::GetBinError(Int_t bin) const 1336 1342 { … … 1346 1352 const Double_t val = fArray[bin] / n; 1347 1353 1348 return sqr>val*val ? TMath::Sqrt(sqr - val*val) / n : 0; 1354 const Double_t spread = sqr>val*val ? TMath::Sqrt(sqr - val*val); 1355 1356 return TestBit(kErrorMean) ? spread/TMath::Sqrt(n) : spread; 1349 1357 1350 1358 /*
Note:
See TracChangeset
for help on using the changeset viewer.