test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWFileEntry.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef Fireworks_Core_FWFileEntry_h
3 #define Fireworks_Core_FWFileEntry_h
4 //
5 // Package: Core
6 // Class : FWFileEntry
7 //
8 
9 // system include files
10 #include <string>
11 #include <sigc++/sigc++.h>
12 
13 #include "TTree.h"
14 
15 // user include files
16 // MT -- to get auxBranch
21 
22 // forward declarations
23 class FWTEventList;
24 class CSGAction;
25 class CmsShowMain;
26 class TFile;
27 class TGWindow;
29 
30 namespace edm {
31  class EventID;
32 }
33 
34 class FWFileEntry {
35 public:
36  struct Filter
37  {
39  FWEventSelector* m_selector; // owned by navigator
41 
44  {
45  delete m_eventList;
46  }
47 
49  {
50  return m_eventList && m_eventList->GetN();
51  }
52  };
53 
54  FWFileEntry(const std::string& name, bool checkVersion);
55  virtual ~FWFileEntry();
56 
57  TFile* file() { return m_file; }
58  fwlite::Event* event() { return m_event; }
59  TTree* tree() { return m_eventTree; }
61 
62  std::list<Filter*>& filters() { return m_filterEntries; }
63 
64  void openFile(bool);
65  void closeFile();
66 
67  bool isEventSelected(int event);
68 
69  bool hasSelectedEvents();
70 
71  bool hasActiveFilters();
72 
73  int firstSelectedEvent();
74  int lastSelectedEvent();
75 
76  int lastEvent() { return m_eventTree->GetEntries() -1; }
77 
78  int nextSelectedEvent(int event);
80 
81  void needUpdate() { m_needUpdate = true; }
82  void updateFilters(const FWEventItemsManager* eiMng, bool isOR);
83 
84 private:
85  FWFileEntry(const FWFileEntry&); // stop default
86  const FWFileEntry& operator=(const FWFileEntry&); // stop default
87 
88  void runFilter(Filter* fe, const FWEventItemsManager* eiMng);
90 
92  TFile* m_file;
93  TTree* m_eventTree;
95 
96  bool m_needUpdate; // To be set in navigator::filterChanged/Added, newFile
97 
98  std::list<Filter*> m_filterEntries;
100 };
101 #endif
TTree * tree()
Definition: FWFileEntry.h:59
void closeFile()
Definition: FWFileEntry.cc:123
Filter(FWEventSelector *s)
Definition: FWFileEntry.h:42
FWEventSelector * m_selector
Definition: FWFileEntry.h:39
void openFile(bool)
Definition: FWFileEntry.cc:39
int lastSelectedEvent()
Definition: FWFileEntry.cc:161
FWTEventList * globalSelection()
Definition: FWFileEntry.h:60
bool hasSelectedEvents()
Definition: FWFileEntry.h:48
bool hasSelectedEvents()
Definition: FWFileEntry.cc:144
FWTEventList * m_eventList
Definition: FWFileEntry.h:38
FWFileEntry(const std::string &name, bool checkVersion)
Definition: FWFileEntry.cc:24
TFile * file()
Definition: FWFileEntry.h:57
bool isEventSelected(int event)
Definition: FWFileEntry.cc:138
std::list< Filter * > m_filterEntries
Definition: FWFileEntry.h:98
fwlite::Event * event()
Definition: FWFileEntry.h:58
bool filterEventsWithCustomParser(Filter *filter)
Definition: FWFileEntry.cc:381
std::list< Filter * > & filters()
Definition: FWFileEntry.h:62
TFile * m_file
Definition: FWFileEntry.h:92
virtual ~FWFileEntry()
Definition: FWFileEntry.cc:31
bool m_needUpdate
Definition: FWFileEntry.h:96
const FWFileEntry & operator=(const FWFileEntry &)
TTree * m_eventTree
Definition: FWFileEntry.h:93
fwlite::Event * m_event
Definition: FWFileEntry.h:94
int firstSelectedEvent()
Definition: FWFileEntry.cc:149
void runFilter(Filter *fe, const FWEventItemsManager *eiMng)
Definition: FWFileEntry.cc:259
int nextSelectedEvent(int event)
Definition: FWFileEntry.cc:169
void updateFilters(const FWEventItemsManager *eiMng, bool isOR)
Definition: FWFileEntry.cc:214
FWTEventList * m_globalEventList
Definition: FWFileEntry.h:99
bool hasActiveFilters()
Definition: FWFileEntry.cc:202
std::string m_name
Definition: FWFileEntry.h:91
int previousSelectedEvent(int event)
Definition: FWFileEntry.cc:184
int lastEvent()
Definition: FWFileEntry.h:76
void needUpdate()
Definition: FWFileEntry.h:81