CMS 3D CMS Logo

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 FWEventItem;
24 class FWTEventList;
25 class FWTTreeCache;
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 {
40  FWEventSelector* m_selector; // owned by navigator
42 
44  ~Filter() { delete m_eventList; }
45 
46  bool hasSelectedEvents() { return m_eventList && m_eventList->GetN(); }
47  };
48 
49  FWFileEntry(const std::string& name, bool checkVersion, bool checkGlobalTag);
50  virtual ~FWFileEntry();
51 
52  TFile* file() { return m_file; }
53  fwlite::Event* event() { return m_event; }
54  TTree* tree() { return m_eventTree; }
57 
58  std::list<Filter*>& filters() { return m_filterEntries; }
59 
60  const std::string& getGlobalTag() const { return m_globalTag; }
61 
62  void openFile(bool, bool);
63  void closeFile();
64 
65  bool isEventSelected(int event);
66 
67  bool hasSelectedEvents();
68 
69  bool hasActiveFilters();
70 
71  int firstSelectedEvent();
72  int lastSelectedEvent();
73 
74  int lastEvent() { return m_eventTree->GetEntries() - 1; }
75 
76  int nextSelectedEvent(int event);
78 
79  void needUpdate() { m_needUpdate = true; }
80  void updateFilters(const FWEventItemsManager* eiMng, bool isOR);
81 
82  // CallIns from FWEventItemsManager for tree-cache add/remove branch
83  void NewEventItemCallIn(const FWEventItem* it);
84  void RemovingEventItemCallIn(const FWEventItem* it);
85 
86 private:
87  FWFileEntry(const FWFileEntry&) = delete; // stop default
88  const FWFileEntry& operator=(const FWFileEntry&) = delete; // stop default
89 
90  void runFilter(Filter* fe, const FWEventItemsManager* eiMng);
92 
93  std::string getBranchName(const FWEventItem* it) const;
94 
96  TFile* m_file;
97  TTree* m_eventTree;
99 
100  bool m_needUpdate; // To be set in navigator::filterChanged/Added, newFile
102 
103  std::list<Filter*> m_filterEntries;
105 };
106 #endif
FWFileEntry::getGlobalTag
const std::string & getGlobalTag() const
Definition: FWFileEntry.h:60
FWFileEntry::m_name
std::string m_name
Definition: FWFileEntry.h:95
FWFileEntry::NewEventItemCallIn
void NewEventItemCallIn(const FWEventItem *it)
Definition: FWFileEntry.cc:560
FWFileEntry::lastEvent
int lastEvent()
Definition: FWFileEntry.h:74
CmsShowMain
Definition: CmsShowMain.h:58
edm
HLT enums.
Definition: AlignableModifier.h:19
FWEventItemsManager
Definition: FWEventItemsManager.h:44
FWFileEntry::RemovingEventItemCallIn
void RemovingEventItemCallIn(const FWEventItem *it)
Definition: FWFileEntry.cc:569
FWFileEntry::globalSelection
FWTEventList * globalSelection()
Definition: FWFileEntry.h:55
FWFileEntry::FWFileEntry
FWFileEntry(const std::string &name, bool checkVersion, bool checkGlobalTag)
Definition: FWFileEntry.cc:35
FWFileEntry::lastSelectedEvent
int lastSelectedEvent()
Definition: FWFileEntry.cc:243
CSGAction
Definition: CSGAction.h:38
FWFileEntry::Filter::m_needsUpdate
bool m_needsUpdate
Definition: FWFileEntry.h:41
FWEventSelector.h
FWFileEntry::file
TFile * file()
Definition: FWFileEntry.h:52
FWFileEntry::operator=
const FWFileEntry & operator=(const FWFileEntry &)=delete
FWEventSelector
Definition: FWEventSelector.h:12
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FWFileEntry::getBranchName
std::string getBranchName(const FWEventItem *it) const
Definition: FWFileEntry.cc:553
FWFileEntry
Definition: FWFileEntry.h:36
FWFileEntry::~FWFileEntry
virtual ~FWFileEntry()
Definition: FWFileEntry.cc:46
FWConfigurable.h
FWFileEntry::event
fwlite::Event * event()
Definition: FWFileEntry.h:53
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
FWFileEntry::m_filterEntries
std::list< Filter * > m_filterEntries
Definition: FWFileEntry.h:103
FWFileEntry::isEventSelected
bool isEventSelected(int event)
Definition: FWFileEntry.cc:228
funct::true
true
Definition: Factorize.h:173
FWFileEntry::filters
std::list< Filter * > & filters()
Definition: FWFileEntry.h:58
FWFileEntry::m_file
TFile * m_file
Definition: FWFileEntry.h:96
FWFileEntry::runFilter
void runFilter(Filter *fe, const FWEventItemsManager *eiMng)
Definition: FWFileEntry.cc:327
FWTTreeCache
Definition: FWTTreeCache.h:9
Filter
Definition: Filter.py:1
FWFileEntry::nextSelectedEvent
int nextSelectedEvent(int event)
Definition: FWFileEntry.cc:250
FWTEventList
Definition: FWTEventList.h:12
FWFileEntry::filterEventsWithCustomParser
bool filterEventsWithCustomParser(Filter *filter)
Definition: FWFileEntry.cc:456
FWFileEntry::updateFilters
void updateFilters(const FWEventItemsManager *eiMng, bool isOR)
Definition: FWFileEntry.cc:291
FWFileEntry::openFile
void openFile(bool, bool)
Definition: FWFileEntry.cc:53
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWEventItem
Definition: FWEventItem.h:56
fwlite::Event
Definition: Event.h:87
FWFileEntry::previousSelectedEvent
int previousSelectedEvent(int event)
Definition: FWFileEntry.cc:264
FWFileEntry::m_globalEventList
FWTEventList * m_globalEventList
Definition: FWFileEntry.h:104
Event.h
FWFileEntry::m_eventTree
TTree * m_eventTree
Definition: FWFileEntry.h:97
FWFileEntry::firstSelectedEvent
int firstSelectedEvent()
Definition: FWFileEntry.cc:235
FWFileEntry::m_event
fwlite::Event * m_event
Definition: FWFileEntry.h:98
FWFileEntry::m_globalTag
std::string m_globalTag
Definition: FWFileEntry.h:101
FWFileEntry::m_needUpdate
bool m_needUpdate
Definition: FWFileEntry.h:100
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
FWFileEntry::Filter::m_eventList
FWTEventList * m_eventList
Definition: FWFileEntry.h:39
FWFileEntry::closeFile
void closeFile()
Definition: FWFileEntry.cc:214
FWFileEntry::fwTreeCache
FWTTreeCache * fwTreeCache()
Definition: FWFileEntry.cc:547
FWFileEntry::Filter::hasSelectedEvents
bool hasSelectedEvents()
Definition: FWFileEntry.h:46
FWFileEntry::hasActiveFilters
bool hasActiveFilters()
Definition: FWFileEntry.cc:281
event
Definition: event.py:1
FWFileEntry::Filter::m_selector
FWEventSelector * m_selector
Definition: FWFileEntry.h:40
FWFileEntry::Filter::Filter
Filter(FWEventSelector *s)
Definition: FWFileEntry.h:43
FWFileEntry::needUpdate
void needUpdate()
Definition: FWFileEntry.h:79
FWFileEntry::tree
TTree * tree()
Definition: FWFileEntry.h:54
FWTEventList.h
FWFileEntry::Filter::~Filter
~Filter()
Definition: FWFileEntry.h:44
FWFileEntry::hasSelectedEvents
bool hasSelectedEvents()
Definition: FWFileEntry.cc:233