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
17 #define private public
19 #undef private
23 
24 // forward declarations
25 class FWTEventList;
26 class CSGAction;
27 class CmsShowMain;
28 class TFile;
29 class TGWindow;
31 
32 namespace edm {
33  class EventID;
34 }
35 
36 class FWFileEntry {
37 public:
38  struct Filter
39  {
41  FWEventSelector* m_selector; // owned by navigator
43 
46  {
47  delete m_eventList;
48  }
49 
51  {
52  return m_eventList && m_eventList->GetN();
53  }
54  };
55 
56  FWFileEntry(const std::string& name, bool checkVersion);
57  virtual ~FWFileEntry();
58 
59  TFile* file() { return m_file; }
60  fwlite::Event* event() { return m_event; }
61  TTree* tree() { return m_eventTree; }
63 
64  std::list<Filter*>& filters() { return m_filterEntries; }
65 
66  void openFile(bool);
67  void closeFile();
68 
69  bool isEventSelected(int event);
70 
71  bool hasSelectedEvents();
72 
73  bool hasActiveFilters();
74 
75  int firstSelectedEvent();
76  int lastSelectedEvent();
77 
78  int lastEvent() { return m_eventTree->GetEntries() -1; }
79 
80  int nextSelectedEvent(int event);
82 
83  void needUpdate() { m_needUpdate = true; }
84  void updateFilters(const FWEventItemsManager* eiMng, bool isOR);
85 
86 private:
87  FWFileEntry(const FWFileEntry&); // stop default
88  const FWFileEntry& operator=(const FWFileEntry&); // stop default
89 
90  void runFilter(Filter* fe, const FWEventItemsManager* eiMng);
92 
94  TFile* m_file;
95  TTree* m_eventTree;
97 
98  bool m_needUpdate; // To be set in navigator::filterChanged/Added, newFile
99 
100  std::list<Filter*> m_filterEntries;
102 };
103 #endif
TTree * tree()
Definition: FWFileEntry.h:61
void closeFile()
Definition: FWFileEntry.cc:112
Filter(FWEventSelector *s)
Definition: FWFileEntry.h:44
FWEventSelector * m_selector
Definition: FWFileEntry.h:41
void openFile(bool)
Definition: FWFileEntry.cc:39
int lastSelectedEvent()
Definition: FWFileEntry.cc:148
FWTEventList * globalSelection()
Definition: FWFileEntry.h:62
bool hasSelectedEvents()
Definition: FWFileEntry.h:50
bool hasSelectedEvents()
Definition: FWFileEntry.cc:131
FWTEventList * m_eventList
Definition: FWFileEntry.h:40
FWFileEntry(const std::string &name, bool checkVersion)
Definition: FWFileEntry.cc:24
TFile * file()
Definition: FWFileEntry.h:59
bool isEventSelected(int event)
Definition: FWFileEntry.cc:125
std::list< Filter * > m_filterEntries
Definition: FWFileEntry.h:100
fwlite::Event * event()
Definition: FWFileEntry.h:60
bool filterEventsWithCustomParser(Filter *filter)
Definition: FWFileEntry.cc:354
std::list< Filter * > & filters()
Definition: FWFileEntry.h:64
TFile * m_file
Definition: FWFileEntry.h:94
virtual ~FWFileEntry()
Definition: FWFileEntry.cc:31
bool m_needUpdate
Definition: FWFileEntry.h:98
const FWFileEntry & operator=(const FWFileEntry &)
TTree * m_eventTree
Definition: FWFileEntry.h:95
fwlite::Event * m_event
Definition: FWFileEntry.h:96
int firstSelectedEvent()
Definition: FWFileEntry.cc:136
void runFilter(Filter *fe, const FWEventItemsManager *eiMng)
Definition: FWFileEntry.cc:246
int nextSelectedEvent(int event)
Definition: FWFileEntry.cc:156
void updateFilters(const FWEventItemsManager *eiMng, bool isOR)
Definition: FWFileEntry.cc:201
FWTEventList * m_globalEventList
Definition: FWFileEntry.h:101
bool hasActiveFilters()
Definition: FWFileEntry.cc:189
std::string m_name
Definition: FWFileEntry.h:93
int previousSelectedEvent(int event)
Definition: FWFileEntry.cc:171
int lastEvent()
Definition: FWFileEntry.h:78
void needUpdate()
Definition: FWFileEntry.h:83