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_FWFileEntryr_h
4 //
5 // Package: Core
6 // Class : FWFileEntry
7 // $Id: FWFileEntry.h,v 1.13 2011/06/03 23:30:50 amraktad Exp $
8 //
9 
10 // system include files
11 #include <string>
12 #include <sigc++/sigc++.h>
13 
14 #include "TTree.h"
15 
16 // user include files
17 // MT -- to get auxBranch
18 #define private public
20 #undef private
24 
25 // forward declarations
26 class FWTEventList;
27 class CSGAction;
28 class CmsShowMain;
29 class TFile;
30 class TGWindow;
32 
33 namespace edm {
34  class EventID;
35 }
36 
37 class FWFileEntry {
38 public:
39  struct Filter
40  {
42  FWEventSelector* m_selector; // owned by navigator
44 
47  {
48  delete m_eventList;
49  }
50 
52  {
53  return m_eventList && m_eventList->GetN();
54  }
55  };
56 
57  FWFileEntry(const std::string& name, bool checkVersion);
58  virtual ~FWFileEntry();
59 
60  TFile* file() { return m_file; }
61  fwlite::Event* event() { return m_event; }
62  TTree* tree() { return m_eventTree; }
64 
65  std::list<Filter*>& filters() { return m_filterEntries; }
66 
67  void openFile(bool);
68  void closeFile();
69 
70  bool isEventSelected(int event);
71 
72  bool hasSelectedEvents();
73 
74  bool hasActiveFilters();
75 
76  int firstSelectedEvent();
77  int lastSelectedEvent();
78 
79  int lastEvent() { return m_eventTree->GetEntries() -1; }
80 
81  int nextSelectedEvent(int event);
83 
84  void needUpdate() { m_needUpdate = true; }
85  void updateFilters(const FWEventItemsManager* eiMng, bool isOR);
86 
87 private:
88  FWFileEntry(const FWFileEntry&); // stop default
89  const FWFileEntry& operator=(const FWFileEntry&); // stop default
90 
91  void runFilter(Filter* fe, const FWEventItemsManager* eiMng);
93 
94  std::string m_name;
95  TFile* m_file;
96  TTree* m_eventTree;
98 
99  bool m_needUpdate; // To be set in navigator::filterChanged/Added, newFile
100 
101  std::list<Filter*> m_filterEntries;
103 };
104 #endif
TTree * tree()
Definition: FWFileEntry.h:62
void closeFile()
Definition: FWFileEntry.cc:108
Filter(FWEventSelector *s)
Definition: FWFileEntry.h:45
FWEventSelector * m_selector
Definition: FWFileEntry.h:42
void openFile(bool)
Definition: FWFileEntry.cc:38
int lastSelectedEvent()
Definition: FWFileEntry.cc:144
FWTEventList * globalSelection()
Definition: FWFileEntry.h:63
bool hasSelectedEvents()
Definition: FWFileEntry.h:51
bool hasSelectedEvents()
Definition: FWFileEntry.cc:127
FWTEventList * m_eventList
Definition: FWFileEntry.h:41
FWFileEntry(const std::string &name, bool checkVersion)
Definition: FWFileEntry.cc:23
TFile * file()
Definition: FWFileEntry.h:60
bool isEventSelected(int event)
Definition: FWFileEntry.cc:121
std::list< Filter * > m_filterEntries
Definition: FWFileEntry.h:101
fwlite::Event * event()
Definition: FWFileEntry.h:61
bool filterEventsWithCustomParser(Filter *filter)
Definition: FWFileEntry.cc:350
std::list< Filter * > & filters()
Definition: FWFileEntry.h:65
TFile * m_file
Definition: FWFileEntry.h:95
virtual ~FWFileEntry()
Definition: FWFileEntry.cc:30
bool m_needUpdate
Definition: FWFileEntry.h:99
const FWFileEntry & operator=(const FWFileEntry &)
TTree * m_eventTree
Definition: FWFileEntry.h:96
fwlite::Event * m_event
Definition: FWFileEntry.h:97
int firstSelectedEvent()
Definition: FWFileEntry.cc:132
void runFilter(Filter *fe, const FWEventItemsManager *eiMng)
Definition: FWFileEntry.cc:242
int nextSelectedEvent(int event)
Definition: FWFileEntry.cc:152
void updateFilters(const FWEventItemsManager *eiMng, bool isOR)
Definition: FWFileEntry.cc:197
FWTEventList * m_globalEventList
Definition: FWFileEntry.h:102
bool hasActiveFilters()
Definition: FWFileEntry.cc:185
std::string m_name
Definition: FWFileEntry.h:94
int previousSelectedEvent(int event)
Definition: FWFileEntry.cc:167
int lastEvent()
Definition: FWFileEntry.h:79
void needUpdate()
Definition: FWFileEntry.h:84