GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GammaFilter.h
Go to the documentation of this file.
1 #ifndef GW_GAMMAFILTER_H
2 #define GW_GAMMAFILTER_H
3 
4 #ifndef ROOT_TH1F
5 #include <TH1F.h>
6 #endif
7 
8 #ifndef GW_GAMMALINK_H
9 #include <GammaLink.h>
10 #endif
11 
12 #ifndef GW_BASEFILTER_H
13 #include <BaseFilter.h>
14 #endif
15 
16 namespace Gw {
17 
19 
41 class GammaFilter : public BaseFilter
42 {
43 private:
44 
45 protected:
46  TH1F *fComptonShape; // What is the energy after a compton scattering
47  TH1F *fCompton; // histogram that is used to do compton scattering
48  TH1F *fDoppler; // doppler broadring
49  TH1F *fEfficiency; // efficiency curve
50 
51 public:
52  GammaFilter();
54 
63  GammaFilter(Axis_t xmin, Axis_t xmax, Float_t eff = 1, Float_t PT = 0.5, Float_t dop = 1.25);
64  virtual ~GammaFilter();
65 
67 
70  Bool_t IsEffective();
71 
73 
79  // void SetEfficiency(TH1F &);
80 
81 
83  Bool_t InitFilter(const char *);
84 
86 
89  Bool_t Compton ( GammaLink *, Float_t &);
90 
92  Float_t Doppler ( GammaLink * );
93 
95  bool IsRejected ( GammaLink * );
96 
98 
105  virtual Int_t ApplyE(const TSeqCollection &, TBuffer &);
106  virtual Int_t ApplyE(const TSeqCollection &, Float_t *);
108 
110  ClassDef(GammaFilter,1); // An experimental filter to real gamma-ray cascades
111 };
112 // GammaFilter inline members //////////////////////////////////////////////////////
113 inline bool GammaFilter::IsRejected ( GammaLink *gam )
114 { return fEfficiency->GetBinContent(fEfficiency->FindBin(gam->GetEnergy().GetValue())) < fRand->Current()->Rndm();}
115 inline Float_t GammaFilter::Doppler ( GammaLink *gam )
116 {
117  Float_t e = gam->GetEnergy().GetValue();
118  return fRand->Current()->Gaus(e,fDoppler->GetBinContent(fDoppler->FindBin(e)));
119 }
120 // End GammaFilter inline members //////////////////////////////////////////////////
121 
122 }
123 #endif
virtual Int_t ApplyE(const TSeqCollection &, TBuffer &)
Apply this filter to the list of gamma-rays.
Bool_t InitFilter(const char *)
to modifiy the efficency curve.
Definition: GammaFilter.cpp:64
TH1F * fComptonShape
Definition: GammaFilter.h:46
TRandom * Current() const
to get the current TRandomom object
Definition: Random.h:118
bool IsRejected(GammaLink *)
True if this gamma ray is not detected.
Definition: GammaFilter.h:113
This class is a base class for any experimental filter.
Definition: BaseFilter.h:28
Standard filter for gamma-rays (EUROBALL-like appproach)
Definition: GammaFilter.h:41
Float_t Doppler(GammaLink *)
return a random number assuming a gaussian at the gamma-rays position with a width given by fDoppler ...
Definition: GammaFilter.h:115
TH1F * fEfficiency
Definition: GammaFilter.h:49
Bool_t Compton(GammaLink *, Float_t &)
true if this gamma-ray has not given all its energy.
Bool_t IsEffective()
check out if it has been correctly initiated
Definition: GammaFilter.cpp:95
virtual ~GammaFilter()
Definition: GammaFilter.cpp:56
ClassDef(GammaFilter, 1)
Root dictionnary related.
Random * fRand
Definition: BaseFilter.h:31
Data_T GetValue() const
get the value, cannot be overloaded
Definition: Data.h:114