EventHolder.cxx
Go to the documentation of this file.
1 ///
2 /// \file EventHolder.h
3 /// \brief Singleton to hold the current art::Event for the event display
4 /// \author brebel@fnal.gov
5 /// \version $Id: EventHolder.cxx,v 1.2 2011-01-19 16:44:59 p-nusoftart Exp $
6 ///
7 #include <iostream>
8 #include "nutools/EventDisplayBase/EventHolder.h"
9 
10 namespace evdb{
11 
12  static EventHolder* gInstance = 0;
13 
14  //---------------------------------------------------------
16  if(!gInstance) gInstance = new EventHolder();
17  return gInstance;
18  }
19 
20  //---------------------------------------------------------
22  fEvent(0)
23  {
24  }
25 
26  //---------------------------------------------------------
28  {
29  }
30 
31  //---------------------------------------------------------
33  {
34  if(fEvent){
35 // std::cerr << "event is already loaded, resetting it" << std::endl;
36  fEvent = 0;
37  }
38  fEvent = evt;
39 
40 // std::cout << "run is " << fEvent->run() << " event is " << fEvent->id().event() << std::endl;
41 
42  }
43 
44  //---------------------------------------------------------
46  {
47 // if(!fEvent){
48 // std::cerr << "No art::Event set to return, handing back null pointer" << std::endl;
49 // }
50  return fEvent;
51  }
52 
53 }//namespace
const art::Event * GetEvent() const
Definition: EventHolder.cxx:45
static EventHolder * gInstance
Definition: EventHolder.cxx:12
Manage all things related to colors for the event display.
static EventHolder * Instance()
Definition: EventHolder.cxx:15
const art::Event * fEvent
the Event
Definition: EventHolder.h:29
TCEvent evt
Definition: DataStructs.cxx:7
void SetEvent(art::Event const *evt)
Definition: EventHolder.cxx:32