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.11 2010/08/16 15:33:20 matevz 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);
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();
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:62
Filter(FWEventSelector *s)
Definition: FWFileEntry.h:45
FWEventSelector * m_selector
Definition: FWFileEntry.h:42
int lastSelectedEvent()
Definition: FWFileEntry.cc:98
FWTEventList * globalSelection()
Definition: FWFileEntry.h:63
bool hasSelectedEvents()
Definition: FWFileEntry.h:51
bool hasSelectedEvents()
Definition: FWFileEntry.cc:81
FWTEventList * m_eventList
Definition: FWFileEntry.h:41
void openFile()
Definition: FWFileEntry.cc:35
TFile * file()
Definition: FWFileEntry.h:60
bool isEventSelected(int event)
Definition: FWFileEntry.cc:75
std::list< Filter * > m_filterEntries
Definition: FWFileEntry.h:101
fwlite::Event * event()
Definition: FWFileEntry.h:61
bool filterEventsWithCustomParser(Filter *filter)
Definition: FWFileEntry.cc:304
FWFileEntry(const std::string &name)
Definition: FWFileEntry.cc:20
std::list< Filter * > & filters()
Definition: FWFileEntry.h:65
TFile * m_file
Definition: FWFileEntry.h:95
virtual ~FWFileEntry()
Definition: FWFileEntry.cc:27
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
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
Definition: align_tpl.py:86
int firstSelectedEvent()
Definition: FWFileEntry.cc:86
void runFilter(Filter *fe, const FWEventItemsManager *eiMng)
Definition: FWFileEntry.cc:196
int nextSelectedEvent(int event)
Definition: FWFileEntry.cc:106
void updateFilters(const FWEventItemsManager *eiMng, bool isOR)
Definition: FWFileEntry.cc:151
FWTEventList * m_globalEventList
Definition: FWFileEntry.h:102
bool hasActiveFilters()
Definition: FWFileEntry.cc:139
std::string m_name
Definition: FWFileEntry.h:94
string s
Definition: asciidump.py:422
int previousSelectedEvent(int event)
Definition: FWFileEntry.cc:121
int lastEvent()
Definition: FWFileEntry.h:79
void needUpdate()
Definition: FWFileEntry.h:84