ReflectedBgMaker.hh

Deil Christoph, 10/15/2012 11:16 AM

Download (2.16 KB)

 
1
#ifndef REFLECTEDBGMAKER_H
2
#define REFLECTEDBGMAKER_H
3

    
4
#include <utilities/ConfigHandler.hh>
5

    
6
#include "BgMaker.hh"
7
#include "BgMaps.hh"
8

    
9

    
10
namespace Background {
11

    
12
  /**
13
   * \brief Estimate the background from off regions that
14
   * are reflected versions of the on region wrt. the run pointing position.
15
   *
16
   * \author The Heidelberg team
17
   */
18
  class ReflectedBgMaker : public BgMaker {
19
    
20
  public:
21
    
22
    ReflectedBgMaker(std::string name, 
23
                     Utilities::ConfigHandler& cfghandler,
24
                     std::string input = "Select", 
25
                     bool init_now = true);
26

    
27
    ReflectedBgMaker(Utilities::ConfigHandler& cfghandler,
28
                     std::string input = "Select", 
29
                     bool init_now = true);
30

    
31
    virtual ~ReflectedBgMaker();
32

    
33
    virtual void  BeginRun();
34
    virtual void  EndRun();
35
    
36
    int  GetNumberOffRegions()         { return fNumberOffRegions;};
37
    void SetNumberOffRegions(int noff) { fNumberOffRegions = noff;};
38
    void SetOffDistanceMax (double dist) {if (dist>0.) fMaxOffRegionDist = dist;} 
39
    void SetMinOnOffDistance(double dist) {if( dist>0. ) fMinOnOffDist = dist; }
40

    
41
    bool IsOnMapEvent();
42
    bool IsOffMapEvent();
43
    void FillOnExposure();
44
    void FillOffExposure();
45

    
46
    virtual bool CanMakeMaps(){return true;}
47
    virtual bool CanMakeStats(){return true;}
48

    
49
  private:
50
    void ConstructMaker(Utilities::ConfigHandler& cfghandler);
51

    
52
    static Tools::Circle* IsCircle(const Tools::Region* region);
53
    bool CreateOffRegions(const Tools::Region* onregion,
54
                          const Stash::Coordinate &obspos);
55
    bool CreateOffRegionsForOnCircle(const Tools::Circle* onregion,
56
                                     const Stash::Coordinate &obspos);
57

    
58
    int    fMaxNumberOffRegions; /// maximum number of OFF regions
59
    int    fMinNumberOffRegions; /// minimum number of OFF regions
60
    double fMinOnOffDist;        /// minimum distance between ON and OFF region
61
    int    fNumberOffRegions;    /// actual number of OFF regions
62
    double fRotationAngleDeg;    /// rotation angle of initial OFF position
63

    
64
    double fCurrentOffset;
65
    double fMaxOffRegionDist;
66

    
67
    bool    fUseCircularOff;     /// use circular OFF regions instead of ON-shaped
68

    
69
    ClassDef( Background::ReflectedBgMaker, 3 );
70
  };
71
}
72

    
73

    
74

    
75
#endif
76