source: trunk/MagicSoft/Mars/mhflux/MHThetaSq.cc@ 7008

Last change on this file since 7008 was 7001, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 5/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2005
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MHThetaSq
28//
29// This is a MHAlpha using "ThetaSquared [MParameterD]" as 'alpha'
30//
31// For more detailes see MHAlpha.
32//
33//////////////////////////////////////////////////////////////////////////////
34#include "MHThetaSq.h"
35
36#include "MParameters.h"
37#include "MHMatrix.h"
38
39#include "MBinning.h"
40#include "MParList.h"
41
42#include "MLog.h"
43#include "MLogManip.h"
44
45ClassImp(MHThetaSq);
46
47using namespace std;
48
49// --------------------------------------------------------------------------
50//
51// Default Constructor
52//
53MHThetaSq::MHThetaSq(const char *name, const char *title)
54 : MHAlpha(name, title), fThetaSq(0)
55{
56 //
57 // set the name and title of this object
58 //
59 fName = name ? name : "MHThetaSq";
60 fTitle = title ? title : "Theta Squared plot";
61
62 fNameParameter = "ThetaSquared";
63
64 fHist.SetName("Theta");
65 fHist.SetTitle("Theta");
66 fHist.SetZTitle("\\theta^{2} [deg^{2}]");
67 fHist.SetDirectory(NULL);
68
69 // Main histogram
70 fHistTime.SetName("Theta");
71 fHistTime.SetXTitle("\\theta^{2} [deg^{2}]");
72 fHistTime.SetDirectory(NULL);
73
74 //fHistTime.SetYTitle("\\theta^{2] [deg^{2}]");
75 /*
76 TArrayD arr(50);
77 for (int i=1; i<50; i++)
78 arr[i] = sqrt((arr[i-1]+1)*(arr[i-1]+1) + 1.1)-1;
79 */
80 MBinning binsa, binse, binst;
81 binsa.SetEdges(75, 0, 1.5);
82 //binsa.SetEdges(arr);
83 binse.SetEdgesLog(15, 10, 100000);
84 binst.SetEdgesCos(50, 0, 60);
85 binsa.Apply(fHistTime);
86
87 MH::SetBinning(&fHist, &binst, &binse, &binsa);
88}
89
90Bool_t MHThetaSq::GetParameter(const MParList &pl)
91{
92 fParameter = (MParContainer*)pl.FindObject(fNameParameter, "MParameterD");
93 if (fParameter)
94 return kTRUE;
95
96 *fLog << err << fNameParameter << " [MParameterD] not found... abort." << endl;
97 return kFALSE;
98}
99
100Double_t MHThetaSq::GetVal() const
101{
102 return static_cast<const MParameterD*>(fParameter)->GetVal();
103}
Note: See TracBrowser for help on using the repository browser.