LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
EventHolder.cxx
Go to the documentation of this file.
1 #include <iostream>
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.
Singleton to hold the current art::Event 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:8
void SetEvent(art::Event const *evt)
Definition: EventHolder.cxx:32