source: trunk/Mars/mhist/MHCamEvent.h@ 16125

Last change on this file since 16125 was 13387, checked in by tbretz, 13 years ago
Added fIsRatio; propagate weights; added a possibility to also fill a ratio into a camera histogram.
File size: 2.7 KB
Line 
1#ifndef MARS_MHCamEvent
2#define MARS_MHCamEvent
3
4#ifndef MARS_MH
5#include "MH.h"
6#endif
7
8class MHCamera;
9class MCamEvent;
10
11class MHCamEvent : public MH
12{
13private:
14 static const TString gsDefName;
15 static const TString gsDefTitle;
16
17protected:
18 MHCamera *fSum; // storing the sum
19 MHCamera *fErr; //! storing the err
20 MCamEvent *fEvt; //! the current event
21 MCamEvent *fSub; //! the event to be subtracted
22
23 TString fNameEvt; // Name of MCamEvent to fill into histogram
24 TString fNameSub; // Name of MCamEvent to fill into histogram
25 TString fNameGeom; // Name of geometry container
26
27 Int_t fType; // Type to used for calling GetPixelContent
28 Bool_t fErrorSpread; // kFALSE==mean, kTRUE==spread
29 Bool_t fErrorRelative; // Display relative error?
30
31 Float_t fThreshold; // Count pixel above/below this threshold
32 Char_t fUseThreshold; // Use a threshold? Which direction has it?
33
34 Bool_t fIsRatio; // If NameSub is set: Use Ratio or difference
35
36 Int_t fNumReInit; //!
37
38 TString Format(const char *ext) const;
39
40 void Init(const char *name, const char *title);
41 Bool_t InitGeom(const MParList &plist);
42
43 Bool_t SetupFill(const MParList *pList);
44 Bool_t ReInit(MParList *plist);
45 Int_t Fill(const MParContainer *par, const Stat_t w=1);
46
47public:
48 enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0, kCollectMin=-2, kCollectMax=2, kMedianShift=3, kMeanShift=4 };
49
50 MHCamEvent(const char *name=NULL, const char *title=NULL);
51 MHCamEvent(Int_t type, const char *name=NULL, const char *title=NULL);
52 ~MHCamEvent();
53
54 void SetNameEvt(const TString name) { fNameEvt = name; }
55 void SetNameSub(const TString name, Bool_t ratio=kFALSE) { fNameSub = name; fIsRatio = ratio; }
56 void SetNameGeom(const TString name) { fNameGeom = name; }
57 void SetType(Int_t type) { fType = type; }
58
59 void SetHist(const MHCamera &cam);
60 MHCamera *GetHist() { return fSum; }
61 const MHCamera *GetHist() const { return fSum; }
62
63 TH1 *GetHistByName(const TString name="") const;
64
65 void Paint(Option_t *o="");
66 void Draw(Option_t *o=""); //*MENU*
67
68 void PrintOutliers(Float_t s) const;
69
70 void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
71 void SetCollectMin() { fUseThreshold=kCollectMin; }
72 void SetCollectMax() { fUseThreshold=kCollectMax; }
73 void SetMedianShift() { fUseThreshold=kMedianShift; }
74 void SetMeanShift() { fUseThreshold=kMeanShift; }
75 void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; }
76 void SetErrorRelative(Bool_t b=kTRUE) { fErrorRelative = b; }
77
78 void RecursiveRemove(TObject *obj);
79
80 ClassDef(MHCamEvent, 3) // Histogram to sum camera events
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.