GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSPlayer.C
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004-2006 by Olivier Stezowski & Christian Finck *
3  * stezow(AT)ipnl.in2p3.fr, cfinck(AT)ires.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 
22 #if !defined(__CINT__) || defined(__MAKECINT__)
23 
24 #include <Riostream.h>
25 #include "TCanvas.h"
26 
27 #include "HistoDB.h"
28 #include "GSPlayer.h"
29 
30 #endif
31 
34 void GSPlayer()
35 {
36  // draw canvas
37  TCanvas* c1 = new TCanvas("c1","titre",10,10,700,500);
38  c1->Draw();
39 
40  // open histo data base
41  Gw::HistoDB db;
42  db.Open("toto", "rad:$PWD");
43 
44  // fill histo and draw
45  TH1F* h = new TH1F();
46  h->SetName("../tools/Eu152.spe");
47  db >> *h;
48  h->SetAxisRange(2150, 2250);
49  h->Draw();
50 
51  // open GS Player and connect to canvas
52  Gw::GSPlayer* s = new Gw::GSPlayer();
53  s->Connect(c1);
54 }
55 
void GSPlayer()
Simple macro that read a histogram (radware format) draw it on a canvas and connect this canvas to GS...
Definition: GSPlayer.C:34
virtual HistoConverter * Open(const char *, const char *)
to open a new DB service
Definition: HistoDB.cpp:93
header file for the HistoDB facility
Most of the methods relies on graphical approach.
Definition: GSPlayer.h:46
Service to read/write ROOT histograms from/to different DB systems.
Definition: HistoDB.h:90
Bool_t Connect(TCanvas *c=0x0)
Connect the Canvas to this to collect events.