source: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h@ 4433

Last change on this file since 4433 was 3734, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1#ifndef MARS_MCerPhotEvt
2#define MARS_MCerPhotEvt
3
4#ifndef ROOT_TClonesArray
5#include <TClonesArray.h>
6#endif
7#ifndef ROOT_TArrayI
8#include <TArrayI.h>
9#endif
10#ifndef MARS_MCamEvent
11#include "MCamEvent.h"
12#endif
13#ifndef MARS_MCerPhotPix
14#include "MCerPhotPix.h"
15#endif
16
17class MGeomCam;
18class MCerPhotPix;
19class MCerPhotEvtIter;
20
21class MCerPhotEvt : public MParContainer, public MCamEvent
22{
23 friend class MCerPhotEvtIter;
24private:
25 UInt_t fNumPixels;
26 Int_t fMaxIndex;
27 TArrayI fLut; // Lookup tabel to lookup pixel by index
28 TClonesArray *fPixels; //-> FIXME: Change TClonesArray away from a pointer?
29
30public:
31 MCerPhotEvt(const char *name=NULL, const char *title=NULL);
32 ~MCerPhotEvt() { delete fPixels; }
33
34 UInt_t GetNumPixels() const { return fNumPixels; }
35 //void InitSize(UInt_t num) { fPixels->Expand(num); }
36
37 MCerPhotPix *AddPixel(Int_t idx, Float_t nph=0, Float_t er=0);
38
39 void FixSize();
40
41 Bool_t IsPixelExisting(Int_t id) const;
42 Bool_t IsPixelUsed (Int_t id) const;
43 Bool_t IsPixelCore (Int_t id) const;
44
45 Float_t GetNumPhotonsMin(const MGeomCam *geom=NULL) const;
46 Float_t GetNumPhotonsMax(const MGeomCam *geom=NULL) const;
47
48 Float_t GetRatioMin(const MGeomCam *geom=NULL) const;
49 Float_t GetRatioMax(const MGeomCam *geom=NULL) const;
50
51 Float_t GetErrorPhotMin(const MGeomCam *geom=NULL) const;
52 Float_t GetErrorPhotMax(const MGeomCam *geom=NULL) const;
53
54 MCerPhotPix &operator[](int i) { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); }
55 MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); }
56
57 void Scale(Double_t f) { fPixels->ForEach(MCerPhotPix, Scale)(f); }
58 void RemoveUnusedPixels();
59
60 MCerPhotPix *GetPixById(Int_t idx) const;
61
62 void Reset();
63
64 void Print(Option_t *opt=NULL) const;
65 void Clear(Option_t *opt=NULL) { Reset(); }
66
67 // class MCamEvent
68 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
69 void DrawPixelContent(Int_t num) const;
70
71 operator TIterator*() const;
72
73 ClassDef(MCerPhotEvt, 2) // class for an event containing cerenkov photons
74};
75
76class MCerPhotEvtIter : public TObjArrayIter
77{
78private:
79 Bool_t fUsedOnly;
80public:
81 MCerPhotEvtIter(const MCerPhotEvt *evt, Bool_t usedonly=kTRUE, Bool_t dir=kIterForward) : TObjArrayIter(evt->fPixels, dir), fUsedOnly(usedonly) { }
82 TObject *Next();
83 TIterator &operator=(const TIterator &) { return *this; }
84 ClassDef(MCerPhotEvtIter, 0)
85};
86
87inline MCerPhotEvt::operator TIterator*() const { return new MCerPhotEvtIter(this); }
88
89#endif
Note: See TracBrowser for help on using the repository browser.