1 | void ReadSetup(TString fname, MAstroCamera &cam)
|
---|
2 | {
|
---|
3 | MMcConfigRunHeader *config=0;
|
---|
4 | MGeomCam *geom=0;
|
---|
5 |
|
---|
6 | TFile file(fname);
|
---|
7 | TTree *tree = (TTree*)file.Get("RunHeaders");
|
---|
8 | tree->SetBranchAddress("MMcConfigRunHeader", &config);
|
---|
9 | if (tree->GetBranch("MGeomCam"))
|
---|
10 | tree->SetBranchAddress("MGeomCam", &geom);
|
---|
11 | tree->GetEntry(0);
|
---|
12 |
|
---|
13 | cam.SetMirrors(*config->GetMirrors());
|
---|
14 | cam.SetGeom(*geom);
|
---|
15 | }
|
---|
16 |
|
---|
17 | void starfield()
|
---|
18 | {
|
---|
19 | // Name of a MC file having MGeomCam and MMcConfigRunHeader
|
---|
20 | TString fname = "../Mars/Gamma_zbin7_90_7_53395to53399_w0.root";
|
---|
21 |
|
---|
22 | // Time for which to get the picture
|
---|
23 | MTime time;
|
---|
24 | time.Set(2004, 2, 28, 01, 32, 15);
|
---|
25 |
|
---|
26 | // Current observatory
|
---|
27 | MObservatory magic1;
|
---|
28 |
|
---|
29 | // Right Ascension [h] and declination [deg] of source
|
---|
30 | // Currently 'perfect' pointing is assumed
|
---|
31 | const Double_t ra = MAstro::Hms2Rad(5, 34, 31.9);
|
---|
32 | const Double_t dec = MAstro::Dms2Rad(22, 0, 52.0);
|
---|
33 |
|
---|
34 | new TCanvas;
|
---|
35 |
|
---|
36 | // --------------------------------------------------------------------------
|
---|
37 | // Create camera display from geometry
|
---|
38 | //MAstroCatalog stars; // Use this top display a catalog
|
---|
39 | MAstroCamera stars; // Use this top display a catalog on top of a camera
|
---|
40 | ReadSetup(fname, stars); // Use this top display a catalog on top of a camera
|
---|
41 | stars.SetLimMag(6);
|
---|
42 | stars.SetRadiusFOV(3);
|
---|
43 | stars.SetRaDec(ra, dec);
|
---|
44 | stars.ReadBSC("bsc5.dat");
|
---|
45 |
|
---|
46 | stars.SetObservatory(magic1);
|
---|
47 | stars.SetTime(time);
|
---|
48 | stars.SetGuiActive();
|
---|
49 |
|
---|
50 | // See the cooresponding Draw-function for more options
|
---|
51 | TObject *o = stars.Clone();
|
---|
52 | o->SetBit(kCanDelete);
|
---|
53 | o->Draw();
|
---|
54 |
|
---|
55 | }
|
---|