Changeset 8291 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/03/07 12:49:36 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r8284 r8291  
    9090//
    9191MHCamEvent::MHCamEvent(const char *name, const char *title)
    92     : fSum(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
     92: fSum(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fErrorRelative(kFALSE),
     93fThreshold(0), fUseThreshold(0)
    9394{
    9495    Init(name, title);
     
    100101//
    101102MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title)
    102     : fSum(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
     103: fSum(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fErrorRelative(kFALSE),
     104fThreshold(0), fUseThreshold(0)
    103105{
    104106    Init(name, title);
     
    159161        fSum->SetBit(MHCamera::kErrorMean);
    160162
    161     fSum->SetXTitle("Pixel Idx");
    162 
    163163    return kTRUE;
    164164}
     
    250250    MHCamera *cam = (MHCamera*)gPad->FindObject(Form("%s;err", fName.Data()));
    251251    if (cam)
    252         cam->SetCamContent(*fSum, 1);
     252        cam->SetCamContent(*fSum, fErrorRelative ? 1 : 2);
    253253}
    254254
     
    294294    p->cd();
    295295
     296    TString e = "Sqrt(Variance)";
     297    if (fSum->TestBit(MHCamera::kErrorMean))
     298        e += "/Sqrt(n_{i})";
     299    if (fErrorRelative)
     300        e += "/v_{i}";
     301
    296302    MHCamera *cam = new MHCamera(*fSum->GetGeometry());
    297303    cam->SetName(Form("%s;err", fName.Data()));
    298     cam->SetTitle(fErrorSpread?"Sqrt(Variance)":"Sqrt(Variance)/Sqrt(n_{i})");
     304    cam->SetTitle(e);
    299305    cam->SetYTitle(fSum->GetYaxis()->GetTitle());
    300     cam->SetCamContent(*fSum, 1);
     306    cam->SetCamContent(*fSum, fErrorRelative ? 1 : 2);
    301307    cam->SetBit(kCanDelete);
    302308    cam->Draw();
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r8281 r8291  
    2424    Int_t fType;           // Type to used for calling GetPixelContent
    2525    Bool_t fErrorSpread;   // kFALSE==mean, kTRUE==spread
     26    Bool_t fErrorRelative; // Display relative error?
    2627
    2728    Float_t fThreshold;    // Count pixel above/below this threshold
     
    4546
    4647    void SetHist(const MHCamera &cam);
     48    MHCamera *GetHist() { return fSum; }
     49    const MHCamera *GetHist() const { return fSum; }
    4750
    4851    TH1 *GetHistByName(const TString name="") const;
    4952
    5053    void Paint(Option_t *o="");
    51     void Draw(Option_t *o="");
     54    void Draw(Option_t *o="");  //*MENU*
    5255
    5356    void PrintOutliers(Float_t s) const;
     
    5558    void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
    5659    void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; }
     60    void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; }
    5761
    5862    ClassDef(MHCamEvent, 2) // Histogram to sum camera events
Note: See TracChangeset for help on using the changeset viewer.