Crombie Tools
GoodLumiFilter.h
Go to the documentation of this file.
1 /**
2  @file GoodLumiFilter.h
3  Header file for GoodLumiFilter class.
4  @author Daniel Abercrombie <dabercro@mit.edu>
5 */
6 
7 #ifndef CROMBIETOOLS_SKIMMINGTOOLS_GOODLUMIFILTER_H
8 #define CROMBIETOOLS_SKIMMINGTOOLS_GOODLUMIFILTER_H
9 
10 #include <map>
11 #include <set>
12 
13 /**
14  @ingroup skimminggroup
15  @class GoodLumiFilter
16  @brief Created using CrombieTools.SkimmingTools.GoodLumiFilter.MakeFilter().
17 
18  Holds good events from JSON file and can return whether
19  a given event is good or not.
20 */
21 
23 {
24  public:
26  virtual ~GoodLumiFilter();
27 
28  /// Returns if event with a given run and lumi number is good
29  Bool_t IsGood ( UInt_t run, UInt_t lumi );
30 
31  /// Add a good run and lumi number
32  void AddLumi ( UInt_t run, UInt_t lumi ) { fGoodLumis[run].insert(lumi); }
33 
34  private:
35  std::map<UInt_t, std::set<UInt_t> > fGoodLumis; ///< Map of good lumis
36 
37  UInt_t fCurrRun = 0; ///< Holds current run to improve performance
38  UInt_t fCurrLumi = 0; ///< Holds current lumi to improve performance
39  Bool_t fCurrGood = false; ///< Holds current IsGood() result to improve performance
40 
41  ClassDef(GoodLumiFilter,1)
42 };
43 
44 #endif